10 #include "TDirectory.h" 19 std::vector<std::string>
labels;
20 labels.push_back(
"FPIX_m");
21 labels.push_back(
"BPIX_L1_mod_1");
22 labels.push_back(
"BPIX_L1_mod_2");
23 labels.push_back(
"BPIX_L1_mod_3");
24 labels.push_back(
"BPIX_L1_mod_4");
25 labels.push_back(
"BPIX_L1_mod_5");
26 labels.push_back(
"BPIX_L1_mod_6");
27 labels.push_back(
"BPIX_L1_mod_7");
28 labels.push_back(
"BPIX_L1_mod_8");
29 labels.push_back(
"FPIX_p");
30 labels.push_back(
"BPIX_L1");
31 labels.push_back(
"BPIX_L2");
32 labels.push_back(
"BPIX_L3");
35 std::vector<TProfile*> profs;
37 for (
unsigned int i = 0;
i <
labels.size(); ++
i) {
42 profs.push_back((TProfile*)camult.
getObject(hname.c_str()));
45 TCanvas*
cc =
new TCanvas(
"BPIX L1 details",
"BPIX L1 details", 1000, 1000);
48 for (
unsigned int i = 1;
i < 5; ++
i) {
50 if (profs[
i] && profs[9 -
i]) {
52 profs[9 -
i]->SetLineColor(kRed);
53 profs[9 -
i]->SetMarkerColor(kRed);
54 profs[9 -
i]->Draw(
"same");
55 TLegend* leg =
new TLegend(0.4, 0.8, 0.6, 0.9,
"Occupancy");
57 leg->AddEntry(profs[
i],
labels[
i].c_str(),
"l");
58 leg->AddEntry(profs[9 -
i],
labels[9 -
i].c_str(),
"l");
62 new TCanvas(
"FPIX",
"FPIX");
63 if (profs[0] && profs[9]) {
65 profs[9]->SetLineColor(kRed);
66 profs[9]->SetMarkerColor(kRed);
67 profs[9]->Draw(
"same");
68 TLegend* leg =
new TLegend(0.4, 0.8, 0.6, 0.9,
"Occupancy");
70 leg->AddEntry(profs[0],
labels[0].c_str(),
"l");
71 leg->AddEntry(profs[9],
labels[9].c_str(),
"l");
75 gStyle->SetOptStat(11);
76 gStyle->SetOptFit(11);
77 new TCanvas(
"BPIXL1",
"BPIX L1");
78 profs[10]->Fit(
"pol2");
79 new TCanvas(
"BPIXL2",
"BPIX L2");
80 profs[11]->Fit(
"pol2");
81 new TCanvas(
"BPIXL3",
"BPIX L3");
82 profs[12]->Fit(
"pol2");
84 new TCanvas(
"LumiAdd",
"LumiAdd");
85 TH1D* hlumi = profs[11]->ProjectionX(
"lumi");
86 TH1D* hbpixl3 = profs[12]->ProjectionX(
"bpixl3");
87 TH1D* hfpixm = profs[0]->ProjectionX(
"fpixm");
88 TH1D* hfpixp = profs[9]->ProjectionX(
"fpixp");
89 hlumi->SetTitle(
"BPIX L2+L3 + FPIX multiplicity vs vtx z position");
94 new TCanvas(
"Lumi",
"Lumi");
95 profs[13]->Fit(
"pol2");
100 const bool excludeLastBins =
false,
101 const char*
histo =
"nTKdigivsorbrun") {
104 TH1D* clusmult =
new TH1D(
"clusmult",
"Average Multiplicity vs run", 10, 0., 10.);
105 clusmult->SetCanExtend(TH1::kXaxis);
111 for (
unsigned int i = 0;
i <
runs.size(); ++
i) {
113 sprintf(runlabel,
"%d",
runs[
i]);
115 sprintf(runpath,
"run_%d",
runs[
i]);
118 TProfile* multvstime =
nullptr;
119 if (multvstime ==
nullptr)
124 if (excludeLastBins) {
125 int lastbin = multvstime->GetNbinsX() + 1;
127 for (
int ibin = multvstime->GetNbinsX() + 1; ibin > 0; --ibin) {
128 if (multvstime->GetBinEntries(ibin) != 0) {
134 std::cout <<
"Restricted range: " << firstbin <<
" " << lastbin << std::endl;
135 multvstime->GetXaxis()->SetRangeUser(multvstime->GetBinLowEdge(firstbin),
136 multvstime->GetBinLowEdge(lastbin - 2));
139 clusmult->Fill(runlabel, multvstime->GetMean(2));
TH1D * AverageRunMultiplicity(TFile &ff, const char *module, const bool excludeLastBins=false, const char *histo="nTKdigivsorbrun")
uint32_t cc[maxCellsPerHit]
TObject * getObject(const char *name) const
void PlotPixelMultVtxPos(TFile *ff, const char *module)
void setPath(const char *path)
const std::vector< unsigned int > getRunList() const