@@ -10,15 +10,14 @@ double EcalUncalibRecHitTimingCCAlgo::computeTimeCC(const EcalDataFrame& dataFra
1010 const FullSampleVector& fullpulse,
1111 const float targetTimePrecision,
1212 const bool correctForOOT,
13- const bool correctForSlew ) const {
14-
13+ const bool correctForSlew) const {
1514 constexpr unsigned int nsample = EcalDataFrame::MAXSAMPLES;
1615
1716 double maxamplitude = -std::numeric_limits<double >::max ();
1817 float pulsenorm = 0 .;
1918
2019 std::vector<float > pedSubSamples (nsample);
21- std::vector<float > weights (nsample,1 .f );
20+ std::vector<float > weights (nsample, 1 .f );
2221 for (unsigned int iSample = 0 ; iSample < nsample; iSample++) {
2322 const EcalMGPASample& sample = dataFrame.sample (iSample);
2423
@@ -54,16 +53,16 @@ double EcalUncalibRecHitTimingCCAlgo::computeTimeCC(const EcalDataFrame& dataFra
5453 maxamplitude = amplitude;
5554 }
5655
57- if ( iSample > 0 && correctForSlew ){
58- int GainIdPrev = dataFrame.sample (iSample - 1 ).gainId ();
59- bool GainIdInRange = GainIdPrev >= 1 && GainIdPrev <= 3 && gainId >= 1 && gainId <= 3 ;
60- bool GainSlew = GainIdPrev < gainId;
61- if ( GainIdInRange && GainSlew ) weights[iSample - 1 ] = 0 . f ;
62- }
63-
56+ if ( iSample > 0 && correctForSlew) {
57+ int GainIdPrev = dataFrame.sample (iSample - 1 ).gainId ();
58+ bool GainIdInRange = GainIdPrev >= 1 && GainIdPrev <= 3 && gainId >= 1 && gainId <= 3 ;
59+ bool GainSlew = GainIdPrev < gainId;
60+ if ( GainIdInRange && GainSlew)
61+ weights[iSample - 1 ] = 0 . f ;
62+ }
6463 }
6564
66- if ( correctForOOT ) {
65+ if ( correctForOOT) {
6766 int ipulse = -1 ;
6867 for (auto const & amplit : amplitudes) {
6968 ipulse++;
@@ -73,7 +72,7 @@ double EcalUncalibRecHitTimingCCAlgo::computeTimeCC(const EcalDataFrame& dataFra
7372
7473 for (unsigned int isample = firstsamplet; isample < nsample; ++isample) {
7574 auto const pulse = fullpulse (isample + offset);
76- pedSubSamples[isample] = pedSubSamples[isample] - ( amplit * pulse / pulsenorm );
75+ pedSubSamples[isample] = pedSubSamples[isample] - (amplit * pulse / pulsenorm);
7776 }
7877 }
7978 }
@@ -110,7 +109,9 @@ double EcalUncalibRecHitTimingCCAlgo::computeTimeCC(const EcalDataFrame& dataFra
110109 }
111110
112111 float tM = (t3 + t0) / 2 - GLOBAL_TIME_SHIFT;
113- if (counter < MIN_NUM_OF_ITERATIONS || counter > MAX_NUM_OF_ITERATIONS - 1 ) { tM = TIME_WHEN_NOT_CONVERGING * ecalPh1::Samp_Period; }
112+ if (counter < MIN_NUM_OF_ITERATIONS || counter > MAX_NUM_OF_ITERATIONS - 1 ) {
113+ tM = TIME_WHEN_NOT_CONVERGING * ecalPh1::Samp_Period;
114+ }
114115 return -tM / ecalPh1::Samp_Period;
115116}
116117
@@ -154,7 +155,7 @@ FullSampleVector EcalUncalibRecHitTimingCCAlgo::interpolatePulse(const FullSampl
154155}
155156
156157float EcalUncalibRecHitTimingCCAlgo::computeCC (const std::vector<float >& samples,
157- const std::vector<float >& weights,
158+ const std::vector<float >& weights,
158159 const FullSampleVector& signalTemplate,
159160 const float time) const {
160161 constexpr int exclude = 1 ;
0 commit comments