4 /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
5 * See cxx source for full Copyright notice */
7 // functions for configs
8 // author: Eulogio Serradilla <eulogio.serradilla@cern.ch>
10 #include <Riostream.h>
19 // multiplicity classes
21 const Int_t kNmult = 6;
22 const TString kMultClass[kNmult] = { "nch0002", "nch0204", "nch0408", "nch0811", "nch1120", "nch20xx" };
23 const Double_t kKNOmult[kNmult] = { 0.20, 0.60, 1.01, 1.60, 2.60, 4.35 };
24 const Double_t kKNOmultErr[kNmult] = { 0, 0, 0, 0, 0, 0 };
27 Double_t GetVertexCorrection(const TString& period)
30 // vertex correction factor for |Vz| < 10 cm and LHC12a5x simulations
32 TString name = period;
35 if(name == "lhc10c900") return 1.0142;
36 if(name == "lhc10b") return 1.0006;
37 if(name == "lhc10c") return 1.0007;
38 if(name == "lhc10d") return 1.0224;
39 if(name == "lhc10e") return 1.0423;
40 if(name == "lhc11a_wsdd") return 1.0728;
45 TString GetCollSystem(const TString& period)
48 // translate period name into colliding system name
50 TString name = period;
53 if(name == "lhc10c900") return "pp0.9TeV";
54 if(name == "lhc10b_pass2") return "pp7TeV";
55 if(name == "lhc10c_pass2") return "pp7TeV";
56 if(name == "lhc10b") return "pp7TeV";
57 if(name == "lhc10c") return "pp7TeV";
58 if(name == "lhc10d") return "pp7TeV";
59 if(name == "lhc10e") return "pp7TeV";
60 if(name.Contains("lhc10")) return "pp7TeV";
61 if(name == "lhc11a_wsdd") return "pp2.76TeV";
62 if(name == "lhc11a_wosdd") return "pp2.76TeV";
63 if(name.Contains("900")) return "pp0.9TeV";
64 if(name.Contains("7000")) return "pp7TeV";
65 if(name.Contains("2760")) return "pp2.76TeV";
70 void GetInelXSection(Double_t xsection[3], const TString& period)
73 // inelastic cross section in mb and largest stat. and syst error
74 // measured by ALICE for the given colliding system
75 // http://arxiv.org/abs/1208.4968
77 TString collsystem = GetCollSystem(period);
79 if( collsystem == "pp0.9TeV" )
85 else if( collsystem == "pp2.76TeV" )
91 else if( collsystem == "pp7TeV" )
99 std::cerr << "Warning: unknown colliding system " << collsystem << " for period " << period << std::endl;
103 void GetTriggerEfficiency(Double_t trigeff[3], const TString& trigname, const TString& period)
106 // trigger efficiency for the given colliding system and largest stat. and syst. errors
107 // http://arxiv.org/abs/1208.4968
109 TString collsystem = GetCollSystem(period);
110 TString trigger = trigname;
113 if( trigger == "mbor" && collsystem == "pp0.9TeV" )
116 trigeff[1] = 0; // stat. error
117 trigeff[2] = 0.032; // syst. error
119 else if( trigger == "mbor" && collsystem == "pp2.76TeV")
125 else if( trigger == "mbor" && collsystem == "pp7TeV")
131 else if( trigger == "mband" && collsystem == "pp0.9TeV" )
137 else if( trigger == "mband" && collsystem == "pp2.76TeV")
143 else if( trigger == "mband" && collsystem == "pp7TeV")
151 std::cerr << "Warning: unknown trigger/colliding system " << trigname << "/" << collsystem << " for period " << period << std::endl;
155 TString GetSimuPeriod(const TString& period)
158 // simulation code for the given period
160 TString name = period;
163 if(period=="lhc10c900") return "lhc10e13";
164 if(period=="lhc10b") return "lhc10d1";
165 if(period=="lhc10c") return "lhc10d4";
166 //if(period=="lhc10b") return "lhc12a5bb";
167 //if(period=="lhc10c") return "lhc12a5bc";
168 if(period=="lhc10d") return "lhc10f6a";
169 if(period=="lhc10e") return "lhc10e21";
170 if(period=="lhc11a_wsdd") return "lhc11e3a_wsdd";
175 TString GetSimuFixPeriod(const TString& period)
178 // simulation fix code for the given period
180 TString name = period;
183 if(period=="lhc10c900") return "lhc12a5a";
184 if(period=="lhc10b") return "lhc12a5bb";
185 if(period=="lhc10c") return "lhc12a5bc";
186 if(period=="lhc10d") return "lhc12a5bd";
187 if(period=="lhc10e") return "lhc12a5be";
188 if(period=="lhc10bcde") return "lhc12a5b";
189 if(period=="lhc11a_wsdd") return "lhc12a5c_wsdd";
194 TString MakeInputName(const TString& species, const TString& period, const TString& trksel)
197 // make input name for data
199 return species + "-" + period + "-" + trksel;
202 TString MakeSimuName(const TString& species, const TString& period, const TString& trksel)
205 // make input name for simulation
207 TString simu = (species == "Proton") ? GetSimuPeriod(period) : GetSimuFixPeriod(period);
211 std::cerr << "No simulation for period: " << period << std::endl;
215 return species + "-" + simu + "-" + trksel;
218 TString MakeSimuFixName(const TString& species, const TString& period, const TString& trksel, Bool_t g3Fluka=0)
221 // make input name for simulation fix
223 TString simufix = (species == "Proton" && g3Fluka) ? GetSimuPeriod(period) : GetSimuFixPeriod(period);
227 std::cerr << "No simulation fix for period: " << period << std::endl;
231 return species + "-" + simufix + "-" + trksel;
234 TString MakeOutputName(const TString& species, const TString& outputTag)
239 return species + "-" + outputTag;
242 TStyle* GetDrawingStyle()
245 // define a default style for drawing
247 TStyle* st = new TStyle();
249 //st->SetPalette(51);
256 st->SetCanvasColor(0);
257 st->SetFrameBorderMode(0);
258 st->SetStatBorderSize(1);
260 st->SetFrameFillColor(0);
261 st->SetTitleFillColor(0);
262 st->SetLabelFont(62,"XYZ");
263 st->SetTitleFont(62,"XYZ");
265 //st->SetOptTitle(1);
271 void DrawOutputCorr(const TString& species, const TString& corr, const TString& tag="")
274 // draw corrections for the given species
276 gROOT->ProcessLine(Form(".x DrawCorr.C+g(\"%s\",\"%s\",\"%s\")", species.Data(), corr.Data(), tag.Data()));
279 void DrawCorrDebug(const TString& sec, const TString& tag, const TString& species, Int_t lowbin=1, Int_t hibin=10, Double_t dcaxyMin=-1.5, Double_t dcaxyMax=1.5)
282 // draw correction for secondaries
284 const TString kParticle[] = { species, Form("Anti%s", species.Data())};
286 for(Int_t i=0; i<2; ++i)
288 gROOT->ProcessLine(Form(".x DrawSec.C+g(\"%s\",\"%s\",\"%s\", %d, %d, %f, %f)", sec.Data(), tag.Data(), kParticle[i].Data(), lowbin, hibin, dcaxyMin, dcaxyMax));
292 void DrawPtDebug(const TString& pt, const TString& tag, const TString& species, Bool_t m2pid=0, Int_t lowm2bin=9, Int_t him2bin=17)
295 // draw pt debug for the particle species
297 const TString kParticle[] = { species, Form("Anti%s", species.Data())};
299 for(Int_t i=0; i<2; ++i)
301 gROOT->ProcessLine(Form(".x DrawPt.C+g(\"%s\",\"%s\",\"%s\",%d,%d, %d)", pt.Data(), tag.Data(), kParticle[i].Data(), m2pid, lowm2bin, him2bin));
305 void DrawOutputRatio(const TString& ratio, const TString& tag, const TString& species)
308 // draw ratio antiparticle/particle
310 gROOT->ProcessLine(Form(".x DrawRatio.C+g(\"%s\",\"%s\",\"%s\")", ratio.Data(), tag.Data(), species.Data()));
313 void DrawOutputSpectra(const TString& spectra, const TString& tag, const TString& species)
316 // draw spectra for the particle species
318 const TString kParticle[] = { species, Form("Anti%s", species.Data())};
320 for(Int_t i=0; i<2; ++i)
322 gROOT->ProcessLine(Form(".x DrawSpectra.C+g(\"%s\",\"%s\",\"%s\")", spectra.Data(), tag.Data(), kParticle[i].Data()));
326 void DrawOutputSpectraMult(const TString& spectra, const TString& species, Double_t ymin, Double_t ymax, Int_t option=0, const TString& refdir="")
329 // draw spectra for each multiplicity class
331 const TString kParticle[] = { species, Form("Anti%s", species.Data())};
333 for(Int_t i=0; i<2; ++i)
335 gROOT->ProcessLine(Form(".x DrawDir.C+g(\"%s\",\"%s_InvDiffYield_Pt\",\"%s\",0,4.5, %g, %g, \"p_{T} (GeV/c)\", \"#frac{1}{2#piN_{inel}} #frac{d^{2}N}{p_{T}dp_{T}dy} (GeV^{-2}c^{3})\", %d, \"c%d\",\"%s\")", spectra.Data(), kParticle[i].Data(), refdir.Data(),ymin, ymax, option, i, kParticle[i].Data()));