11 #include "TDirectoryFile.h" 18 gROOT->SetStyle(
"Plain");
30 stripmin = atoi(
argv[3]);
31 stripmax = atoi(
argv[4]);
37 TLegend leg(0.1, 0.7, 0.2, 0.9);
40 std::ifstream inmodules(modulelist);
44 if (!inmodules.good())
47 hn =
"ClusterDigiPosition__det__" +
detid;
49 TCanvas
c1(
"c1",
"c1", 1600, 900);
56 std::ifstream fileToCountLines(
filelist);
57 std::size_t lines_count = 0;
60 while (std::getline(fileToCountLines,
line))
63 const float dim = lines_count;
70 TH1D* trend =
new TH1D(
"trend",
"trend",
int(dim), 0.5, dim + 0.5);
71 trend->SetMarkerSize(3);
72 trend->SetMarkerStyle(8);
73 trend->SetMarkerColor(4);
76 trend->SetTitle(
ttitle.c_str());
84 THStack* hs =
new THStack(
"hs",
"");
101 TH1D* Events = (TH1D*)
fin->Get(
"TotEvents");
103 double EvtNum = Events->GetBinContent(1);
105 TH1D*
histo = (TH1D*)
fin->Get(hn.c_str());
108 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)
116 histo->Scale(1 / EvtNum);
118 double numberPerEvent;
119 if (stripmin == 999 && stripmax == 999)
120 numberPerEvent =
histo->Integral();
122 numberPerEvent =
histo->Integral(stripmin, stripmax);
124 if (max <= histo->GetBinContent(
histo->GetMaximumBin()))
129 histo->SetLineColor(
k + 1);
130 histo->SetMarkerStyle(9);
131 histo->SetMarkerColor(
k + 1);
133 trend->SetBinContent(
k + 1, numberPerEvent);
134 trend->GetXaxis()->SetBinLabel(
k + 1,
runNum.c_str());
150 hs->SetTitle(hn.c_str());
160 l.DrawLine(128,
min, 128,
max);
161 l.DrawLine(256,
min, 256,
max);
162 l.DrawLine(384,
min, 384,
max);
163 l.DrawLine(384,
min, 384,
max);
164 l.DrawLine(512,
min, 512,
max);
165 l.DrawLine(640,
min, 640,
max);
174 if (trend->GetMinimum() == 0)
177 mintrend = trend->GetMinimum();
179 trend->SetStats(kFALSE);
181 trend->GetYaxis()->SetRangeUser(mintrend * 0.5, trend->GetMaximum() * 2);
int main(int argc, char *argv[])
filelist
File list which will contain skimmed file names.