]> git.uio.no Git - u/mrichter/AliRoot.git/blob - PWGLF/SPECTRA/Nuclei/B2/Config.h
9cd3368cb08a2f984ad7bff2b94e9d18043a8a27
[u/mrichter/AliRoot.git] / PWGLF / SPECTRA / Nuclei / B2 / Config.h
1 #ifndef CONFIG_H
2 #define CONFIG_H
3
4 /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
5  * See cxx source for full Copyright notice                               */
6
7 // common functions for config macros
8 // author: Eulogio Serradilla <eulogio.serradilla@cern.ch>
9
10 #if !defined(__CINT__) || defined(__MAKECINT__)
11 #include <Riostream.h>
12 #include <TROOT.h>
13 #include <TString.h>
14 #include <cstdlib>
15 #endif
16
17 namespace CollSystem
18 {
19 //
20 // pp collision energies
21 //
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)";
28 };
29
30 namespace B2mult
31 {
32 //
33 // multiplicity classes
34 //
35
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";
42 };
43
44 namespace B2HiLowMult
45 {
46 //
47 // high and low multiplicity classes
48 //
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";
55 };
56
57 TString GetCollSystem(const TString& period)
58 {
59 //
60 // translate period name into colliding system name
61 //
62         TString name = period;
63         name.ToLower();
64         
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";
78         
79         return "unknown";
80 }
81
82 void GetTriggerEfficiency(Double_t trigeff[3], const TString& trigname, const TString& period)
83 {
84 //
85 // trigger efficiency for the given colliding system and largest systematic error
86 // http://arxiv.org/abs/1208.4968
87 //
88         TString collsystem = GetCollSystem(period);
89         TString trigger = trigname;
90         trigger.ToLower();
91         
92         if( trigger == "mbor"  && collsystem == "pp0.9TeV" )
93         {
94                 trigeff[0] = 0.910;
95                 trigeff[1] = 0; // stat. error
96                 trigeff[2] = 0.032; // syst. error
97         }
98         else if( trigger == "mbor"  && collsystem == "pp2.76TeV")
99         {
100                 trigeff[0] = 0.881;
101                 trigeff[1] = 0;
102                 trigeff[2] = 0.059;
103         }
104         else if( trigger == "mbor"  && collsystem == "pp7TeV")
105         {
106                 trigeff[0] = 0.852;
107                 trigeff[1] = 0;
108                 trigeff[2] = 0.062;
109         }
110         else if( trigger == "mband" && collsystem == "pp0.9TeV" )
111         {
112                 trigeff[0] = 0.763;
113                 trigeff[1] = 0;
114                 trigeff[2] = 0.022;
115         }
116         else if( trigger == "mband" && collsystem == "pp2.76TeV")
117         {
118                 trigeff[0] = 0.760;
119                 trigeff[1] = 0;
120                 trigeff[2] = 0.052;
121         }
122         else if( trigger == "mband" && collsystem == "pp7TeV")
123         {
124                 trigeff[0] = 0.742;
125                 trigeff[1] = 0;
126                 trigeff[2] = 0.050;
127         }
128         else
129         {
130                 std::cerr << "Warning: unknown trigger/colliding system " << trigname << "/" << collsystem << " for period " << period << std::endl;
131         }
132 }
133
134 TString GetSimuPeriod(const TString& period)
135 {
136 //
137 // simulation code for the given period
138 //
139         TString name = period;
140         name.ToLower();
141         
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";
149         
150         return "";
151 }
152
153 TString GetSimuFixPeriod(const TString& period)
154 {
155 //
156 // simulation fix code for the given period
157 //
158         TString name = period;
159         name.ToLower();
160         
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";
172         
173         return "";
174 }
175
176 TString MakeInputName(const TString& species, const TString& period, const TString& trksel)
177 {
178 //
179 // make input name for data
180 //
181         if(trksel == "")           return species + "-" + period;
182         if(trksel.BeginsWith("-")) return species + "-" + period + trksel;
183         return species + "-" + period + "-" + trksel;
184 }
185
186 TString MakeSimuName(const TString& species, const TString& period, const TString& trksel)
187 {
188 //
189 // make input name for simulation
190 //
191         TString simu = (species == "Proton") ? GetSimuPeriod(period) : GetSimuFixPeriod(period);
192         
193         if(simu=="")
194         {
195                 std::cerr << "No simulation for period: " << period << std::endl;
196                 exit(1);
197         }
198         
199         return species + "-" + simu + "-" + trksel;
200 }
201
202 TString MakeSimuFixName(const TString& species, const TString& period, const TString& trksel, Bool_t g3Fluka=0)
203 {
204 //
205 // make input name for simulation fix
206 //
207         TString simufix = (species == "Proton" && g3Fluka) ? GetSimuPeriod(period) : GetSimuFixPeriod(period);
208         
209         if(simufix=="")
210         {
211                 std::cerr << "No simulation fix for period: " << period << std::endl;
212                 exit(1);
213         }
214         
215         return species + "-" + simufix + "-" + trksel;
216 }
217
218 TString MakeOutputName(const TString& species, const TString& outputTag)
219 {
220 //
221 // make output name
222 //
223         return species + "-" + outputTag;
224 }
225
226 void DrawOutputCorr(const TString& species, const TString& corr, const TString& tag="")
227 {
228 //
229 // draw corrections for the given species
230 //
231         gROOT->ProcessLine(Form(".x DrawCorr.C+g(\"%s\",\"%s\",\"%s\")", species.Data(), corr.Data(), tag.Data()));
232 }
233
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)
235 {
236 //
237 // draw correction for secondaries
238 //
239         const TString kParticle[] = { species, Form("Anti%s", species.Data())};
240         
241         for(Int_t i=0; i<2; ++i)
242         {
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));
244         }
245 }
246
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)
248 {
249 //
250 // draw pt debug for the particle species
251 //
252         const TString kParticle[] = { species, Form("Anti%s", species.Data())};
253         
254         for(Int_t i=0; i<2; ++i)
255         {
256                 gROOT->ProcessLine(Form(".x DrawPt.C+g(\"%s\",\"%s\",\"%s\",%f, %d, %f)", pt.Data(), tag.Data(), kParticle[i].Data(), ptmax, m2pid, ptpid));
257         }
258 }
259
260 void DrawOutputRatio(const TString& ratio, const TString& tag, const TString& species)
261 {
262 //
263 // draw ratio antiparticle/particle
264 //
265         gROOT->ProcessLine(Form(".x DrawRatio.C+g(\"%s\",\"%s\",\"%s\")", ratio.Data(), tag.Data(), species.Data()));
266 }
267
268 void DrawOutputSpectra(const TString& spectra, const TString& tag, const TString& species)
269 {
270 //
271 // draw spectra for the particle species
272 //
273         const TString kParticle[] = { species, Form("Anti%s", species.Data())};
274         
275         for(Int_t i=0; i<2; ++i)
276         {
277                 gROOT->ProcessLine(Form(".x DrawSpectra.C+g(\"%s\",\"%s\",\"%s\")", spectra.Data(), tag.Data(), kParticle[i].Data()));
278         }
279 }
280
281 void DrawOutputSpectraMult(const TString& spectra, const TString& species, Double_t ymin, Double_t ymax, Int_t option=0, const TString& refdir="")
282 {
283 //
284 // draw spectra for each multiplicity class
285 //
286         const TString kParticle[] = { species, Form("Anti%s", species.Data())};
287         
288         for(Int_t i=0; i<2; ++i)
289         {
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()));
291         }
292 }
293
294 #endif // CONFIG_H