- derive from AliAnalysisTaskSE
authormorsch <morsch@f7af4fe6-9843-0410-8265-dc069ae4e863>
Fri, 19 Feb 2010 16:44:02 +0000 (16:44 +0000)
committermorsch <morsch@f7af4fe6-9843-0410-8265-dc069ae4e863>
Fri, 19 Feb 2010 16:44:02 +0000 (16:44 +0000)
- Correct position of DefineOutput

PWG1/AliAnalysisTaskV0QA.cxx
PWG1/AliAnalysisTaskV0QA.h
PWG1/macros/AddTaskV0QA.C

index 9f121db..5e25e37 100644 (file)
@@ -14,7 +14,7 @@
 
 //#include "TLorentzVector.h"
 
-#include "AliAnalysisTask.h"
+#include "AliAnalysisTaskSE.h"
 #include "AliTrackReference.h"
 #include "AliKFParticle.h"
 #include "AliKFVertex.h"
 #include "AliAnalysisTaskV0QA.h"
 
 ClassImp(AliAnalysisTaskV0QA)
+AliAnalysisTaskV0QA::AliAnalysisTaskV0QA() :AliAnalysisTaskSE(), 
+fESD(0), 
+fStack(0),
+fMCtruth(0),
+fChain(0),
+fOutputContainer(0),
+fSparseV0(0),
+fSparseK0(0),
+fSparseL(0),
+fSparseAL(0),
+fnEv(0),
+fgDim(50),
+fnConvGamGeant(-1),
+fgConvGamGeantIndex(0),
+feNegConvGamGeantIndex(0),
+fePosConvGamGeantIndex(0),
+feNegConvGamGeantLength(0),
+fePosConvGamGeantLength(0),
+feNegConvGamSingleRecIndex(0),
+fePosConvGamSingleRecIndex(0),
+feNegConvGamV0RecIndex(0),
+fePosConvGamV0RecIndex(0),
+fConvGamV0RecIndexPos(0),
+fConvGamV0RecIndexNeg(0),
+fnDecayLGeant(-1),
+flDecayLGeantIndex(0),
+fpiNegDecayLGeantIndex(0),
+fpPosDecayLGeantIndex(0),
+fpiNegDecayLGeantLength(0),
+fpPosDecayLGeantLength(0),
+fpiNegDecayLSingleRecIndex(0),
+fpPosDecayLSingleRecIndex(0),
+fpiNegDecayLV0RecIndex(0),
+fpPosDecayLV0RecIndex(0),
+fDecayLV0RecIndexPos(0),
+fDecayLV0RecIndexNeg(0),
+fnDecayALGeant(-1),
+falDecayALGeantIndex(0),
+fpiPosDecayALGeantIndex(0),
+fapNegDecayALGeantIndex(0),
+fpiPosDecayALGeantLength(0),
+fapNegDecayALGeantLength(0),
+fpiPosDecayALSingleRecIndex(0),
+fapNegDecayALSingleRecIndex(0),
+fpiPosDecayALV0RecIndex(0),
+fapNegDecayALV0RecIndex(0),
+fDecayALV0RecIndexPos(0),
+fDecayALV0RecIndexNeg(0),
+fnDecayK0Geant(-1),
+fK0DecayK0GeantIndex(0),
+fpiNegDecayK0GeantIndex(0),
+fpiPosDecayK0GeantIndex(0),
+fpiNegDecayK0GeantLength(0),
+fpiPosDecayK0GeantLength(0),
+fpiNegDecayK0SingleRecIndex(0),
+fpiPosDecayK0SingleRecIndex(0),
+fpiNegDecayK0V0RecIndex(0),
+fpiPosDecayK0V0RecIndex(0),
+fDecayK0V0RecIndexPos(0),
+fDecayK0V0RecIndexNeg(0),
+fpiPosK0Index(-1),
+fpiNegK0Index(-1),
+fnTracksPrim(-1),
+ftpcRefit(0),
+fitsRefit(0),
+ftrdRefit(0),
+ftrdOut(0),
+fDim(37),
+fValueL(0),
+fValueAL(0),
+fValueK0(0),
+fValueV0(0),
+fxminV0(0),
+fxmaxV0(0),
+fbinsV0(0),
+fRefTPC(0),
+fclRefsN(0),
+fclRefsP(0)
+
+ {
+  // Default Constructor.
+
+ }
 
 //________________________________________________________________________
-AliAnalysisTaskV0QA::AliAnalysisTaskV0QA(const char *name) :AliAnalysisTask(name,""), 
+AliAnalysisTaskV0QA::AliAnalysisTaskV0QA(const char *name) :AliAnalysisTaskSE(name), 
 fESD(0), 
 fStack(0),
 fMCtruth(0),
@@ -112,14 +195,6 @@ fclRefsN(0),
 fclRefsP(0)
 
  {
-  // Constructor.
-  // Input slot #0 works with an Ntuple
-   DefineInput(0, TChain::Class());
-  // Output slot #0 writes into a TH1 container
-   // DefineOutput(0,TObjArray::Class());
-   DefineOutput(0,TList::Class());
-
-  // Reconstructed arrays
 
    fnEv=0;
    fDim=37; 
@@ -206,19 +281,8 @@ fclRefsP(0)
 
 
   AliLog::SetGlobalLogLevel(AliLog::kError);
-
-}
-
-//________________________________________________________________________
-void AliAnalysisTaskV0QA::ConnectInputData(Option_t *) {
-  printf("   ConnectInputData %s\n", GetName());
-  // Connect Input Data
-  
-  AliESDInputHandler* esdH = (AliESDInputHandler*) ((AliAnalysisManager::GetAnalysisManager())->GetInputEventHandler());
-  fESD = esdH->GetEvent();
-  
-  fChain = (TChain*)GetInputData(0);
-
+//
+  DefineOutput(1, TList::Class());
 }
 
 //_____________________________________________________
@@ -298,7 +362,7 @@ AliAnalysisTaskV0QA::~AliAnalysisTaskV0QA()
 
 
 //________________________________________________________________________
-void AliAnalysisTaskV0QA::CreateOutputObjects() {
+void AliAnalysisTaskV0QA::UserCreateOutputObjects() {
   // Create Ouptut objects
 
   for(Int_t d=0;d<fDim;d++){
@@ -660,9 +724,11 @@ void AliAnalysisTaskV0QA::CreateOutputObjects() {
 }
 
 //________________________________________________________________________
-void AliAnalysisTaskV0QA::Exec(Option_t *) {
+void AliAnalysisTaskV0QA::UserExec(Option_t *) {
   // Execution of the Task
 
+    fESD = dynamic_cast<AliESDEvent*>(InputEvent());
+    
   if (!fESD) {
     //cout<< "not a tree"<< endl;
     return;
@@ -1319,7 +1385,7 @@ void AliAnalysisTaskV0QA::Exec(Option_t *) {
   }
 
  
-  PostData(0,fOutputContainer );
+  PostData(1, fOutputContainer );
   
 
 }
index 06719a1..d60c69e 100644 (file)
@@ -8,7 +8,7 @@
 #include "THnSparse.h"
 #include "TList.h"
 #include "AliPID.h"
-#include "AliAnalysisTask.h"
+#include "AliAnalysisTaskSE.h"
 #include "AliAnalysisManager.h"
 #include "AliAnalysisDataContainer.h"
 
@@ -25,15 +25,16 @@ class AliMCEventHandler;
 class AliStack;
 class TChain;
 
-class AliAnalysisTaskV0QA : public AliAnalysisTask {
+class AliAnalysisTaskV0QA : public AliAnalysisTaskSE {
  public:
   //  AliAnalysisTaskV0QA() : AliAnalysisTask(), fESD(0), fChain(0) {}
-  AliAnalysisTaskV0QA(const char *name);
+    AliAnalysisTaskV0QA();
+    AliAnalysisTaskV0QA(const char *name);
+  
   virtual ~AliAnalysisTaskV0QA();
   
-  virtual void   ConnectInputData(Option_t *);
-  virtual void   CreateOutputObjects();
-  virtual void   Exec(Option_t *option);
+  virtual void   UserCreateOutputObjects();
+  virtual void   UserExec(Option_t *option);
   virtual void   Terminate(Option_t *);
 
   void InspectListOfChargedParticles();
index 626e2da..25ac78a 100644 (file)
@@ -61,7 +61,7 @@ AliAnalysisTaskV0QA *AddTaskV0QA(Bool_t bUseMCInfo=kTRUE)
    AliAnalysisDataContainer *coutput_v0QA =  
    mgr->CreateContainer("V0QA", TList::Class(), 
                        AliAnalysisManager::kOutputContainer, Form("%s.root", v0QA->GetName()));
-   mgr->ConnectOutput(v0QA, 0, coutput_v0QA);
+   mgr->ConnectOutput(v0QA, 1, coutput_v0QA);
        
 
    return v0QA;