1 R__LOAD_LIBRARY(interface_main)
2 R__LOAD_LIBRARY(ana_embedding)
7 const string dir_in =
"scratch";
9 const string fn_list =
"list_run_spill.txt";
11 ifstream ifs(fn_list);
14 while (ifs >> run_id >> spill_id) list_run.push_back(run_id);
16 std::sort(list_run.begin(), list_run.end());
17 list_run.erase(std::unique(list_run.begin(), list_run.end()), list_run.end());
18 cout <<
"N of runs = " << list_run.size() << endl;
20 TH1* h1_rfp00 =
new TH1D(
"h1_rfp00",
";RF+00;", 100, 0, 1000);
21 TH1* h1_D1 =
new TH1D(
"h1_D1" ,
";D1;" , 100, 0, 800);
22 TH1* h1_D2 =
new TH1D(
"h1_D2" ,
";D2;" , 100, 0, 500);
23 TH1* h1_D3p =
new TH1D(
"h1_D3p" ,
";D3p;", 100, 0, 500);
24 TH1* h1_D3m =
new TH1D(
"h1_D3m" ,
";D3m;", 100, 0, 500);
33 for (
auto it = list_run.begin(); it != list_run.end(); it++) {
35 cout <<
"Run " << run_id << endl;
37 oss << dir_in <<
"/run_" << setfill(
'0') << setw(6) << run_id <<
"/out/embedding_data.root";
38 string fn_in = oss.str();
39 TFile* file_in =
new TFile(fn_in.c_str());
40 if (! file_in->IsOpen()) {
41 cout <<
" Cannot open the input file." << endl;
45 TTree* tree_in = (TTree*)file_in->Get(
"tree");
47 cout <<
" Cannot get the input tree." << endl;
52 tree_in->SetBranchAddress(
"qa_data", &qa_data);
54 for (
int i_ent = 0; i_ent < tree_in->GetEntries(); i_ent++) {
55 tree_in->GetEntry(i_ent);
58 if (qa_data->
rfp00 > 0) n_evt_rf_ok++;
59 if (qa_data->
D1 > 0 && qa_data->
D2 > 0 && qa_data->
D3p > 0 && qa_data->
D3m > 0) {
61 h1_rfp00->Fill(qa_data->
rfp00);
62 h1_D1 ->Fill(qa_data->
D1);
63 h1_D2 ->Fill(qa_data->
D2);
64 h1_D3p ->Fill(qa_data->
D3p);
65 h1_D3m ->Fill(qa_data->
D3m);
71 gSystem->mkdir(
"qa",
true);
73 TCanvas* c1 =
new TCanvas(
"c1",
"");
77 h1_rfp00->Draw(); c1->SaveAs(
"qa/h1_rfp00.png");
78 h1_D1 ->Draw(); c1->SaveAs(
"qa/h1_D1.png");
79 h1_D2 ->Draw(); c1->SaveAs(
"qa/h1_D2.png");
80 h1_D3p ->Draw(); c1->SaveAs(
"qa/h1_D3p.png");
81 h1_D3m ->Draw(); c1->SaveAs(
"qa/h1_D3m.png");
83 ofstream ofs(
"qa/count.txt");
84 ofs <<
"All = " << n_evt_all <<
"\n"
85 <<
"Turn+RF ID OK = " << n_evt_id_ok <<
"\n"
86 <<
"RFp00 OK = " << n_evt_rf_ok <<
"\n"
87 <<
"Occ OK = " << n_evt_occ_ok <<
"\n";