@@ -115,6 +115,35 @@ void printContent(const std::string inFile, const uint32_t mask)
115115 dataFile->Close ();
116116}
117117
118+ // ____________________________________________________________________________________
119+ void dumpContent (const std::string inFile, const size_t iTF, const uint32_t mask)
120+ {
121+ // / print the content of the status map of the given TF with the given mask
122+
123+ auto [dataFile, dataReader] = loadData (inFile);
124+ TTreeReaderValue<o2::mch::StatusMap> statusMap (*dataReader, " statusmaps" );
125+
126+ if (dataReader->SetEntry (iTF) != TTreeReader::kEntryValid ) {
127+ LOGP (error, " invalid TF index {} (number of TFs = {})" , iTF, dataReader->GetEntries ());
128+ exit (3 );
129+ }
130+
131+ LOGP (info, " status map content for TF {} with statusMask=0x{:x}:" , iTF, mask);
132+
133+ for (const auto & status : *statusMap) {
134+ if ((mask & status.second ) != 0 ) {
135+ auto channel = status.first ;
136+ if (!channel.isValid ()) {
137+ LOGP (error, " invalid channel with status {}" , status.second );
138+ } else {
139+ LOGP (info, " {} status {}" , asString (channel), status.second );
140+ }
141+ }
142+ }
143+
144+ dataFile->Close ();
145+ }
146+
118147// ____________________________________________________________________________________
119148BadChannelsVector statusMap2RejectList (const std::string inFile, const size_t iTF, const uint32_t mask)
120149{
@@ -174,6 +203,7 @@ int main(int argc, char** argv)
174203 size_t iTF;
175204 uint32_t mask;
176205 bool print;
206+ bool dump;
177207
178208 auto tnow = std::chrono::system_clock::now ().time_since_epoch ();
179209 using namespace std ::chrono_literals;
@@ -193,6 +223,7 @@ int main(int argc, char** argv)
193223 (" tf,i" , po::value<size_t >(&iTF)->default_value (0 ), " index of the TF to process" )
194224 (" mask,m" , po::value<uint32_t >(&mask)->default_value (defaultMask), " mask to apply to the statusMap to produce the RejectList" )
195225 (" print,p" ,po::bool_switch (&print)," print the content of the input file without processing it" )
226+ (" dump,d" ,po::bool_switch (&dump)," dump the raw content of the input file without processing it" )
196227 ;
197228 // clang-format on
198229
@@ -214,7 +245,9 @@ int main(int argc, char** argv)
214245 exit (1 );
215246 }
216247
217- if (print) {
248+ if (dump) {
249+ dumpContent (inFile, iTF, mask);
250+ } else if (print) {
218251 printContent (inFile, mask);
219252 } else {
220253 auto bv = statusMap2RejectList (inFile, iTF, mask);
0 commit comments