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