Skip to content

Commit

Permalink
fixed ttypos in CCDB table path, switch FT and EB to use solenoid cen…
Browse files Browse the repository at this point in the history
…ter for compatibility with calibrations, fixed bug if ND3 is chosen for CVT eloss
  • Loading branch information
raffaelladevita committed Mar 8, 2024
1 parent d6973a6 commit a387518
Show file tree
Hide file tree
Showing 9 changed files with 16 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,6 @@ public static ConstantProvider getConstants(DetectorType type, int run, String v
provider.loadTable("/geometry/cvt/svt/material/box");
provider.loadTable("/geometry/cvt/svt/material/tube");
provider.loadTable("/geometry/cvt/svt/alignment");
provider.loadTable("/geometry/target");
}

if(type==DetectorType.TARGET){
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -387,7 +387,7 @@ else if( value == "tube" ) // offset by boxNum to reset row for CCDB table
// | | radius | radius
// | | |
// o==============v===========================v===================================-> z (beamline)
// System.out.println("SVT READ Z SHIFT VALUE "+cp.getDouble("/geometry/target/position", 0));

// LAYERRADIUS and ZSTARTACTIVE are used primarily by the Reconstruction and getStrip()
for( int region = 0; region < NREGIONS; region++ )
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ public boolean processDataEvent(DataEvent event) {
if (solShift == null) { // if no shift is set in the yaml file or environment, read from CCDB
// will read target position and assume that is representative of the shift of
// the whole CD
IndexedTable targetPosition = this.getConstantsManager().getConstants(newRun, "/geometry/shift/solenoid");
IndexedTable targetPosition = this.getConstantsManager().getConstants(newRun, "/geometry/shifts/solenoid");
Swimmer.set_zShift((float) targetPosition.getDoubleValue("z", 0, 0, 0));
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,8 @@ private Surface getTarget(double xbeam, double ybeam, boolean beamSpot) {
Point3D p = new Point3D(xbeam, ybeam, 0);
Line3D l = new Line3D(p, u);
Surface target = new Surface(l.origin(), l.end(), Constants.DEFAULTSWIMACC);
if(Geometry.getInstance().getTargetCellSurface().lineVolume!=null) {
if(Geometry.getInstance().getTargetCellSurface()!=null &&
Geometry.getInstance().getTargetCellSurface().lineVolume!=null) {
target.lineVolume = Geometry.getInstance().getTargetCellSurface().lineVolume;
}
for(Material m : Geometry.getInstance().getTargetMaterials())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ public class EBCCDBConstants {
"/runcontrol/fcup",
"/runcontrol/hwp",
"/runcontrol/helicity",
"/geometry/shifts/target",
"/geometry/shifts/solenoid",
"/calibration/ftof/tres",
//"/calibration/ctof/tres"
};
Expand Down Expand Up @@ -275,7 +275,7 @@ public final void load(int run,ConstantsManager manager) {

loadDouble(EBCCDBEnum.NEUTRON_maxBeta,"neutron_beta","neutron_beta",0,0,0);

loadDouble(EBCCDBEnum.TARGET_POSITION,"/geometry/shifts/target","z",0,0,0);
loadDouble(EBCCDBEnum.SOLENOID_POSITION,"/geometry/shifts/solenoid","z",0,0,0);

loadDouble(EBCCDBEnum.FCUP_slope,"/runcontrol/fcup","slope",0,0,0);
loadDouble(EBCCDBEnum.FCUP_offset,"/runcontrol/fcup","offset",0,0,0);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ public enum EBCCDBEnum {
FTOF_MATCHING_1B,
FTOF_MATCHING_2,
CTOF_Matching,
TARGET_POSITION,
SOLENOID_POSITION,
RF_BUCKET_LENGTH,
RF_OFFSET,
RF_CYCLES,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,12 +40,15 @@ public double getStartTime(DetectorParticle trigger,final DetectorType type,fin

final double rfPeriod = this.ccdb.getDouble(EBCCDBEnum.RF_BUCKET_LENGTH);

// The RF calibration is relative to target center:
final double zTarget = this.ccdb.getDouble(EBCCDBEnum.TARGET_POSITION);
// The RF calibration is relative to the solenoid center:
// FIXME the reference point doesn't have to be the solenoid center or
// target center but could be z=0. It only needs to be consistent with
// the one used in RF calibrations
final double zSolenoid = this.ccdb.getDouble(EBCCDBEnum.SOLENOID_POSITION);

// The trigger particles' vertex info:
final double tVertex = trigger.getVertexTime(type,layer,trigger.getPid());
final double dzTargetVertex = zTarget - trigger.vertex().z();
final double dzTargetVertex = zSolenoid - trigger.vertex().z();

// The RF time at the trigger particle's vertex:
// (Note, this is shifted forward by a large integer number of RF periods,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ public boolean init() {
"/calibration/ft/ftcal/cluster",
"/calibration/ft/ftcal/thetacorr",
"/calibration/ft/ftcal/phicorr",
"/geometry/shift/target"
"/geometry/shifts/solenoid"
};
requireConstants(Arrays.asList(tables));
this.getConstantsManager().setVariation("default");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -113,13 +113,13 @@ public void correctDirection(List<FTParticle> particles, ConstantsManager manage
}

public List<FTParticle> initFTparticles(List<FTResponse> responses, ConstantsManager manager, int run) {
IndexedTable target = manager.getConstants(run, "/geometry/shifts/target");
IndexedTable solenoid = manager.getConstants(run, "/geometry/shifts/solenoid");

List<FTParticle> particles = new ArrayList<>();
for (int i = 0; i < responses.size(); i++) {
if (responses.get(i).getType()==DetectorType.FTCAL) {
// start assuming the cluster to be associated to a photon
FTParticle track = new FTParticle(i, 0, this.solenoidField, responses.get(i), 0, 0, target.getDoubleValue("z", 0,0,0));
FTParticle track = new FTParticle(i, 0, this.solenoidField, responses.get(i), 0, 0, solenoid.getDoubleValue("z", 0,0,0));
particles.add(track);
responses.get(i).setAssociation(particles.size()-1);
}
Expand Down

0 comments on commit a387518

Please sign in to comment.