Streamlining with the analyis framework:
authormorsch <morsch@f7af4fe6-9843-0410-8265-dc069ae4e863>
Thu, 25 Feb 2010 09:20:23 +0000 (09:20 +0000)
committermorsch <morsch@f7af4fe6-9843-0410-8265-dc069ae4e863>
Thu, 25 Feb 2010 09:20:23 +0000 (09:20 +0000)
- tasks derive from AliAnalysisTaskSE
- slots 0 reserved for standard I/O
- tasks have default constructor
- DefineInput, DefineOutput in non-default constructor

28 files changed:
PWG1/TRD/AliTRDalignmentTask.cxx
PWG1/TRD/AliTRDalignmentTask.h
PWG1/TRD/AliTRDcalibration.cxx
PWG1/TRD/AliTRDcalibration.h
PWG1/TRD/AliTRDcheckDET.cxx
PWG1/TRD/AliTRDcheckDET.h
PWG1/TRD/AliTRDcheckESD.cxx
PWG1/TRD/AliTRDcheckESD.h
PWG1/TRD/AliTRDcheckPID.cxx
PWG1/TRD/AliTRDcheckPID.h
PWG1/TRD/AliTRDclusterResolution.cxx
PWG1/TRD/AliTRDclusterResolution.h
PWG1/TRD/AliTRDefficiency.cxx
PWG1/TRD/AliTRDefficiency.h
PWG1/TRD/AliTRDefficiencyMC.cxx
PWG1/TRD/AliTRDefficiencyMC.h
PWG1/TRD/AliTRDinfoGen.cxx
PWG1/TRD/AliTRDinfoGen.h
PWG1/TRD/AliTRDmultiplicity.cxx
PWG1/TRD/AliTRDmultiplicity.h
PWG1/TRD/AliTRDpidRefMaker.cxx
PWG1/TRD/AliTRDpidRefMaker.h
PWG1/TRD/AliTRDpidRefMakerLQ.cxx
PWG1/TRD/AliTRDpidRefMakerLQ.h
PWG1/TRD/AliTRDrecoTask.cxx
PWG1/TRD/AliTRDrecoTask.h
PWG1/TRD/AliTRDresolution.cxx
PWG1/TRD/AliTRDresolution.h

index 37681fa..157afcd 100644 (file)
@@ -41,13 +41,20 @@ ClassImp(AliTRDalignmentTask)
 
 //________________________________________________________
 AliTRDalignmentTask::AliTRDalignmentTask()
-  :AliTRDrecoTask("Alignment", "TRD alignment")
+  :AliTRDrecoTask()
   ,fTree(0x0)
   ,fArray(0x0)
 {
   InitFunctorList();
-  DefineOutput(1, TTree::Class());
+}
 
+AliTRDalignmentTask::AliTRDalignmentTask(char* name)
+  :AliTRDrecoTask(name, "TRD alignment")
+  ,fTree(0x0)
+  ,fArray(0x0)
+{
+  InitFunctorList();
+  DefineOutput(2, TTree::Class());
 }
 
 //________________________________________________________
@@ -58,10 +65,10 @@ AliTRDalignmentTask::~AliTRDalignmentTask()
 
 
 //________________________________________________________
-void AliTRDalignmentTask::CreateOutputObjects()
+void AliTRDalignmentTask::UserCreateOutputObjects()
 {
   // spatial resolution
-  OpenFile(1, "RECREATE");
+  OpenFile(2, "RECREATE");
 
   fTree = new TTree("spTree", "Tree with track space point arrays");
   fTree->Branch("SP","AliTrackPointArray", &fArray);
@@ -69,12 +76,12 @@ void AliTRDalignmentTask::CreateOutputObjects()
 
 
 //________________________________________________________
-void AliTRDalignmentTask::Exec(Option_t *opt)
+void AliTRDalignmentTask::UserExec(Option_t *opt)
 {
 // Documentation to come
 
   AliTRDrecoTask::Exec(opt);
-  PostData(1, fTree);
+  PostData(2, fTree);
 }
 
 
index 568894a..30e4402 100644 (file)
@@ -24,10 +24,11 @@ class AliTRDalignmentTask : public AliTRDrecoTask
 public:
 
   AliTRDalignmentTask();
+  AliTRDalignmentTask(char* name);
   virtual ~AliTRDalignmentTask();
   
-  void    CreateOutputObjects();
-  void    Exec(Option_t *opt);
+  void    UserCreateOutputObjects();
+  void    UserExec(Option_t *opt);
   TH1*    PlotTrackPoints(const AliTRDtrackV1 *track=0x0);
   Bool_t  PostProcess() { return kTRUE;}
   
index b8e6c04..1177e90 100644 (file)
@@ -69,7 +69,7 @@ ClassImp(AliTRDcalibration)
 
 //________________________________________________________________________
 AliTRDcalibration::AliTRDcalibration() 
-  :AliTRDrecoTask("Calibration", "Calibration on tracks")
+  :AliTRDrecoTask()
   ,fTrackInfo(0)
   ,ftrdTrack(0)
   ,fcl(0)
@@ -119,6 +119,59 @@ AliTRDcalibration::AliTRDcalibration()
     }
 
 }  
+
+AliTRDcalibration::AliTRDcalibration(char* name) 
+  :AliTRDrecoTask(name, "Calibration on tracks")
+  ,fTrackInfo(0)
+  ,ftrdTrack(0)
+  ,fcl(0)
+  ,fTRDCalibraFillHisto(0)
+  ,fNbTRDTrack(0)
+  ,fNbTRDTrackOffline(0)
+  ,fNbTRDTrackStandalone(0)
+  ,fNbTRDTracklet(0)
+  ,fNbTRDTrackletOffline(0)
+  ,fNbTRDTrackletStandalone(0)
+  ,fNbTimeBin(0x0)
+  ,fNbTimeBinOffline(0x0)
+  ,fNbTimeBinStandalone(0x0)
+  ,fNbClusters(0)
+  ,fNbClustersOffline(0)
+  ,fNbClustersStandalone(0)
+  ,fPHSM(0)
+  ,fCHSM(0)
+  ,fPHSum(0)
+  ,fCHSum(0)
+  ,fDetSum(0)
+  ,fDetSumVector(0)
+  ,fHisto2d(kTRUE)
+  ,fVector2d(kFALSE)
+  ,fVdriftLinear(kTRUE)
+  ,flow(0)
+  ,fhigh(30)
+  ,fNbTimeBins(0)
+  ,ffillZero(kFALSE)
+  ,fnormalizeNbOfCluster(kFALSE)
+  ,fmaxCluster(0)
+  ,fOfflineTracks(kFALSE)
+  ,fStandaloneTracks(kFALSE)
+  ,fCompressPerDetector(kFALSE)
+  ,fGraph(0x0)
+  ,fArrayCalib(0x0)
+  ,fPostProcess(kFALSE)
+{
+  // Constructor
+  
+  fNRefFigures = 17;
+
+  for(Int_t k = 0; k < 3; k++)
+    {
+      fNz[k]=0;
+      fNrphi[k]=0;
+    }
+
+}  
+
 //________________________________________________________________________
 AliTRDcalibration::~AliTRDcalibration() 
 {
@@ -147,11 +200,11 @@ AliTRDcalibration::~AliTRDcalibration()
    
 }
 //________________________________________________________________________
-void AliTRDcalibration::CreateOutputObjects() 
+void AliTRDcalibration::UserCreateOutputObjects() 
 {
   // Create output objects
 
-  OpenFile(0, "RECREATE");
+  OpenFile(1, "RECREATE");
   
   // Number of time bins
   if(fNbTimeBins==0) {
@@ -297,7 +350,7 @@ void AliTRDcalibration::CreateOutputObjects()
 }
 
 //________________________________________________________________________
-void AliTRDcalibration::Exec(Option_t *) 
+void AliTRDcalibration::UserExec(Option_t *) 
 {
   //
   // Execute function where the reference data are filled
@@ -418,7 +471,7 @@ void AliTRDcalibration::Exec(Option_t *)
   //printf("Nbof tracks %d\n",nbTrdTracks);
   
   // Post output data
-  PostData(0, fContainer);
+  PostData(1, fContainer);
 
   //printf("post container\n");
   
index db1dcc5..7ee8148 100644 (file)
@@ -55,10 +55,11 @@ public:
   
 
   AliTRDcalibration();
+  AliTRDcalibration(char* name);
   virtual ~AliTRDcalibration();
   
-  virtual void    CreateOutputObjects();
-  virtual void    Exec(Option_t *option);
+  virtual void    UserCreateOutputObjects();
+  virtual void    UserExec(Option_t *option);
   virtual void    Terminate(Option_t *);
   virtual Bool_t  GetRefFigure(Int_t ifig);
   virtual Bool_t  PostProcess();
index ce50023..bea98d7 100644 (file)
@@ -44,6 +44,7 @@
 #include <TProfile.h>
 #include <TProfile2D.h>
 #include <TROOT.h>
+#include <TChain.h>
 
 #include "AliLog.h"
 #include "AliTRDcluster.h"
@@ -74,7 +75,7 @@ ClassImp(AliTRDcheckDET)
 
 //_______________________________________________________
 AliTRDcheckDET::AliTRDcheckDET():
-  AliTRDrecoTask("checkDET", "Basic TRD data checker")
+  AliTRDrecoTask()
   ,fEventInfo(0x0)
   ,fTriggerNames(0x0)
   ,fReconstructor(0x0)
@@ -84,13 +85,29 @@ AliTRDcheckDET::AliTRDcheckDET():
   //
   // Default constructor
   //
-  DefineInput(1,AliTRDeventInfo::Class());
+}
+
+
+AliTRDcheckDET::AliTRDcheckDET(char* name):
+  AliTRDrecoTask(name, "Basic TRD data checker")
+  ,fEventInfo(0x0)
+  ,fTriggerNames(0x0)
+  ,fReconstructor(0x0)
+  ,fGeo(0x0)
+  ,fFlags(0)
+{
+  //
+  // Default constructor
+  //
+  DefineInput(2, AliTRDeventInfo::Class());
+
   fReconstructor = new AliTRDReconstructor;
   fReconstructor->SetRecoParam(AliTRDrecoParam::GetLowFluxParam());
   fGeo = new AliTRDgeometry;
   InitFunctorList();
 }
 
+
 //_______________________________________________________
 AliTRDcheckDET::~AliTRDcheckDET(){
   //
@@ -107,21 +124,21 @@ void AliTRDcheckDET::ConnectInputData(Option_t *opt){
   // Connect the Input data with the task
   //
   AliTRDrecoTask::ConnectInputData(opt);
-  fEventInfo = dynamic_cast<AliTRDeventInfo *>(GetInputData(1));
+  fEventInfo = dynamic_cast<AliTRDeventInfo *>(GetInputData(2));
 }
 
 //_______________________________________________________
-void AliTRDcheckDET::CreateOutputObjects(){
+void AliTRDcheckDET::UserCreateOutputObjects(){
   //
   // Create Output Objects
   //
-  OpenFile(0,"RECREATE");
+  OpenFile(1,"RECREATE");
   fContainer = Histos();
   if(!fTriggerNames) fTriggerNames = new TMap();
 }
 
 //_______________________________________________________
-void AliTRDcheckDET::Exec(Option_t *opt){
+void AliTRDcheckDET::UserExec(Option_t *opt){
   //
   // Execution function
   // Filling TRD quality histos
@@ -139,6 +156,7 @@ void AliTRDcheckDET::Exec(Option_t *opt){
     if(!fTrackInfo->GetTrack()) continue;
     nTracks++;
   }
+
   if(nTracks){
     dynamic_cast<TH1F *>(fContainer->UncheckedAt(kNeventsTriggerTracks))->Fill(triggermask);
     dynamic_cast<TH1F *>(fContainer->UncheckedAt(kNtracksEvent))->Fill(nTracks);
@@ -151,7 +169,7 @@ void AliTRDcheckDET::Exec(Option_t *opt){
     histo = dynamic_cast<TH1F *>(fContainer->UncheckedAt(kNeventsTrigger));
     histo->GetXaxis()->SetBinLabel(histo->FindBin(triggermask), triggername);
   }
-  PostData(0, fContainer);
+  PostData(1, fContainer);
 }
 
 
@@ -196,6 +214,7 @@ Bool_t AliTRDcheckDET::PostProcess(){
   h->SetBinContent(1, 0.);
 
   // tracklet status
+  
   TObjArray *arr = dynamic_cast<TObjArray*>(fContainer->UncheckedAt(kTrackletStatus));
   for(Int_t ily = AliTRDgeometry::kNlayer; ily--;){
     h=dynamic_cast<TH1F*>(arr->At(ily));
@@ -348,6 +367,7 @@ TObjArray *AliTRDcheckDET::Histos(){
   //
   // Create QA histograms
   //
+    
   if(fContainer) return fContainer;
   
   fContainer = new TObjArray(20);
@@ -496,6 +516,8 @@ TObjArray *AliTRDcheckDET::Histos(){
   if(!(h = (TH1F *)gROOT->FindObject("hEventsTrigger")))
     h = new TH1F("hEventsTrigger", "Trigger Class", 100, 0, 100);
   else h->Reset();
+  printf("Histos Adding \n");
+  
   fContainer->AddAt(h, kNeventsTrigger);
 
   if(!(h = (TH1F *)gROOT->FindObject("hEventsTriggerTracks")))
index 6c2810b..2edbd5e 100644 (file)
@@ -50,12 +50,12 @@ public:
   };
 
   AliTRDcheckDET();
+  AliTRDcheckDET(char* name);
   virtual ~AliTRDcheckDET();
 
-  virtual void ConnectInputData(const Option_t *);
-  virtual void CreateOutputObjects();
-  virtual void Exec(Option_t *opt);
-
+  virtual void UserCreateOutputObjects();
+  virtual void UserExec(Option_t *opt);
+  virtual void ConnectInputData(Option_t *opt);
   virtual TObjArray *Histos();
 
   // Plotting Functions:
index 4c63d97..b3fa9c1 100644 (file)
@@ -63,7 +63,7 @@ FILE* AliTRDcheckESD::fgFile = NULL;
 
 //____________________________________________________________________
 AliTRDcheckESD::AliTRDcheckESD():
-  AliAnalysisTask("checkESD", "ESD checker for TRD info")
+  AliAnalysisTaskSE()
   ,fStatus(0)
   ,fESD(NULL)
   ,fMC(NULL)
@@ -74,8 +74,21 @@ AliTRDcheckESD::AliTRDcheckESD():
   // Default constructor
   //
   SetMC(kTRUE);
-  DefineInput(0, TChain::Class());
-  DefineOutput(0, TObjArray::Class());
+}
+
+AliTRDcheckESD::AliTRDcheckESD(char* name):
+  AliAnalysisTaskSE(name)
+  ,fStatus(0)
+  ,fESD(NULL)
+  ,fMC(NULL)
+  ,fHistos(NULL)
+  ,fResults(NULL)
+{
+  //
+  // Default constructor
+  //
+  SetMC(kTRUE);
+  DefineOutput(1, TObjArray::Class());
 }
 
 //____________________________________________________________________
@@ -93,24 +106,7 @@ AliTRDcheckESD::~AliTRDcheckESD()
 }
 
 //____________________________________________________________________
-void AliTRDcheckESD::ConnectInputData(Option_t *)
-{
-  //
-  // Link the Input Data
-  //
-  TTree *tree = dynamic_cast<TChain*>(GetInputData(0));
-  if(tree) tree->SetBranchStatus("Tracks", 1);
-
-  AliESDInputHandler *esdH = dynamic_cast<AliESDInputHandler*>(AliAnalysisManager::GetAnalysisManager()->GetInputEventHandler());
-  fESD = esdH ? esdH->GetEvent() : NULL;
-
-  if(!HasMC()) return;
-  AliMCEventHandler *mcH = dynamic_cast<AliMCEventHandler*>(AliAnalysisManager::GetAnalysisManager()->GetMCtruthEventHandler());
-  fMC = mcH ? mcH->MCEvent() : NULL;
-}
-
-//____________________________________________________________________
-void AliTRDcheckESD::CreateOutputObjects()
+void AliTRDcheckESD::UserCreateOutputObjects()
 {      
   //
   // Create Output Containers (TObjectArray containing 1D histograms)
@@ -199,15 +195,18 @@ TGraph* AliTRDcheckESD::GetGraph(Int_t id, Option_t *opt)
 }
 
 //____________________________________________________________________
-void AliTRDcheckESD::Exec(Option_t *){
+void AliTRDcheckESD::UserExec(Option_t *){
   //
   // Run the Analysis
   //
+  fESD = dynamic_cast<AliESDEvent*>(InputEvent());
+  fMC = MCEvent();
+  
   if(!fESD){
     AliError("ESD event missing.");
     return;
   }
-
+  
   // Get MC information if available
   AliStack * fStack = NULL;
   if(HasMC()){
@@ -326,7 +325,7 @@ void AliTRDcheckESD::Exec(Option_t *){
       }
     }
   }  
-  PostData(0, fHistos);
+  PostData(1, fHistos);
 }
 
 //____________________________________________________________________
index d0133e4..dbcb231 100644 (file)
@@ -15,7 +15,7 @@
 //////////////////////////////////////////////////////
 
 #ifndef ALIANALYSISTASK_H
-#include "AliAnalysisTask.h"
+#include "AliAnalysisTaskSE.h"
 #endif
 
 class AliESDEvent;
@@ -24,7 +24,7 @@ class TH1;
 class TObjArray;
 class TGraph;
 class TGraphErrors;
-class AliTRDcheckESD : public AliAnalysisTask {
+class AliTRDcheckESD : public AliAnalysisTaskSE {
 public:
   enum ETRDcheckESDstatus {
      kMC   = BIT(0)  // use MC info
@@ -46,12 +46,12 @@ public:
    ,kTRDref     // track refitted in TRD
   };
   AliTRDcheckESD();
+  AliTRDcheckESD(char* name);
   virtual ~AliTRDcheckESD();
   
-  void          ConnectInputData(Option_t *);
-  void          CreateOutputObjects();
+  void          UserCreateOutputObjects();
   TGraph*       GetGraph(Int_t id, Option_t *opt="bc");
-  void          Exec(Option_t *);
+  void          UserExec(Option_t *);
 
   Bool_t        HasMC() const { return TESTBIT(fStatus, kMC);}
   Bool_t        IsLoad() const { return TESTBIT(fStatus, kLoad);}
index 952e9f1..b1413fc 100644 (file)
@@ -59,7 +59,22 @@ ClassImp(AliTRDcheckPID)
 
 //________________________________________________________________________
 AliTRDcheckPID::AliTRDcheckPID() 
-  :AliTRDrecoTask("checkPID", "TRD PID checker")
+  :AliTRDrecoTask()
+  ,fReconstructor(NULL)
+  ,fUtil(NULL)
+  ,fGraph(NULL)
+  ,fPID(NULL)
+  ,fMomentumAxis(NULL)
+  ,fMinNTracklets(AliTRDgeometry::kNlayer)
+  ,fMaxNTracklets(AliTRDgeometry::kNlayer)
+ {
+  //
+  // Default constructor
+  //
+}
+
+AliTRDcheckPID::AliTRDcheckPID(char* name ) 
+  :AliTRDrecoTask(name, "Check PID")
   ,fReconstructor(NULL)
   ,fUtil(NULL)
   ,fGraph(NULL)
@@ -85,7 +100,9 @@ AliTRDcheckPID::AliTRDcheckPID()
 
   fUtil = new AliTRDpidUtil();
   InitFunctorList();
-  DefineOutput(1, TObjArray::Class()); // PID for reference maker
+
+  DefineOutput(2, TObjArray::Class());
+  
 }
 
 
@@ -100,12 +117,12 @@ AliTRDcheckPID::~AliTRDcheckPID()
 
 
 //________________________________________________________________________
-void AliTRDcheckPID::CreateOutputObjects()
+void AliTRDcheckPID::UserCreateOutputObjects()
 {
   // Create histograms
   // Called once
 
-  OpenFile(0, "RECREATE");
+  OpenFile(1, "RECREATE");
   fContainer = Histos();
 
   fPID = new TObjArray();
@@ -113,7 +130,7 @@ void AliTRDcheckPID::CreateOutputObjects()
 }
 
 //________________________________________________________
-void AliTRDcheckPID::Exec(Option_t *opt)
+void AliTRDcheckPID::UserExec(Option_t *opt)
 {
   //
   // Execution part
@@ -123,7 +140,7 @@ void AliTRDcheckPID::Exec(Option_t *opt)
 
   AliTRDrecoTask::Exec(opt);
 
-  PostData(1, fPID);
+  PostData(2, fPID);
 }
 
 
index 38037fd..de824d3 100644 (file)
@@ -45,11 +45,12 @@ public:
     ,kNPlots           =  12    // Number of plots for this tasks 
   };
   AliTRDcheckPID();
+  AliTRDcheckPID(char* name);
   virtual ~AliTRDcheckPID();
   
-  virtual void    CreateOutputObjects();
+  virtual void    UserCreateOutputObjects();
   virtual Bool_t  GetRefFigure(Int_t ifig);
-  virtual void    Exec(Option_t *opt);
+  virtual void    UserExec(Option_t *opt);
   virtual Bool_t  PostProcess();
 
   TH1 *PlotLQ(const AliTRDtrackV1 *track = 0x0);
index 6f7a36c..7e576d3 100644 (file)
@@ -200,6 +200,24 @@ ClassImp(AliTRDclusterResolution)
 
 const Float_t AliTRDclusterResolution::fgkTimeBinLength = 1./ AliTRDCommonParam::Instance()->GetSamplingFrequency();
 //_______________________________________________________
+AliTRDclusterResolution::AliTRDclusterResolution()
+  : AliTRDrecoTask()
+  ,fCanvas(0x0)
+  ,fInfo(0x0)
+  ,fResults(0x0)
+  ,fAt(0x0)
+  ,fStatus(0)
+  ,fDet(-1)
+  ,fExB(0.)
+  ,fVdrift(0.)
+  ,fLy(0)
+  ,fX(0.)
+  ,fY(0.)
+  ,fZ(0.)
+{
+// Constructor
+}
+
 AliTRDclusterResolution::AliTRDclusterResolution(const char *name, const char *title)
   : AliTRDrecoTask(name, title)
   ,fCanvas(NULL)
@@ -246,13 +264,14 @@ AliTRDclusterResolution::~AliTRDclusterResolution()
 //_______________________________________________________
 void AliTRDclusterResolution::ConnectInputData(Option_t *)
 {
-  fInfo = dynamic_cast<TObjArray *>(GetInputData(0));
+    AliAnalysisTaskSE::ConnectInputData();
+    fInfo = dynamic_cast<TObjArray *>(GetInputData(0));
 }
 
 //_______________________________________________________
-void AliTRDclusterResolution::CreateOutputObjects()
+void AliTRDclusterResolution::UserCreateOutputObjects()
 {
-  OpenFile(0, "RECREATE");
+  OpenFile(1, "RECREATE");
   fContainer = Histos();
 }
 
@@ -472,7 +491,7 @@ TObjArray* AliTRDclusterResolution::Histos()
 }
 
 //_______________________________________________________
-void AliTRDclusterResolution::Exec(Option_t *)
+void AliTRDclusterResolution::UserExec(Option_t *)
 {
 // Fill container histograms
 
@@ -536,7 +555,7 @@ void AliTRDclusterResolution::Exec(Option_t *)
     // fill histo for systematic (mean)
     ((TH3S*)arr2->At(ix-1))->Fill(10.*cli->GetAnisochronity(), dydx-cli->GetTilt()*dzdx, dy);  
   }
-  PostData(0, fContainer);
+  PostData(1, fContainer);
 }
 
 
index 7bdc891..58bdc5d 100644 (file)
@@ -34,12 +34,13 @@ public:
     kSaveAs    = BIT(22)
    ,kExB       = BIT(23)
   };
-  AliTRDclusterResolution(const char *name="ClErrParam", const char *title="Cluster error monitor");
+  AliTRDclusterResolution();
+  AliTRDclusterResolution(const char *name, const char *title="Cluster error monitor");
   virtual ~AliTRDclusterResolution();
 
   void          ConnectInputData(Option_t *);
-  void          CreateOutputObjects();
-  void          Exec(Option_t *);
+  void          UserCreateOutputObjects();
+  void          UserExec(Option_t *);
   Int_t         GetDetector() const { return fDet; }
   inline Float_t GetExB() const;
   inline Float_t GetVdrift() const;
index 1d4440e..9b39a23 100644 (file)
@@ -44,7 +44,16 @@ ClassImp(AliTRDefficiency)
 
 //____________________________________________________________________
 AliTRDefficiency::AliTRDefficiency()
-  :AliTRDrecoTask("efficiency", "TRD barrel tracking efficiency checker")
+  :AliTRDrecoTask()
+  ,fMissed(0x0)
+{
+  //
+  // Default constructor
+  //
+}
+
+AliTRDefficiency::AliTRDefficiency(char* name)
+  :AliTRDrecoTask(name, "TRD barrel tracking efficiency checker")
   ,fMissed(0x0)
 {
   //
@@ -63,13 +72,13 @@ AliTRDefficiency::~AliTRDefficiency()
 }
 
 //____________________________________________________________________
-void  AliTRDefficiency::CreateOutputObjects()
+void  AliTRDefficiency::UserCreateOutputObjects()
 {
   //
   // Create output objects
   //
 
-  OpenFile(0, "RECREATE");
+  OpenFile(1, "RECREATE");
   const Int_t nbins = AliTRDCalPID::kNMom;
   Float_t xbins[nbins+1] = {.5, .7, .9, 1.3, 1.7, 2.4, 3.5, 4.5, 5.5, 7., 9., 11.};
 
@@ -86,7 +95,7 @@ void  AliTRDefficiency::CreateOutputObjects()
 } 
 
 //____________________________________________________________________
-void AliTRDefficiency::Exec(Option_t *)
+void AliTRDefficiency::UserExec(Option_t *)
 {
   //
   // Do it
@@ -249,7 +258,7 @@ void AliTRDefficiency::Exec(Option_t *)
        for(Int_t itk = 0; itk < nTRD - 1; itk++)
                if(labelsacc[indices[itk]] ==labelsacc[indices[itk + 1]]) printf("Double counted MC track: %d\n", labelsacc[indices[itk]]);
        }
-  PostData(0, fContainer);
+  PostData(1, fContainer);
 }
 
 
index ea27399..87479d4 100644 (file)
@@ -23,9 +23,10 @@ class AliTRDefficiency : public AliTRDrecoTask
 {
 public:
   AliTRDefficiency();
+  AliTRDefficiency(char* name);
   virtual ~AliTRDefficiency();
-  void    CreateOutputObjects();
-  void    Exec(Option_t *);
+  void    UserCreateOutputObjects();
+  void    UserExec(Option_t *);
   Bool_t  GetRefFigure(Int_t ifig);
   Bool_t  PostProcess();
 
index 9ef4515..a251ccc 100644 (file)
@@ -54,27 +54,34 @@ Float_t AliTRDefficiencyMC::fgPhiCut = 50.; //[deg]
 Float_t AliTRDefficiencyMC::fgThtCut = 50.; //[deg]
 //_____________________________________________________________________________
 AliTRDefficiencyMC::AliTRDefficiencyMC()
-  :AliTRDrecoTask("EfficiencyMC", "Combined Tracking Efficiency")
+  :AliTRDrecoTask()
 {
   //
   // Default constructor
   //
 }
 
+AliTRDefficiencyMC::AliTRDefficiencyMC(char* name)
+  :AliTRDrecoTask(name, "Combined Tracking Efficiency")
+{
+  //
+  // Default constructor
+  //
+}
 
 //_____________________________________________________________________________
-void AliTRDefficiencyMC::CreateOutputObjects(){
+void AliTRDefficiencyMC::UserCreateOutputObjects(){
   //
   // Create output objects
   //
 
-  OpenFile(0, "RECREATE");
+  OpenFile(1, "RECREATE");
   fContainer = Histos();
 
 }
 
 //_____________________________________________________________________________
-void AliTRDefficiencyMC::Exec(Option_t *){
+void AliTRDefficiencyMC::UserExec(Option_t *){
   //
   // Execute the task:
   //
@@ -191,7 +198,7 @@ void AliTRDefficiencyMC::Exec(Option_t *){
     ncontam, 
     (nall ? 1.E2*Float_t(ncontam)/Float_t(nall) : 0.)));
 
-  PostData(0, fContainer);
+  PostData(1, fContainer);
 }
 
 
index ebc7ea3..ace77f6 100644 (file)
@@ -32,10 +32,11 @@ public:
    ,kFake
   };
   AliTRDefficiencyMC();
+  AliTRDefficiencyMC(char* name);
   virtual ~AliTRDefficiencyMC(){;}
   
-  void        CreateOutputObjects();
-  void        Exec(Option_t *);
+  void        UserCreateOutputObjects();
+  void        UserExec(Option_t *);
   
   Bool_t      PostProcess();
   TObjArray*  Histos();
index 38c3904..e16c021 100644 (file)
@@ -88,11 +88,10 @@ const Float_t AliTRDinfoGen::fgkEta       = 0.9;
 
 //____________________________________________________________________
 AliTRDinfoGen::AliTRDinfoGen():
-  AliTRDrecoTask("infoGen", "MC-REC TRD-track list generator")
+  AliTRDrecoTask()
   ,fEvTrigger("CINT1B-ABCE-NOPF-ALL")
   ,fESDev(NULL)
   ,fMCev(NULL)
-  ,fESDfriend(NULL)
   ,fTrackInfo(NULL)
   ,fEventInfo(NULL)
   ,fV0container(NULL)
@@ -101,11 +100,22 @@ AliTRDinfoGen::AliTRDinfoGen():
   //
   // Default constructor
   //
+}
 
-  DefineInput(0, TChain::Class());
-  DefineOutput(0, TObjArray::Class());
-  DefineOutput(1, AliTRDeventInfo::Class());
-  DefineOutput(2, TObjArray::Class());
+AliTRDinfoGen::AliTRDinfoGen(char* name):
+  AliTRDrecoTask(name, "MC-REC TRD-track list generator")
+  ,fESDev(NULL)
+  ,fMCev(NULL)
+  ,fTrackInfo(NULL)
+  ,fEventInfo(NULL)
+  ,fV0container(NULL)
+  ,fV0Info(NULL)
+{
+  //
+  // Default constructor
+  //
+    DefineOutput(2, AliTRDeventInfo::Class());   // -> TRDeventInfo
+    DefineOutput(3, TObjArray::Class());         // -> TObjArray
 }
 
 //____________________________________________________________________
@@ -127,43 +137,7 @@ AliTRDinfoGen::~AliTRDinfoGen()
 }
 
 //____________________________________________________________________
-void AliTRDinfoGen::ConnectInputData(Option_t *)
-{
-  //
-  // Link the Input Data
-  //
-  TTree *tree = dynamic_cast<TChain*>(GetInputData(0));
-  if(!tree){
-    AliError("ESD event not found");
-  } else {
-    tree->SetBranchStatus("Tracks", 1);
-    tree->SetBranchStatus("ESDfriend*",1);
-  }
-
-  AliESDInputHandler *esdH = dynamic_cast<AliESDInputHandler*>(AliAnalysisManager::GetAnalysisManager()->GetInputEventHandler());
-  if(!esdH){
-    printf("ERROR - ESD input handler not found");
-  } else {
-    fESDev = esdH->GetEvent();
-    if(!fESDev){
-      printf("ERROR - ESD event not found");
-    } else {
-      esdH->SetActiveBranches("ESDfriend*");
-      fESDfriend = (AliESDfriend *)fESDev->FindListObject("AliESDfriend");
-    }
-  }
-  if(HasMCdata()){
-    AliMCEventHandler *mcH = dynamic_cast<AliMCEventHandler*>(AliAnalysisManager::GetAnalysisManager()->GetMCtruthEventHandler());
-    if(!mcH){ 
-      AliError("MC input handler not found");
-    } else {
-      fMCev = mcH->MCEvent();
-    }
-  }
-}
-
-//____________________________________________________________________
-void AliTRDinfoGen::CreateOutputObjects()
+void AliTRDinfoGen::UserCreateOutputObjects()
 {      
   //
   // Create Output Containers (TObjectArray containing 1D histograms)
@@ -179,10 +153,13 @@ void AliTRDinfoGen::CreateOutputObjects()
 }
 
 //____________________________________________________________________
-void AliTRDinfoGen::Exec(Option_t *){
+void AliTRDinfoGen::UserExec(Option_t *){
   //
   // Run the Analysis
   //
+  fESDev = dynamic_cast<AliESDEvent*>(InputEvent());
+  fMCev = MCEvent();
+
   if(!fESDev){
     AliError("Failed retrieving ESD event");
     return;
@@ -226,10 +203,10 @@ void AliTRDinfoGen::Exec(Option_t *){
     AliError("Failed retrieving MC event");
     return;
   }
+
   fContainer->Delete();
   fV0container->Delete();
   fEventInfo->Delete("");
-  fESDev->SetESDfriend(fESDfriend);
   new(fEventInfo)AliTRDeventInfo(fESDev->GetHeader(), const_cast<AliESDRun *>(fESDev->GetESDRun()));
   
   Bool_t *trackMap(NULL);
@@ -435,8 +412,8 @@ void AliTRDinfoGen::Exec(Option_t *){
     }
     delete[] trackMap;
   }
-  PostData(0, fContainer);
-  PostData(1, fEventInfo);
-  PostData(2, fV0container);
+  PostData(1, fContainer);
+  PostData(2, fEventInfo);
+  PostData(3, fV0container);
 }
 
index 44bc1c6..7bc8820 100644 (file)
@@ -35,10 +35,12 @@ public:
    ,kCollision            = BIT(23)
   };
   AliTRDinfoGen();
+  AliTRDinfoGen(char* name);
   virtual ~AliTRDinfoGen();
   
-  void    ConnectInputData(Option_t *);
-  void    CreateOutputObjects();
+
+  void  UserCreateOutputObjects();
+  void  UserExec(Option_t *);
   static Float_t GetTPCx() { return fgkTPC;}
   static Float_t GetTOFx() { return fgkTOF;}
 
@@ -74,12 +76,11 @@ private:
 
   AliESDEvent      *fESDev;          //! ESD event
   AliMCEvent       *fMCev;           //! MC event
-  AliESDfriend     *fESDfriend;      //! ESD friends
   AliTRDtrackInfo  *fTrackInfo;      //! Track info
-  AliTRDeventInfo  *fEventInfo;                   //! Event info
+  AliTRDeventInfo  *fEventInfo;             //! Event info
   TObjArray        *fV0container;    //! V0 container
-  AliTRDv0Info     *fV0Info;                //! V0 info
+  AliTRDv0Info     *fV0Info;        //! V0 info
 
-  ClassDef(AliTRDinfoGen, 2)         // entry to TRD analysis train
+  ClassDef(AliTRDinfoGen, 3)         // entry to TRD analysis train
 };
 #endif
index 619c89d..6e16893 100644 (file)
@@ -55,7 +55,16 @@ ClassImp(AliTRDmultiplicity)
 
 //____________________________________________________________________
 AliTRDmultiplicity::AliTRDmultiplicity()
-    :AliTRDrecoTask("Multiplicity", "Barrel Tracking Multiplicity")
+    :AliTRDrecoTask()
+  ,fEventCounter(0)
+{
+  //
+  // Default constructor
+    //
+}
+
+AliTRDmultiplicity::AliTRDmultiplicity(char* name)
+    :AliTRDrecoTask(name, "Barrel Tracking Multiplicity")
   ,fEventCounter(0)
 {
   //
@@ -69,13 +78,13 @@ AliTRDmultiplicity::~AliTRDmultiplicity()
 }
 
 //____________________________________________________________________
-void  AliTRDmultiplicity::CreateOutputObjects()
+void  AliTRDmultiplicity::UserCreateOutputObjects()
 {
   //
   // Create output objects
   //
 
-  OpenFile(0, "RECREATE");
+  OpenFile(1, "RECREATE");
 
   TH1 *h = 0x0;
   fContainer = new TObjArray();
@@ -85,7 +94,7 @@ void  AliTRDmultiplicity::CreateOutputObjects()
 } 
 
 //____________________________________________________________________
-void AliTRDmultiplicity::Exec(Option_t *)
+void AliTRDmultiplicity::UserExec(Option_t *)
 {
   //
   // Do it
@@ -282,7 +291,7 @@ void AliTRDmultiplicity::Exec(Option_t *)
   }
 
   
-  PostData(0, fContainer);
+  PostData(1, fContainer);
 }
 
 
index f544424..21ad648 100644 (file)
@@ -18,9 +18,10 @@ class AliTRDmultiplicity : public AliTRDrecoTask
 {
 public:
   AliTRDmultiplicity();
+  AliTRDmultiplicity(char* name);
   virtual ~AliTRDmultiplicity();
-  void    CreateOutputObjects();
-  void    Exec(Option_t *);
+  void    UserCreateOutputObjects();
+  void    UserExec(Option_t *);
 
 private:
   AliTRDmultiplicity(const AliTRDmultiplicity&);
index 5adbbc1..818b920 100644 (file)
@@ -134,12 +134,12 @@ void AliTRDpidRefMaker::ConnectInputData(Option_t *opt)
 } 
 
 //________________________________________________________________________
-void AliTRDpidRefMaker::CreateOutputObjects()
+void AliTRDpidRefMaker::UserCreateOutputObjects()
 {
   // Create histograms
   // Called once
 
-  OpenFile(0, "RECREATE");
+  OpenFile(1, "RECREATE");
   fContainer = new TObjArray();
   fContainer->SetName(Form("Moni%s", GetName()));
 
@@ -159,7 +159,7 @@ void AliTRDpidRefMaker::CreateOutputObjects()
 }
 
 //________________________________________________________________________
-void AliTRDpidRefMaker::Exec(Option_t *) 
+void AliTRDpidRefMaker::UserExec(Option_t *) 
 {
   // Main loop
   // Called for each event
@@ -239,8 +239,8 @@ void AliTRDpidRefMaker::Exec(Option_t *)
     Fill();
   }
 
-  PostData(0, fContainer);
-  PostData(1, fData);
+  PostData(1, fContainer);
+  PostData(2, fData);
 }
 
 
index 9110096..eb557be 100644 (file)
@@ -81,8 +81,8 @@ public:
   virtual ~AliTRDpidRefMaker();
   
   void    ConnectInputData(Option_t *opt);
-  void    CreateOutputObjects();
-  void    Exec(Option_t *option);
+  void    UserCreateOutputObjects();
+  void    UserExec(Option_t *option);
   Float_t GetPthreshold() const { return fPthreshold;}
 
   void    SetAbundance(Float_t train);
index 1f34fa2..09edec5 100644 (file)
@@ -75,7 +75,7 @@ AliTRDpidRefMakerLQ::~AliTRDpidRefMakerLQ()
 }
 
 // //________________________________________________________________________
-void AliTRDpidRefMakerLQ::CreateOutputObjects()
+void AliTRDpidRefMakerLQ::UserCreateOutputObjects()
 {
   // Create histograms
   // Called once
@@ -226,7 +226,7 @@ Bool_t AliTRDpidRefMakerLQ::Load(const Char_t */*fname*/)
 
 
 //________________________________________________________________________
-void AliTRDpidRefMakerLQ::Exec(Option_t */*opt*/)
+void AliTRDpidRefMakerLQ::UserExec(Option_t */*opt*/)
 {
 // Load PID data into local data storage
 
index cafa54a..0252e33 100644 (file)
@@ -36,8 +36,8 @@ public:
   AliTRDpidRefMakerLQ();
   ~AliTRDpidRefMakerLQ();
 
-  void        CreateOutputObjects();
-  void        Exec(Option_t *opt);
+  void        UserCreateOutputObjects();
+  void        UserExec(Option_t *opt);
   TObject*    GetOCDBEntry(Option_t *opt);
   Bool_t      GetRefFigure(Int_t ifig);
   Bool_t      HasOnlineMonitor() const {return kTRUE;}
index 4937f5f..f3c45ee 100644 (file)
@@ -18,6 +18,7 @@
 #include "TMethodCall.h"
 #include "TMethodArg.h"
 #include "TFile.h"
+#include "TChain.h"
 #include "TList.h"
 #include "TMap.h"
 #include "TH1.h"
@@ -36,19 +37,31 @@ ClassImp(AliTRDrecoTask)
 TList* AliTRDrecoTask::fgTrendPoint(0x0);
 TTreeSRedirector* AliTRDrecoTask::fgDebugStream(0x0);
 //_______________________________________________________
-AliTRDrecoTask::AliTRDrecoTask(const char *name, const char *title)
-  : AliAnalysisTask(name, title)
+
+AliTRDrecoTask::AliTRDrecoTask()
+  : AliAnalysisTaskSE()
+  ,fNRefFigures(0)
+  ,fContainer(0x0)
+  ,fTracks(0x0)
+  ,fkTrack(0x0)
+  ,fkMC(0x0)
+  ,fkESD(0x0)
+  ,fPlotFuncList(0x0)
+{
+}
+
+AliTRDrecoTask::AliTRDrecoTask(const char *name, const char */*title*/)
+  : AliAnalysisTaskSE(name)
   ,fNRefFigures(0)
   ,fContainer(0x0)
   ,fTracks(0x0)
   ,fkTrack(0x0)
   ,fkMC(0x0)
   ,fkESD(0x0)
-  ,fDebugLevel(0)
   ,fPlotFuncList(0x0)
 {
-  DefineInput(0, TObjArray::Class());
-  DefineOutput(0, TObjArray::Class());
+  DefineInput (1, TObjArray::Class());
+  DefineOutput(1, TObjArray::Class());
 }
 
 //_______________________________________________________
@@ -90,12 +103,12 @@ void AliTRDrecoTask::ConnectInputData(Option_t *)
   //
   // Connect input data
   //
-
-  fTracks = dynamic_cast<TObjArray *>(GetInputData(0));
+    AliAnalysisTaskSE::ConnectInputData();
+    fTracks = dynamic_cast<TObjArray *>(GetInputData(1));
 }
 
 //_______________________________________________________
-void AliTRDrecoTask::Exec(Option_t *)
+void AliTRDrecoTask::UserExec(Option_t *)
 {
 // Loop over Plot functors published by particular tasks
 
@@ -120,7 +133,7 @@ void AliTRDrecoTask::Exec(Option_t *)
       plot->Execute(this);
     }
   }
-  PostData(0, fContainer);
+  PostData(1, fContainer);
 }
 
 //_______________________________________________________
@@ -216,8 +229,8 @@ void AliTRDrecoTask::SetDebugLevel(Int_t level)
 {
 // Generic debug handler
 
-  fDebugLevel = level;
-  if(fDebugLevel>=1){
+  fDebug = level;
+  if(fDebug>=1){
     TDirectory *savedir = gDirectory;
     fgDebugStream = new TTreeSRedirector("TRD.DebugPerformance.root");
     savedir->cd();
@@ -234,7 +247,7 @@ void AliTRDrecoTask::Terminate(Option_t *)
   if(fgDebugStream){ 
     delete fgDebugStream;
     fgDebugStream = 0x0;
-    fDebugLevel = 0;
+    fDebug = 0;
   }
   if(HasPostProcess()) PostProcess();
 }
index 698a464..369255a 100644 (file)
@@ -9,9 +9,7 @@
 //
 //////////////////////////////////////////////////
 
-#ifndef ALIANALYSISTASK_H
-#include "AliAnalysisTask.h"
-#endif
+#include "AliAnalysisTaskSE.h"
 
 #ifndef ALITRDTRACKINFO_H
 #include "info/AliTRDtrackInfo.h"
@@ -24,7 +22,7 @@ class TObjArray;
 class TTreeSRedirector;
 class AliTRDtrackV1;
 class AliTRDtrackInfo;
-class AliTRDrecoTask : public AliAnalysisTask 
+class AliTRDrecoTask : public AliAnalysisTaskSE 
 {
 public:
   enum AliTRDrecoSteeringBits{
@@ -32,14 +30,18 @@ public:
     ,kFriends     = BIT(19)
     ,kPostProcess = BIT(20)
   };
+  
+  AliTRDrecoTask();
   AliTRDrecoTask(const char *name, const char *title);
   virtual ~AliTRDrecoTask();
   
   
-  void           ConnectInputData(Option_t *);
-  virtual void   CreateOutputObjects() = 0;
-  virtual void   Exec(Option_t *opt);
-
+  virtual void   UserCreateOutputObjects() = 0;
+  virtual void   UserExec(Option_t *opt);
+  virtual void   ConnectInputData(Option_t *);
+  virtual void   SetDebugLevel(Int_t level);
+  
+    
   Int_t          GetNRefFigures() const  { return fNRefFigures; } 
   TList*         GetPlotFunctors() const { return fPlotFuncList;}
   virtual Bool_t GetRefFigure(Int_t ifig);
@@ -53,14 +55,12 @@ public:
   virtual Bool_t Save(TObjArray * const res);
   virtual Bool_t PostProcess();
   virtual Bool_t PutTrendValue(const Char_t *name, Double_t val);
-  virtual void   SetDebugLevel(Int_t level);
   virtual void   SetFriends(Bool_t fr = kTRUE) {SetBit(kFriends, fr);}
   virtual void   SetMCdata(Bool_t mc = kTRUE) {SetBit(kMCdata, mc);}
   virtual void   SetPostProcess(Bool_t pp = kTRUE) {SetBit(kPostProcess, pp);}
   virtual void   Terminate(Option_t *);
 
 protected:
-  Int_t          DebugLevel() const      { return fDebugLevel;}
   static TTreeSRedirector* DebugStream() { return fgDebugStream;}
   void           InitFunctorList();
   void           Adjust(TF1 *f, TH1 * const h);
index 50f3cc1..8ba7bc4 100644 (file)
@@ -201,6 +201,26 @@ AliTRDresolution::AliTRDresolution()
   //
   // Default constructor
   //
+}
+
+AliTRDresolution::AliTRDresolution(char* name)
+  :AliTRDrecoTask(name, "Spatial and momentum TRD resolution checker")
+  ,fStatus(0)
+  ,fIdxPlot(0)
+  ,fIdxFrame(0)
+  ,fReconstructor(NULL)
+  ,fGeo(NULL)
+  ,fDBPDG(NULL)
+  ,fGraphS(NULL)
+  ,fGraphM(NULL)
+  ,fCl(NULL)
+  ,fTrklt(NULL)
+  ,fMCcl(NULL)
+  ,fMCtrklt(NULL)
+{
+  //
+  // Default constructor
+  //
 
   fReconstructor = new AliTRDReconstructor();
   fReconstructor->SetRecoParam(AliTRDrecoParam::GetLowFluxParam());
@@ -234,10 +254,10 @@ AliTRDresolution::~AliTRDresolution()
 
 
 //________________________________________________________
-void AliTRDresolution::CreateOutputObjects()
+void AliTRDresolution::UserCreateOutputObjects()
 {
   // spatial resolution
-  OpenFile(0, "RECREATE");
+  OpenFile(1, "RECREATE");
 
   fContainer = Histos();
 
@@ -252,7 +272,7 @@ void AliTRDresolution::CreateOutputObjects()
 }
 
 //________________________________________________________
-void AliTRDresolution::Exec(Option_t *opt)
+void AliTRDresolution::UserExec(Option_t *opt)
 {
   //
   // Execution part
index b00e4c8..2152eb2 100644 (file)
@@ -52,13 +52,14 @@ public:
   };
 
   AliTRDresolution();
+  AliTRDresolution(char* name);
   virtual ~AliTRDresolution();
   
-  void    CreateOutputObjects();
+  void    UserCreateOutputObjects();
   Bool_t  GetRefFigure(Int_t ifig);
   TObjArray*  Histos(); 
   TObjArray*  Results(Int_t i=0) const {return i ? fGraphS : fGraphM;} 
-  void    Exec(Option_t * opt);
+  void    UserExec(Option_t * opt);
   Bool_t  IsVerbose() const {return TESTBIT(fStatus, kVerbose);}
   Bool_t  IsVisual() const {return TESTBIT(fStatus, kVisual);}
   Bool_t  PostProcess();