1 #ifndef MIDNCHANALYSIS_C 2 #define MIDNCHANALYSIS_C 7 # include <TParticle.h> 8 # include <TObjArray.h> 10 # include <TGraphErrors.h> 11 # include <TProfile.h> 80 Info(
"SlaveBegin",
"Creating histogram");
82 fNpartVsNch->SetDirectory(0);
83 fNpartVsNch->SetName(
"nPartVsnCh");
84 fNpartVsNch->SetXTitle(
"\\langle N_{\\mathrm{part}}\\rangle");
85 fNpartVsNch->SetYTitle(
"\\left\\langle\\frac{\\mathrm{d}N_{\\mathrm{ch}}}" 86 "{\\mathrm{d}\\eta}\\right\\rangle");
87 fNpartVsNch->SetMarkerColor(kRed+2);
88 fNpartVsNch->SetMarkerStyle(20);
89 fNpartVsNch->SetFillStyle(1001);
90 fNpartVsNch->SetFillColor(kYellow+1);
92 fNpartB =
new TProfile(
"nPartB",
"N_{\\mathrm{part}}\\hbox{ vs. }b",
94 fNpartB->SetXTitle(
"b\\hbox{ (fm)}");
95 fNpartB->SetYTitle(
"\\langle N_{\\mathrm{part}}\\rangle");
96 fNpartB->SetDirectory(0);
97 fNpartB->SetMarkerColor(kBlue+2);
98 fNpartB->SetMarkerStyle(21);
103 if (centAxis.GetXbins() && centAxis.GetXbins()->GetArray()) {
104 fMeanNpart =
new TProfile(
"meanNpart",
"", centAxis.GetNbins(),
105 centAxis.GetXbins()->GetArray());
106 fMeanNch =
new TProfile(
"meanNch",
"", centAxis.GetNbins(),
107 centAxis.GetXbins()->GetArray());
110 fMeanNpart =
new TProfile(
"meanNpart",
"", centAxis.GetNbins(),
111 centAxis.GetXmin(), centAxis.GetXmax());
112 fMeanNch =
new TProfile(
"meanNch",
"", centAxis.GetNbins(),
113 centAxis.GetXmin(), centAxis.GetXmax());
115 fMeanNpart->SetDirectory(0);
116 fMeanNch ->SetDirectory(0);
117 fMeanNpart->SetXTitle(
"Centrality (%)");
118 fMeanNch ->SetXTitle(
"Centrality (%)");
119 fMeanNpart->SetXTitle(fNpartVsNch->GetXaxis()->GetTitle());
120 fMeanNch ->SetYTitle(fNpartVsNch->GetYaxis()->GetTitle());
121 fMeanNpart->SetMarkerStyle(20);
122 fMeanNch ->SetMarkerStyle(21);
123 fMeanNpart->SetMarkerColor(kRed +1);
124 fMeanNch ->SetMarkerStyle(kBlue+1);
125 fMeanNpart->SetLineColor(kRed +1);
126 fMeanNch ->SetLineStyle(kBlue+1);
130 fOutput->Add(fNpartVsNch);
131 fOutput->Add(fNpartB);
132 fOutput->Add(fMeanNpart);
133 fOutput->Add(fMeanNch);
174 Double_t theta = TMath::ATan2(pT, pZ);
175 Double_t eta = (pT < 1e-10 ? 1024 : -TMath::Log(TMath::Tan(theta/2)));
176 if (TMath::Abs(eta) > 0.5)
return false;
192 fNpartVsNch->Fill(fNpart, fNch);
193 fMeanNpart ->Fill(fCent, fNpart);
194 fMeanNch ->Fill(fCent, fNch);
206 Warning(
"Terminate",
"No events selected");
209 TClass* pcl = TProfile::Class();
215 if (!fNpartVsNch || !fMeanNpart || !fMeanNch) {
217 Warning(
"Terminate",
"No profiles found found (%p,%p,%p)",
218 fNpartVsNch, fMeanNpart, fMeanNch);
221 Printf(
"A total of %ld events",
fOK);
225 Color_t
c = kYellow+1;
230 if (t.Contains(
"HIJING")) { c = kRed - 3; s = 1; }
231 else if (t.Contains(
"AMPT")) { c = kBlue - 3; s = 2; }
232 else if (t.Contains(
"DPMJET")) { c = kMagenta - 3; s = 3; }
233 else if (t.Contains(
"EPOS-LHC")) { c = kGreen - 3; s = 4; }
234 else if (t.Contains(
"AMPT2")) { c = kMagenta - 3; s = 3; }
235 else if (t.Contains(
"KLN")) { c = kBlue - 3; s = 2; }
236 else if (t.Contains(
"HIJING2")) { c = kRed + 3; s = 1; }
237 else if (t.Contains(
"ANGANTYR")) { c = kOrange + 3; s = 3; }
242 res->SetName(
"result");
243 res->SetTitle(Form(
"%s \\frac{2}{%s}",
244 fNpartVsNch->GetYaxis()->GetTitle(),
245 fNpartVsNch->GetXaxis()->GetTitle()));
246 res->SetMarkerColor(c);
247 res->SetFillColor(c);
248 res->SetFillStyle(1001);
249 res->SetLineColor(c);
250 res->SetLineStyle(s);
251 for (
Int_t i = 1; i <= mNch->GetNbinsX(); i++) {
252 Double_t nPart = mNch->GetXaxis()->GetBinCenter(i);
253 Double_t ePart = mNch->GetXaxis()->GetBinWidth(i);
254 Double_t nCh = mNch->GetBinContent(i);
255 Double_t eCh = mNch->GetBinError (i);
256 res->SetPoint (i-1, nPart, nCh/(nPart/2));
257 res->SetPointError(i-1, ePart/2, eCh/(nPart/2));
262 ret->SetName(
"resultB");
263 ret->SetTitle(Form(
"%s \\frac{2}{%s}",
264 fNpartVsNch->GetYaxis()->GetTitle(),
265 fNpartVsNch->GetXaxis()->GetTitle()));
266 ret->SetMarkerColor(c);
267 ret->SetFillColor(c);
268 ret->SetFillStyle(1001);
269 ret->SetLineColor(c);
270 ret->SetLineStyle(s);
271 for (
Int_t i = 1; i <= fMeanNpart->GetNbinsX(); i++) {
272 Double_t nPart = fMeanNpart->GetBinContent(i);
273 Double_t ePart = fMeanNpart->GetBinError (i);
274 Double_t nCh = fMeanNch ->GetBinContent(i);
275 Double_t eCh = fMeanNch ->GetBinError (i);
277 Double_t ey = y*TMath::Sqrt(TMath::Power(eCh/nCh,2)
278 +TMath::Power(ePart/nPart,2));
279 ret->SetPoint (i-1, nPart, y);
280 ret->SetPointError(i-1, ePart, ey);
284 ret->GetHistogram()->SetTitle(
"");
285 ret->GetHistogram()->SetXTitle(fMeanNpart->GetYaxis()->GetTitle());
286 ret->GetHistogram()->SetYTitle(Form(
"%s \\frac{2}{%s}",
287 fMeanNch->GetYaxis()->GetTitle(),
288 fMeanNpart->GetYaxis()->GetTitle()));
324 :
Base(verbose, monitor)
330 return new TProfile(
"",
"Xe-Xe", 10, 0, 260);
356 bins[21] = mid[0] + (mid[0]-mid[1])/2;
357 for (
size_t i = 1; i < 21; i++)
358 bins[21-i] = mid[i] + (mid[i-1]-mid[i]) / 2;
359 bins[0] = mid[20] - (mid[19]-mid[20]) / 2;
361 return new TH2D(
"",
"Xe-Xe", bins.GetSize()-1, bins.GetArray(),
382 if (t.EqualTo(
"XeXe")) ret =
new MidNch::XeXe(verbose, monitor);
385 TPair* tp =
static_cast<TPair*
>(uopt.FindObject(
"trig"));
386 if( tp) ret->
SetTrigger(tp->Value()->GetName());
389 Printf(
"Error: MidNchMaker::Make: Invalid spec: %s", t.Data());
395 Printf(
"XeXe - For Xe-Xe collisions at sqrt(sNN)=5.44TeV");
397 const char*
Script()
const {
return __FILE__; }
403 #pragma link C++ nestedclasses; 404 #pragma link C++ namespace MidNch;
virtual TList * GetMonitorObjects()
TObject * GetOutputObject(const char *name, TClass *cls)
MidNchMaker * _midNchMaker
XeXe(Bool_t verbose=false, Int_t monitor=0)
FastShortHeader * fHeader
virtual Bool_t SetupEstimator()
Bool_t Finalize(TCollection *output, Long_t minEvents, TH1 *(*callback)(TObject *, Int_t))
This script defines classes for looping over the data produced by FastSim.C.
const char * Script() const
virtual Bool_t Process(Long64_t entry)
virtual Bool_t Process(Long64_t entry)
Base(Bool_t verbose=false, Int_t monitor=0)
virtual Bool_t ProcessHeader()
virtual void Clear(Option_t *option="")
virtual Bool_t ProcessHeader()
void CreateHistos(TCollection *output, TObject *(*callback)())
Double_t GetCentrality() const
virtual TProfile * CreateOutput()=0
void CreateDiagnostics(TCollection *output, TH1 *centHist)
Int_t CheckCentrality(Double_t cent, Double_t mult, Double_t b, Double_t nPart, Double_t nBin)
FastAnalysis * Make(const TString &subtype, Int_t monitor, Bool_t verbose, TMap &uopt)
virtual Bool_t ProcessParticle(const TParticle *p)
virtual TProfile * CreateOutput()
virtual Bool_t SetupEstimator()
void SetTrigger(UInt_t mask)
virtual void SlaveBegin(TTree *)
virtual void Clear(Option_t *option="")