@@ -23,30 +23,55 @@ namespace {
2323 return false ;
2424 }
2525
26- std::vector<std::string> lines;
27- lines.push_back (" LHCInfoPerFill Inspector" );
28- lines.push_back (" " );
29- lines.push_back (" Fill Number: " + std::to_string (payload->fillNumber ()));
30- lines.push_back (" Beam Energy: " + std::to_string (payload->energy ()));
31- lines.push_back (" Deliv Lumi: " + std::to_string (payload->delivLumi ()));
32- lines.push_back (" Rec Lumi: " + std::to_string (payload->recLumi ()));
33- lines.push_back (" Inst Lumi: " + std::to_string (payload->instLumi ()));
34- lines.push_back (" Injection Scheme: " + payload->injectionScheme ());
35- lines.push_back (" Colliding Bunches: " + std::to_string (payload->collidingBunches ()));
36- lines.push_back (" Target Bunches: " + std::to_string (payload->targetBunches ()));
37-
38- TCanvas canvas (" c" ," c" ,800 ,600 );
26+ std::vector<std::pair<std::string, std::string>> items;
27+ items.push_back ({" Fill Number: " , std::to_string (payload->fillNumber ())});
28+ items.push_back ({" Beam Energy: " , std::to_string (payload->energy ())});
29+ items.push_back ({" Deliv Lumi: " , std::to_string (payload->delivLumi ())});
30+ items.push_back ({" Rec Lumi: " , std::to_string (payload->recLumi ())});
31+ items.push_back ({" Inst Lumi: " , std::to_string (payload->instLumi ())});
32+ items.push_back ({" Injection Scheme: " , payload->injectionScheme ()});
33+ items.push_back ({" Colliding Bunches: " , std::to_string (payload->collidingBunches ())});
34+ items.push_back ({" Target Bunches: " , std::to_string (payload->targetBunches ())});
35+
36+ TCanvas canvas (" c" , " c" , 800 , 600 );
3937 canvas.cd ();
4038 TLatex latex;
4139 latex.SetTextSize (0.03 );
42-
40+
4341 float startY = 0.95 ;
4442 float stepY = 0.06 ;
45- for (std::size_t i = 0 ; i < lines.size (); ++i) {
46- latex.DrawLatexNDC (0.05 , startY - i * stepY, lines[i].c_str ());
43+
44+ // Print the title
45+ latex.SetTextColor (kBlack );
46+ latex.DrawLatexNDC (0.05 , startY, " LHCInfoPerFill Inspector" );
47+
48+ // Print the fields with values in red
49+ for (std::size_t i = 0 ; i < items.size (); ++i) {
50+ float y = startY - (i + 2 ) * stepY; // +2 to skip title and add a blank line
51+ // Print key in black
52+ latex.SetTextColor (kBlack );
53+ latex.DrawLatexNDC (0.05 , y, items[i].first .c_str ());
54+ // Print value in red, offset to the right (adjust offset as needed)
55+ latex.SetTextColor (kRed );
56+ latex.DrawLatexNDC (0.30 , y, items[i].second .c_str ());
4757 }
48- std::string fileName = " LHCInfoPerFill.png" ;
58+
59+ // info
60+ TLatex t1;
61+ t1.SetNDC ();
62+ t1.SetTextAlign (12 );
63+ t1.SetTextSize (0.04 );
64+ t1.DrawLatex (0.1 , 0.18 , " LHCInfo parameters:" );
65+ t1.DrawLatex (0.1 , 0.15 , " payload:" );
66+
67+ t1.SetTextFont (42 );
68+ t1.SetTextColor (4 );
69+ t1.DrawLatex (0.37 , 0.182 , Form (" IOV %s" , std::to_string (+std::get<0 >(iov)).c_str ()));
70+ t1.DrawLatex (0.21 , 0.152 , Form (" %s" , (std::get<1 >(iov)).c_str ()));
71+
72+ std::string fileName (m_imageFileName);
4973 canvas.SaveAs (fileName.c_str ());
74+
5075 return true ;
5176 }
5277 };
0 commit comments