@@ -137,6 +137,12 @@ Quality RawDataReaderCheck::check(std::map<std::string, std::shared_ptr<MonitorO
137137 result.set (setQualityResult (mVecIndexBad , mVecIndexMedium ));
138138 }
139139 mHistClassRatioPrevious = (TH1D*)h->Clone ();
140+ } else if (mo->getName () == " decodeError" ) {
141+ if (h->GetEntries () > 0 ) {
142+ result.set (Quality::Bad);
143+ } else {
144+ result.set (Quality::Good);
145+ }
140146 } else {
141147 ILOG (Info, Support) << " Unknown histo:" << moName << ENDM;
142148 }
@@ -186,6 +192,14 @@ int RawDataReaderCheck::checkChangeOfRatio(TH1D* mHist, TH1D* mHistPrev, TH1D* m
186192 }
187193 return 0 ;
188194}
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+ }
189203
190204std::string RawDataReaderCheck::getAcceptedType () { return " TH1" ; }
191205
@@ -194,6 +208,10 @@ void RawDataReaderCheck::beautify(std::shared_ptr<MonitorObject> mo, Quality che
194208 std::shared_ptr<TLatex> msg;
195209 if (mo->getName () == " bcMinBias1" || mo->getName () == " bcMinBias2" ) {
196210 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+ }
197215 h->SetMarkerStyle (20 );
198216 h->SetMarkerSize (0.6 );
199217 if (checkResult != Quality::Null) {
@@ -255,8 +273,47 @@ void RawDataReaderCheck::beautify(std::shared_ptr<MonitorObject> mo, Quality che
255273 }
256274 h->SetStats (kFALSE );
257275 h->GetYaxis ()->SetRangeUser (0 , h->GetMaximum () * 1.5 );
276+ } else if (mo->getName () == " decodeError" ) {
277+ 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+ }
282+ if (checkResult != Quality::Null) {
283+ msg = std::make_shared<TLatex>(0.2 , 0.85 , Form (" Quality: %s" , (checkResult.getName ()).c_str ()));
284+ if (checkResult == Quality::Bad) {
285+ msg->SetTextColor (kRed );
286+ } else if (checkResult == Quality::Good) {
287+ msg->SetTextColor (kGreen + 1 );
288+ }
289+ msg->SetTextSize (0.03 );
290+ msg->SetNDC ();
291+ h->GetListOfFunctions ()->Add (msg->Clone ());
292+ }
293+ if (checkResult == Quality::Bad) {
294+ float initialMessagePos = 0.8 ;
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+ }
309+ }
310+ }
258311 } else {
259312 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+ }
260317 h->SetStats (kFALSE );
261318 msg = std::make_shared<TLatex>(0.45 , 0.8 , Form (" Quality: %s" , (checkResult.getName ()).c_str ()));
262319 std::string groupName = " Input" ;
0 commit comments