@@ -23,12 +23,10 @@ FT0ChannelTimeTimeSlotContainer::FT0ChannelTimeTimeSlotContainer(std::size_t min
2323 : mMinEntries(minEntries)
2424{
2525
26-
2726 mHistogram = boost::histogram::make_histogram (boost::histogram::axis::integer<>(-HISTOGRAM_RANGE , HISTOGRAM_RANGE , " channel_times" ),
2827 boost::histogram::axis::integer<>(0 , o2::ft0::Nchannels_FT0, " channel_ID" ));
2928}
3029
31-
3230bool FT0ChannelTimeTimeSlotContainer::hasEnoughEntries () const
3331{
3432 return *std::min_element (mEntriesPerChannel .begin (), mEntriesPerChannel .end ()) > mMinEntries ;
@@ -73,37 +71,34 @@ int16_t FT0ChannelTimeTimeSlotContainer::getMeanGaussianFitValue(std::size_t cha
7371 std::vector<double > channelHistogramData (NUMBER_OF_HISTOGRAM_BINS );
7472
7573 std::vector<double > outputGaussianFitValues;
76- double binWidth = (HISTOGRAM_RANGE - (-HISTOGRAM_RANGE ))/ NUMBER_OF_HISTOGRAM_BINS ;
74+ double binWidth = (HISTOGRAM_RANGE - (-HISTOGRAM_RANGE )) / NUMBER_OF_HISTOGRAM_BINS ;
7775 double minGausFitRange = 0 ;
7876 double maxGausFitRange = 0 ;
7977 double MaxValOfHistogram = 0.0 ;
8078
81-
8279 for (int iBin = 0 ; iBin < NUMBER_OF_HISTOGRAM_BINS ; ++iBin) {
8380 channelHistogramData[iBin] = mHistogram .at (iBin, channelID);
8481 }
8582
86- int maxElementIndex = std::max_element (channelHistogramData.begin (),channelHistogramData.end ()) - channelHistogramData.begin ();
83+ int maxElementIndex = std::max_element (channelHistogramData.begin (), channelHistogramData.end ()) - channelHistogramData.begin ();
8784 int maxElement = *std::max_element (channelHistogramData.begin (), channelHistogramData.end ());
88-
85+
8986 // calculating the min & max range values to fit gaussian
90- minGausFitRange = (-HISTOGRAM_RANGE + (maxElementIndex- sGausFitBins ) * binWidth + binWidth/ 2.0 );
91- maxGausFitRange = (-HISTOGRAM_RANGE + (maxElementIndex+ sGausFitBins ) * binWidth + binWidth/ 2.0 );
87+ minGausFitRange = (-HISTOGRAM_RANGE + (maxElementIndex - sGausFitBins ) * binWidth + binWidth / 2.0 );
88+ maxGausFitRange = (-HISTOGRAM_RANGE + (maxElementIndex + sGausFitBins ) * binWidth + binWidth / 2.0 );
9289
9390 double returnCode = math_utils::fitGaus<double >(NUMBER_OF_HISTOGRAM_BINS , channelHistogramData.data (),
9491 minGausFitRange, maxGausFitRange, outputGaussianFitValues);
9592
96- MaxValOfHistogram = (-HISTOGRAM_RANGE + maxElementIndex * binWidth + binWidth/2.0 );
97- if (returnCode < 0 )
98- {
99- LOG (ERROR ) << " Gaussian fit error!" ;
100- return static_cast <int16_t >(std::round (MaxValOfHistogram));
101- }
93+ MaxValOfHistogram = (-HISTOGRAM_RANGE + maxElementIndex * binWidth + binWidth / 2.0 );
94+ if (returnCode < 0 ) {
95+ LOG (ERROR ) << " Gaussian fit error!" ;
96+ return static_cast <int16_t >(std::round (MaxValOfHistogram));
97+ }
10298
103- return static_cast <int16_t >(std::round (outputGaussianFitValues[MEAN_VALUE_INDEX_IN_OUTPUT_VECTOR ]));
99+ return static_cast <int16_t >(std::round (outputGaussianFitValues[MEAN_VALUE_INDEX_IN_OUTPUT_VECTOR ]));
104100}
105101
106-
107102void FT0ChannelTimeTimeSlotContainer::print () const
108103{
109104 // QC will do that part
0 commit comments