11 if(!daq_words_by_type){
12 cout <<
"Can't find 'daq_words_by_type' histogram! (aborting macro)" << endl;
16 TCanvas *
c1 =
new TCanvas(
"c1",
"", 1600, 800);
20 cout <<
"gPad==NULL!! aborting macro" << endl;
24 gPad->SetBottomMargin(0.3);
25 gPad->SetLeftMargin(0.05);
26 gPad->SetRightMargin(0.02);
29 gPad->GetCanvas()->SetTicks();
30 gPad->GetCanvas()->SetLogy();
36 double mid = daq_words_by_type->GetMaximum(daq_words_by_type->GetMaximum());
38 double max = pow(10.0, (1.0/0.65)*(log10(mid)-log10(min) + log10(min)));
40 daq_words_by_type->SetStats(0);
41 daq_words_by_type->SetYTitle(
"Total number of 32-bit words");
42 daq_words_by_type->GetYaxis()->SetTitleOffset(0.6);
43 daq_words_by_type->GetYaxis()->SetRangeUser(min, max);
44 daq_words_by_type->SetFillColor(kBlue);
45 daq_words_by_type->SetBarWidth(0.92);
46 daq_words_by_type->Draw(
"bar");
51 latex.SetTextSize(0.030);
52 latex.SetTextAlign(32);
53 latex.SetTextAngle(90.0);
55 Int_t
Nbins = daq_words_by_type->GetNbinsX();
56 double Nword_tot = daq_words_by_type->GetBinContent(Nbins-1);
57 double Nevents = daq_words_by_type->GetBinContent(Nbins);
58 double Nunknown = daq_words_by_type->GetBinContent(2);
60 for(
int ibin=1; ibin<=
Nbins; ibin++){
62 double x = daq_words_by_type->GetXaxis()->GetBinCenter(ibin);
63 double Nwords = daq_words_by_type->GetBinContent(ibin);
64 double percent = 100.0 * Nwords /
Nword_tot;
66 if(Nwords == 0)
continue;
68 if(ibin < Nbins-2) sum += Nwords;
71 sprintf(str,
"%4.1f%%", percent);
72 if(ibin < Nbins-2)
sprintf(str,
"%s _{(%3.1f%% total)}", str, 100.0*sum/Nword_tot);
73 latex.DrawLatex( x, ylab, str);
78 TLine lin(0.0, y_one_percent, (
double)Nbins, y_one_percent);
79 lin.SetLineColor(kMagenta);
82 cout <<
" sum: " << sum << endl;
83 cout <<
" Nword_tot: " << Nword_tot << endl;
84 cout <<
" missing: " << (Nword_tot-
sum)/Nword_tot*100.0 <<
"%" << endl;
85 cout <<
" Event Size: " << (double)Nword_tot/(
double)Nevents*4.0/1024.0 <<
" kB/event" << endl;
86 cout <<
" Nunknown/event: " << (double)Nunknown/(
double)Nevents <<
" bytes" << endl;
88 c1->SaveAs(
"daq_words.png");
89 c1->SaveAs(
"daq_words.pdf");
sprintf(text,"Post KinFit Cut")