]>
Commit | Line | Data |
---|---|---|
fdceab34 | 1 | //DEFINITION OF A FEW CONSTANTS |
67ebd013 | 2 | const Float_t ptmin = 2.0 ; |
3 | const Float_t ptmax = 50.0 ; | |
4 | const Float_t phimin = 0.; | |
5 | const Float_t phimax = 2.*TMath::Pi(); | |
6 | const Float_t etamin = -0.9; | |
7 | const Float_t etamax = 0.9; | |
8 | const Float_t dcarmin = -0.2; | |
9 | const Float_t dcarmax = 0.2; | |
10 | const Float_t chi2TPCmin = 0.0; | |
11 | const Float_t chi2TPCmax = 3.5; | |
12 | ||
13 | const Float_t ptmin1 = ptmin ; | |
14 | const Float_t ptmax1 = 10.0 ; | |
15 | const Float_t ptmin2 = ptmax1 ; | |
16 | const Float_t ptmax2 = 20.0 ; | |
17 | const Float_t ptmin3 = ptmax2 ; | |
18 | const Float_t ptmax3 = ptmax ; | |
19 | ||
20 | const Int_t mintrackrefsTPC = 1; | |
21 | const Int_t mintrackrefsITS = 1; | |
22 | const Int_t charge = 1; | |
fdceab34 | 23 | |
10295ac3 | 24 | AliPWG4HighPtSpectra* AddTaskPWG4HighPtSpectra() |
fdceab34 | 25 | { |
67ebd013 | 26 | // Creates HighPtSpectra analysis task and adds it to the analysis manager. |
fdceab34 | 27 | |
28 | // A. Get the pointer to the existing analysis manager via the static access method. | |
29 | //============================================================================== | |
30 | AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager(); | |
31 | if (!mgr) { | |
32 | Error("AddTaskPWG4HighPtSpectra", "No analysis manager to connect to."); | |
33 | return NULL; | |
34 | } | |
35 | ||
36 | // B. Check the analysis type using the event handlers connected to the analysis | |
37 | // manager. The availability of MC handler can also be checked here. | |
38 | //============================================================================== | |
39 | if (!mgr->GetInputEventHandler()) { | |
67ebd013 | 40 | ::Error("AddTaskPWG4HighPtSpectra", "This task requires an input event handler"); |
fdceab34 | 41 | return NULL; |
42 | } | |
43 | TString type = mgr->GetInputEventHandler()->GetDataType(); // can be "ESD" or "AOD" | |
44 | const char *analysisType = "ESD";//"TPC" | |
45 | ||
46 | // C. Create the task, add it to manager. | |
47 | //=========================================================================== | |
67ebd013 | 48 | //CONTAINER DEFINITION |
fdceab34 | 49 | Info("AliPWG4HighPtSpectra","SETUP CONTAINER"); |
50 | //the sensitive variables, their indices | |
67ebd013 | 51 | UInt_t ipt = 0; |
52 | UInt_t iphi = 1; | |
53 | UInt_t ieta = 2; | |
54 | UInt_t idcar = 3; | |
55 | UInt_t ichi2TPC = 4; | |
56 | ||
fdceab34 | 57 | //Setting up the container grid... |
67ebd013 | 58 | UInt_t nstep = 5; //Steps/Modes for containers |
fdceab34 | 59 | Int_t kStepReconstructed = 0; |
60 | Int_t kStepReconstructedTPCOnly = 1; | |
61 | Int_t kStepSecondaries = 2; | |
62 | Int_t kStepMCtrackable = 3; | |
63 | Int_t kStepReconstructedMC = 4; | |
67ebd013 | 64 | |
65 | const Int_t nvar = 5; //number of variables on the grid:pt | |
66 | const Int_t nbin11 = (int)(ptmax1-ptmin1); | |
67 | const Int_t nbin12 = (int)((ptmax2-ptmin2)/2.)+nbin11; | |
68 | const Int_t nbin13 = (int)((ptmax3-ptmin3)/5.)+nbin12; | |
69 | const Int_t nbin1 = nbin13; //bins in pt 98 | |
70 | const Int_t nbin2 = 18;//36; //bins in phi | |
71 | const Int_t nbin3 = 9; //bins in eta | |
72 | const Int_t nbin4 = 80; //bins in DCAR | |
73 | const Int_t nbin5 = 35; //bins in Chi2/#NclusTPC | |
fdceab34 | 74 | |
fdceab34 | 75 | //arrays for the number of bins in each dimension |
76 | Int_t iBin[nvar]; | |
77 | iBin[0]=nbin1; | |
67ebd013 | 78 | iBin[1]=nbin2; |
79 | iBin[2]=nbin3; | |
80 | iBin[3]=nbin4; | |
81 | iBin[4]=nbin5; | |
82 | ||
fdceab34 | 83 | //arrays for lower bounds : |
84 | Double_t *binLim1=new Double_t[nbin1+1]; | |
67ebd013 | 85 | Double_t *binLim2=new Double_t[nbin2+1]; |
86 | Double_t *binLim3=new Double_t[nbin3+1]; | |
87 | Double_t *binLim4=new Double_t[nbin4+1]; | |
88 | Double_t *binLim5=new Double_t[nbin5+1]; | |
89 | ||
90 | //values for bin lower bounds | |
91 | for(Int_t i=0; i<=nbin1; i++) { | |
92 | if(i<=nbin11) binLim1[i]=(Double_t)ptmin1 + (ptmax1-ptmin1)/nbin11*(Double_t)i ; | |
93 | if(i<=nbin12 && i>nbin11) binLim1[i]=(Double_t)ptmin2 + (ptmax2-ptmin2)/(nbin12-nbin11)*((Double_t)i-(Double_t)nbin11) ; | |
94 | if(i<=nbin13 && i>nbin12) binLim1[i]=(Double_t)ptmin3 + (ptmax3-ptmin3)/(nbin13-nbin12)*((Double_t)i-(Double_t)nbin12) ; | |
95 | } | |
96 | // for(Int_t i=0; i<=nbin1; i++) binLim1[i]=(Double_t)ptmin + (ptmax-ptmin)/nbin1*(Double_t)i ; | |
97 | for(Int_t i=0; i<=nbin2; i++) binLim2[i]=(Double_t)phimin + (phimax-phimin)/nbin2*(Double_t)i ; | |
98 | for(Int_t i=0; i<=nbin3; i++) binLim3[i]=(Double_t)etamin + (etamax-etamin)/nbin3*(Double_t)i ; | |
99 | for(Int_t i=0; i<=nbin4; i++) binLim4[i]=(Double_t)dcarmin + (dcarmax-dcarmin)/nbin4*(Double_t)i ; | |
100 | for(Int_t i=0; i<=nbin5; i++) binLim5[i]=(Double_t)chi2TPCmin + (chi2TPCmax-chi2TPCmin)/nbin5*(Double_t)i ; | |
101 | ||
102 | ||
103 | AliCFContainer* containerPos = new AliCFContainer("containerPos","container for positive tracks",nstep,nvar,iBin); | |
104 | //setting the bin limits | |
105 | containerPos -> SetBinLimits(ipt,binLim1); | |
106 | containerPos -> SetBinLimits(iphi,binLim2); | |
107 | containerPos -> SetBinLimits(ieta,binLim3); | |
108 | containerPos -> SetBinLimits(idcar,binLim4); | |
109 | containerPos -> SetBinLimits(ichi2TPC,binLim5); | |
fdceab34 | 110 | |
67ebd013 | 111 | AliCFContainer* containerNeg = new AliCFContainer("containerNeg","container for negative tracks",nstep,nvar,iBin); |
fdceab34 | 112 | //setting the bin limits |
67ebd013 | 113 | containerNeg -> SetBinLimits(ipt,binLim1); |
114 | containerNeg -> SetBinLimits(iphi,binLim2); | |
115 | containerNeg -> SetBinLimits(ieta,binLim3); | |
116 | containerNeg -> SetBinLimits(idcar,binLim4); | |
117 | containerNeg -> SetBinLimits(ichi2TPC,binLim5); | |
118 | ||
fdceab34 | 119 | //CREATE THE CUTS ----------------------------------------------- |
120 | //Use AliESDtrackCuts | |
121 | AliESDtrackCuts *trackCuts = new AliESDtrackCuts("AliESDtrackCuts","Standard Cuts"); | |
10295ac3 | 122 | // //Standard Cuts |
123 | // trackCuts->SetAcceptKinkDaughters(kFALSE); | |
124 | // trackCuts->SetRequireTPCStandAlone(kTRUE); | |
125 | // trackCuts->SetRequireTPCRefit(kTRUE); | |
126 | // trackCuts->SetMinNClustersTPC(70); | |
127 | // trackCuts->SetEtaRange(-0.9,0.9); | |
128 | // trackCuts->SetMaxCovDiagonalElements(2,2,0.5,0.5,2); | |
129 | // trackCuts->SetPtRange(0.15, 1e10); | |
130 | // trackCuts->SetMaxChi2PerClusterTPC(3.5); | |
131 | // trackCuts->SetMaxDCAToVertexXY(2.4); | |
132 | // trackCuts->SetMaxDCAToVertexZ(3.2); | |
133 | // trackCuts->SetDCAToVertex2D(kTRUE); | |
134 | // trackCuts->SetRequireITSRefit(kTRUE); | |
135 | trackCuts->SetEtaRange(-0.9,0.9); | |
136 | trackCuts->SetPtRange(0.15, 1e10); | |
137 | trackCuts->GetStandardITSTPCTrackCuts2009(kTRUE);//Primary Track Selection | |
67ebd013 | 138 | |
139 | // Gen-Level kinematic cuts | |
fdceab34 | 140 | AliCFTrackKineCuts *mcKineCuts = new AliCFTrackKineCuts("mcKineCuts","MC-level kinematic cuts"); |
67ebd013 | 141 | mcKineCuts->SetPtRange(0.15,1e10); |
fdceab34 | 142 | mcKineCuts->SetRapidityRange(-0.9,0.9);//-0.5,0.5); |
143 | mcKineCuts->SetRequireIsCharged(kTRUE); | |
144 | ||
145 | //Acceptance Cuts | |
146 | AliCFAcceptanceCuts *mcAccCuts = new AliCFAcceptanceCuts("mcAccCuts","MC acceptance cuts"); | |
147 | // mcAccCuts->SetMinNHitITS(mintrackrefsITS); | |
148 | mcAccCuts->SetMinNHitTPC(mintrackrefsTPC); | |
149 | ||
150 | TObjArray* recList = new TObjArray(0); | |
151 | TObjArray* recMCList = new TObjArray(0); | |
152 | TObjArray* recTPConlyList = new TObjArray(0); | |
153 | TObjArray* secList = new TObjArray(0) ; | |
154 | ||
155 | printf("CREATE MC KINE CUTS\n"); | |
156 | TObjArray* mcList = new TObjArray(0) ; | |
157 | mcList->AddLast(mcKineCuts); | |
158 | mcList->AddLast(mcAccCuts); | |
159 | ||
160 | //CREATE THE INTERFACE TO CORRECTION FRAMEWORK USED IN THE TASK | |
161 | printf("CREATE INTERFACE AND CUTS\n"); | |
67ebd013 | 162 | AliCFManager* manPos = new AliCFManager("manPos","Manager for Positive tracks") ; |
163 | manPos->SetParticleContainer(containerPos); | |
164 | manPos->SetParticleCutsList(0,recList); | |
165 | manPos->SetParticleCutsList(1,recTPConlyList); | |
166 | manPos->SetParticleCutsList(2,secList); | |
167 | manPos->SetParticleCutsList(3,mcList); | |
168 | manPos->SetParticleCutsList(4,recMCList); | |
169 | ||
170 | AliCFManager* manNeg = new AliCFManager("manNeg","Manager for Negative tracks") ; | |
171 | manNeg->SetParticleContainer(containerNeg); | |
172 | manNeg->SetParticleCutsList(0,recList); | |
173 | manNeg->SetParticleCutsList(1,recTPConlyList); | |
174 | manNeg->SetParticleCutsList(2,secList); | |
175 | manNeg->SetParticleCutsList(3,mcList); | |
176 | manNeg->SetParticleCutsList(4,recMCList); | |
177 | ||
178 | ||
179 | printf("Create task AliPWG4HighPtSpectra\n"); | |
fdceab34 | 180 | AliPWG4HighPtSpectra *taskPWG4HighPtSpectra = new AliPWG4HighPtSpectra("taskPWG4HighPtSpectra"); |
181 | taskPWG4HighPtSpectra->SetCuts(trackCuts); | |
67ebd013 | 182 | taskPWG4HighPtSpectra->SetCFManagerPos(manPos); //here is set the CF manager |
183 | taskPWG4HighPtSpectra->SetCFManagerNeg(manNeg); //here is set the CF manager | |
184 | ||
e50809ff | 185 | |
fdceab34 | 186 | // E. Create ONLY the output containers for the data produced by the task. |
187 | // Get and connect other common input/output containers via the manager as below | |
188 | //============================================================================== | |
189 | ||
190 | //------ input data ------ | |
191 | // AliAnalysisDataContainer *cinput0 = mgr->GetCommonInputContainer(); | |
192 | // char *outputfile = "outputAliPWG4HighPtSpectraTestTrain.root"; | |
193 | TString outputfile = AliAnalysisManager::GetCommonFileName(); | |
194 | outputfile += ":PWG4_HighPtSpectra"; | |
10295ac3 | 195 | |
67ebd013 | 196 | AliAnalysisDataContainer *coutput0 = mgr->CreateContainer("chist0HighPtSpectra", TList::Class(),AliAnalysisManager::kOutputContainer,outputfile); |
197 | AliAnalysisDataContainer *coutput1 = mgr->CreateContainer("ccontainer0HighPtSpectra", AliCFContainer::Class(),AliAnalysisManager::kOutputContainer,outputfile); | |
198 | AliAnalysisDataContainer *coutput2 = mgr->CreateContainer("ccontainer1HighPtSpectra", AliCFContainer::Class(),AliAnalysisManager::kOutputContainer,outputfile); | |
10295ac3 | 199 | |
fdceab34 | 200 | mgr->AddTask(taskPWG4HighPtSpectra); |
201 | ||
202 | mgr->ConnectInput(taskPWG4HighPtSpectra,0,mgr->GetCommonInputContainer()); | |
203 | mgr->ConnectOutput(taskPWG4HighPtSpectra,0,coutput0); | |
204 | mgr->ConnectOutput(taskPWG4HighPtSpectra,1,coutput1); | |
67ebd013 | 205 | mgr->ConnectOutput(taskPWG4HighPtSpectra,2,coutput2); |
206 | ||
fdceab34 | 207 | |
208 | // Return task pointer at the end | |
209 | return taskPWG4HighPtSpectra; | |
210 | } |