]>
Commit | Line | Data |
---|---|---|
8612dfc8 | 1 | enum AlgoType {kKT, kANTIKT}; |
2 | enum JetType {kFULLJETS, kCHARGEDJETS, kNEUTRALJETS}; | |
3 | ||
4 | AliAnalysisTaskEmcalJetMass* AddTaskEmcalJetMass(const char * njetsBase, | |
5 | const char * njetsTag, | |
6 | const Double_t R, | |
7 | const char * nrhoBase, | |
8 | const char * nrhoTag, | |
9 | const char * ntracks, | |
10 | const char * nclusters, | |
11 | const char *type, | |
12 | const char *CentEst, | |
13 | Int_t pSel, | |
14 | TString trigClass = "", | |
15 | TString kEmcalTriggers = ""); | |
16 | ||
17 | AliAnalysisTaskEmcalJetMass* AddTaskEmcalJetMass(TString kTracksName = "PicoTracks", | |
18 | TString kClusName = "caloClustersCorr", | |
19 | Double_t R = 0.4, | |
20 | Double_t ptminTrack = 0.15, | |
21 | Double_t etminClus = 0.3, | |
22 | Double_t ptminTag = 4., | |
23 | Int_t rhoType = 1, | |
24 | const char *type = "EMCAL", | |
25 | const char *CentEst = "V0M", | |
26 | Int_t pSel = AliVEvent::kCentral | AliVEvent::kSemiCentral | AliVEvent::kMB, | |
27 | TString trigClass = "", | |
28 | TString kEmcalTriggers = "", | |
29 | TString kPeriod = "LHC11h" | |
30 | ) { | |
31 | ||
32 | AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager(); | |
33 | if (!mgr) | |
34 | { | |
35 | Error("AddTaskEmcalJetMass","No analysis manager found."); | |
36 | return 0; | |
37 | } | |
38 | Bool_t ismc=kFALSE; | |
39 | ismc = (mgr->GetMCtruthEventHandler())?kTRUE:kFALSE; | |
40 | ||
41 | // Check the analysis type using the event handlers connected to the analysis manager. | |
42 | //============================================================================== | |
43 | if (!mgr->GetInputEventHandler()) | |
44 | { | |
45 | ::Error("AddTaskEmcalJetMass", "This task requires an input event handler"); | |
46 | return NULL; | |
47 | } | |
48 | ||
49 | // #### Add necessary jet finder tasks | |
50 | gROOT->LoadMacro("$ALICE_ROOT/PWGJE/EMCALJetTasks/macros/AddTaskEmcalJet.C"); | |
51 | ||
52 | AliEmcalJetTask* jetFinderTaskBase = 0x0; | |
53 | if (strcmp(type,"TPC")==0) | |
54 | jetFinderTaskBase = AddTaskEmcalJet(kTracksName, "", kANTIKT, R, kCHARGEDJETS, ptminTrack, etminClus,0.005,0); | |
55 | else if (strcmp(type,"EMCAL")==0) | |
56 | jetFinderTaskBase = AddTaskEmcalJet(kTracksName, kClusName, kANTIKT, R, kFULLJETS, ptminTrack, etminClus,0.005,0); | |
57 | ||
58 | TString strJetsBase = jetFinderTaskBase->GetName(); | |
59 | ||
60 | AliAnalysisTaskRhoBase *rhoTaskBase; | |
61 | TString rhoNameBase = ""; | |
62 | if(rhoType==1) { | |
63 | rhoTaskBase = AttachRhoTask(kPeriod,kTracksName,kClusName,R,ptminTrack,etminClus); | |
396ffc82 MV |
64 | if(rhoTaskBase) { |
65 | rhoTaskBase->SetCentralityEstimator(CentEst); | |
66 | rhoTaskBase->SelectCollisionCandidates(AliVEvent::kAny); | |
67 | if (strcmp(type,"TPC")==0) | |
68 | rhoNameBase = rhoTaskBase->GetOutRhoName(); | |
69 | if (strcmp(type,"EMCAL")==0) | |
70 | rhoNameBase = rhoTaskBase->GetOutRhoScaledName(); | |
71 | } | |
8612dfc8 | 72 | } |
73 | ||
74 | //Configure jet tagger task | |
75 | AliAnalysisTaskEmcalJetMass *task = AddTaskEmcalJetMass(jetFinderTaskBase->GetName(), | |
76 | R, | |
77 | rhoNameBase, | |
78 | kTracksName.Data(), | |
79 | kClusName.Data(), | |
80 | type, | |
81 | CentEst, | |
82 | pSel, | |
83 | trigClass, | |
84 | kEmcalTriggers | |
85 | ); | |
86 | ||
87 | return task; | |
88 | ||
89 | } | |
90 | ||
91 | AliAnalysisTaskEmcalJetMass* AddTaskEmcalJetMass(const char * njetsBase, | |
92 | const Double_t R, | |
93 | const char * nrhoBase, | |
94 | const char * ntracks, | |
95 | const char * nclusters, | |
96 | const char * type, | |
97 | const char * CentEst, | |
98 | Int_t pSel, | |
99 | TString trigClass, | |
100 | TString kEmcalTriggers | |
101 | ) { | |
102 | ||
103 | AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager(); | |
104 | if (!mgr) | |
105 | { | |
106 | Error("AddTaskEmcalJetMass","No analysis manager found."); | |
107 | return 0; | |
108 | } | |
109 | Bool_t ismc=kFALSE; | |
110 | ismc = (mgr->GetMCtruthEventHandler())?kTRUE:kFALSE; | |
111 | ||
112 | // Check the analysis type using the event handlers connected to the analysis manager. | |
113 | //============================================================================== | |
114 | if (!mgr->GetInputEventHandler()) | |
115 | { | |
116 | ::Error("AddTaskEmcalJetMass", "This task requires an input event handler"); | |
117 | return NULL; | |
118 | } | |
119 | ||
120 | TString wagonName = Form("JetMass_%s_TC%s",njetsBase,trigClass.Data()); | |
121 | ||
122 | //Configure jet tagger task | |
123 | AliAnalysisTaskEmcalJetMass *task = new AliAnalysisTaskEmcalJetMass(wagonName.Data()); | |
124 | ||
125 | task->SetNCentBins(4); | |
126 | //task->SetVzRange(-10.,10.); | |
127 | ||
128 | AliParticleContainer *trackCont = task->AddParticleContainer(ntracks); | |
129 | AliClusterContainer *clusterCont = task->AddClusterContainer(nclusters); | |
130 | ||
131 | task->SetJetContainerBase(0); | |
132 | ||
133 | TString strType(type); | |
134 | AliJetContainer *jetContBase = task->AddJetContainer(njetsBase,strType,R); | |
135 | if(jetContBase) { | |
136 | jetContBase->SetRhoName(nrhoBase); | |
137 | jetContBase->ConnectParticleContainer(trackCont); | |
138 | jetContBase->ConnectClusterContainer(clusterCont); | |
139 | jetContBase->SetZLeadingCut(0.98,0.98); | |
02e33ee8 | 140 | jetContBase->SetPercAreaCut(0.6); |
8612dfc8 | 141 | } |
142 | ||
143 | task->SetCaloTriggerPatchInfoName(kEmcalTriggers.Data()); | |
144 | ||
145 | task->SetCentralityEstimator(CentEst); | |
146 | ||
147 | task->SelectCollisionCandidates(pSel); | |
148 | ||
149 | task->SetUseAliAnaUtils(kFALSE); | |
150 | ||
151 | mgr->AddTask(task); | |
152 | ||
153 | //Connnect input | |
154 | mgr->ConnectInput (task, 0, mgr->GetCommonInputContainer() ); | |
155 | ||
156 | //Connect output | |
157 | TString contName(wagonName); | |
158 | TString outputfile = Form("%s",AliAnalysisManager::GetCommonFileName()); | |
159 | AliAnalysisDataContainer *coutput1 = mgr->CreateContainer(contName.Data(), TList::Class(),AliAnalysisManager::kOutputContainer,outputfile); | |
160 | mgr->ConnectOutput(task,1,coutput1); | |
161 | ||
162 | return task; | |
163 | ||
164 | } | |
165 | ||
166 | ||
167 | AliAnalysisTaskRhoBase *AttachRhoTask(TString kPeriod ,// = "LHC13b", | |
168 | TString kTracksName ,// = "PicoTracks", | |
169 | TString kClusName ,// = "caloClustersCorr", | |
170 | Double_t R ,// = 0.4, | |
171 | Double_t ptminTrack ,// = 0.15, | |
172 | Double_t etminClus // = 0.3 | |
173 | ) { | |
174 | ||
175 | AliAnalysisTaskRhoBase *rhoTaskBase; | |
176 | ||
177 | kPeriod.ToLower(); | |
178 | ||
179 | // Add kt jet finder and rho task in case we want background subtraction | |
180 | AliEmcalJetTask *jetFinderKt; | |
181 | AliEmcalJetTask *jetFinderAKt; | |
182 | jetFinderKt = AddTaskEmcalJet(kTracksName, "", kKT, R, kCHARGEDJETS, ptminTrack, etminClus,0.005,0); | |
183 | jetFinderAKt = AddTaskEmcalJet(kTracksName, "", kANTIKT, R, kCHARGEDJETS, ptminTrack, etminClus,0.005,0); | |
184 | ||
185 | if(kPeriod.EqualTo("lhc13b") || kPeriod.EqualTo("lhc13c") || kPeriod.EqualTo("lhc13d") || kPeriod.EqualTo("lhc13e") || kPeriod.EqualTo("lhc13f")) { | |
186 | ||
187 | jetFinderKt->SetMinJetPt(0.); | |
188 | ||
189 | gROOT->LoadMacro("$ALICE_ROOT/PWGJE/EMCALJetTasks/macros/AddTaskRhoSparse.C"); | |
190 | TF1 *fScale = new TF1("fScale","1.42",0.,100.); //scale factor for pPb | |
191 | AliAnalysisTaskRhoSparse *rhoTaskSparse = AddTaskRhoSparse( | |
192 | jetFinderKt->GetName(), | |
193 | jetFinderAKt->GetName(), | |
194 | kTracksName, | |
195 | kClusName, | |
196 | Form("RhoSparseR%03d",(int)(100*R)), | |
197 | R, | |
198 | "TPC", | |
199 | 0.01, | |
200 | 0.15, | |
201 | 0, | |
202 | fScale, | |
203 | 0, | |
204 | kTRUE, | |
205 | Form("RhoSparseR%03d",(int)(100*R)), | |
206 | kTRUE | |
207 | ); | |
208 | rhoTaskSparse->SetUseAliAnaUtils(kTRUE); | |
209 | ||
210 | rhoTaskBase = dynamic_cast<AliAnalysisTaskRhoBase*>rhoTaskSparse; | |
211 | } | |
212 | else if(kPeriod.EqualTo("lhc10h") || kPeriod.EqualTo("lhc11h") ) { | |
213 | ||
214 | gROOT->LoadMacro("$ALICE_ROOT/PWGJE/EMCALJetTasks/macros/AddTaskRho.C"); | |
215 | ||
216 | TF1* sfunc = new TF1("sfunc","[0]*x*x+[1]*x+[2]",-1,100); | |
217 | sfunc->SetParameter(2,1.76458); | |
218 | sfunc->SetParameter(1,-0.0111656); | |
219 | sfunc->SetParameter(0,0.000107296); | |
396ffc82 | 220 | TString rhoname = Form("RhoR%03dptmin%3.0f%s",(int)(100*R),ptminTrack*1000.0,kTracksName.Data()); |
8612dfc8 | 221 | AliAnalysisTaskRho *rhoTask = AddTaskRho( |
222 | jetFinderKt->GetName(), | |
223 | kTracksName, | |
224 | kClusName, | |
396ffc82 | 225 | rhoname, |
8612dfc8 | 226 | R, |
227 | "TPC", | |
228 | 0.01, | |
229 | 0, | |
230 | sfunc, | |
231 | 2, | |
232 | kTRUE); | |
233 | rhoTask->SetHistoBins(100,0,250); | |
234 | ||
235 | rhoTaskBase = dynamic_cast<AliAnalysisTaskRhoBase*>rhoTask; | |
236 | ||
237 | } | |
238 | ||
239 | return rhoTaskBase; | |
240 | ||
241 | } |