Skip to content

Commit 6293938

Browse files
committed
dev:CTpCfg list of used inputs
1 parent ab29595 commit 6293938

File tree

2 files changed

+19
-3
lines changed

2 files changed

+19
-3
lines changed

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -214,7 +214,8 @@ struct CtpCfg {
214214
uint32_t orbitShift = 0;
215215
uint32_t irInputs_1_24 = 0;
216216
uint32_t irInputs_25_48 = 0;
217-
ClassDefNV(CtpCfg, 1)
217+
std::vector<int> listOfUsedInputs();
218+
ClassDefNV(CtpCfg, 2)
218219
};
219220
} // namespace ctp
220221
} // namespace o2

DataFormats/Detectors/CTP/src/Configuration.cxx

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1227,9 +1227,24 @@ int CtpCfg::readAndSave(std::string& path)
12271227
}
12281228
return 0;
12291229
}
1230-
1230+
std::vector<int> CtpCfg::listOfUsedInputs()
1231+
{
1232+
std::cout << std::hex << "0x" << irInputs_1_24 << " " << irInputs_25_48 << std::dec << std::endl;
1233+
std::vector<int> inputList;
1234+
for(int i = 0; i < 24; i++) {
1235+
if ((1ul << i) & irInputs_1_24) {
1236+
inputList.push_back(i);
1237+
}
1238+
}
1239+
for(int i = 0; i < 24; i++) {
1240+
if ((1ul << i) & irInputs_25_48) {
1241+
inputList.push_back(i + 24);
1242+
}
1243+
}
1244+
return inputList;
1245+
}
12311246
std::ostream& o2::ctp::operator<<(std::ostream& in, const o2::ctp::CTPConfiguration& conf)
12321247
{
12331248
conf.printStream(in);
12341249
return in;
1235-
}
1250+
}

0 commit comments

Comments
 (0)