entry# stored for each event.
authormorsch <morsch@f7af4fe6-9843-0410-8265-dc069ae4e863>
Wed, 5 Mar 2008 16:54:10 +0000 (16:54 +0000)
committermorsch <morsch@f7af4fe6-9843-0410-8265-dc069ae4e863>
Wed, 5 Mar 2008 16:54:10 +0000 (16:54 +0000)
ANALYSIS/AliAnalysisTaskSE.cxx
ANALYSIS/AliAnalysisTaskSE.h

index aaf26e6..d5f11d0 100644 (file)
@@ -42,7 +42,9 @@ ClassImp(AliAnalysisTaskSE)
 AliAnalysisTaskSE::AliAnalysisTaskSE():
     AliAnalysisTask(),
     fDebug(0),
+    fEntry(0),
     fInputEvent(0x0),
+    fInputHandler(0x0),
     fOutputAOD(0x0),
     fMCEvent(0x0),
     fTreeA(0x0)
@@ -53,7 +55,9 @@ AliAnalysisTaskSE::AliAnalysisTaskSE():
 AliAnalysisTaskSE::AliAnalysisTaskSE(const char* name):
     AliAnalysisTask(name, "AnalysisTaskSE"),
     fDebug(0),
+    fEntry(0),
     fInputEvent(0x0),
+    fInputHandler(0x0),
     fOutputAOD(0x0),
     fMCEvent(0x0),
     fTreeA(0x0)
@@ -66,17 +70,21 @@ AliAnalysisTaskSE::AliAnalysisTaskSE(const char* name):
 AliAnalysisTaskSE::AliAnalysisTaskSE(const AliAnalysisTaskSE& obj):
     AliAnalysisTask(obj),
     fDebug(0),
+    fEntry(0),
     fInputEvent(0x0),
+    fInputHandler(0x0),
     fOutputAOD(0x0),
     fMCEvent(0x0),
     fTreeA(0x0)
 {
 // Copy constructor
-    fDebug      = obj.fDebug;
-    fInputEvent = obj.fInputEvent;
-    fOutputAOD  = obj.fOutputAOD;
-    fMCEvent    = obj.fMCEvent;
-    fTreeA      = obj.fTreeA;    
+    fDebug        = obj.fDebug;
+    fEntry        = obj.fEntry;
+    fInputEvent   = obj.fInputEvent;
+    fInputHandler = obj.fInputHandler;
+    fOutputAOD    = obj.fOutputAOD;
+    fMCEvent      = obj.fMCEvent;
+    fTreeA        = obj.fTreeA;    
 }
 
 
@@ -84,11 +92,13 @@ AliAnalysisTaskSE& AliAnalysisTaskSE::operator=(const AliAnalysisTaskSE& other)
 {
 // Assignment
     AliAnalysisTask::operator=(other);
-    fDebug      = other.fDebug;
-    fInputEvent = other.fInputEvent;
-    fOutputAOD  = other.fOutputAOD;
-    fMCEvent    = other.fMCEvent;
-    fTreeA      = other.fTreeA;    
+    fDebug        = other.fDebug;
+    fEntry        = other.fEntry;
+    fInputEvent   = other.fInputEvent;
+    fInputHandler = other.fInputHandler;
+    fOutputAOD    = other.fOutputAOD;
+    fMCEvent      = other.fMCEvent;
+    fTreeA        = other.fTreeA;    
     return *this;
 }
 
@@ -100,9 +110,9 @@ void AliAnalysisTaskSE::ConnectInputData(Option_t* /*option*/)
 //
 //  ESD
 //
-    AliInputEventHandler* handler = (AliInputEventHandler*) 
+    AliInputEventHandler* fInputHandler = (AliInputEventHandler*) 
        ((AliAnalysisManager::GetAnalysisManager())->GetInputEventHandler());
-    if (handler) fInputEvent = handler->GetEvent();
+    if (fInputHandler) fInputEvent = fInputHandler->GetEvent();
 //
 //  Monte Carlo
 //
@@ -130,7 +140,7 @@ void AliAnalysisTaskSE::Exec(Option_t* option)
 {
 //
 // Exec analysis of one event
-    PostData(0, fTreeA);
+    fEntry = fInputHandler->GetReadEntry();
     UserExec(option);
 }
 
index c47bf62..4e5b315 100644 (file)
@@ -10,6 +10,7 @@
 class AliVEvent;
 class AliAODEvent;
 class AliMCEvent;
+class AliInputEventHandler;
 class TTree;
 
 
@@ -37,12 +38,15 @@ class AliAnalysisTaskSE : public AliAnalysisTask
     virtual AliAODEvent* AODEvent()    {return fOutputAOD;}
     virtual TTree*       OutputTree()  {return fTreeA;}
     virtual AliMCEvent*  MCEvent()     {return fMCEvent;}
- protected:
-    Int_t         fDebug;        //  Debug flag
-    AliVEvent*    fInputEvent;   //! VEvent Input
-    AliAODEvent*  fOutputAOD;    //! AOD out 
-    AliMCEvent*   fMCEvent;      //! MC
-    TTree*        fTreeA;        //  AOD output Tree
+    virtual Long64_t     Entry()       {return fEntry;}
+  protected:
+    Int_t                 fDebug;           //  Debug flag
+    Int_t                 fEntry;           //  Current entry in the chain
+    AliVEvent*            fInputEvent;      //! VEvent Input
+    AliInputEventHandler* fInputHandler;    //! Input Handler
+    AliAODEvent*          fOutputAOD;       //! AOD out 
+    AliMCEvent*           fMCEvent;         //! MC
+    TTree*                fTreeA;           //  AOD output Tree
     ClassDef(AliAnalysisTaskSE, 1); // Analysis task for standard jet analysis
 };