10 #include <TPaveText.h>
17 m_name(name), m_title(title), m_num(num),
18 m_can(
"c1",
"", 200+600*num, 20, 600, 800),
19 m_pad_title(
"title",
"", 0.0, 0.9, 1.0, 1.0),
20 m_pad_main (
"main" ,
"", 0.0, 0.1, 1.0, 0.9),
21 m_pad_msg (
"msg" ,
"", 0.0, 0.0, 1.0, 0.1),
22 m_pate_msg(.02, .02, .98, .98),
24 m_run(0), m_spill(0), m_event(0), m_spill_min(0), m_spill_max(0),
35 void OnlMonCanvas::SetBasicID(
const int run_id,
const int spill_id,
const int event_id,
const int spill_id_min,
const int spill_id_max)
84 m_can.SetTitle(oss.str().c_str());
91 TPaveText* pate =
new TPaveText(.02, .52, .98, .98);
94 pate->AddText(oss.str().c_str());
97 TPaveText* pate2 =
new TPaveText(.02, .02, .98, .48,
"NB");
98 pate2->SetFillColor(kWhite);
104 pate2->AddText(oss.str().c_str());
106 time_t utime = time(0);
108 strftime(stime,
sizeof(stime),
"%Y-%m-%d %H:%M:%S", localtime(&utime));
109 oss.str(
""); oss <<
"Drawn at " << stime;
110 pate2->AddText(oss.str().c_str());
113 gStyle->SetOptStat(0000);
114 gStyle->SetHistMinimumZero(
true);
119 if (
m_pate_msg.GetListOfLines()->GetSize() == 0) {
124 default :
m_pate_msg.AddText(
"Undefined");
break;
129 case OK : color = kGreen ;
break;
130 case WARN : color = kYellow;
break;
131 case ERROR: color = kRed ;
break;
132 default : color = kGray ;
break;
141 gSystem->mkdir(oss.str().c_str(),
true);
144 string path_base = oss.str();
146 int lvl = gErrorIgnoreLevel;
147 gErrorIgnoreLevel = 1111;
149 oss << path_base <<
".png";
150 m_can.SaveAs(oss.str().c_str());
151 gErrorIgnoreLevel = lvl;
154 oss << path_base <<
".txt";
155 ofstream ofs(oss.str().c_str());
OnlMonCanvas(const std::string name, const std::string title, const int num)
void SetBasicCount(const int n_evt=0, const int n_sp=0)
void SetBasicID(const int run_id, const int spill_id=0, const int event_id=0, const int spill_id_min=0, const int spill_id_max=0)
void SetWorseStatus(const MonStatus_t stat)
void PreDraw(const bool at_end=false)
static std::string GetOnlMonDir()
void PostDraw(const bool at_end=false)
void AddMessage(const char *msg)