10 #include "TDirectory.h"
20 std::vector<std::string>
labels;
21 labels.push_back(
"FPIX_m");
22 labels.push_back(
"BPIX_L1_mod_1");
23 labels.push_back(
"BPIX_L1_mod_2");
24 labels.push_back(
"BPIX_L1_mod_3");
25 labels.push_back(
"BPIX_L1_mod_4");
26 labels.push_back(
"BPIX_L1_mod_5");
27 labels.push_back(
"BPIX_L1_mod_6");
28 labels.push_back(
"BPIX_L1_mod_7");
29 labels.push_back(
"BPIX_L1_mod_8");
30 labels.push_back(
"FPIX_p");
31 labels.push_back(
"BPIX_L1");
32 labels.push_back(
"BPIX_L2");
33 labels.push_back(
"BPIX_L3");
34 labels.push_back(
"Lumi");
36 std::vector<TProfile*> profs;
38 for(
unsigned int i=0;
i<labels.size();++
i) {
44 profs.push_back((TProfile*)camult.
getObject(hname.c_str()));
48 TCanvas* cc =
new TCanvas(
"BPIX L1 details",
"BPIX L1 details",1000,1000);
51 for(
unsigned int i = 1;
i<5;++
i) {
53 if(profs[
i] && profs[9-
i]) {
55 profs[9-
i]->SetLineColor(kRed);
56 profs[9-
i]->SetMarkerColor(kRed);
57 profs[9-
i]->Draw(
"same");
58 TLegend*
leg =
new TLegend(0.4,0.8,0.6,0.9,
"Occupancy");
60 leg->AddEntry(profs[
i],labels[i].c_str(),
"l");
61 leg->AddEntry(profs[9-i],labels[9-i].c_str(),
"l");
65 new TCanvas(
"FPIX",
"FPIX");
66 if(profs[0] && profs[9]) {
68 profs[9]->SetLineColor(kRed);
69 profs[9]->SetMarkerColor(kRed);
70 profs[9]->Draw(
"same");
71 TLegend*
leg =
new TLegend(0.4,0.8,0.6,0.9,
"Occupancy");
73 leg->AddEntry(profs[0],labels[0].c_str(),
"l");
74 leg->AddEntry(profs[9],labels[9].c_str(),
"l");
78 gStyle->SetOptStat(11);
79 gStyle->SetOptFit(11);
80 new TCanvas(
"BPIXL1",
"BPIX L1");
81 profs[10]->Fit(
"pol2");
82 new TCanvas(
"BPIXL2",
"BPIX L2");
83 profs[11]->Fit(
"pol2");
84 new TCanvas(
"BPIXL3",
"BPIX L3");
85 profs[12]->Fit(
"pol2");
87 new TCanvas(
"LumiAdd",
"LumiAdd");
88 TH1D* hlumi = profs[11]->ProjectionX(
"lumi");
89 TH1D* hbpixl3 = profs[12]->ProjectionX(
"bpixl3");
90 TH1D* hfpixm = profs[0]->ProjectionX(
"fpixm");
91 TH1D* hfpixp = profs[9]->ProjectionX(
"fpixp");
92 hlumi->SetTitle(
"BPIX L2+L3 + FPIX multiplicity vs vtx z position");
97 new TCanvas(
"Lumi",
"Lumi");
98 profs[13]->Fit(
"pol2");
105 TH1D* clusmult =
new TH1D(
"clusmult",
"Average Multiplicity vs run",10,0.,10.);
106 clusmult->SetCanExtend(TH1::kXaxis);
112 for(
unsigned int i=0;
i<runs.size();++
i) {
115 sprintf(runlabel,
"%d",runs[
i]);
117 sprintf(runpath,
"run_%d",runs[i]);
121 TProfile* multvstime=0;
122 if(multvstime==0) multvstime = (TProfile*)camult.
getObject(
histo);
126 if(excludeLastBins) {
127 int lastbin= multvstime->GetNbinsX()+1;
129 for(
int ibin=multvstime->GetNbinsX()+1;ibin>0;--ibin) {
130 if(multvstime->GetBinEntries(ibin)!=0) {
136 std::cout <<
"Restricted range: " << firstbin <<
" " << lastbin << std::endl;
137 multvstime->GetXaxis()->SetRangeUser(multvstime->GetBinLowEdge(firstbin),multvstime->GetBinLowEdge(lastbin-2));
140 clusmult->Fill(runlabel,multvstime->GetMean(2));
TH1D * AverageRunMultiplicity(TFile &ff, const char *module, const bool excludeLastBins=false, const char *histo="nTKdigivsorbrun")
TObject * getObject(const char *name) const
tuple path
else: Piece not in the list, fine.
void PlotPixelMultVtxPos(TFile *ff, const char *module)
void setPath(const char *path)
const std::vector< unsigned int > getRunList() const