11 #include "TDirectoryFile.h" 19 gROOT->SetStyle(
"Plain");
31 stripmin=atoi(
argv[3]);
32 stripmax=atoi(
argv[4]);
38 TLegend leg(0.1,0.7,0.2,0.9);
41 std::ifstream inmodules(modulelist);
46 if (!inmodules.good())
break;
48 hn=
"ClusterDigiPosition__det__" +
detid;
50 TCanvas
c1(
"c1",
"c1",1600,900);
57 std::ifstream fileToCountLines(
filelist);
58 std::size_t lines_count =0;
61 while (std::getline(fileToCountLines ,
line))
64 const float dim=lines_count;
71 TH1D* trend=
new TH1D(
"trend",
"trend",
int(dim),0.5,dim+0.5);
72 trend->SetMarkerSize(3);
73 trend->SetMarkerStyle(8);
74 trend->SetMarkerColor(4);
77 trend->SetTitle(
ttitle.c_str());
85 THStack *hs =
new THStack(
"hs",
"");
91 if (!filesin.good())
break;
102 TH1D* Events=(TH1D*)
fin->Get(
"TotEvents");
104 double EvtNum=Events->GetBinContent(1);
106 TH1D*
histo=(TH1D*)
fin->Get(hn.c_str());
108 if (!
histo) {
std::cout <<
"Cannot open histo " << hn.c_str() << std::endl;
112 histo->SetDirectory(
nullptr);
113 histo->SetStats(kFALSE);
115 if (hn.find(
"Summary")==std::string::npos)
histo->Scale(1/EvtNum);
117 double numberPerEvent;
118 if (stripmin==999 && stripmax==999) numberPerEvent=
histo->Integral();
119 else numberPerEvent=
histo->Integral(stripmin,stripmax);
122 if (max<=histo->GetBinContent(
histo->GetMaximumBin()))
max=
histo->GetBinContent(
histo->GetMaximumBin());
126 histo->SetMarkerStyle(9);
127 histo->SetMarkerColor(
k+1);
129 trend->SetBinContent(
k+1,numberPerEvent);
130 trend->GetXaxis()->SetBinLabel(
k+1,
runNum.c_str());
145 hs->SetTitle(hn.c_str());
169 if (trend->GetMinimum()==0) mintrend=1.
e-4;
170 else mintrend=trend->GetMinimum();
172 trend->SetStats(kFALSE);
174 trend->GetYaxis()->SetRangeUser(mintrend*0.5,trend->GetMaximum()*2);
int main(int argc, char *argv[])
filelist
File list which will contain skimmed file names.