]> git.uio.no Git - u/mrichter/AliRoot.git/blob - ANALYSIS/AliAnalysisTaskSE.cxx
fix codding violation in AliTRDseedV1 class
[u/mrichter/AliRoot.git] / ANALYSIS / AliAnalysisTaskSE.cxx
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"
27 #include "AliAnalysisCuts.h"
28 #include "AliAnalysisDataSlot.h"
29
30 #include "AliESDEvent.h"
31 #include "AliESDfriend.h"
32 #include "AliESD.h"
33 #include "AliAODEvent.h"
34 #include "AliAODHeader.h"
35 #include "AliAODTracklets.h"
36 #include "AliAODCaloCells.h"
37 #include "AliAODMCParticle.h"
38 #include "AliVEvent.h"
39 #include "AliAODHandler.h"
40 #include "AliAODInputHandler.h"
41 #include "AliMCEventHandler.h"
42 #include "AliInputEventHandler.h"
43 #include "AliESDInputHandler.h"
44 #include "AliMCEvent.h"
45 #include "AliStack.h"
46 #include "AliLog.h"
47 #include "AliAODDimuon.h"
48
49
50 ClassImp(AliAnalysisTaskSE)
51
52 ////////////////////////////////////////////////////////////////////////
53 AliAODHeader*    AliAnalysisTaskSE::fgAODHeader         = NULL;
54 TClonesArray*    AliAnalysisTaskSE::fgAODTracks         = NULL;
55 TClonesArray*    AliAnalysisTaskSE::fgAODVertices       = NULL;
56 TClonesArray*    AliAnalysisTaskSE::fgAODV0s            = NULL;
57 TClonesArray*    AliAnalysisTaskSE::fgAODPMDClusters    = NULL;
58 TClonesArray*    AliAnalysisTaskSE::fgAODJets           = NULL;
59 TClonesArray*    AliAnalysisTaskSE::fgAODFMDClusters    = NULL;
60 TClonesArray*    AliAnalysisTaskSE::fgAODCaloClusters   = NULL;
61 TClonesArray*    AliAnalysisTaskSE::fgAODMCParticles    = NULL;
62 AliAODTracklets* AliAnalysisTaskSE::fgAODTracklets      = NULL;
63 AliAODCaloCells* AliAnalysisTaskSE::fgAODEmcalCells     = NULL;
64 AliAODCaloCells* AliAnalysisTaskSE::fgAODPhosCells      = NULL;
65 TClonesArray*    AliAnalysisTaskSE::fgAODDimuons        = NULL;
66
67 AliAnalysisTaskSE::AliAnalysisTaskSE():
68     AliAnalysisTask(),
69     fDebug(0),
70     fEntry(0),
71     fInputEvent(0x0),
72     fESDfriend(0x0),
73     fInputHandler(0x0),
74     fOutputAOD(0x0),
75     fMCEvent(0x0),
76     fTreeA(0x0),
77     fCurrentRunNumber(-1),
78     fHistosQA(0x0),
79     fOfflineTriggerMask(0)
80 {
81   // Default constructor
82 }
83
84 AliAnalysisTaskSE::AliAnalysisTaskSE(const char* name):
85     AliAnalysisTask(name, "AnalysisTaskSE"),
86     fDebug(0),
87     fEntry(0),
88     fInputEvent(0x0),
89     fESDfriend(0x0),
90     fInputHandler(0x0),
91     fOutputAOD(0x0),
92     fMCEvent(0x0),
93     fTreeA(0x0),
94     fCurrentRunNumber(-1),
95     fHistosQA(0x0),
96     fOfflineTriggerMask(0)
97 {
98   // Default constructor
99     DefineInput (0, TChain::Class());
100     DefineOutput(0,  TTree::Class());
101 }
102
103 AliAnalysisTaskSE::AliAnalysisTaskSE(const AliAnalysisTaskSE& obj):
104     AliAnalysisTask(obj),
105     fDebug(0),
106     fEntry(0),
107     fInputEvent(0x0),
108     fESDfriend(0x0),
109     fInputHandler(0x0),
110     fOutputAOD(0x0),
111     fMCEvent(0x0),
112     fTreeA(0x0),
113     fCurrentRunNumber(-1),
114     fHistosQA(0x0),
115     fOfflineTriggerMask(0)
116 {
117 // Copy constructor
118     fDebug            = obj.fDebug;
119     fEntry            = obj.fEntry;
120     fInputEvent       = obj.fInputEvent;
121     fESDfriend        = obj.fESDfriend;
122     fInputHandler     = obj.fInputHandler;
123     fOutputAOD        = obj.fOutputAOD;
124     fMCEvent          = obj.fMCEvent;
125     fTreeA            = obj.fTreeA;    
126     fCurrentRunNumber = obj.fCurrentRunNumber;
127     fHistosQA         = obj.fHistosQA;
128
129 }
130
131
132 AliAnalysisTaskSE& AliAnalysisTaskSE::operator=(const AliAnalysisTaskSE& other)
133 {
134 // Assignment
135     AliAnalysisTask::operator=(other);
136     fDebug            = other.fDebug;
137     fEntry            = other.fEntry;
138     fInputEvent       = other.fInputEvent;
139     fESDfriend        = other.fESDfriend;
140     fInputHandler     = other.fInputHandler;
141     fOutputAOD        = other.fOutputAOD;
142     fMCEvent          = other.fMCEvent;
143     fTreeA            = other.fTreeA;    
144     fCurrentRunNumber = other.fCurrentRunNumber;
145     fHistosQA         = other.fHistosQA;
146     fOfflineTriggerMask = other.fOfflineTriggerMask;
147     return *this;
148 }
149
150
151 void AliAnalysisTaskSE::ConnectInputData(Option_t* /*option*/)
152 {
153 // Connect the input data
154     if (fDebug > 1) printf("AnalysisTaskSE::ConnectInputData() \n");
155 //
156 //  ESD
157 //
158     fInputHandler = (AliInputEventHandler*) 
159          ((AliAnalysisManager::GetAnalysisManager())->GetInputEventHandler());
160 //
161 //  Monte Carlo
162 //
163     AliMCEventHandler*    mcH = 0;
164     mcH = (AliMCEventHandler*) ((AliAnalysisManager::GetAnalysisManager())->GetMCtruthEventHandler());
165     if (mcH) {
166         fMCEvent = mcH->MCEvent();
167     } 
168     
169     if (fInputHandler) {
170         if ((fInputHandler->GetTree())->GetBranch("ESDfriend."))
171             fESDfriend = ((AliESDInputHandler*)fInputHandler)->GetESDfriend();
172
173         fInputEvent = fInputHandler->GetEvent();
174     } else if( fMCEvent ) {
175          AliWarning("No Input Event Handler connected, only MC Truth Event Handler") ; 
176     } else {
177          AliError("No Input Event Handler connected") ; 
178          return ; 
179     }
180 }
181
182 void AliAnalysisTaskSE::CreateOutputObjects()
183 {
184 // Create the output container
185 //
186 //  Default AOD
187     if (fDebug > 1) printf("AnalysisTaskSE::CreateOutPutData() \n");
188
189     AliAODHandler* handler = dynamic_cast<AliAODHandler*> 
190          ((AliAnalysisManager::GetAnalysisManager())->GetOutputEventHandler());
191     
192     Bool_t merging = kFALSE;
193     AliAODInputHandler* aodIH = static_cast<AliAODInputHandler*>((AliAnalysisManager::GetAnalysisManager())->GetInputEventHandler());
194     if (aodIH) {
195         if (aodIH->GetMergeEvents()) merging = kTRUE;
196     }
197     
198
199     // Check if AOD replication has been required
200     
201     if (handler) {
202         fOutputAOD   = handler->GetAOD();
203         fTreeA = handler->GetTree();
204         if (fOutputAOD && !(handler->IsStandard())) {
205             if ((handler->NeedsHeaderReplication()) && !(fgAODHeader)) 
206                 {
207                  if (fDebug > 1) AliInfo("Replicating header");
208                  fgAODHeader = new AliAODHeader;
209                  handler->AddBranch("AliAODHeader", &fgAODHeader);
210                 }
211             if ((handler->NeedsTracksBranchReplication() || merging) && !(fgAODTracks))      
212             {   
213                 if (fDebug > 1) AliInfo("Replicating track branch\n");
214                 fgAODTracks = new TClonesArray("AliAODTrack",500);
215                 fgAODTracks->SetName("tracks");
216                 handler->AddBranch("TClonesArray", &fgAODTracks);
217             }    
218             if ((handler->NeedsVerticesBranchReplication() || merging) && !(fgAODVertices))
219             {
220                 if (fDebug > 1) AliInfo("Replicating vertices branch\n");
221                 fgAODVertices = new TClonesArray("AliAODVertex",500);
222                 fgAODVertices->SetName("vertices");
223                 handler->AddBranch("TClonesArray", &fgAODVertices);
224             }   
225             if ((handler->NeedsV0sBranchReplication()) && !(fgAODV0s))    
226             {   
227                 if (fDebug > 1) AliInfo("Replicating V0s branch\n");
228                 fgAODV0s = new TClonesArray("AliAODv0",500);
229                 fgAODV0s->SetName("v0s");
230                 handler->AddBranch("TClonesArray", &fgAODV0s);
231             }
232             if ((handler->NeedsTrackletsBranchReplication()) && !(fgAODTracklets))        
233             {   
234                 if (fDebug > 1) AliInfo("Replicating Tracklets branch\n");
235                 fgAODTracklets = new AliAODTracklets("tracklets","tracklets");
236                 handler->AddBranch("AliAODTracklets", &fgAODTracklets);
237             }
238             if ((handler->NeedsPMDClustersBranchReplication()) && !(fgAODPMDClusters))    
239             {   
240                 if (fDebug > 1) AliInfo("Replicating PMDClusters branch\n");
241                 fgAODPMDClusters = new TClonesArray("AliAODPmdCluster",500);
242                 fgAODPMDClusters->SetName("pmdClusters");
243                 handler->AddBranch("TClonesArray", &fgAODPMDClusters);
244             }
245             if ((handler->NeedsJetsBranchReplication() || merging) && !(fgAODJets))       
246             {   
247                 if (fDebug > 1) AliInfo("Replicating Jets branch\n");
248                 fgAODJets = new TClonesArray("AliAODJet",500);
249                 fgAODJets->SetName("jets");
250                 handler->AddBranch("TClonesArray", &fgAODJets);
251             }
252             if ((handler->NeedsFMDClustersBranchReplication()) && !(fgAODFMDClusters))    
253             {   
254                 AliInfo("Replicating FMDClusters branch\n");
255                 fgAODFMDClusters = new TClonesArray("AliAODFmdCluster",500);
256                 fgAODFMDClusters->SetName("fmdClusters");
257                 handler->AddBranch("TClonesArray", &fgAODFMDClusters);
258             }
259             if ((handler->NeedsCaloClustersBranchReplication() || merging) && !(fgAODCaloClusters))       
260             {   
261                 if (fDebug > 1) AliInfo("Replicating CaloClusters branch\n");
262                 fgAODCaloClusters = new TClonesArray("AliAODCaloCluster",500);
263                 fgAODCaloClusters->SetName("caloClusters");
264                 handler->AddBranch("TClonesArray", &fgAODCaloClusters);
265
266                 fgAODEmcalCells = new AliAODCaloCells();
267                 fgAODEmcalCells->SetName("emcalCells");
268                 handler->AddBranch("AliAODCaloCells", &fgAODEmcalCells);
269
270                 fgAODPhosCells = new AliAODCaloCells();
271                 fgAODPhosCells->SetName("phosCells");
272                 handler->AddBranch("AliAODCaloCells", &fgAODPhosCells);
273             }
274             if ((handler->NeedsMCParticlesBranchReplication() || merging) && !(fgAODMCParticles))         
275             {   
276                 if (fDebug > 1) AliInfo("Replicating MCParticles branch\n");
277                 fgAODMCParticles = new TClonesArray("AliAODMCParticle",500);
278                 fgAODMCParticles->SetName("mcparticles");
279                 handler->AddBranch("TClonesArray", &fgAODMCParticles);
280             }
281             if ((handler->NeedsDimuonsBranchReplication() || merging) && !(fgAODDimuons))      
282             {   
283                 if (fDebug > 1) AliInfo("Replicating dimuon branch\n");
284                 fgAODDimuons = new TClonesArray("AliAODDimuon",0);
285                 fgAODDimuons->SetName("dimuons");
286                 handler->AddBranch("TClonesArray", &fgAODDimuons);
287             }    
288
289             // cache the pointerd in the AODEvent
290             fOutputAOD->GetStdContent();
291         }
292     } else {
293         AliWarning("No AOD Event Handler connected.") ; 
294     }
295     UserCreateOutputObjects();
296 }
297
298 void AliAnalysisTaskSE::Exec(Option_t* option)
299 {
300 //
301 // Exec analysis of one event
302     if ( fDebug >= 10)
303       printf("Task is active %5d\n", IsActive());
304     
305     if (fDebug > 1) AliInfo("AliAnalysisTaskSE::Exec() \n");
306 //
307     AliAODHandler* handler = dynamic_cast<AliAODHandler*> 
308         ((AliAnalysisManager::GetAnalysisManager())->GetOutputEventHandler());
309
310     AliAODInputHandler* aodH = dynamic_cast<AliAODInputHandler*>(fInputHandler);
311 //
312 // Was event selected ? If no event selection mechanism, the event SHOULD be selected (AG)
313     UInt_t isSelected = AliVEvent::kAny;
314     if( fInputHandler && fInputHandler->GetEventSelection()) {
315       // Get the actual offline trigger mask for the event
316       isSelected = fInputHandler->IsEventSelected();
317       // If the task had a selection AND it with the event mask (i.e. event interesting for the task if at least one matching trigger)
318       if (fOfflineTriggerMask) isSelected &= fOfflineTriggerMask;
319     }
320 //  Functionality below moved in the filter tasks (AG)
321 //    if (handler) handler->SetFillAOD(isSelected);
322
323     if( fInputHandler ) {
324         fEntry = fInputHandler->GetReadEntry();
325         fESDfriend = ((AliESDInputHandler*)fInputHandler)->GetESDfriend();
326     }
327     
328
329 // Notify the change of run number
330     if (InputEvent() && (InputEvent()->GetRunNumber() != fCurrentRunNumber)) {
331         fCurrentRunNumber = InputEvent()->GetRunNumber();
332         NotifyRun();
333     }    
334            
335     else if( fMCEvent )
336        fEntry = fMCEvent->Header()->GetEvent(); 
337     if ( !((Entry()-1)%100) && fDebug > 0) 
338          AliInfo(Form("%s ----> Processing event # %lld", CurrentFileName(), Entry()));
339
340     
341     
342
343     if (handler && aodH) {
344         fMCEvent = aodH->MCEvent();
345         Bool_t merging = aodH->GetMergeEvents();
346         
347         if (!(handler->IsStandard()) && !(handler->AODIsReplicated())) {
348             if ((handler->NeedsHeaderReplication()) && (fgAODHeader))
349             {
350               // copy the contents by assigment
351               *fgAODHeader =  *(dynamic_cast<AliAODHeader*>(InputEvent()->GetHeader()));
352             }
353             if ((handler->NeedsTracksBranchReplication() || merging) && (fgAODTracks))
354             {
355                 TClonesArray* tracks = (dynamic_cast<AliAODEvent*>(InputEvent()))->GetTracks();
356                 new (fgAODTracks) TClonesArray(*tracks);
357             }
358             if ((handler->NeedsVerticesBranchReplication() || merging) && (fgAODVertices))
359             {
360                 TClonesArray* vertices = (dynamic_cast<AliAODEvent*>(InputEvent()))->GetVertices();
361                 new (fgAODVertices) TClonesArray(*vertices);
362             }
363             if ((handler->NeedsV0sBranchReplication()) && (fgAODV0s))
364             {
365                 TClonesArray* v0s = (dynamic_cast<AliAODEvent*>(InputEvent()))->GetV0s();
366                 new (fgAODV0s) TClonesArray(*v0s);
367             }
368             if ((handler->NeedsTrackletsBranchReplication()) && (fgAODTracklets))
369             {
370               *fgAODTracklets = *(dynamic_cast<AliAODEvent*>(InputEvent()))->GetTracklets();
371             }
372             if ((handler->NeedsPMDClustersBranchReplication()) && (fgAODPMDClusters))
373             {
374                 TClonesArray* pmdClusters = (dynamic_cast<AliAODEvent*>(InputEvent()))->GetPmdClusters();
375                 new (fgAODPMDClusters) TClonesArray(*pmdClusters);
376             }
377             if ((handler->NeedsJetsBranchReplication() || merging) && (fgAODJets))
378             {
379                 TClonesArray* jets = (dynamic_cast<AliAODEvent*>(InputEvent()))->GetJets();
380                 new (fgAODJets) TClonesArray(*jets);
381             }
382             if ((handler->NeedsFMDClustersBranchReplication()) && (fgAODFMDClusters))
383             {
384                 TClonesArray* fmdClusters = (dynamic_cast<AliAODEvent*>(InputEvent()))->GetFmdClusters();
385                 new (fgAODFMDClusters) TClonesArray(*fmdClusters);
386             }
387             if ((handler->NeedsCaloClustersBranchReplication() || merging) && (fgAODCaloClusters))
388             {
389                 TClonesArray* caloClusters = (dynamic_cast<AliAODEvent*>(InputEvent()))->GetCaloClusters();
390                 new (fgAODCaloClusters) TClonesArray(*caloClusters);
391             }
392
393             if ((handler->NeedsMCParticlesBranchReplication() || merging) && (fgAODMCParticles))
394             {
395                 TClonesArray* mcParticles = (TClonesArray*) ((dynamic_cast<AliAODEvent*>(InputEvent()))->FindListObject("mcparticles"));
396                 new (fgAODMCParticles) TClonesArray(*mcParticles);
397             }
398             
399             if ((handler->NeedsDimuonsBranchReplication() || merging) && (fgAODDimuons))
400             {
401                 fgAODDimuons->Clear();
402                 TClonesArray& dimuons = *fgAODDimuons;
403                 TClonesArray& tracksnew = *fgAODTracks;
404                 
405                 Int_t nMuonTrack[10]; 
406                 for(Int_t imuon = 0; imuon < 10; imuon++) nMuonTrack[imuon] = 0;
407                 Int_t nMuons=0;
408                 for(Int_t ii=0; ii < fgAODTracks->GetEntries(); ii++){
409                     AliAODTrack *track = (AliAODTrack*) fgAODTracks->At(ii);
410                     if(track->IsMuonTrack()) {
411                         nMuonTrack[nMuons]= ii;
412                         nMuons++;
413                     }  
414                 }
415                 Int_t jDimuons=0;
416                 if(nMuons >= 2){
417                     for(Int_t i = 0; i < nMuons; i++){
418                         Int_t index0 = nMuonTrack[i];
419                         for(Int_t j = i+1; j < nMuons; j++){
420                             Int_t index1 = nMuonTrack[j];
421                             tracksnew.At(index0)->ResetBit(kIsReferenced);
422                             tracksnew.At(index0)->SetUniqueID(0); 
423                             tracksnew.At(index1)->ResetBit(kIsReferenced);
424                             tracksnew.At(index1)->SetUniqueID(0);
425                             new(dimuons[jDimuons++]) AliAODDimuon(tracksnew.At(index0),tracksnew.At(index1));
426                         }
427                     }    
428                 }
429             }
430             
431             // Additional merging if needed
432             if (merging) {
433                 // mcParticles
434                 TClonesArray* mcparticles = (TClonesArray*) ((aodH->GetEventToMerge())->FindListObject("mcparticles"));
435                 Int_t npart = mcparticles->GetEntries();
436                 Int_t nc = fgAODMCParticles->GetEntries();
437                 Int_t nc0 = nc;
438                 
439                 for (Int_t i = 0; i < npart; i++) {
440                     AliAODMCParticle* particle = (AliAODMCParticle*) mcparticles->At(i);
441                     new((*fgAODMCParticles)[nc++]) AliAODMCParticle(*particle);
442                 }
443                 
444                 // tracks
445                 TClonesArray* tracks = aodH->GetEventToMerge()->GetTracks();
446                 Int_t ntr = tracks->GetEntries();
447                 nc  = fgAODTracks->GetEntries();        
448                 for (Int_t i = 0; i < ntr; i++) {
449                     AliAODTrack*    track = (AliAODTrack*) tracks->At(i);
450                     AliAODTrack* newtrack = new((*fgAODTracks)[nc++]) AliAODTrack(*track);
451                     newtrack->SetLabel(newtrack->GetLabel() + nc0);
452                 }
453
454                 for (Int_t i = 0; i < nc; i++) 
455                 {
456                     AliAODTrack* track = (AliAODTrack*) fgAODTracks->At(i);
457                     track->ResetBit(kIsReferenced);
458                     track->SetUniqueID(0);
459                 }
460                 
461                 
462                 // clusters
463                 TClonesArray* clusters = aodH->GetEventToMerge()->GetCaloClusters();
464                 Int_t ncl  = clusters->GetEntries();
465                 nc         =  fgAODCaloClusters->GetEntries();
466                 for (Int_t i = 0; i < ncl; i++) {
467                     AliAODCaloCluster*    cluster = (AliAODCaloCluster*) clusters->At(i);
468                     new((*fgAODCaloClusters)[nc++]) AliAODCaloCluster(*cluster);
469                 }
470                 // cells
471                 AliAODCaloCells* cellsA = aodH->GetEventToMerge()->GetEMCALCells();
472                 Int_t ncells  = cellsA->GetNumberOfCells();
473                 nc = fgAODEmcalCells->GetNumberOfCells();
474                 
475                 for (Int_t i  = 0; i < ncells; i++) {
476                     Int_t cn  = cellsA->GetCellNumber(i);
477                     Int_t pos = fgAODEmcalCells->GetCellPosition(cn);
478                     if (pos >= 0) {
479                         Double_t amp = cellsA->GetAmplitude(i) + fgAODEmcalCells->GetAmplitude(pos);
480                         fgAODEmcalCells->SetCell(pos, cn, amp);
481                     } else {
482                         Double_t amp = cellsA->GetAmplitude(i);
483                         fgAODEmcalCells->SetCell(nc++, cn, amp);
484                         fgAODEmcalCells->Sort();
485                     }
486                 }
487                 
488                 
489             } // merging
490             
491             handler->SetAODIsReplicated();
492         }
493     }
494
495 // Call the user analysis    
496     AliMCEventHandler*    mcH = 0;
497     mcH = (AliMCEventHandler*) ((AliAnalysisManager::GetAnalysisManager())->GetMCtruthEventHandler());
498
499     if (!mcH) {
500         if (isSelected) 
501             UserExec(option);
502     } else {
503         if (isSelected && (mcH->InitOk())) 
504             UserExec(option);
505     }
506     
507 // Added protection in case the derived task is not an AOD producer.
508     AliAnalysisDataSlot *out0 = GetOutputSlot(0);
509     if (out0 && out0->IsConnected()) PostData(0, fTreeA);    
510 }
511
512 const char* AliAnalysisTaskSE::CurrentFileName()
513 {
514 // Returns the current file name    
515     if( fInputHandler )
516       return fInputHandler->GetTree()->GetCurrentFile()->GetName();
517     else if( fMCEvent )
518       return ((AliMCEventHandler*) ((AliAnalysisManager::GetAnalysisManager())->GetMCtruthEventHandler()))->TreeK()->GetCurrentFile()->GetName();
519     else return "";
520 }
521
522 void AliAnalysisTaskSE::AddAODBranch(const char* cname, void* addobj, const char *fname)
523 {
524     // Add a new branch to the aod tree
525     AliAODHandler* handler = dynamic_cast<AliAODHandler*> 
526         ((AliAnalysisManager::GetAnalysisManager())->GetOutputEventHandler());
527     if (handler) {
528         handler->AddBranch(cname, addobj, fname);
529     }
530 }
531
532 Bool_t AliAnalysisTaskSE::IsStandardAOD() const
533 {
534 // Check if the output AOD handler is configured for standard or delta AOD.
535 // Users should first check that AODEvent() returns non-null.
536     AliAODHandler* handler = dynamic_cast<AliAODHandler*> 
537          ((AliAnalysisManager::GetAnalysisManager())->GetOutputEventHandler());
538     if (!handler) {
539        Error("IsStandardAOD", "No AOD handler. Please use AODEvent() to check this first");
540        return kTRUE;
541     }
542     return handler->IsStandard();   
543 }
544
545 Bool_t AliAnalysisTaskSE::Notify()
546 {
547     return (UserNotify());
548 }
549
550