4 /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
5 * See cxx source for full Copyright notice */
7 // common functions for config macros
8 // author: Eulogio Serradilla <eulogio.serradilla@cern.ch>
10 #if !defined(__CINT__) || defined(__MAKECINT__)
11 #include <Riostream.h>
20 // pp collision energies
22 const Int_t kNener = 3;
23 const TString kEnergyTag[kNener] = { "-900GeV", "-2.76TeV", "-7TeV" };
24 const TString kEnergyLabel[kNener] = { "900 GeV", "2.76 TeV", "7 TeV" };
25 const Double_t kEnergy[kNener] = { 0.9, 2.76, 7 };
26 const Double_t kEnergyError[kNener] = { 0 };
27 const TString kEnergyName = "#sqrt{s} (TeV)";
33 // multiplicity classes
36 const Int_t kNmult = 5;
37 const TString kMultTag[kNmult] = { "-ntrk0103", "-ntrk0405", "-ntrk0608", "-ntrk0914", "-ntrk15xx" };
38 const Double_t kKNOmult[kNmult] = { 0.35, 0.74, 1.13, 1.82, 3.14 };
39 const Double_t kDtrPtMax[kNmult] = { 1.8, 2.0, 2.2, 2.3, 2.5 };
40 const Double_t kKNOmultErr[kNmult] = { 0 };
41 const TString kKNOmultName = "z";
47 // high and low multiplicity classes
49 const Int_t kNmult = 2;
50 const TString kMultTag[kNmult] = { "-ntrk0108", "-ntrk09xx" };
51 const Double_t kKNOmult[kNmult] = { 0.64, 2.23 };
52 const Double_t kDtrPtMax[kNmult] = { 2.0, 2.5 };
53 const Double_t kKNOmultErr[kNmult] = { 0 };
54 const TString kKNOmultName = "z";
57 TString GetCollSystem(const TString& period)
60 // translate period name into colliding system name
62 TString name = period;
65 if(name == "lhc10c900") return "pp0.9TeV";
66 if(name == "lhc10b_pass2") return "pp7TeV";
67 if(name == "lhc10c_pass2") return "pp7TeV";
68 if(name == "lhc10b") return "pp7TeV";
69 if(name == "lhc10c") return "pp7TeV";
70 if(name == "lhc10d") return "pp7TeV";
71 if(name == "lhc10e") return "pp7TeV";
72 if(name.Contains("lhc10")) return "pp7TeV";
73 if(name == "lhc11a_wsdd") return "pp2.76TeV";
74 if(name == "lhc11a_wosdd") return "pp2.76TeV";
75 if(name.Contains("900")) return "pp0.9TeV";
76 if(name.Contains("7000")) return "pp7TeV";
77 if(name.Contains("2760")) return "pp2.76TeV";
82 void GetTriggerEfficiency(Double_t trigeff[3], const TString& trigname, const TString& period)
85 // trigger efficiency for the given colliding system and largest systematic error
86 // http://arxiv.org/abs/1208.4968
88 TString collsystem = GetCollSystem(period);
89 TString trigger = trigname;
92 if( trigger == "mbor" && collsystem == "pp0.9TeV" )
95 trigeff[1] = 0; // stat. error
96 trigeff[2] = 0.032; // syst. error
98 else if( trigger == "mbor" && collsystem == "pp2.76TeV")
104 else if( trigger == "mbor" && collsystem == "pp7TeV")
110 else if( trigger == "mband" && collsystem == "pp0.9TeV" )
116 else if( trigger == "mband" && collsystem == "pp2.76TeV")
122 else if( trigger == "mband" && collsystem == "pp7TeV")
130 std::cerr << "Warning: unknown trigger/colliding system " << trigname << "/" << collsystem << " for period " << period << std::endl;
134 TString GetSimuPeriod(const TString& period)
137 // simulation code for the given period
139 TString name = period;
142 if(period=="lhc10c900") return "lhc10e13";
143 if(period=="lhc10b") return "lhc10d1";
144 if(period=="lhc10c") return "lhc10d4";
145 if(period=="lhc10d") return "lhc10f6a";
146 if(period=="lhc10e") return "lhc10e21";
147 if(period=="lhc10de") return "lhc10f6ade";
148 if(period=="lhc11a_wsdd") return "lhc11e3a_wsdd";
153 TString GetSimuFixPeriod(const TString& period)
156 // simulation fix code for the given period
158 TString name = period;
161 if(period=="lhc10c900") return "lhc12a5a";
162 if(period=="lhc10b") return "lhc12a5bb";
163 if(period=="lhc10c") return "lhc12a5bc";
164 if(period=="lhc10d") return "lhc12a5bd";
165 if(period=="lhc10e") return "lhc12a5be";
166 if(period=="lhc10bc") return "lhc12a5bbc";
167 if(period=="lhc10de") return "lhc12a5bde";
168 if(period=="lhc10cde") return "lhc12a5bcde";
169 if(period=="lhc10bcd") return "lhc12a5bbcd";
170 if(period=="lhc10bcde") return "lhc12a5bbcde";
171 if(period=="lhc11a_wsdd") return "lhc12a5c_wsdd";
176 TString MakeInputName(const TString& species, const TString& period, const TString& trksel)
179 // make input name for data
181 if(trksel == "") return species + "-" + period;
182 if(trksel.BeginsWith("-")) return species + "-" + period + trksel;
183 return species + "-" + period + "-" + trksel;
186 TString MakeSimuName(const TString& species, const TString& period, const TString& trksel)
189 // make input name for simulation
191 TString simu = (species == "Proton") ? GetSimuPeriod(period) : GetSimuFixPeriod(period);
195 std::cerr << "No simulation for period: " << period << std::endl;
199 return species + "-" + simu + "-" + trksel;
202 TString MakeSimuFixName(const TString& species, const TString& period, const TString& trksel, Bool_t g3Fluka=0)
205 // make input name for simulation fix
207 TString simufix = (species == "Proton" && g3Fluka) ? GetSimuPeriod(period) : GetSimuFixPeriod(period);
211 std::cerr << "No simulation fix for period: " << period << std::endl;
215 return species + "-" + simufix + "-" + trksel;
218 TString MakeOutputName(const TString& species, const TString& outputTag)
223 return species + "-" + outputTag;
226 void DrawOutputCorr(const TString& species, const TString& corr, const TString& tag="")
229 // draw corrections for the given species
231 gROOT->ProcessLine(Form(".x DrawCorr.C+g(\"%s\",\"%s\",\"%s\")", species.Data(), corr.Data(), tag.Data()));
234 void DrawCorrDebug(const TString& sec, const TString& tag, const TString& species, Double_t ptmin=0.5, Double_t ptmax=3., Double_t dcaxyMin=-1.5, Double_t dcaxyMax=1.5)
237 // draw correction for secondaries
239 const TString kParticle[] = { species, Form("Anti%s", species.Data())};
241 for(Int_t i=0; i<2; ++i)
243 gROOT->ProcessLine(Form(".x DrawSec.C+g(\"%s\",\"%s\",\"%s\", %f, %f, %f, %f)", sec.Data(), tag.Data(), kParticle[i].Data(), ptmin, ptmax, dcaxyMin, dcaxyMax));
247 void DrawPtDebug(const TString& pt, const TString& tag, const TString& species, Bool_t m2pid=0, Double_t ptmax=3., Double_t ptpid=1.2)
250 // draw pt debug for the particle species
252 const TString kParticle[] = { species, Form("Anti%s", species.Data())};
254 for(Int_t i=0; i<2; ++i)
256 gROOT->ProcessLine(Form(".x DrawPt.C+g(\"%s\",\"%s\",\"%s\",%f, %d, %f)", pt.Data(), tag.Data(), kParticle[i].Data(), ptmax, m2pid, ptpid));
260 void DrawOutputRatio(const TString& ratio, const TString& tag, const TString& species)
263 // draw ratio antiparticle/particle
265 gROOT->ProcessLine(Form(".x DrawRatio.C+g(\"%s\",\"%s\",\"%s\")", ratio.Data(), tag.Data(), species.Data()));
268 void DrawOutputSpectra(const TString& spectra, const TString& tag, const TString& species)
271 // draw spectra for the particle species
273 const TString kParticle[] = { species, Form("Anti%s", species.Data())};
275 for(Int_t i=0; i<2; ++i)
277 gROOT->ProcessLine(Form(".x DrawSpectra.C+g(\"%s\",\"%s\",\"%s\")", spectra.Data(), tag.Data(), kParticle[i].Data()));
281 void DrawOutputSpectraMult(const TString& spectra, const TString& species, Double_t ymin, Double_t ymax, Int_t option=0, const TString& refdir="")
284 // draw spectra for each multiplicity class
286 const TString kParticle[] = { species, Form("Anti%s", species.Data())};
288 for(Int_t i=0; i<2; ++i)
290 gROOT->ProcessLine(Form(".x DrawDir.C+g(\"%s\",\"%s_InvDiffYield_Pt\",\"%s\",0,3.5, %g, %g, \"p_{T} (GeV/c)\", \"#frac{1}{2#piN_{ev}} #frac{d^{2}N}{p_{T}dp_{T}dy} (GeV^{-2}c^{3})\", %d, \"%s\",\"%s\")", spectra.Data(), kParticle[i].Data(), refdir.Data(),ymin, ymax, option, kParticle[i].Data(), kParticle[i].Data()));