1 /**************************************************************************
2 * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4 * Author: The ALICE Off-line Project. *
5 * Contributors are mentioned in the code where appropriate. *
7 * Permission to use, copy, modify and distribute this software and its *
8 * documentation strictly for non-commercial purposes is hereby granted *
9 * without fee, provided that the above copyright notice appears in all *
10 * copies and that both the copyright notice and this permission notice *
11 * appear in the supporting documentation. The authors make no claims *
12 * about the suitability of this software for any purpose. It is *
13 * provided "as is" without express or implied warranty. *
14 **************************************************************************/
17 // author: Eulogio Serradilla <eulogio.serradilla@cern.ch>
19 Double_t GetMeanNtrk(const TString& period, Double_t eta);
20 Double_t GetNSDMeanNtrk(const TString& period, Double_t eta);
22 AliAnalysisTaskB2* AddTaskB2( const TString& species
23 , const TString& containername
24 , const TString& trksel
26 , const TString& periodname
27 , Bool_t simulation = kFALSE
28 , Bool_t heavyIons = kFALSE
29 , Double_t maxDCAxy = 1
30 , Double_t maxDCAz = 2
31 , Double_t maxEta = 0.8
33 , Double_t minKNOmult = -10
34 , Double_t maxKNOmult = 10000
35 , Bool_t V0AND = kFALSE
36 , const TString& ztag = ""
38 , Double_t minCentrality = 0
39 , Double_t maxCentrality = 20
41 , Double_t maxM2 = 6.)
44 // Create, configure and add the analysis task to the analysis manager
50 const Double_t kMaxVx = 1.;
51 const Double_t kMaxVy = 1.;
53 const Double_t kMaxNSigma = 3.;
55 const Int_t kMaxNSigmaITS = 3;
56 const Int_t kMaxNSigmaTPC = 3;
57 const Int_t kMaxNSigmaTOF = 3;
58 const Int_t kMinTPCnCls = 70;
60 TString period = periodname;
63 // Get pointer to the existing analysis manager
65 AliAnalysisManager* mgr = AliAnalysisManager::GetAnalysisManager();
68 cerr << "AddTaskB2: no analysis manager to connect to" << endl;
72 if (!mgr->GetInputEventHandler())
74 cerr << "AddTaskB2: this task requires an input event handler" << endl;
78 // Create and configure the task
80 AliAnalysisTaskB2* task = new AliAnalysisTaskB2(Form("B2.%s",containername.Data()));
82 task->SetParticleSpecies(species);
83 task->SetSimulation(simulation);
84 task->SetHeavyIons(heavyIons);
85 task->SetV0ANDtrigger(V0AND);
87 task->SetMaxNSigmaITS(kMaxNSigmaITS);
88 task->SetMaxNSigmaTPC(kMaxNSigmaTPC);
89 task->SetMaxNSigmaTOF(kMaxNSigmaTOF);
91 Double_t meanNtrk = V0AND ? GetNSDMeanNtrk(period, maxEta) : GetMeanNtrk(period, maxEta);
93 task->SetMeanNtrk(meanNtrk);
94 task->SetKNOmultInterval(minKNOmult, maxKNOmult);
95 task->SetVertexXInterval(-kMaxVx, kMaxVx);
96 task->SetVertexYInterval(-kMaxVy, kMaxVy);
97 task->SetVertexZInterval(-maxVz, maxVz);
99 task->SetEtaInterval(-maxEta, maxEta);
100 task->SetRapidityInterval(-maxY, maxY);
101 task->SetM2Interval(minM2, maxM2);
103 task->SetCentralityInterval(minCentrality, maxCentrality);
105 if(period=="lhc11a_wsdd" || period=="lhc11a_wosdd")
107 task->SetNoFastOnlyTrigger();
112 gROOT->LoadMacro("$ALICE_ROOT/PWGLF/SPECTRA/Nuclei/B2/macros/CreateHistograms.C");
114 AliLnHistoMap* hMap = CreateHistograms(species, simulation, maxDCAxy, maxEta, maxY, heavyIons);
116 task->SetHistogramMap(hMap);
118 // track selection criteria
120 gROOT->LoadMacro("$ALICE_ROOT/PWGLF/SPECTRA/Nuclei/B2/macros/TrackCuts.C");
122 AliESDtrackCuts* trkCuts = TrackCuts(task, trksel, maxDCAxy, maxDCAz, kMaxNSigma, kMinTPCnCls, maxEta);
123 task->SetESDtrackCuts(trkCuts);
127 gROOT->LoadMacro("$ALICE_ROOT/PWGLF/SPECTRA/Nuclei/B2/macros/BetheBlochParams.C");
130 BetheBlochParams(bethe, period);
132 gROOT->LoadMacro("$ALICE_ROOT/PWGLF/SPECTRA/Nuclei/B2/macros/PriorProbabilities.C");
135 PriorProbabilities(prob, period, trksel, ztag);
137 AliLnID* lnID = new AliLnID();
139 lnID->SetTPCBetheBlochParams(bethe);
140 lnID->SetPriorProbabilities(prob);
141 lnID->SetPidProcedure(pidProc);
143 if(!simulation) lnID->SetTPCChargeCorrection(2.3);
147 // Add task to the manager
151 // input and output containers
153 AliAnalysisDataContainer* output = mgr->CreateContainer(containername.Data(), TList::Class(), AliAnalysisManager::kOutputContainer, Form("%s:AliAnalysisTaskB2", AliAnalysisManager::GetCommonFileName()));
155 mgr->ConnectInput(task, 0, mgr->GetCommonInputContainer());
156 mgr->ConnectOutput(task, 1, output);
161 Double_t GetMeanNtrk(const TString& period, Double_t eta)
164 // average track multiplicity <Ntrk> for the given period and eta
166 if(TMath::Abs(eta) > 0.51) // |eta|<0.8
168 if(period =="lhc10b") return 9.68887; // pass3
169 if(period =="lhc10d") return 9.47466; // pass2
170 if(period =="lhc10e") return 9.55678; // pass2
173 if(period =="lhc10e21") return 7.69483;
177 if(period =="lhc10c900") return 3.70158; // pass3
178 if(period =="lhc10b_pass2") return 9.86258;
179 if(period =="lhc10c_pass2") return 9.61402;
180 if(period =="lhc10b") return 5.96104; // pass3
181 if(period =="lhc10c") return 5.94719; // pass3
182 if(period =="lhc10d") return 5.82333; // pass2
183 if(period =="lhc10e") return 5.89367; // pass2
184 if(period =="lhc11a_wosdd") return 4.28597; // pass3
185 if(period =="lhc11a_wsdd") return 4.69927; // pass4
188 if(period =="lhc10e13") return 3.13712;
189 if(period =="lhc10f6a") return 4.41362;
190 if(period =="lhc10e21") return 4.74991;
191 if(period =="lhc11e3a_plus_wosdd") return 3.37669;
192 if(period =="lhc11e3a_plus_wsdd") return 3.47885;
194 if(period =="lhc12a5a") return 29.264;
195 if(period =="lhc12a5bb") return 31.0288;
196 if(period =="lhc12a5bc") return 30.6888;
197 if(period =="lhc12a5bd") return 30.3528;
198 if(period =="lhc12a5be") return 29.9859;
199 if(period =="lhc12a5c_wsdd") return 27.5981;
202 cerr << "Warning in GetMeanNtrk: no <Ntrk> for period " << period << " and |eta| < " << eta << endl;
207 Double_t GetNSDMeanNtrk(const TString& period, Double_t eta)
210 // average track multiplicity <Ntrk> for the given period and eta
213 if(TMath::Abs(eta) > 0.51) // |eta|<0.8
215 if(period =="lhc10b") return 10.0630; // pass3
216 if(period =="lhc10d") return 9.77129; // pass2
217 if(period =="lhc10e") return 9.90511; // pass2
220 if(period =="lhc10e21") return 7.91423;
224 if(period =="lhc10c900") return 3.84362; // pass3
225 if(period =="lhc10b") return 6.18470; // pass3
226 if(period =="lhc10c") return 6.16175; // pass3
227 if(period =="lhc10d") return 6.03108; // pass2
228 if(period =="lhc10e") return 6.10384; // pass2
229 if(period =="lhc11a_wosdd") return 4.40312; // pass3
230 if(period =="lhc11a_wsdd") return 4.87609; // pass4
233 if(period =="lhc10e13") return 3.33273;
234 if(period =="lhc10f6a") return 4.80771;
235 if(period =="lhc10e21") return 4.91967;
236 if(period =="lhc11e3a_plus_wosdd") return 3.4774;
237 if(period =="lhc11e3a_plus_wsdd") return 3.6467;
239 if(period =="lhc12a5a") return 29.3414;
240 if(period =="lhc12a5bb") return 31.1514;
241 if(period =="lhc12a5bc") return 30.7877;
242 if(period =="lhc12a5bd") return 30.4706;
243 if(period =="lhc12a5be") return 30.1013;
244 if(period =="lhc12a5c_wsdd") return 27.6921;
247 cerr << "Warning in GetNSDMeanNtrk: no <Ntrk> for period " << period << " and |eta| < " << eta << endl;