@@ -342,6 +342,7 @@ class sbnd::crt::CRTAnalysis : public art::EDAnalyzer {
342342 std::vector<bool > _tpc_tr_matchable;
343343 std::vector<bool > _tpc_tr_matched;
344344 std::vector<bool > _tpc_tr_good_match;
345+ std::vector<double > _tpc_tr_xshift;
345346 std::vector<double > _tpc_tr_ts0;
346347 std::vector<double > _tpc_tr_ts1;
347348 std::vector<std::vector<int >> _tpc_tr_taggers;
@@ -630,6 +631,7 @@ sbnd::crt::CRTAnalysis::CRTAnalysis(fhicl::ParameterSet const& p)
630631 fTree ->Branch (" tpc_sp_z" , " std::vector<double>" , &_tpc_sp_z);
631632 fTree ->Branch (" tpc_sp_score" , " std::vector<double>" , &_tpc_sp_score);
632633 fTree ->Branch (" tpc_tr_matched" , " std::vector<bool>" , &_tpc_tr_matched);
634+ fTree ->Branch (" tpc_tr_xshift" , " std::vector<double>" , &_tpc_tr_xshift);
633635 fTree ->Branch (" tpc_tr_ts0" , " std::vector<double>" , &_tpc_tr_ts0);
634636 fTree ->Branch (" tpc_tr_ts1" , " std::vector<double>" , &_tpc_tr_ts1);
635637 fTree ->Branch (" tpc_tr_taggers" , " std::vector<std::vector<int>>" , &_tpc_tr_taggers);
@@ -1685,6 +1687,7 @@ void sbnd::crt::CRTAnalysis::AnalyseTPCMatching(const art::Event &e, const art::
16851687 _tpc_tr_matchable.resize (nTracks);
16861688 _tpc_tr_matched.resize (nTracks);
16871689 _tpc_tr_good_match.resize (nTracks);
1690+ _tpc_tr_xshift.resize (nTracks);
16881691 _tpc_tr_ts0.resize (nTracks);
16891692 _tpc_tr_ts1.resize (nTracks);
16901693 _tpc_tr_taggers.resize (nTracks);
@@ -1797,7 +1800,11 @@ void sbnd::crt::CRTAnalysis::AnalyseTPCMatching(const art::Event &e, const art::
17971800 {
17981801 const anab::T0 trackMatch = tracksToTrackMatches.data (track.key ()).ref ();
17991802
1803+ const int driftDirection = TPCGeoUtil::DriftDirectionFromHits (geometryService, trackHits);
1804+ const double crtShiftingTime = fDataMode ? crttrack->Ts0 () * 1e-3 : crttrack->Ts1 () * 1e-3 ;
1805+
18001806 _tpc_tr_matched[nActualTracks] = true ;
1807+ _tpc_tr_xshift[nActualTracks] = driftDirection * crtShiftingTime * detProp.DriftVelocity ();
18011808 _tpc_tr_ts0[nActualTracks] = crttrack->Ts0 ();
18021809 _tpc_tr_ts1[nActualTracks] = crttrack->Ts1 ();
18031810 _tpc_tr_score[nActualTracks] = trackMatch.TriggerConfidence ();
@@ -1821,6 +1828,7 @@ void sbnd::crt::CRTAnalysis::AnalyseTPCMatching(const art::Event &e, const art::
18211828 else
18221829 {
18231830 _tpc_tr_matched[nActualTracks] = false ;
1831+ _tpc_tr_xshift[nActualTracks] = -std::numeric_limits<double >::max ();
18241832 _tpc_tr_ts0[nActualTracks] = -std::numeric_limits<double >::max ();
18251833 _tpc_tr_ts1[nActualTracks] = -std::numeric_limits<double >::max ();
18261834 _tpc_tr_score[nActualTracks] = -std::numeric_limits<double >::max ();
0 commit comments