@@ -192,6 +192,14 @@ int RawDataReaderCheck::checkChangeOfRatio(TH1D* mHist, TH1D* mHistPrev, TH1D* m
192192 }
193193 return 0 ;
194194}
195+ float RawDataReaderCheck::setTextPosition (float iPos, std::shared_ptr<TLatex> msg, TH1D* h)
196+ {
197+ msg->SetTextSize (0.03 );
198+ msg->SetNDC ();
199+ h->GetListOfFunctions ()->Add (msg->Clone ());
200+ float MessagePos = iPos - 0.04 ;
201+ return MessagePos;
202+ }
195203
196204std::string RawDataReaderCheck::getAcceptedType () { return " TH1" ; }
197205
@@ -200,6 +208,10 @@ void RawDataReaderCheck::beautify(std::shared_ptr<MonitorObject> mo, Quality che
200208 std::shared_ptr<TLatex> msg;
201209 if (mo->getName () == " bcMinBias1" || mo->getName () == " bcMinBias2" ) {
202210 auto * h = dynamic_cast <TH1D*>(mo->getObject ());
211+ if (h == nullptr ) {
212+ ILOG (Info, Support) << " null pointer for hist:" << mo->getName () << ENDM;
213+ return ;
214+ }
203215 h->SetMarkerStyle (20 );
204216 h->SetMarkerSize (0.6 );
205217 if (checkResult != Quality::Null) {
@@ -263,6 +275,10 @@ void RawDataReaderCheck::beautify(std::shared_ptr<MonitorObject> mo, Quality che
263275 h->GetYaxis ()->SetRangeUser (0 , h->GetMaximum () * 1.5 );
264276 } else if (mo->getName () == " decodeError" ) {
265277 auto * h = dynamic_cast <TH1D*>(mo->getObject ());
278+ if (h == nullptr ) {
279+ ILOG (Info, Support) << " null pointer for hist:" << mo->getName () << ENDM;
280+ return ;
281+ }
266282 if (checkResult != Quality::Null) {
267283 msg = std::make_shared<TLatex>(0.2 , 0.85 , Form (" Quality: %s" , (checkResult.getName ()).c_str ()));
268284 if (checkResult == Quality::Bad) {
@@ -276,64 +292,28 @@ void RawDataReaderCheck::beautify(std::shared_ptr<MonitorObject> mo, Quality che
276292 }
277293 if (checkResult == Quality::Bad) {
278294 float initialMessagePos = 0.8 ;
279- if (h->GetBinContent (1 ) > 0 ) {
280- msg = std::make_shared<TLatex>(0.2 , initialMessagePos, " Failed to extract RDD" );
281- msg->SetTextSize (0.03 );
282- msg->SetNDC ();
283- h->GetListOfFunctions ()->Add (msg->Clone ());
284- initialMessagePos -= 0.04 ;
285- }
286- if (h->GetBinContent (3 ) > 0 ) {
287- msg = std::make_shared<TLatex>(0.2 , initialMessagePos, " Two CTP IRs with the same ts" );
288- msg->SetTextSize (0.03 );
289- msg->SetNDC ();
290- h->GetListOfFunctions ()->Add (msg->Clone ());
291- initialMessagePos -= 0.04 ;
292- }
293- if (h->GetBinContent (4 ) > 0 ) {
294- msg = std::make_shared<TLatex>(0.2 , initialMessagePos, " Two digits with the same ts" );
295- msg->SetTextSize (0.03 );
296- msg->SetNDC ();
297- h->GetListOfFunctions ()->Add (msg->Clone ());
298- initialMessagePos -= 0.04 ;
299- }
300- if (h->GetBinContent (5 ) > 0 ) {
301- msg = std::make_shared<TLatex>(0.2 , initialMessagePos, " Two CTP class masks with the same ts" );
302- msg->SetTextSize (0.03 );
303- msg->SetNDC ();
304- h->GetListOfFunctions ()->Add (msg->Clone ());
305- initialMessagePos -= 0.04 ;
306- }
307- if (h->GetBinContent (6 ) > 0 ) {
308- msg = std::make_shared<TLatex>(0.2 , initialMessagePos, " Two digits (Class Mask) with the same ts" );
309- msg->SetTextSize (0.03 );
310- msg->SetNDC ();
311- h->GetListOfFunctions ()->Add (msg->Clone ());
312- initialMessagePos -= 0.04 ;
313- }
314- if (h->GetBinContent (7 ) > 0 ) {
315- msg = std::make_shared<TLatex>(0.2 , initialMessagePos, " Trigger class without input" );
316- msg->SetTextSize (0.03 );
317- msg->SetNDC ();
318- h->GetListOfFunctions ()->Add (msg->Clone ());
319- initialMessagePos -= 0.04 ;
320- }
321- if (h->GetBinContent (8 ) > 0 ) {
322- msg = std::make_shared<TLatex>(0.2 , initialMessagePos, " CTP class mask not compatible with input class mask" );
323- msg->SetTextSize (0.03 );
324- msg->SetNDC ();
325- h->GetListOfFunctions ()->Add (msg->Clone ());
326- initialMessagePos -= 0.04 ;
327- }
328- if (h->GetBinContent (9 ) > 0 ) {
329- msg = std::make_shared<TLatex>(0.2 , initialMessagePos, " CTP class not found in the digit" );
330- msg->SetTextSize (0.03 );
331- msg->SetNDC ();
332- h->GetListOfFunctions ()->Add (msg->Clone ());
295+ string messages[9 ] = { " Failed to extract RDD" ,
296+ " " ,
297+ " Two CTP IRs with the same ts" ,
298+ " Two digits with the same ts" ,
299+ " Two CTP class masks with the same ts" ,
300+ " Two digits (Class Mask) with the same ts" ,
301+ " Trigger class without input" ,
302+ " CTP class mask not compatible with input class mask" ,
303+ " CTP class not found in the digit" };
304+ for (int i = 1 ; i < h->GetXaxis ()->GetNbins () + 1 ; i++) {
305+ if (h->GetBinContent (i) > 0 ) {
306+ msg = std::make_shared<TLatex>(0.2 , initialMessagePos, messages[i - 1 ].c_str ());
307+ initialMessagePos = setTextPosition (initialMessagePos, msg, h);
308+ }
333309 }
334310 }
335311 } else {
336312 auto * h = dynamic_cast <TH1D*>(mo->getObject ());
313+ if (h == nullptr ) {
314+ ILOG (Info, Support) << " null pointer for hist:" << mo->getName () << ENDM;
315+ return ;
316+ }
337317 h->SetStats (kFALSE );
338318 msg = std::make_shared<TLatex>(0.45 , 0.8 , Form (" Quality: %s" , (checkResult.getName ()).c_str ()));
339319 std::string groupName = " Input" ;
0 commit comments