@@ -4,7 +4,6 @@ namespace sbnd::crt {
44
55 CRTClusterCharacterisationAlg::CRTClusterCharacterisationAlg (const fhicl::ParameterSet& pset)
66 : fCRTGeoAlg (pset.get<fhicl::ParameterSet>(" CRTGeoAlg" ))
7- , fUseT1 (pset.get<bool >(" UseT1" ))
87 , fTimeOffset (pset.get<double >(" TimeOffset" ))
98 , fOverlapBuffer (pset.get<double >(" OverlapBuffer" ))
109 , fPEAttenuation (pset.get<double >(" PEAttenuation" ))
@@ -14,8 +13,6 @@ namespace sbnd::crt {
1413 {
1514 }
1615
17- CRTClusterCharacterisationAlg::CRTClusterCharacterisationAlg (){}
18-
1916 CRTClusterCharacterisationAlg::~CRTClusterCharacterisationAlg (){}
2017
2118 CRTSpacePoint CRTClusterCharacterisationAlg::CharacteriseSingleHitCluster (const art::Ptr<CRTCluster> &cluster, const art::Ptr<CRTStripHit> &stripHit)
@@ -27,7 +24,7 @@ namespace sbnd::crt {
2724 geo::Point_t pos, err;
2825 CentralPosition (hitPos, pos, err);
2926
30- return CRTSpacePoint (pos, err, pe, stripHit->Ts1 () + fTimeOffset , 0 ., false );
27+ return CRTSpacePoint (pos, err, pe, stripHit->Ts0 () + fTimeOffset , 0 ., stripHit-> Ts1 () + fTimeOffset , 0 ., false );
3128 }
3229
3330 bool CRTClusterCharacterisationAlg::CharacteriseDoubleHitCluster (const art::Ptr<CRTCluster> &cluster, const std::vector<art::Ptr<CRTStripHit>> &stripHits, CRTSpacePoint &spacepoint)
@@ -52,10 +49,10 @@ namespace sbnd::crt {
5249 CentralPosition (overlap, pos, err);
5350
5451 const double pe = ReconstructPE (hit0, hit1, pos);
55- double time, etime ;
56- CorrectTime (hit0, hit1, pos, time, etime );
52+ double t0, et0, t1, et1 ;
53+ CorrectTime (hit0, hit1, pos, t0, et0, t1, et1 );
5754
58- spacepoint = CRTSpacePoint (pos, err, pe, time + fTimeOffset , etime , true );
55+ spacepoint = CRTSpacePoint (pos, err, pe, t0 + fTimeOffset , et0, t1 + fTimeOffset , et1 , true );
5956 return true ;
6057 }
6158 return false ;
@@ -69,11 +66,13 @@ namespace sbnd::crt {
6966 geo::Point_t pos, err;
7067 CentralPosition (overlap, pos, err);
7168
72- const double pe = ADCToPE (hit0->Channel (), hit0->ADC1 (), hit0->ADC2 ()) + ADCToPE (hit1->Channel (), hit1->ADC1 (), hit1->ADC2 ());
73- const double time = (hit0->Ts1 () + hit1->Ts1 ()) / 2 .;
74- const double etime = std::abs ((double )hit0->Ts1 () - (double )hit1->Ts1 ()) / 2 .;
69+ const double pe = ADCToPE (hit0->Channel (), hit0->ADC1 (), hit0->ADC2 ()) + ADCToPE (hit1->Channel (), hit1->ADC1 (), hit1->ADC2 ());
70+ const double t0 = (hit0->Ts0 () + hit1->Ts0 ()) / 2 .;
71+ const double t1 = (hit0->Ts1 () + hit1->Ts1 ()) / 2 .;
72+ const double et0 = std::abs ((double )hit0->Ts0 () - (double )hit1->Ts0 ()) / 2 .;
73+ const double et1 = std::abs ((double )hit0->Ts1 () - (double )hit1->Ts1 ()) / 2 .;
7574
76- spacepoint = CRTSpacePoint (pos, err, pe, time + fTimeOffset , etime , false );
75+ spacepoint = CRTSpacePoint (pos, err, pe, t0 + fTimeOffset , et0, t1 + fTimeOffset , et1 , false );
7776 return true ;
7877 }
7978 return false ;
@@ -107,21 +106,25 @@ namespace sbnd::crt {
107106 return false ;
108107
109108 double pe = 0 .;
110- std::vector<double > times ;
109+ std::vector<double > t0s, t1s ;
111110
112111 for (auto const &sp : complete_spacepoints)
113112 {
114113 pe += sp.PE ();
115- times.push_back (sp.Time ());
114+ t0s.push_back (sp.Ts0 ());
115+ t1s.push_back (sp.Ts1 ());
116116 }
117117
118118 geo::Point_t pos, err;
119119 AggregatePositions (complete_spacepoints, pos, err);
120120
121- double time, etime;
122- TimeErrorCalculator (times, time, etime);
123-
124- spacepoint = CRTSpacePoint (pos, err, pe, time, etime, true );
121+ double t0, et0;
122+ TimeErrorCalculator (t0s, t0, et0);
123+
124+ double t1, et1;
125+ TimeErrorCalculator (t1s, t1, et1);
126+
127+ spacepoint = CRTSpacePoint (pos, err, pe, t0, et0, t1, et1, true );
125128 return true ;
126129 }
127130
@@ -194,7 +197,7 @@ namespace sbnd::crt {
194197 }
195198
196199 void CRTClusterCharacterisationAlg::CorrectTime (const art::Ptr<CRTStripHit> &hit0, const art::Ptr<CRTStripHit> &hit1, const geo::Point_t &pos,
197- double &time , double &etime )
200+ double &t0 , double &et0, double &t1, double &et1 )
198201 {
199202 const double dist0 = fCRTGeoAlg .DistanceDownStrip (pos, hit0->Channel ());
200203 const double dist1 = fCRTGeoAlg .DistanceDownStrip (pos, hit1->Channel ());
@@ -205,16 +208,11 @@ namespace sbnd::crt {
205208 const double corr0 = TimingCorrectionOffset (dist0, pe0);
206209 const double corr1 = TimingCorrectionOffset (dist1, pe1);
207210
208- if (fUseT1 )
209- {
210- time = ((double )hit0->Ts1 () - corr0 + (double )hit1->Ts1 () - corr1) / 2 .;
211- etime = std::abs (((double )hit0->Ts1 () - corr0) - ((double )hit1->Ts1 () - corr1)) / 2 .;
212- }
213- else
214- {
215- time = ((double )hit0->Ts0 () - corr0 + (double )hit1->Ts0 () - corr1) / 2 .;
216- etime = std::abs (((double )hit0->Ts0 () - corr0) - ((double )hit1->Ts0 () - corr1)) / 2 .;
217- }
211+ t0 = ((double )hit0->Ts0 () - corr0 + (double )hit1->Ts0 () - corr1) / 2 .;
212+ et0 = std::abs (((double )hit0->Ts0 () - corr0) - ((double )hit1->Ts0 () - corr1)) / 2 .;
213+
214+ t1 = ((double )hit0->Ts1 () - corr0 + (double )hit1->Ts1 () - corr1) / 2 .;
215+ et1 = std::abs (((double )hit0->Ts1 () - corr0) - ((double )hit1->Ts1 () - corr1)) / 2 .;
218216 }
219217
220218 double CRTClusterCharacterisationAlg::TimingCorrectionOffset (const double &dist, const double &pe)
0 commit comments