Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 24 additions & 0 deletions analysis/src/main/java/org/hps/analysis/tuple/TupleDriver.java
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,8 @@ public abstract class TupleDriver extends Driver {
private final double[] vzcBeamSize = {0.001, 100, 100};
private final double[] topTrackCorrection = {0, 0, 0, 0, 0};
private final double[] botTrackCorrection = {0, 0, 0, 0, 0};
private final double[] topPos = {45.5,92.0,192.0};
private final double[] botPos = {54.5,107.5,207.5};
protected final BasicHep3Matrix beamAxisRotation = BasicHep3Matrix.identity();
protected double ebeam = Double.NaN;

Expand Down Expand Up @@ -291,6 +293,9 @@ protected void addParticleVariables(String prefix) {
"PhiKink1/D", "PhiKink2/D", "PhiKink3/D",
"IsoStereo/D", "IsoAxial/D",
"MinPositiveIso/D", "MinNegativeIso/D",
"TrkExtrpXL0/D", "TrkExtrpYL0/D",
"TrkExtrpXL1/D", "TrkExtrpYL1/D",
"TrkExtrpXL2/D", "TrkExtrpYL2/D",
"RawMaxAmplL1/D", "RawT0L1/D", "RawChisqL1/D","RawTDiffL1/D",
"RawMaxAmplL2/D", "RawT0L2/D", "RawChisqL2/D","RawTDiffL2/D",
"RawMaxAmplL3/D", "RawT0L3/D", "RawChisqL3/D","RawTDiffL3/D",
Expand Down Expand Up @@ -604,6 +609,19 @@ protected TrackState fillParticleVariables(EventHeader event, ReconstructedParti

Track track = particle.getTracks().get(0);
TrackState trackState = track.getTrackStates().get(0);
Hep3Vector extrapTrackPosL0;
Hep3Vector extrapTrackPosL1;
Hep3Vector extrapTrackPosL2;
if(trackState.getTanLambda() > 0){
extrapTrackPosL0 = TrackUtils.extrapolateTrack(track,topPos[0]);
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In the future, you should switch to using the extrapolator which makes use of the field map. The analytic extrapolator should be fine for L1-L2 but I'm not certain it will give the most accurate results for L0.

extrapTrackPosL1 = TrackUtils.extrapolateTrack(track,topPos[1]);
extrapTrackPosL2 = TrackUtils.extrapolateTrack(track,topPos[2]);
}
else{
extrapTrackPosL0 = TrackUtils.extrapolateTrack(track,botPos[0]);
extrapTrackPosL1 = TrackUtils.extrapolateTrack(track,botPos[1]);
extrapTrackPosL2 = TrackUtils.extrapolateTrack(track,botPos[2]);
}
double[] param = new double[5];
for (int i = 0; i < 5; i++) {
param[i] = trackState.getParameters()[i] + ((trackState.getTanLambda() > 0) ? topTrackCorrection[i] : botTrackCorrection[i]);
Expand Down Expand Up @@ -802,6 +820,12 @@ protected TrackState fillParticleVariables(EventHeader event, ReconstructedParti
tupleMap.put(prefix + "IsoAxial/D", isoAxial);
tupleMap.put(prefix + "MinPositiveIso/D", minPositiveIso);
tupleMap.put(prefix + "MinNegativeIso/D", minNegativeIso);
tupleMap.put(prefix + "TrkExtrpXL0/D", extrapTrackPosL0.x());
tupleMap.put(prefix + "TrkExtrpYL0/D", extrapTrackPosL0.y());
tupleMap.put(prefix + "TrkExtrpXL1/D", extrapTrackPosL1.x());
tupleMap.put(prefix + "TrkExtrpYL1/D", extrapTrackPosL1.y());
tupleMap.put(prefix + "TrkExtrpXL2/D", extrapTrackPosL2.x());
tupleMap.put(prefix + "TrkExtrpYL2/D", extrapTrackPosL2.y());
tupleMap.put(prefix + "MatchChisq/D", particle.getGoodnessOfPID());

returnTrackState = tweakedTrackState;
Expand Down