3 #include <TGraphAsymmErrors.h>
4 #include <TGraphErrors.h>
12 #include "SaveCanvas.C"
13 #include "sPhenixStyle.C"
22 const TString
infile =
"/sphenix/user/jinhuang/TPC/Multiplicity/AuAu200MB_170kHz_Iter2/AuAu200MB_170kHz_Iter2_SUM.xml_TPCIntegratedCharge.root",
23 const TString disc =
"Au+Au MB Triggered + 170 kHz collision"
27 gStyle->SetOptStat(0);
28 gStyle->SetOptFit(1111);
29 TVirtualFitter::SetDefaultFitter(
"Minuit2");
52 TH2 *hLayerCellCharge = (TH2 *)
_file0->GetObjectChecked(
"hLayerCellCharge",
"TH2");
55 TH1 *chargePDFs[100000];
56 TH1 *chargeCDFs[100000];
58 Color_t colors[] = {kPink + 2, kRed + 2, kSpring + 2, kGreen + 2, kAzure + 2, kBlue + 2};
60 for (
int i = 0;
i < layers.size(); ++
i)
64 const int layer = layers[
i];
65 TH1 *chargePDF = hLayerCellCharge->ProjectionY(Form(
"hLayerCellCharge_PDF_Layer%d", layer), layer, layer);
68 chargePDF->SetMarkerStyle(kFullCircle);
69 chargePDF->SetMarkerColor(color);
70 chargePDF->SetLineColor(color);
72 chargePDF->Scale(1 / chargePDF->Integral(0, -1));
74 TH1 *chargeCDF = chargePDF->Clone(Form(
"hLayerCellCharge_CDF_Layer%d", layer));
75 for (
int bin = chargeCDF->GetNbinsX() + 1; bin >= 0; --bin)
79 cdf = chargePDF->IntegralAndError(bin, -1, cdf_err);
81 chargeCDF->SetBinContent(bin, cdf);
82 chargeCDF->SetBinError(bin, cdf_err);
87 chargePDFs[
i] = (chargePDF);
88 chargeCDFs[
i] = chargeCDF;
91 TCanvas *c1 =
new TCanvas(
"ChargePerLayer",
"ChargePerLayer", 1800, 960);
96 p = (TPad *) c1->cd(idx++);
100 p->DrawFrame(0, 1
e-4, 610, 1,
";Charge [fC];Probability/bin");
102 TLegend *
leg =
new TLegend(.17, .8, .93, .93);
103 leg->AddEntry(
"",
"#it{#bf{sPHENIX}} Simulation, CD-1 configuration",
"");
105 leg->AddEntry(
"",
"TPC charge PDF per FEE chan. over 13 us drift window",
"");
108 leg =
new TLegend(.55, .5, .93, .75);
109 for (
int i = 0;
i < layers.size(); ++
i)
111 chargePDFs[
i]->Draw(
"same");
113 TString performance = Form(
"Layer #%d: <Q> = %.0f fC", layers[
i], chargePDFs[i]->GetMean());
114 cout <<
"ChargePerLayer : " << performance << endl;
115 leg->AddEntry(chargePDFs[i], performance,
"lp");
120 p = (TPad *) c1->cd(idx++);
123 p->DrawFrame(0, 1
e-3, 610, 1,
";Charge Threshold [fC];Probability[Q > Charge Threshold]");
125 TLegend *leg =
new TLegend(.17, .8, .93, .93);
126 leg->AddEntry(
"",
"#it{#bf{sPHENIX}} Simulation, CD-1 configuration",
"");
128 leg->AddEntry(
"",
"TPC charge CCDF per FEE chan. over 13 us drift window",
"");
131 leg =
new TLegend(.2, .2, .65, .4);
132 for (
int i = 0;
i < layers.size(); ++
i)
134 chargeCDFs[
i]->Draw(
"same");
136 TString cdf_desk = Form(
"Layer #%d: P[Q>300fC] = %.1f%%",
138 100 * chargeCDFs[i]->GetBinContent(chargeCDFs[i]->FindBin(300)));
139 cout <<
"ChargePerLayer : " << cdf_desk << endl;
140 leg->AddEntry(chargeCDFs[i], cdf_desk,
"lp");
151 TCanvas *c1 =
new TCanvas(
"Check",
"Check", 1800, 960);
156 p = (TPad *) c1->cd(idx++);
163 hNormalization->Draw();
165 p = (TPad *) c1->cd(idx++);
169 TH2 *hLayerCellHit = (TH2 *)
_file0->GetObjectChecked(
"hLayerCellHit",
"TH2");
172 hLayerCellHit->Draw(
"colz");
174 TProfile *hLayerCellHit_px = hLayerCellHit->ProfileX();
175 hLayerCellHit_px->Draw(
"same");
177 p = (TPad *) c1->cd(idx++);
181 TH2 *hLayerCellCharge = (TH2 *)
_file0->GetObjectChecked(
"hLayerCellCharge",
"TH2");
184 hLayerCellCharge->Draw(
"colz");
186 p = (TPad *) c1->cd(idx++);
190 TH2 *hLayerSumCellHit = (TH2 *)
_file0->GetObjectChecked(
"hLayerSumCellHit",
"TH2");
193 hLayerSumCellHit->Draw(
"colz");
195 p = (TPad *) c1->cd(idx++);
199 TH2 *hLayerSumCellCharge = (TH2 *)
_file0->GetObjectChecked(
"hLayerSumCellCharge",
"TH2");
200 assert(hLayerSumCellCharge);
202 hLayerSumCellCharge->Draw(
"colz");