70int main(
int argc,
char* argv[])
73 po::options_description
generic(
"Generic options");
77 (
"help",
"produce help message")
78 (
"feeId-config-file", po::value<std::string>(),
"Filename with crate FEE ID correspondence")
79 (
"crate-masks-file", po::value<std::string>(),
"Filename with crate masks")
80 (
"electronics-delay-file", po::value<std::string>(),
"Filename with electronics delay")
81 (
"occupancy-threshold", po::value<double>()->default_value(0.9),
"Occupancy threshold");
84 po::options_description hidden(
"hidden options");
86 (
"input", po::value<std::vector<std::string>>(),
"Input filename");
89 po::options_description cmdline;
90 cmdline.add(generic).add(hidden);
92 po::positional_options_description
pos;
95 po::store(po::command_line_parser(argc, argv).options(cmdline).positional(
pos).run(), vm);
98 if (vm.count(
"help")) {
99 std::cout <<
"Usage: " << argv[0] <<
" <input_raw_filename> [input_raw_filename_1 ...]\n";
100 std::cout <<
generic << std::endl;
103 if (vm.count(
"input") == 0) {
104 std::cout <<
"no input file specified" << std::endl;
108 std::vector<std::string> inputfiles{vm[
"input"].as<std::vector<std::string>>()};
110 std::unique_ptr<o2::mid::Decoder> decoder{
nullptr};
113 if (vm.count(
"feeId-config-file")) {
118 if (vm.count(
"electronics-delay-file")) {
123 if (vm.count(
"crate-masks-file")) {
127 auto threshold = vm[
"occupancy-threshold"].as<
double>();
129 std::vector<o2::mid::ROBoard>
data;
130 std::vector<o2::mid::ROFRecord> rofRecords;
138 while (rawFileReader.
readHB() > 0) {
143 decoder->process(rawFileReader.
getData());
144 rawFileReader.
clear();
146 data.insert(
data.end(), decoder->getData().begin(), decoder->getData().end());
147 for (
auto& rof : decoder->getROFRecords()) {
148 rofRecords.emplace_back(rof.interactionRecord, rof.eventType, rof.firstEntry +
offset, rof.nEntries);
155 std::array<o2::mid::ChannelScalers, 2> scalers;
157 scalers[0].count(noisy);
161 auto refMasks = makeDefaultMasksFromCrateConfig(feeIdConfig, crateMasks);
164 std::cout <<
"\nCHECKING NOISY CHANNELS:" << std::endl;
172 for (
auto& rof : fetRofs) {
173 std::vector<o2::mid::ColumnData> eventFets(fets.begin() + rof.firstEntry, fets.begin() + rof.getEndIndex());
174 auto deadChannels = fetToDead.
process(eventFets);
175 for (
auto& dead : deadChannels) {
176 scalers[1].count(dead);
179 std::cout <<
"\nCHECKING DEAD CHANNELS:" << std::endl;
bool processScalers(const o2::mid::ChannelScalers &scalers, unsigned long nEvents, double threshold, const std::vector< o2::mid::ColumnData > &refMasks, const char *outFilename)
std::unique_ptr< Decoder > createDecoder(const o2::header::RDHAny &rdh, bool isDebugMode, const ElectronicsDelay &electronicsDelay, const CrateMasks &crateMasks, const FEEIdConfig &feeIdConfig)