5 # include <TParticle.h>
6 # include <TObjArray.h>
64 h->SetXTitle(
"p_{T}");
65 h->SetYTitle(
"dN/dp_{T}");
67 h->SetMarkerColor(col);
70 h->SetMarkerStyle(sty);
87 h->SetXTitle(Form(
"%d/211",pdg));
88 h->SetYTitle(
"Events");
90 h->SetMarkerColor(col);
93 h->SetMarkerStyle(sty);
106 Info(
"SlaveBegin",
"Making dN/deta histogram");
131 if (
fNpi <= 0)
return;
144 Int_t pdg = TMath::Abs(p->GetPdgCode());
146 else if (pdg == 321) {
fdNdptK ->Fill(pT);
fNK++; }
147 else if (pdg == 2212) {
fdNdptP ->Fill(pT);
fNP++; }
161 case 211:
return "dNdptPi";
162 case 321:
return "dNdptK";
163 case 2212:
return "dNdptP";
177 case 321:
return "KtoPiRatio";
178 case 2212:
return "PtoPiRatio";
194 Warning(
"Terminate",
"No %s histogram found",
dNdptName(pdg));
197 h->Scale(1./
fOK,
"width");
215 Warning(
"Terminate",
"No %s histogram found",
RatioName(pdg));
218 r->SetBinContent(bin, h->GetMean());
219 r->SetBinError(bin, h->GetRMS());
231 Warning(
"Terminate",
"No events selected");
234 Printf(
"A total of %ld events",
fOK);
241 TH1* ratios =
new TH1D(
"ratios",
"Ratios to #pi",
243 ratios->GetXaxis()->SetBinLabel(1,
"K/#pi");
244 ratios->GetXaxis()->SetBinLabel(2,
"p/#pi");
245 ratios->GetXaxis()->SetBinLabel(3,
"other/#pi");
246 ratios->SetFillColor(kCyan+2);
247 ratios->SetLineColor(kCyan+2);
248 ratios->SetMarkerColor(kCyan+2);
249 ratios->SetMarkerStyle(20);
250 Ratio(ratios, 1, 321);
251 Ratio(ratios, 2, 2212);
254 fOutput->Add(ratios);
310 const char*
Script()
const {
return __FILE__; }
TObject * GetOutputObject(const char *name, TClass *cls)
spectraMaker * _spectraMaker
const char * Script() const
This script defines classes for looping over the data produced by FastSim.C.
TH1 * CreateRatio(UInt_t pdg, Color_t col, Style_t sty)
virtual void SlaveBegin(TTree *)
static const char * RatioName(UInt_t pdg)
spectraAnalysis(Bool_t verbose=false, Int_t monitor=0)
static const char * dNdptName(UInt_t pdg)
FastAnalysis * Make(const TString &subtype, Int_t monitor, Bool_t verbose, TString &uopt)
virtual void ProcessParticles()
Bool_t Ratio(TH1 *r, Int_t bin, UInt_t pdg)
ClassDef(spectraAnalysis, 0)
virtual Bool_t ProcessParticle(const TParticle *p)
TH1 * CreateSpectra(UInt_t pdg, Color_t col, Style_t sty)
Maker(const char *type="")