Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,8 @@ struct CtpCfg {
uint32_t orbitShift = 0;
uint32_t irInputs_1_24 = 0;
uint32_t irInputs_25_48 = 0;
ClassDefNV(CtpCfg, 1)
std::vector<int> listOfUsedInputs();
ClassDefNV(CtpCfg, 2)
};
} // namespace ctp
} // namespace o2
Expand Down
19 changes: 17 additions & 2 deletions DataFormats/Detectors/CTP/src/Configuration.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -1227,9 +1227,24 @@ int CtpCfg::readAndSave(std::string& path)
}
return 0;
}

std::vector<int> CtpCfg::listOfUsedInputs()
{
std::cout << std::hex << "0x" << irInputs_1_24 << " " << irInputs_25_48 << std::dec << std::endl;
std::vector<int> inputList;
for (int i = 0; i < 24; i++) {
if ((1ul << i) & irInputs_1_24) {
inputList.push_back(i);
}
}
for (int i = 0; i < 24; i++) {
if ((1ul << i) & irInputs_25_48) {
inputList.push_back(i + 24);
}
}
return inputList;
}
std::ostream& o2::ctp::operator<<(std::ostream& in, const o2::ctp::CTPConfiguration& conf)
{
conf.printStream(in);
return in;
}
}