Skip to content

Commit e3dd57f

Browse files
authored
Merge pull request #1 from alibuild/alibot-cleanup-13356
Please consider the following formatting changes to #13356
2 parents 25a75e6 + d07ffba commit e3dd57f

File tree

2 files changed

+44
-46
lines changed

2 files changed

+44
-46
lines changed

DataFormats/Detectors/ITSMFT/common/include/DataFormatsITSMFT/NoiseMap.h

Lines changed: 25 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -85,14 +85,14 @@ class NoiseMap
8585
while (chipID--) {
8686
const auto& map = mNoisyPixels[chipID];
8787
for (const auto& pair : map) {
88-
if (pair.second <= t) {
88+
if (pair.second <= t) {
8989
continue;
90-
}
90+
}
9191
n++;
9292
auto key = pair.first;
9393
auto row = key2Row(key);
9494
auto col = key2Col(key);
95-
std::cout << "chip, row, col, noise: " << chipID << ' ' << row << ' ' << col << ' ' << pair.second << '\n';
95+
std::cout << "chip, row, col, noise: " << chipID << ' ' << row << ' ' << col << ' ' << pair.second << '\n';
9696
}
9797
}
9898
return n;
@@ -202,29 +202,28 @@ class NoiseMap
202202
return std::ceil((1. + 1. / t) / (relErr * relErr));
203203
}
204204

205-
NoiseMap merge(NoiseMap* prev){
206-
int incre=0;
207-
for (size_t i = 0; i < (int)mNoisyPixels.size(); ++i) { //920 is the total number of chips in MFT
208-
for (const auto& prev_np : prev->mNoisyPixels[i]) { //only enters this for loop if the "i" chip exists.
209-
bool existsInCurrentMap = false;
210-
for (const auto& current_np : mNoisyPixels[i]) {
211-
if(prev_np.first==current_np.first)
212-
{
213-
existsInCurrentMap = true;
214-
break;
215-
}
216-
}//end of for loop on elements of previous noise map
217-
218-
if (!existsInCurrentMap) {
219-
incre++;
220-
mNoisyPixels[i][prev_np.first] = prev_np.second;
221-
}
222-
}//end of for loop on elements of previous noise map
223-
}//end of for loop on i (chip ID)
224-
return(mNoisyPixels);
225-
}//end of void merge
226-
227-
205+
NoiseMap merge(NoiseMap* prev)
206+
{
207+
int incre = 0;
208+
for (size_t i = 0; i < (int)mNoisyPixels.size(); ++i) { // 920 is the total number of chips in MFT
209+
for (const auto& prev_np : prev->mNoisyPixels[i]) { // only enters this for loop if the "i" chip exists.
210+
bool existsInCurrentMap = false;
211+
for (const auto& current_np : mNoisyPixels[i]) {
212+
if (prev_np.first == current_np.first) {
213+
existsInCurrentMap = true;
214+
break;
215+
}
216+
} // end of for loop on elements of previous noise map
217+
218+
if (!existsInCurrentMap) {
219+
incre++;
220+
mNoisyPixels[i][prev_np.first] = prev_np.second;
221+
}
222+
} // end of for loop on elements of previous noise map
223+
} // end of for loop on i (chip ID)
224+
return (mNoisyPixels);
225+
} // end of void merge
226+
228227
size_t size() const { return mNoisyPixels.size(); }
229228
void setNumOfStrobes(long n) { mNumOfStrobes = n; }
230229
void addStrobes(long n) { mNumOfStrobes += n; }

Detectors/ITSMFT/MFT/calibration/src/NoiseCalibratorSpec.cxx

Lines changed: 19 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
1-
//AA Copyright 2019-2020 CERN and copyright holders of ALICE O2.A
2-
// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders.
3-
// All rights not expressly granted are reserved.
1+
// AA Copyright 2019-2020 CERN and copyright holders of ALICE O2.A
2+
// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders.
3+
// All rights not expressly granted are reserved.
44
//
5-
// This software is distributed under the terms of the GNU General Public
6-
// License v3 (GPL Version 3), copied verbatim in the file "COPYING".
5+
// This software is distributed under the terms of the GNU General Public
6+
// License v3 (GPL Version 3), copied verbatim in the file "COPYING".
77
//
8-
// In applying this license CERN does not waive the privileges and immunities
9-
// granted to it by virtue of its status as an Intergovernmental Organization
10-
// or submit itself to any jurisdiction.
8+
// In applying this license CERN does not waive the privileges and immunities
9+
// granted to it by virtue of its status as an Intergovernmental Organization
10+
// or submit itself to any jurisdiction.
1111

1212
/// @file NoiseCalibratorSpec.cxx
1313

@@ -49,7 +49,7 @@ void NoiseCalibratorSpec::init(InitContext& ic)
4949
mStopMeOnly = ic.options().get<bool>("stop-me-only");
5050
mPath = ic.options().get<std::string>("path-CCDB");
5151
mPathMerge = ic.options().get<std::string>("path-CCDB-merge");
52-
52+
5353
mMeta = ic.options().get<std::string>("meta");
5454
mStart = ic.options().get<int64_t>("tstart");
5555
mEnd = ic.options().get<int64_t>("tend");
@@ -75,7 +75,7 @@ void NoiseCalibratorSpec::run(ProcessingContext& pc)
7575
if (mOutputType.compare("CCDB") == 0) {
7676
LOG(info) << "Sending an object to Production-CCDB";
7777
sendOutputCcdb(pc.outputs());
78-
LOG(info) << "Sending an object to Production-CCDBMerge";
78+
LOG(info) << "Sending an object to Production-CCDBMerge";
7979
sendOutputCcdbMerge(pc.outputs());
8080
} else if (mOutputType.compare("DCS") == 0) {
8181
LOG(info) << "Sending an object to DCS-CCDB";
@@ -97,7 +97,7 @@ void NoiseCalibratorSpec::run(ProcessingContext& pc)
9797
if (mOutputType.compare("CCDB") == 0) {
9898
LOG(info) << "Sending an object to Production-CCDB";
9999
sendOutputCcdb(pc.outputs());
100-
LOG(info) << "Sending an object to Production-CCDBMerge";
100+
LOG(info) << "Sending an object to Production-CCDBMerge";
101101
sendOutputCcdbMerge(pc.outputs());
102102
} else if (mOutputType.compare("DCS") == 0) {
103103
LOG(info) << "Sending an object to DCS-CCDB";
@@ -168,7 +168,7 @@ void NoiseCalibratorSpec::sendOutputCcdbDcs(DataAllocator& output)
168168

169169
const auto& payload = mCalibrator->getNoiseMap();
170170
// const auto& payload = mCalibrator->getNoiseMap(starTF, endTF); //For TimeSlot calibration
171-
171+
172172
o2::ccdb::CcdbObjectInfo info(mPath, "NoiseMap", "noise.root", meta, tstart, tend);
173173
auto flName = o2::ccdb::CcdbApi::generateFileName("noise");
174174
auto image = o2::ccdb::CcdbApi::createObjectImage(&payload, &info);
@@ -182,7 +182,6 @@ void NoiseCalibratorSpec::sendOutputCcdbDcs(DataAllocator& output)
182182
output.snapshot(Output{clbUtils::gDataOriginCDBPayload, "MFT_NoiseMap", 0}, *image.get());
183183
output.snapshot(Output{clbUtils::gDataOriginCDBWrapper, "MFT_NoiseMap", 0}, info);
184184

185-
186185
setOutputDcs(payload);
187186

188187
o2::ccdb::CcdbObjectInfo infoDcs(mPathDcs, "NoiseMap", "noise.root", meta, tstart, tend);
@@ -298,13 +297,13 @@ void NoiseCalibratorSpec::sendOutputCcdbMerge(DataAllocator& output)
298297
// const auto& payload = mCalibrator->getNoiseMap(starTF, endTF); //For TimeSlot calibration
299298
map<string, string> headers;
300299
map<std::string, std::string> filter;
301-
auto *payloadPrev1 = api.retrieveFromTFileAny<o2::itsmft::NoiseMap>(mPath, filter,-1, &headers);
300+
auto* payloadPrev1 = api.retrieveFromTFileAny<o2::itsmft::NoiseMap>(mPath, filter, -1, &headers);
302301
long validtime = std::stol(headers["Valid-From"]);
303-
validtime=validtime-60;
304-
auto *payloadPrev2 = api.retrieveFromTFileAny<o2::itsmft::NoiseMap>(mPath, filter,validtime, &headers);
305-
auto bufferPL= payloadPrev2->merge(payloadPrev1);
306-
auto mergedPL= payload.merge(&bufferPL);
307-
//payload.merge(payloadPrev);
302+
validtime = validtime - 60;
303+
auto* payloadPrev2 = api.retrieveFromTFileAny<o2::itsmft::NoiseMap>(mPath, filter, validtime, &headers);
304+
auto bufferPL = payloadPrev2->merge(payloadPrev1);
305+
auto mergedPL = payload.merge(&bufferPL);
306+
// payload.merge(payloadPrev);
308307
o2::ccdb::CcdbObjectInfo info(mPathMerge, "NoiseMap", "noise.root", meta, tstart, tend);
309308
auto flName = o2::ccdb::CcdbApi::generateFileName("noise");
310309
auto image = o2::ccdb::CcdbApi::createObjectImage(&mergedPL, &info);
@@ -360,7 +359,7 @@ void NoiseCalibratorSpec::sendOutputDcs(DataAllocator& output)
360359

361360
const auto& payload = mCalibrator->getNoiseMap();
362361
// const auto& payload = mCalibrator->getNoiseMap(starTF, endTF); //For TimeSlot calibration
363-
362+
364363
setOutputDcs(payload);
365364

366365
o2::ccdb::CcdbObjectInfo infoDcs(mPathDcs, "NoiseMap", "noise.root", meta, tstart, tend);

0 commit comments

Comments
 (0)