Skip to content

Commit 290186e

Browse files
committed
Fix clang formatting
1 parent 56f4a20 commit 290186e

3 files changed

Lines changed: 24 additions & 31 deletions

File tree

Detectors/FIT/FT0/calibration/src/FT0ChannelTimeTimeSlotContainer.cxx

Lines changed: 11 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -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-
3230
bool 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-
107102
void FT0ChannelTimeTimeSlotContainer::print() const
108103
{
109104
//QC will do that part

Detectors/FIT/FT0/calibration/testWorkflow/FT0TFProcessor-Workflow.cxx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,5 +78,6 @@ WorkflowSpec defineDataProcessing(ConfigContext const& cfgc)
7878

7979
WorkflowSpec workflow;
8080
workflow.emplace_back(dataProcessorSpec);
81+
8182
return workflow;
8283
}

Detectors/FIT/FV0/calibration/src/FV0ChannelTimeTimeSlotContainer.cxx

Lines changed: 12 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -72,39 +72,36 @@ int16_t FV0ChannelTimeTimeSlotContainer::getMeanGaussianFitValue(std::size_t cha
7272
std::vector<double> channelHistogramData(NUMBER_OF_HISTOGRAM_BINS, 0);
7373

7474
std::vector<double> outputGaussianFitValues;
75-
double binWidth = (HISTOGRAM_RANGE - (-HISTOGRAM_RANGE))/NUMBER_OF_HISTOGRAM_BINS;
75+
double binWidth = (HISTOGRAM_RANGE - (-HISTOGRAM_RANGE)) / NUMBER_OF_HISTOGRAM_BINS;
7676
double minGausFitRange = 0;
7777
double maxGausFitRange = 0;
7878
double MaxValOfHistogram = 0.0;
7979

80-
8180
for (int iBin = 0; iBin < NUMBER_OF_HISTOGRAM_BINS; ++iBin) {
8281
channelHistogramData[iBin] = mHistogram.at(iBin, channelID);
8382
}
8483

85-
int maxElementIndex = std::max_element(channelHistogramData.begin(),channelHistogramData.end()) - channelHistogramData.begin();
84+
int maxElementIndex = std::max_element(channelHistogramData.begin(), channelHistogramData.end()) - channelHistogramData.begin();
8685
int maxElement = *std::max_element(channelHistogramData.begin(), channelHistogramData.end());
87-
86+
8887
// calculating the min & max range values to fit gaussian
89-
minGausFitRange = (-HISTOGRAM_RANGE + (maxElementIndex-sGausFitBins) * binWidth + binWidth/2.0 );
90-
maxGausFitRange = (-HISTOGRAM_RANGE + (maxElementIndex+sGausFitBins) * binWidth + binWidth/2.0 );
88+
minGausFitRange = (-HISTOGRAM_RANGE + (maxElementIndex - sGausFitBins) * binWidth + binWidth / 2.0);
89+
maxGausFitRange = (-HISTOGRAM_RANGE + (maxElementIndex + sGausFitBins) * binWidth + binWidth / 2.0);
9190

9291
double returnCode = math_utils::fitGaus<double>(NUMBER_OF_HISTOGRAM_BINS, channelHistogramData.data(),
9392
minGausFitRange, maxGausFitRange, outputGaussianFitValues);
9493

95-
MaxValOfHistogram = (-HISTOGRAM_RANGE + maxElementIndex * binWidth + binWidth/2.0 );
94+
MaxValOfHistogram = (-HISTOGRAM_RANGE + maxElementIndex * binWidth + binWidth / 2.0);
9695

97-
if (returnCode < 0)
98-
{
99-
LOG(ERROR) << "Gaussian fit error!";
100-
return static_cast<int16_t>(std::round(MaxValOfHistogram));
101-
//return 0;
102-
}
96+
if (returnCode < 0) {
97+
LOG(ERROR) << "Gaussian fit error!";
98+
return static_cast<int16_t>(std::round(MaxValOfHistogram));
99+
//return 0;
100+
}
103101

104-
return static_cast<int16_t>(std::round(outputGaussianFitValues[MEAN_VALUE_INDEX_IN_OUTPUT_VECTOR]));
102+
return static_cast<int16_t>(std::round(outputGaussianFitValues[MEAN_VALUE_INDEX_IN_OUTPUT_VECTOR]));
105103
}
106104

107-
108105
void FV0ChannelTimeTimeSlotContainer::print() const
109106
{
110107
//QC will do that part

0 commit comments

Comments
 (0)