Skip to content

Commit f7cc3d8

Browse files
committed
Ensure CRT T0 usage in calibration ntuples is direction aware
1 parent d3b098e commit f7cc3d8

1 file changed

Lines changed: 3 additions & 8 deletions

File tree

sbncode/Calibration/TrackCaloSkimmer_module.cc

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1140,15 +1140,10 @@ void sbn::TrackCaloSkimmer::FillTrack(const recob::Track &track,
11401140
fTrack->start.x = track.Start().X();
11411141
fTrack->end.x = track.End().X();
11421142
} else if (t0Info.hasT0CRTTrack) {
1143+
int driftDir = geo->TPC(hits[0]->WireID()).DriftDir().X();
11431144
const double driftv(dprop.DriftVelocity(dprop.Efield(), dprop.Temperature()));
1144-
// Comment from Francesco: I am not sure of the below formula.
1145-
// SBND has two TPCs with a common cathode like ICARUS, the driftvelocity
1146-
// returns the absolute value, but the displacement (basically the + below)
1147-
// depends on the TPC, in one case is + and in the other is negative.
1148-
// In this way the displacement is always in the same direction, working for
1149-
// one TPC, but not for the other.
1150-
fTrack->start.x = track.Start().X() + driftv*t0Info.t0CRTTrack*1e-3;
1151-
fTrack->end.x = track.End().X() + driftv*t0Info.t0CRTTrack*1e-3;
1145+
fTrack->start.x = track.Start().X() + driftDir*driftv*t0Info.t0CRTTrack*1e-3;
1146+
fTrack->end.x = track.End().X() + driftDir*driftv*t0Info.t0CRTTrack*1e-3;
11521147
} else if (t0Info.hasT0CRTHit){
11531148
// If the track does not have a a Pandora T0, the tracks will always be either on the left or (ex Or) right of the cathode.
11541149
int driftDir = geo->TPC(hits[0]->WireID()).DriftDir().X();

0 commit comments

Comments
 (0)