]> git.uio.no Git - u/mrichter/AliRoot.git/blob - PWGLF/SPECTRA/Nuclei/B2/macros/AddTaskB2.C
Adding Eulogios analysis
[u/mrichter/AliRoot.git] / PWGLF / SPECTRA / Nuclei / B2 / macros / AddTaskB2.C
1 /**************************************************************************
2  * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
3  *                                                                        *
4  * Author: The ALICE Off-line Project.                                    *
5  * Contributors are mentioned in the code where appropriate.              *
6  *                                                                        *
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  **************************************************************************/
15
16 // Add task B2
17 // author: Eulogio Serradilla <eulogio.serradilla@cern.ch>
18
19 Double_t GetMeanNtrk(const TString& period);
20
21 AliAnalysisTaskB2* AddTaskB2(const TString& species,
22                              const TString& outputfile,
23                              const TString& trksel,
24                              Int_t pidProc,
25                              const TString& periodname,
26                              Bool_t simulation=kFALSE,
27                              Bool_t heavyIons=kFALSE,
28                              Double_t maxDCAxy=1,
29                              Double_t maxDCAz=2,
30                              Double_t minKNOmult=-10,
31                              Double_t maxKNOmult=10000,
32                              Bool_t V0AND=kFALSE,
33                              Double_t minCentrality=0,
34                              Double_t maxCentrality=20)
35 {
36 //
37 // Create, configure and add the analysis task to the analysis manager
38 //
39         using namespace std;
40         
41         // sample config
42         
43         const Double_t kMaxVx     = 1.;
44         const Double_t kMaxVy     = 1.;
45         const Double_t kMaxVz     = 10.;
46         
47         const Double_t kMaxY      = 0.5;
48         const Double_t kMaxEta    = 0.8;
49         const Double_t kMaxNSigma = 3.;
50         
51         const Int_t kMaxNSigmaITS = 3;
52         const Int_t kMaxNSigmaTPC = 3;
53         const Int_t kMaxNSigmaTOF = 3;
54         const Int_t kMinTPCnCls   = 70;
55         
56         TString period = periodname;
57         period.ToLower();
58         
59         // Get pointer to the existing analysis manager
60         
61         AliAnalysisManager* mgr = AliAnalysisManager::GetAnalysisManager();
62         if (!mgr)
63         {
64                 cerr << "AddTaskB2: no analysis manager to connect to" << endl;
65                 return 0;
66         }
67         
68         if (!mgr->GetInputEventHandler())
69         {
70                 cerr << "AddTaskB2: this task requires an input event handler" << endl;
71                 return 0;
72         }
73         
74         // Create and configure the task
75         
76         AliAnalysisTaskB2* task = new AliAnalysisTaskB2(Form("B2_%s",species.Data()));
77         
78         task->SetParticleSpecies(species);
79         task->SetSimulation(simulation);
80         task->SetHeavyIons(heavyIons);
81         task->SetV0ANDtrigger(V0AND);
82         
83         task->SetMaxNSigmaITS(kMaxNSigmaITS);
84         task->SetMaxNSigmaTPC(kMaxNSigmaTPC);
85         task->SetMaxNSigmaTOF(kMaxNSigmaTOF);
86         
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);
92         
93         task->SetCentralityInterval(minCentrality, maxCentrality);
94         
95         if(period=="lhc11a_wsdd" || period=="lhc11a_wosdd")
96         {
97                 task->SetNoFastOnlyTrigger();
98         }
99         
100         // histograms
101         
102         gROOT->LoadMacro("$ALICE_ROOT/PWGLF/SPECTRA/Nuclei/B2/macros/CreateHistograms.C");
103         
104         AliLnHistoMap* hMap = CreateHistograms(species, simulation, maxDCAxy, kMaxEta, kMaxY, heavyIons);
105         
106         task->SetHistogramMap(hMap);
107         
108         // track selection criteria
109         
110         gROOT->LoadMacro("$ALICE_ROOT/PWGLF/SPECTRA/Nuclei/B2/macros/TrackCuts.C");
111         
112         AliESDtrackCuts* trkCuts = TrackCuts(task, trksel, maxDCAxy, maxDCAz, kMaxNSigma, kMinTPCnCls, kMaxEta);
113         task->SetESDtrackCuts(trkCuts);
114         
115         // PID
116         
117         gROOT->LoadMacro("$ALICE_ROOT/PWGLF/SPECTRA/Nuclei/B2/macros/BetheBlochParams.C");
118         
119         Double_t bethe[5];
120         BetheBlochParams(bethe, period);
121         
122         gROOT->LoadMacro("$ALICE_ROOT/PWGLF/SPECTRA/Nuclei/B2/macros/PriorProbabilities.C");
123         
124         Double_t prob[9];
125         PriorProbabilities(prob, period, trksel);
126         
127         AliLnID* lnID = new AliLnID();
128         
129         lnID->SetTPCBetheBlochParams(bethe);
130         lnID->SetPriorProbabilities(prob);
131         lnID->SetPidProcedure(pidProc);
132         
133         task->SetPID(lnID);
134         
135         // Add task to the manager
136         
137         mgr->AddTask(task);
138         
139         // input and output containers
140         
141         AliAnalysisDataContainer* output = mgr->CreateContainer(outputfile.Data(), AliLnHistoMap::Class(), AliAnalysisManager::kOutputContainer, outputfile.Data());
142         
143         mgr->ConnectInput(task, 0, mgr->GetCommonInputContainer());
144         mgr->ConnectOutput(task, 0, output);
145         
146         return task;
147 }
148
149 Double_t GetMeanNtrk(const TString& period)
150 {
151 //
152 // average track multiplicity <Ntrk> for the given period
153 //
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
163         
164         // MC
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;
170         
171         return 1;
172 }