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