Skip to content

Commit 555994a

Browse files
committed
clang
1 parent 2b16b65 commit 555994a

File tree

8 files changed

+41
-41
lines changed

8 files changed

+41
-41
lines changed

DataFormats/Detectors/CTP/include/DataFormatsCTP/Configuration.h

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -205,13 +205,12 @@ class CTPConfiguration
205205

206206
std::ostream& operator<<(std::ostream& in, const CTPConfiguration& conf);
207207

208-
struct CtpCfg
209-
{
208+
struct CtpCfg {
210209
CtpCfg() = default;
211210
std::string filename = "ctp.cfg";
212211
CtpCfg readAndSave(std::string& path);
213212
uint32_t TFOrbits = 0;
214-
int ccdb = -1; // -1 means def constructor was called
213+
int ccdb = -1; // -1 means def constructor was called
215214
uint32_t orbitShift = 0;
216215
uint32_t irInputs_1_24 = 0;
217216
uint32_t irInputs_25_48 = 0;

DataFormats/Detectors/CTP/src/Configuration.cxx

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -909,7 +909,7 @@ uint64_t CTPConfiguration::getTriggerClassMaskWInputs() const
909909
{
910910
uint64_t clsmask = 0;
911911
for (auto const& cls : mCTPClasses) {
912-
if( cls.name.find("TRUE") != std::string::npos) { // ignoring internal ctp generators
912+
if (cls.name.find("TRUE") != std::string::npos) { // ignoring internal ctp generators
913913
continue;
914914
}
915915
clsmask |= cls.classMask;
@@ -921,10 +921,10 @@ uint64_t CTPConfiguration::getTriggerClassMaskWInputsNoTrgDets() const
921921
uint64_t clsmask = 0;
922922
for (auto const& cls : mCTPClasses) {
923923
bool exclude = cls.name.find("TRUE") != std::string::npos; // ignoring internal ctp generators
924-
exclude += cls.name.find("EMC") != std::string::npos;
925-
exclude += cls.name.find("TRD") != std::string::npos;
926-
exclude += cls.name.find("HMP") != std::string::npos;
927-
if(!exclude)
924+
exclude += cls.name.find("EMC") != std::string::npos;
925+
exclude += cls.name.find("TRD") != std::string::npos;
926+
exclude += cls.name.find("HMP") != std::string::npos;
927+
if (!exclude)
928928
clsmask |= cls.classMask;
929929
}
930930
return clsmask;
@@ -1179,7 +1179,7 @@ int CTPInputsConfiguration::getInputIndexFromName(std::string& name)
11791179

11801180
CtpCfg CtpCfg::readAndSave(std::string& path)
11811181
{
1182-
std::ifstream ctpcfg(path+filename);
1182+
std::ifstream ctpcfg(path + filename);
11831183
if (ctpcfg.is_open()) {
11841184
std::string line;
11851185
while (std::getline(ctpcfg, line)) {
@@ -1192,17 +1192,17 @@ CtpCfg CtpCfg::readAndSave(std::string& path)
11921192
}
11931193
std::vector<std::string> tokens = o2::utils::Str::tokenize(line, ' ');
11941194
size_t ntokens = tokens.size();
1195-
if(ntokens < 2) {
1195+
if (ntokens < 2) {
11961196
LOG(warn) << "Not enough tokens";
11971197
return *this;
11981198
}
1199-
if(tokens[0].find("TForbits") != std::string::npos) {
1199+
if (tokens[0].find("TForbits") != std::string::npos) {
12001200
TFOrbits = std::atol(tokens[1].c_str());
1201-
} else if(tokens[0].find("ccdb") != std::string::npos) {
1201+
} else if (tokens[0].find("ccdb") != std::string::npos) {
12021202
ccdb = std::atoi(tokens[1].c_str());
1203-
} else if(tokens[0].find("orbitshift") != std::string::npos) {
1203+
} else if (tokens[0].find("orbitshift") != std::string::npos) {
12041204
orbitShift = std::atol(tokens[1].c_str());
1205-
} else if(tokens[0].find("ir_inputs") != std::string::npos){
1205+
} else if (tokens[0].find("ir_inputs") != std::string::npos) {
12061206
irInputs_1_24 = std::stoul(tokens[1].c_str(), nullptr, 16);
12071207
irInputs_25_48 = std::stoul(tokens[2].c_str(), nullptr, 16);
12081208
} else {

DataFormats/Detectors/CTP/src/DataFormatsCTPLinkDef.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,6 @@
5555
#pragma link C++ class o2::ctp::TriggerOffsetsParam + ;
5656
#pragma link C++ class o2::conf::ConfigurableParamHelper < o2::ctp::TriggerOffsetsParam> + ;
5757

58-
#pragma link C++ class o2::ctp::CtpCfg +;
58+
#pragma link C++ class o2::ctp::CtpCfg + ;
5959

6060
#endif

Detectors/CTP/reconstruction/include/CTPReconstruction/RawDataDecoder.h

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -56,11 +56,12 @@ class RawDataDecoder
5656
static int shiftNew(const o2::InteractionRecord& irin, uint32_t TFOrbit, std::bitset<48>& inpmask, int64_t shift, int level, std::map<o2::InteractionRecord, CTPDigit>& digmap);
5757
static int shiftInputs(std::map<o2::InteractionRecord, CTPDigit>& digitsMap, o2::pmr::vector<CTPDigit>& digits, uint32_t TFOrbit, uint64_t trgclassmask = 0xffffffffffffffff);
5858
int checkReadoutConsistentncy(o2::pmr::vector<CTPDigit>& digits, uint64_t trgclassmask = 0xffffffffffffffff, uint64_t trigclassmaskNoTrgDets = 0xffffffffffffffff);
59-
std::array<uint64_t,o2::ctp::CTP_NCLASSES> getClassErrorsA() {return mClassErrorsA; }
60-
std::array<uint64_t,o2::ctp::CTP_NCLASSES> getClassErrorsB() { return mClassErrorsB; }
61-
std::array<uint64_t,o2::ctp::CTP_NCLASSES> getClassCountersA() {return mClassCountersA; }
62-
std::array<uint64_t,o2::ctp::CTP_NCLASSES> getClassCountersB() { return mClassCountersB; }
59+
std::array<uint64_t, o2::ctp::CTP_NCLASSES> getClassErrorsA() { return mClassErrorsA; }
60+
std::array<uint64_t, o2::ctp::CTP_NCLASSES> getClassErrorsB() { return mClassErrorsB; }
61+
std::array<uint64_t, o2::ctp::CTP_NCLASSES> getClassCountersA() { return mClassCountersA; }
62+
std::array<uint64_t, o2::ctp::CTP_NCLASSES> getClassCountersB() { return mClassCountersB; }
6363
int getLostDueToShift() { return mLostDueToShift; }
64+
6465
private:
6566
static constexpr uint32_t TF_TRIGGERTYPE_MASK = 0x800;
6667
static constexpr uint32_t HB_TRIGGERTYPE_MASK = 0x2;
@@ -89,10 +90,10 @@ class RawDataDecoder
8990
int mErrorTCR = 0;
9091
int mErrorMax = 5;
9192
bool mStickyError = false;
92-
std::array<uint64_t,o2::ctp::CTP_NCLASSES> mClassErrorsA{};
93-
std::array<uint64_t,o2::ctp::CTP_NCLASSES> mClassErrorsB{}; // from inputs
94-
std::array<uint64_t,o2::ctp::CTP_NCLASSES> mClassCountersA{};
95-
std::array<uint64_t,o2::ctp::CTP_NCLASSES> mClassCountersB{}; // from inputs
93+
std::array<uint64_t, o2::ctp::CTP_NCLASSES> mClassErrorsA{};
94+
std::array<uint64_t, o2::ctp::CTP_NCLASSES> mClassErrorsB{}; // from inputs
95+
std::array<uint64_t, o2::ctp::CTP_NCLASSES> mClassCountersA{};
96+
std::array<uint64_t, o2::ctp::CTP_NCLASSES> mClassCountersB{}; // from inputs
9697
int mLostDueToShift = 0;
9798
CTPConfiguration mCTPConfig;
9899
};

Detectors/CTP/reconstruction/src/RawDataDecoder.cxx

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -298,12 +298,12 @@ int RawDataDecoder::decodeRaw(o2::framework::InputRecord& inputs, std::vector<o2
298298
if (mCTPConfig.getRunNumber() != 0) {
299299
trgclassmask = mCTPConfig.getTriggerClassMaskWInputs();
300300
trgclassmaskNOTRGDet = mCTPConfig.getTriggerClassMaskWInputsNoTrgDets();
301-
//mCTPConfig.printStream(std::cout);
301+
// mCTPConfig.printStream(std::cout);
302302
}
303-
//std::cout << "trgclassmask:" << std::hex << trgclassmask << std::dec << std::endl;
303+
// std::cout << "trgclassmask:" << std::hex << trgclassmask << std::dec << std::endl;
304304
ret = shiftInputs(digitsMap, digits, mTFOrbit);
305-
//if (mCheckConsistency) {
306-
if(1) {
305+
// if (mCheckConsistency) {
306+
if (1) {
307307
ret = checkReadoutConsistentncy(digits, trgclassmask, trgclassmaskNOTRGDet);
308308
}
309309
}
@@ -608,20 +608,20 @@ int RawDataDecoder::checkReadoutConsistentncy(o2::pmr::vector<CTPDigit>& digits,
608608
if (digit.CTPClassMask[i] & trgcls) {
609609
const CTPClass* cls = mCTPConfig.getCTPClassFromHWIndex(i);
610610
if (cls == nullptr) {
611-
if(nerror < mErrorMax) {
611+
if (nerror < mErrorMax) {
612612
LOG(error) << "Class mask index not found in CTP config:" << i;
613613
nerror++;
614614
}
615615
ret = 128;
616616
continue;
617617
}
618618
mClassCountersA[i]++;
619-
if( cls->descriptor == nullptr)
619+
if (cls->descriptor == nullptr)
620620
continue;
621621
uint64_t clsinpmask = cls->descriptor->getInputsMask();
622622
uint64_t diginpmask = digit.CTPInputMask.to_ullong();
623623
if (!((clsinpmask & diginpmask) == clsinpmask)) {
624-
if(nerror < mErrorMax) {
624+
if (nerror < mErrorMax) {
625625
LOG(error) << "Cls=>Inps: CTP class:" << cls->name << " inpmask:" << clsinpmask << " not compatible with inputs mask:" << diginpmask;
626626
nerror++;
627627
}
@@ -632,21 +632,21 @@ int RawDataDecoder::checkReadoutConsistentncy(o2::pmr::vector<CTPDigit>& digits,
632632
}
633633
// if inps => class mask
634634
for (auto const& cls : mCTPConfig.getCTPClasses()) {
635-
//cls.printStream(std::cout);
636-
if(cls.descriptor == nullptr)
635+
// cls.printStream(std::cout);
636+
if (cls.descriptor == nullptr)
637637
continue;
638-
uint64_t clsinpmask = cls.descriptor->getInputsMask(); // class definition
638+
uint64_t clsinpmask = cls.descriptor->getInputsMask(); // class definition
639639
uint64_t diginpmask = digit.CTPInputMask.to_ullong();
640640
uint64_t digclsmask = digit.CTPClassMask.to_ullong();
641641
if ((clsinpmask & diginpmask) == clsinpmask) {
642-
if(cls.classMask & trgclassmask) {
642+
if (cls.classMask & trgclassmask) {
643643
mClassCountersB[cls.getIndex()]++;
644644
if ((cls.classMask & digclsmask) == 0) {
645645
int32_t BCShiftCorrection = -o2::ctp::TriggerOffsetsParam::Instance().customOffset[o2::detectors::DetID::CTP];
646646
int32_t offset = BCShiftCorrection + o2::ctp::TriggerOffsetsParam::Instance().LM_L0 + o2::ctp::TriggerOffsetsParam::Instance().L0_L1_classes - 1;
647647
offset = o2::constants::lhc::LHCMaxBunches - offset;
648648
if (digit.intRecord.bc < offset) {
649-
if((nerror < mErrorMax) && (cls.classMask & ~trgclassmaskNoTrgDet)){
649+
if ((nerror < mErrorMax) && (cls.classMask & ~trgclassmaskNoTrgDet)) {
650650
LOG(info) << "Inp=>Cls: CTP class:" << cls.name << " inpmask:" << clsinpmask << " cls mask:" << cls.classMask << " not found in digit:" << digit;
651651
nerror++;
652652
}

Detectors/CTP/workflow/src/RawDecoderSpec.cxx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -71,19 +71,19 @@ void RawDecoderSpec::endOfStream(framework::EndOfStreamContext& ec)
7171
std::cout << std::endl;
7272
LOG(info) << " Lost due to the shift:" << mDecoder.getLostDueToShift();
7373
LOG(info) << "Number of missing TF:" << nmiss << std::endl;
74-
if(mDecoder.getErrorIR() || mDecoder.getErrorTCR())
74+
if (mDecoder.getErrorIR() || mDecoder.getErrorTCR())
7575
LOG(error) << "# of IR errors:" << mDecoder.getErrorIR() << " TCR errors:" << mDecoder.getErrorTCR() << std::endl;
7676
std::array<uint64_t, o2::ctp::CTP_NCLASSES> clsA = mDecoder.getClassCountersA();
7777
std::array<uint64_t, o2::ctp::CTP_NCLASSES> clsB = mDecoder.getClassCountersB();
7878
std::array<uint64_t, o2::ctp::CTP_NCLASSES> clsEA = mDecoder.getClassErrorsA();
7979
std::array<uint64_t, o2::ctp::CTP_NCLASSES> clsEB = mDecoder.getClassErrorsB();
8080

81-
for(int i = 0; i < o2::ctp::CTP_NCLASSES; i ++){
81+
for (int i = 0; i < o2::ctp::CTP_NCLASSES; i++) {
8282
bool print = clsA[i] > 0 || clsB[i] > 0 || clsEA[i] > 0 || clsEB[i] > 0;
83-
if(clsEA[i])
83+
if (clsEA[i])
8484
LOG(error) << " Class without inputs:";
8585
LOG(important) << "CLASS:" << i << " Cls=>Inp:" << clsA[i] << " Inp=>Cls:" << clsB[i] << " ErrorsCls=>Inps:" << clsEA[i] << " MissingInps=>Cls:" << clsEB[i];
86-
}
86+
}
8787
}
8888
void RawDecoderSpec::run(framework::ProcessingContext& ctx)
8989
{

Detectors/CTP/workflowScalers/src/RunManager.cxx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ int CTPRunManager::loadRun(const std::string& cfg)
123123
//
124124
mRunsLoaded[runnumber] = activerun;
125125
saveRunConfigToCCDB(&activerun->cfg, timeStamp);
126-
if(mCtpCfgDir != "none")
126+
if (mCtpCfgDir != "none")
127127
saveCtpCfg(runnumber, timeStamp);
128128
return 0;
129129
}

Detectors/CTP/workflowScalers/src/ctpCCDBManager.cxx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,7 @@ int ctpCCDBManager::saveCtpCfg(uint32_t runNumber, long timeStart)
185185
o2::ccdb::CcdbApi api;
186186
map<string, string> metadata; // can be empty
187187
metadata["runNumber"] = std::to_string(runNumber);
188-
api.init(mCCDBHost.c_str()); // or http://localhost:8080 for a local installation
188+
api.init(mCCDBHost.c_str()); // or http://localhost:8080 for a local installation
189189
// store abitrary user object in strongly typed manner
190190
int ret = api.storeAsTFileAny(&ctpcfg, mCCDBPathCtpCfg, metadata, tmin, tmax);
191191
if (ret == 0) {

0 commit comments

Comments
 (0)