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);
21 AliAnalysisTaskB2* AddTaskB2(const TString& species,
22 const TString& outputfile,
23 const TString& trksel,
25 const TString& periodname,
26 Bool_t simulation=kFALSE,
27 Bool_t heavyIons=kFALSE,
30 Double_t minKNOmult=-10,
31 Double_t maxKNOmult=10000,
33 Double_t minCentrality=0,
34 Double_t maxCentrality=20)
37 // Create, configure and add the analysis task to the analysis manager
43 const Double_t kMaxVx = 1.;
44 const Double_t kMaxVy = 1.;
45 const Double_t kMaxVz = 10.;
47 const Double_t kMaxY = 0.5;
48 const Double_t kMaxEta = 0.8;
49 const Double_t kMaxNSigma = 3.;
51 const Int_t kMaxNSigmaITS = 3;
52 const Int_t kMaxNSigmaTPC = 3;
53 const Int_t kMaxNSigmaTOF = 3;
54 const Int_t kMinTPCnCls = 70;
56 TString period = periodname;
59 // Get pointer to the existing analysis manager
61 AliAnalysisManager* mgr = AliAnalysisManager::GetAnalysisManager();
64 cerr << "AddTaskB2: no analysis manager to connect to" << endl;
68 if (!mgr->GetInputEventHandler())
70 cerr << "AddTaskB2: this task requires an input event handler" << endl;
74 // Create and configure the task
76 AliAnalysisTaskB2* task = new AliAnalysisTaskB2(Form("B2_%s",species.Data()));
78 task->SetParticleSpecies(species);
79 task->SetSimulation(simulation);
80 task->SetHeavyIons(heavyIons);
81 task->SetV0ANDtrigger(V0AND);
83 task->SetMaxNSigmaITS(kMaxNSigmaITS);
84 task->SetMaxNSigmaTPC(kMaxNSigmaTPC);
85 task->SetMaxNSigmaTOF(kMaxNSigmaTOF);
87 task->SetMeanNtrk(GetMeanNtrk(period));
88 task->SetKNOmultInterval(minKNOmult, maxKNOmult);
89 task->SetVertexXInterval(-kMaxVx, kMaxVx);
90 task->SetVertexYInterval(-kMaxVy, kMaxVy);
91 task->SetVertexZInterval(-kMaxVz, kMaxVz);
93 task->SetCentralityInterval(minCentrality, maxCentrality);
95 if(period=="lhc11a_wsdd" || period=="lhc11a_wosdd")
97 task->SetNoFastOnlyTrigger();
102 gROOT->LoadMacro("$ALICE_ROOT/PWGLF/SPECTRA/Nuclei/B2/macros/CreateHistograms.C");
104 AliLnHistoMap* hMap = CreateHistograms(species, simulation, maxDCAxy, kMaxEta, kMaxY, heavyIons);
106 task->SetHistogramMap(hMap);
108 // track selection criteria
110 gROOT->LoadMacro("$ALICE_ROOT/PWGLF/SPECTRA/Nuclei/B2/macros/TrackCuts.C");
112 AliESDtrackCuts* trkCuts = TrackCuts(task, trksel, maxDCAxy, maxDCAz, kMaxNSigma, kMinTPCnCls, kMaxEta);
113 task->SetESDtrackCuts(trkCuts);
117 gROOT->LoadMacro("$ALICE_ROOT/PWGLF/SPECTRA/Nuclei/B2/macros/BetheBlochParams.C");
120 BetheBlochParams(bethe, period);
122 gROOT->LoadMacro("$ALICE_ROOT/PWGLF/SPECTRA/Nuclei/B2/macros/PriorProbabilities.C");
125 PriorProbabilities(prob, period, trksel);
127 AliLnID* lnID = new AliLnID();
129 lnID->SetTPCBetheBlochParams(bethe);
130 lnID->SetPriorProbabilities(prob);
131 lnID->SetPidProcedure(pidProc);
135 // Add task to the manager
139 // input and output containers
141 AliAnalysisDataContainer* output = mgr->CreateContainer(outputfile.Data(), AliLnHistoMap::Class(), AliAnalysisManager::kOutputContainer, outputfile.Data());
143 mgr->ConnectInput(task, 0, mgr->GetCommonInputContainer());
144 mgr->ConnectOutput(task, 0, output);
149 Double_t GetMeanNtrk(const TString& period)
152 // average track multiplicity <Ntrk> for the given period
154 if(period =="lhc10c900") return 3.70158; // pass3
155 if(period =="lhc10b_pass2") return 9.86258;
156 if(period =="lhc10c_pass2") return 9.61402;
157 if(period =="lhc10b") return 5.96104; // pass3
158 if(period =="lhc10c") return 5.94719; // pass3
159 if(period =="lhc10d") return 5.82333; // pass2
160 if(period =="lhc10e") return 5.89367; // pass2
161 if(period =="lhc11a_wosdd") return 4.28597; // pass3
162 if(period =="lhc11a_wsdd") return 4.57960; // pass4
165 if(period =="lhc10e13") return 3.17763;
166 if(period =="lhc10f6a") return 4.41362;
167 if(period =="lhc10e21") return 4.74991;
168 if(period =="lhc11e3a_plus_wosdd") return 3.37669;
169 if(period =="lhc11e3a_plus_wosdd") return 3.55973;