]>
Commit | Line | Data |
---|---|---|
5232d0de | 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 | /* $Id$ */ | |
17 | ||
18 | #include <TROOT.h> | |
19 | #include <TSystem.h> | |
20 | #include <TInterpreter.h> | |
21 | #include <TChain.h> | |
22 | #include <TFile.h> | |
23 | #include <TList.h> | |
24 | ||
25 | #include "AliAnalysisTaskSE.h" | |
26 | #include "AliAnalysisManager.h" | |
60a04972 | 27 | #include "AliAnalysisDataSlot.h" |
5232d0de | 28 | #include "AliESDEvent.h" |
29 | #include "AliESD.h" | |
30 | #include "AliAODEvent.h" | |
3f2431c4 | 31 | #include "AliAODHeader.h" |
c185e0db | 32 | #include "AliAODTracklets.h" |
5a922844 | 33 | #include "AliAODCaloCells.h" |
113bc2bd | 34 | #include "AliAODMCParticle.h" |
5232d0de | 35 | #include "AliVEvent.h" |
36 | #include "AliAODHandler.h" | |
3f2431c4 | 37 | #include "AliAODInputHandler.h" |
5232d0de | 38 | #include "AliMCEventHandler.h" |
39 | #include "AliInputEventHandler.h" | |
40 | #include "AliMCEvent.h" | |
41 | #include "AliStack.h" | |
4d0a82af | 42 | #include "AliLog.h" |
5232d0de | 43 | |
44 | ||
45 | ClassImp(AliAnalysisTaskSE) | |
46 | ||
47 | //////////////////////////////////////////////////////////////////////// | |
c185e0db | 48 | AliAODHeader* AliAnalysisTaskSE::fgAODHeader = NULL; |
49 | TClonesArray* AliAnalysisTaskSE::fgAODTracks = NULL; | |
50 | TClonesArray* AliAnalysisTaskSE::fgAODVertices = NULL; | |
51 | TClonesArray* AliAnalysisTaskSE::fgAODV0s = NULL; | |
52 | TClonesArray* AliAnalysisTaskSE::fgAODPMDClusters = NULL; | |
53 | TClonesArray* AliAnalysisTaskSE::fgAODJets = NULL; | |
54 | TClonesArray* AliAnalysisTaskSE::fgAODFMDClusters = NULL; | |
55 | TClonesArray* AliAnalysisTaskSE::fgAODCaloClusters = NULL; | |
113bc2bd | 56 | TClonesArray* AliAnalysisTaskSE::fgAODMCParticles = NULL; |
c185e0db | 57 | AliAODTracklets* AliAnalysisTaskSE::fgAODTracklets = NULL; |
5a922844 | 58 | AliAODCaloCells* AliAnalysisTaskSE::fgAODEmcalCells = NULL; |
59 | AliAODCaloCells* AliAnalysisTaskSE::fgAODPhosCells = NULL; | |
c185e0db | 60 | |
5232d0de | 61 | |
62 | AliAnalysisTaskSE::AliAnalysisTaskSE(): | |
63 | AliAnalysisTask(), | |
64 | fDebug(0), | |
80d13558 | 65 | fEntry(0), |
5232d0de | 66 | fInputEvent(0x0), |
80d13558 | 67 | fInputHandler(0x0), |
5232d0de | 68 | fOutputAOD(0x0), |
69 | fMCEvent(0x0), | |
9a587f77 | 70 | fTreeA(0x0), |
71 | fCurrentRunNumber(-1), | |
72 | fHistosQA(0x0) | |
5232d0de | 73 | { |
74 | // Default constructor | |
75 | } | |
76 | ||
77 | AliAnalysisTaskSE::AliAnalysisTaskSE(const char* name): | |
78 | AliAnalysisTask(name, "AnalysisTaskSE"), | |
79 | fDebug(0), | |
80d13558 | 80 | fEntry(0), |
5232d0de | 81 | fInputEvent(0x0), |
80d13558 | 82 | fInputHandler(0x0), |
5232d0de | 83 | fOutputAOD(0x0), |
84 | fMCEvent(0x0), | |
1ec2c8dc | 85 | fTreeA(0x0), |
86 | fCurrentRunNumber(-1), | |
87 | fHistosQA(0x0) | |
5232d0de | 88 | { |
89 | // Default constructor | |
90 | DefineInput (0, TChain::Class()); | |
91 | DefineOutput(0, TTree::Class()); | |
92 | } | |
93 | ||
26f071d8 | 94 | AliAnalysisTaskSE::AliAnalysisTaskSE(const AliAnalysisTaskSE& obj): |
95 | AliAnalysisTask(obj), | |
96 | fDebug(0), | |
80d13558 | 97 | fEntry(0), |
26f071d8 | 98 | fInputEvent(0x0), |
80d13558 | 99 | fInputHandler(0x0), |
26f071d8 | 100 | fOutputAOD(0x0), |
101 | fMCEvent(0x0), | |
1ec2c8dc | 102 | fTreeA(0x0), |
103 | fCurrentRunNumber(-1), | |
104 | fHistosQA(0x0) | |
26f071d8 | 105 | { |
106 | // Copy constructor | |
1ec2c8dc | 107 | fDebug = obj.fDebug; |
108 | fEntry = obj.fEntry; | |
109 | fInputEvent = obj.fInputEvent; | |
110 | fInputHandler = obj.fInputHandler; | |
111 | fOutputAOD = obj.fOutputAOD; | |
112 | fMCEvent = obj.fMCEvent; | |
113 | fTreeA = obj.fTreeA; | |
114 | fCurrentRunNumber = obj.fCurrentRunNumber; | |
115 | fHistosQA = obj.fHistosQA; | |
26f071d8 | 116 | } |
117 | ||
118 | ||
119 | AliAnalysisTaskSE& AliAnalysisTaskSE::operator=(const AliAnalysisTaskSE& other) | |
120 | { | |
121 | // Assignment | |
122 | AliAnalysisTask::operator=(other); | |
1ec2c8dc | 123 | fDebug = other.fDebug; |
124 | fEntry = other.fEntry; | |
125 | fInputEvent = other.fInputEvent; | |
126 | fInputHandler = other.fInputHandler; | |
127 | fOutputAOD = other.fOutputAOD; | |
128 | fMCEvent = other.fMCEvent; | |
129 | fTreeA = other.fTreeA; | |
130 | fCurrentRunNumber = other.fCurrentRunNumber; | |
131 | fHistosQA = other.fHistosQA; | |
26f071d8 | 132 | return *this; |
133 | } | |
5232d0de | 134 | |
135 | ||
136 | void AliAnalysisTaskSE::ConnectInputData(Option_t* /*option*/) | |
137 | { | |
138 | // Connect the input data | |
139 | if (fDebug > 1) printf("AnalysisTaskSE::ConnectInputData() \n"); | |
140 | // | |
141 | // ESD | |
142 | // | |
f0b15803 | 143 | fInputHandler = (AliInputEventHandler*) |
259b7a8a | 144 | ((AliAnalysisManager::GetAnalysisManager())->GetInputEventHandler()); |
5232d0de | 145 | // |
146 | // Monte Carlo | |
147 | // | |
148 | AliMCEventHandler* mcH = 0; | |
149 | mcH = (AliMCEventHandler*) ((AliAnalysisManager::GetAnalysisManager())->GetMCtruthEventHandler()); | |
04a79fa0 | 150 | if (mcH) { |
151 | fMCEvent = mcH->MCEvent(); | |
152 | } | |
259b7a8a | 153 | |
154 | if (fInputHandler) { | |
155 | fInputEvent = fInputHandler->GetEvent(); | |
156 | } else if( fMCEvent ) { | |
157 | AliWarning("No Input Event Handler connected, only MC Truth Event Handler") ; | |
158 | } else { | |
159 | AliError("No Input Event Handler connected") ; | |
160 | return ; | |
161 | } | |
5232d0de | 162 | } |
163 | ||
164 | void AliAnalysisTaskSE::CreateOutputObjects() | |
165 | { | |
166 | // Create the output container | |
167 | // | |
168 | // Default AOD | |
169 | if (fDebug > 1) printf("AnalysisTaskSE::CreateOutPutData() \n"); | |
170 | ||
171 | AliAODHandler* handler = (AliAODHandler*) | |
259b7a8a | 172 | ((AliAnalysisManager::GetAnalysisManager())->GetOutputEventHandler()); |
5232d0de | 173 | |
5a922844 | 174 | Bool_t merging = kFALSE; |
175 | AliAODInputHandler* aodIH = static_cast<AliAODInputHandler*>((AliAnalysisManager::GetAnalysisManager())->GetInputEventHandler()); | |
176 | if (aodIH) { | |
177 | if (aodIH->GetMergeEvents()) merging = kTRUE; | |
178 | } | |
179 | ||
c185e0db | 180 | // Check if AOD replication has been required |
181 | ||
3b9a675c | 182 | if (handler) { |
183 | fOutputAOD = handler->GetAOD(); | |
184 | fTreeA = handler->GetTree(); | |
c185e0db | 185 | if (!(handler->IsStandard())) { |
186 | if ((handler->NeedsHeaderReplication()) && !(fgAODHeader)) | |
187 | { | |
87022830 | 188 | if (fDebug > 1) AliInfo("Replicating header"); |
189 | fgAODHeader = new AliAODHeader; | |
190 | handler->AddBranch("AliAODHeader", &fgAODHeader); | |
c185e0db | 191 | } |
5a922844 | 192 | if ((handler->NeedsTracksBranchReplication() || merging) && !(fgAODTracks)) |
c185e0db | 193 | { |
194 | if (fDebug > 1) AliInfo("Replicating track branch\n"); | |
195 | fgAODTracks = new TClonesArray("AliAODTrack",500); | |
87022830 | 196 | fgAODTracks->SetName("tracks"); |
c185e0db | 197 | handler->AddBranch("TClonesArray", &fgAODTracks); |
198 | } | |
4dd8a1c8 | 199 | if ((handler->NeedsVerticesBranchReplication() || merging) && !(fgAODVertices)) |
c185e0db | 200 | { |
201 | if (fDebug > 1) AliInfo("Replicating vertices branch\n"); | |
202 | fgAODVertices = new TClonesArray("AliAODVertex",500); | |
87022830 | 203 | fgAODVertices->SetName("vertices"); |
c185e0db | 204 | handler->AddBranch("TClonesArray", &fgAODVertices); |
205 | } | |
206 | if ((handler->NeedsV0sBranchReplication()) && !(fgAODV0s)) | |
207 | { | |
208 | if (fDebug > 1) AliInfo("Replicating V0s branch\n"); | |
209 | fgAODV0s = new TClonesArray("AliAODv0",500); | |
87022830 | 210 | fgAODV0s->SetName("v0s"); |
c185e0db | 211 | handler->AddBranch("TClonesArray", &fgAODV0s); |
212 | } | |
213 | if ((handler->NeedsTrackletsBranchReplication()) && !(fgAODTracklets)) | |
214 | { | |
215 | if (fDebug > 1) AliInfo("Replicating Tracklets branch\n"); | |
87022830 | 216 | fgAODTracklets = new AliAODTracklets("tracklets","tracklets"); |
c185e0db | 217 | handler->AddBranch("AliAODTracklets", &fgAODTracklets); |
218 | } | |
219 | if ((handler->NeedsPMDClustersBranchReplication()) && !(fgAODPMDClusters)) | |
220 | { | |
221 | if (fDebug > 1) AliInfo("Replicating PMDClusters branch\n"); | |
222 | fgAODPMDClusters = new TClonesArray("AliAODPmdCluster",500); | |
87022830 | 223 | fgAODPMDClusters->SetName("pmdClusters"); |
c185e0db | 224 | handler->AddBranch("TClonesArray", &fgAODPMDClusters); |
225 | } | |
5a922844 | 226 | if ((handler->NeedsJetsBranchReplication() || merging) && !(fgAODJets)) |
c185e0db | 227 | { |
228 | if (fDebug > 1) AliInfo("Replicating Jets branch\n"); | |
229 | fgAODJets = new TClonesArray("AliAODJet",500); | |
87022830 | 230 | fgAODJets->SetName("jets"); |
c185e0db | 231 | handler->AddBranch("TClonesArray", &fgAODJets); |
232 | } | |
233 | if ((handler->NeedsFMDClustersBranchReplication()) && !(fgAODFMDClusters)) | |
234 | { | |
235 | AliInfo("Replicating FMDClusters branch\n"); | |
236 | fgAODFMDClusters = new TClonesArray("AliAODFmdCluster",500); | |
87022830 | 237 | fgAODFMDClusters->SetName("fmdClusters"); |
c185e0db | 238 | handler->AddBranch("TClonesArray", &fgAODFMDClusters); |
239 | } | |
5a922844 | 240 | if ((handler->NeedsCaloClustersBranchReplication() || merging) && !(fgAODCaloClusters)) |
c185e0db | 241 | { |
242 | if (fDebug > 1) AliInfo("Replicating CaloClusters branch\n"); | |
243 | fgAODCaloClusters = new TClonesArray("AliAODCaloCluster",500); | |
87022830 | 244 | fgAODCaloClusters->SetName("caloClusters"); |
c185e0db | 245 | handler->AddBranch("TClonesArray", &fgAODCaloClusters); |
5a922844 | 246 | |
247 | fgAODEmcalCells = new AliAODCaloCells(); | |
248 | fgAODEmcalCells->SetName("emcalCells"); | |
249 | handler->AddBranch("AliAODCaloCells", &fgAODEmcalCells); | |
250 | ||
251 | fgAODPhosCells = new AliAODCaloCells(); | |
252 | fgAODPhosCells->SetName("phosCells"); | |
253 | handler->AddBranch("AliAODCaloCells", &fgAODPhosCells); | |
c185e0db | 254 | } |
113bc2bd | 255 | if ((handler->NeedsMCParticlesBranchReplication() || merging) && !(fgAODMCParticles)) |
256 | { | |
257 | if (fDebug > 1) AliInfo("Replicating MCParticles branch\n"); | |
258 | fgAODMCParticles = new TClonesArray("AliAODMCParticle",500); | |
259 | fgAODMCParticles->SetName("mcparticles"); | |
260 | handler->AddBranch("TClonesArray", &fgAODMCParticles); | |
261 | } | |
5a922844 | 262 | // cache the pointerd in the AODEvent |
263 | fOutputAOD->GetStdContent(); | |
3f2431c4 | 264 | } |
3b9a675c | 265 | } else { |
266 | AliWarning("No AOD Event Handler connected.") ; | |
267 | } | |
5232d0de | 268 | UserCreateOutputObjects(); |
269 | } | |
270 | ||
271 | void AliAnalysisTaskSE::Exec(Option_t* option) | |
272 | { | |
273 | // | |
274 | // Exec analysis of one event | |
259b7a8a | 275 | if (fDebug > 1) AliInfo("AliAnalysisTaskSE::Exec() \n"); |
04a79fa0 | 276 | |
277 | if( fInputHandler ) { | |
259b7a8a | 278 | fEntry = fInputHandler->GetReadEntry(); |
04a79fa0 | 279 | } |
280 | ||
281 | ||
259b7a8a | 282 | else if( fMCEvent ) |
283 | fEntry = fMCEvent->Header()->GetEvent(); | |
4d0a82af | 284 | if ( !((Entry()-1)%100) && fDebug > 0) |
259b7a8a | 285 | AliInfo(Form("%s ----> Processing event # %lld", CurrentFileName(), Entry())); |
3f2431c4 | 286 | |
287 | AliAODHandler* handler = (AliAODHandler*) | |
288 | ((AliAnalysisManager::GetAnalysisManager())->GetOutputEventHandler()); | |
c185e0db | 289 | AliAODInputHandler* aodH = dynamic_cast<AliAODInputHandler*>(fInputHandler); |
290 | ||
291 | if (handler && aodH) { | |
04a79fa0 | 292 | fMCEvent = aodH->MCEvent(); |
5a922844 | 293 | Bool_t merging = aodH->GetMergeEvents(); |
04a79fa0 | 294 | |
c185e0db | 295 | if (!(handler->IsStandard()) && !(handler->AODIsReplicated())) { |
296 | if ((handler->NeedsHeaderReplication()) && (fgAODHeader)) | |
297 | { | |
61d5496b | 298 | // copy the contents by assigment |
299 | *fgAODHeader = *(dynamic_cast<AliAODHeader*>(InputEvent()->GetHeader())); | |
daa81fe5 | 300 | } |
5a922844 | 301 | if ((handler->NeedsTracksBranchReplication() || merging) && (fgAODTracks)) |
c185e0db | 302 | { |
303 | TClonesArray* tracks = (dynamic_cast<AliAODEvent*>(InputEvent()))->GetTracks(); | |
304 | new (fgAODTracks) TClonesArray(*tracks); | |
305 | } | |
417ab5ac | 306 | if ((handler->NeedsVerticesBranchReplication() || merging) && (fgAODVertices)) |
c185e0db | 307 | { |
308 | TClonesArray* vertices = (dynamic_cast<AliAODEvent*>(InputEvent()))->GetVertices(); | |
309 | new (fgAODVertices) TClonesArray(*vertices); | |
310 | } | |
311 | if ((handler->NeedsV0sBranchReplication()) && (fgAODV0s)) | |
312 | { | |
113bc2bd | 313 | TClonesArray* v0s = (dynamic_cast<AliAODEvent*>(InputEvent()))->GetV0s(); |
314 | new (fgAODV0s) TClonesArray(*v0s); | |
c185e0db | 315 | } |
316 | if ((handler->NeedsTrackletsBranchReplication()) && (fgAODTracklets)) | |
317 | { | |
61d5496b | 318 | *fgAODTracklets = *(dynamic_cast<AliAODEvent*>(InputEvent()))->GetTracklets(); |
c185e0db | 319 | } |
320 | if ((handler->NeedsPMDClustersBranchReplication()) && (fgAODPMDClusters)) | |
321 | { | |
113bc2bd | 322 | TClonesArray* pmdClusters = (dynamic_cast<AliAODEvent*>(InputEvent()))->GetPmdClusters(); |
323 | new (fgAODPMDClusters) TClonesArray(*pmdClusters); | |
c185e0db | 324 | } |
5a922844 | 325 | if ((handler->NeedsJetsBranchReplication() || merging) && (fgAODJets)) |
c185e0db | 326 | { |
113bc2bd | 327 | TClonesArray* jets = (dynamic_cast<AliAODEvent*>(InputEvent()))->GetJets(); |
328 | new (fgAODJets) TClonesArray(*jets); | |
c185e0db | 329 | } |
330 | if ((handler->NeedsFMDClustersBranchReplication()) && (fgAODFMDClusters)) | |
331 | { | |
113bc2bd | 332 | TClonesArray* fmdClusters = (dynamic_cast<AliAODEvent*>(InputEvent()))->GetFmdClusters(); |
333 | new (fgAODFMDClusters) TClonesArray(*fmdClusters); | |
c185e0db | 334 | } |
5a922844 | 335 | if ((handler->NeedsCaloClustersBranchReplication() || merging) && (fgAODCaloClusters)) |
c185e0db | 336 | { |
113bc2bd | 337 | TClonesArray* caloClusters = (dynamic_cast<AliAODEvent*>(InputEvent()))->GetCaloClusters(); |
338 | new (fgAODCaloClusters) TClonesArray(*caloClusters); | |
339 | } | |
340 | ||
341 | if ((handler->NeedsMCParticlesBranchReplication() || merging) && (fgAODMCParticles)) | |
342 | { | |
343 | TClonesArray* mcParticles = (TClonesArray*) ((dynamic_cast<AliAODEvent*>(InputEvent()))->FindListObject("mcparticles")); | |
344 | new (fgAODMCParticles) TClonesArray(*mcParticles); | |
c185e0db | 345 | } |
5a922844 | 346 | |
347 | // Additional merging if needed | |
348 | if (merging) { | |
113bc2bd | 349 | // mcParticles |
350 | TClonesArray* mcparticles = (TClonesArray*) ((aodH->GetEventToMerge())->FindListObject("mcparticles")); | |
351 | Int_t npart = mcparticles->GetEntries(); | |
352 | Int_t nc = fgAODMCParticles->GetEntries(); | |
353 | Int_t nc0 = nc; | |
354 | ||
355 | for (Int_t i = 0; i < npart; i++) { | |
356 | AliAODMCParticle* particle = (AliAODMCParticle*) mcparticles->At(i); | |
c8de791b | 357 | new((*fgAODMCParticles)[nc++]) AliAODMCParticle(*particle); |
113bc2bd | 358 | } |
359 | ||
5a922844 | 360 | // tracks |
361 | TClonesArray* tracks = aodH->GetEventToMerge()->GetTracks(); | |
362 | Int_t ntr = tracks->GetEntries(); | |
113bc2bd | 363 | nc = fgAODTracks->GetEntries(); |
5a922844 | 364 | for (Int_t i = 0; i < ntr; i++) { |
365 | AliAODTrack* track = (AliAODTrack*) tracks->At(i); | |
366 | AliAODTrack* newtrack = new((*fgAODTracks)[nc++]) AliAODTrack(*track); | |
c8de791b | 367 | |
113bc2bd | 368 | newtrack->SetLabel(newtrack->GetLabel() + nc0); |
5a922844 | 369 | } |
c8de791b | 370 | |
371 | for (Int_t i = 0; i < nc; i++) | |
372 | { | |
373 | AliAODTrack* track = (AliAODTrack*) fgAODTracks->At(i); | |
374 | track->ResetBit(kIsReferenced); | |
375 | track->SetUniqueID(0); | |
376 | } | |
377 | ||
378 | ||
5a922844 | 379 | // clusters |
380 | TClonesArray* clusters = aodH->GetEventToMerge()->GetCaloClusters(); | |
381 | Int_t ncl = clusters->GetEntries(); | |
382 | nc = fgAODCaloClusters->GetEntries(); | |
383 | for (Int_t i = 0; i < ncl; i++) { | |
384 | AliAODCaloCluster* cluster = (AliAODCaloCluster*) clusters->At(i); | |
c8de791b | 385 | new((*fgAODCaloClusters)[nc++]) AliAODCaloCluster(*cluster); |
5a922844 | 386 | } |
387 | // cells | |
388 | AliAODCaloCells* cellsA = aodH->GetEventToMerge()->GetEMCALCells(); | |
389 | Int_t ncells = cellsA->GetNumberOfCells(); | |
390 | nc = fgAODEmcalCells->GetNumberOfCells(); | |
391 | ||
392 | for (Int_t i = 0; i < ncells; i++) { | |
393 | Int_t cn = cellsA->GetCellNumber(i); | |
394 | Int_t pos = fgAODEmcalCells->GetCellPosition(cn); | |
395 | if (pos >= 0) { | |
396 | Double_t amp = cellsA->GetAmplitude(i) + fgAODEmcalCells->GetAmplitude(pos); | |
397 | fgAODEmcalCells->SetCell(pos, cn, amp); | |
398 | } else { | |
399 | Double_t amp = cellsA->GetAmplitude(i); | |
400 | fgAODEmcalCells->SetCell(nc++, cn, amp); | |
401 | fgAODEmcalCells->Sort(); | |
402 | } | |
403 | } | |
113bc2bd | 404 | |
405 | ||
406 | } // merging | |
c185e0db | 407 | |
5a922844 | 408 | handler->SetAODIsReplicated(); |
3f2431c4 | 409 | } |
410 | } | |
411 | ||
4d0a82af | 412 | // Call the user analysis |
5232d0de | 413 | UserExec(option); |
60a04972 | 414 | // Added protection in case the derived task is not an AOD producer. |
415 | AliAnalysisDataSlot *out0 = GetOutputSlot(0); | |
416 | if (out0 && out0->IsConnected()) PostData(0, fTreeA); | |
5232d0de | 417 | } |
418 | ||
4d0a82af | 419 | const char* AliAnalysisTaskSE::CurrentFileName() |
420 | { | |
421 | // Returns the current file name | |
259b7a8a | 422 | if( fInputHandler ) |
423 | return fInputHandler->GetTree()->GetCurrentFile()->GetName(); | |
424 | else if( fMCEvent ) | |
425 | return ((AliMCEventHandler*) ((AliAnalysisManager::GetAnalysisManager())->GetMCtruthEventHandler()))->TreeK()->GetCurrentFile()->GetName(); | |
8803dcb1 | 426 | else return ""; |
4d0a82af | 427 | } |
5232d0de | 428 | |
3cee83d7 | 429 | void AliAnalysisTaskSE::AddAODBranch(const char* cname, void* addobj, const char *fname) |
164e94ff | 430 | { |
431 | // Add a new branch to the aod tree | |
432 | AliAODHandler* handler = (AliAODHandler*) | |
433 | ((AliAnalysisManager::GetAnalysisManager())->GetOutputEventHandler()); | |
434 | if (handler) { | |
3cee83d7 | 435 | handler->AddBranch(cname, addobj, fname); |
164e94ff | 436 | } |
437 | } | |
3cee83d7 | 438 | |
439 | Bool_t AliAnalysisTaskSE::IsStandardAOD() const | |
440 | { | |
441 | // Check if the output AOD handler is configured for standard or delta AOD. | |
442 | // Users should first check that AODEvent() returns non-null. | |
443 | AliAODHandler* handler = (AliAODHandler*) | |
444 | ((AliAnalysisManager::GetAnalysisManager())->GetOutputEventHandler()); | |
445 | if (!handler) { | |
446 | Error("IsStandardAOD", "No AOD handler. Please use AODEvent() to check this first"); | |
447 | return kTRUE; | |
448 | } | |
449 | return handler->IsStandard(); | |
450 | } | |
1ec2c8dc | 451 | |
452 | Bool_t AliAnalysisTaskSE::Notify() | |
453 | { | |
454 | // Called for every change of input file | |
455 | if (InputEvent()->GetRunNumber() != fCurrentRunNumber) { | |
456 | fCurrentRunNumber = InputEvent()->GetRunNumber(); | |
457 | NotifyRun(); | |
458 | } | |
9a587f77 | 459 | return (UserNotify()); |
1ec2c8dc | 460 | } |
461 | ||
462 |