]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - STEER/AliReconstruction.h
Modifications to eliminate the simulation parameters from
[u/mrichter/AliRoot.git] / STEER / AliReconstruction.h
index 2fb8bb8cc73c79919b35a28c2fbd2771776e8045..02eb818377d752d19f3e4e4ed040273fea09a916 100644 (file)
@@ -17,7 +17,7 @@
 ///////////////////////////////////////////////////////////////////////////////
 
 
-#include <TNamed.h>
+#include <TSelector.h>
 #include <TString.h>
 #include <TObjArray.h>
 
@@ -37,12 +37,16 @@ class TTree;
 class TList;
 class AliQADataMakerSteer; 
 class TMap;
-
-class AliReconstruction: public TNamed {
+class AliRecoParam;
+class AliDetectorRecoParam;
+class AliRunInfo;
+#include "AliQA.h"
+#include "AliEventInfo.h"
+#include "AliRecoParam.h"
+
+class AliReconstruction: public TSelector {
 public:
-  AliReconstruction(const char* gAliceFilename = "galice.root",
-                   const char* name = "AliReconstruction", 
-                   const char* title = "reconstruction");
+  AliReconstruction(const char* gAliceFilename = "galice.root");
   virtual ~AliReconstruction();
 
   void           SetGAliceFile(const char* fileName);
@@ -54,6 +58,7 @@ public:
   void           SetNumberOfEventsPerFile(UInt_t nEvents)
     {fNumberOfEventsPerFile = nEvents;};
   void           SetOption(const char* detector, const char* option);
+  void           SetRecoParam(const char* detector, AliDetectorRecoParam *par);
 
   void           SetRunLocalReconstruction(const char* detectors) {
     fRunLocalReconstruction = detectors;};
@@ -89,7 +94,6 @@ public:
   void SetStopOnError(Bool_t flag=kTRUE) {fStopOnError=flag;}
   void SetWriteAlignmentData(Bool_t flag=kTRUE){fWriteAlignmentData=flag;}
   void SetWriteESDfriend(Bool_t flag=kTRUE){fWriteESDfriend=flag;}
-  void SetWriteAOD(Bool_t flag=kTRUE){fWriteAOD=flag;}
   void SetFillTriggerESD(Bool_t flag=kTRUE){fFillTriggerESD=flag;}
   void SetDiamondProfile(AliESDVertex *dp) {fDiamondProfile=dp;}
   void SetDiamondProfileTPC(AliESDVertex *dp) {fDiamondProfileTPC=dp;}
@@ -105,9 +109,6 @@ public:
   Float_t GetV0CsPmin() const {return fV0CsPmin;}
   Float_t GetDmax() const {return fDmax;}
   Float_t GetZmax() const {return fZmax;}
-
-  void           SetCheckPointLevel(Int_t checkPointLevel)
-    {fCheckPointLevel = checkPointLevel;}
   
   // CDB storage activation
   void SetDefaultStorage(const char* uri);
@@ -119,10 +120,19 @@ public:
                    {fAlignObjArray = array;
                   fLoadAlignFromCDB = kFALSE;}
 
-  virtual Bool_t InitRun(const char* input);
-  virtual Bool_t RunEvent(Int_t iEvent);
-  virtual Bool_t FinishRun();
+  virtual Int_t  Version() const {return 2;}
+  virtual void   Begin(TTree*);
+  virtual void   SlaveBegin(TTree*);
+  virtual void   Init(TTree *tree);
+  virtual Bool_t Process(Long64_t entry);
+  virtual Bool_t ProcessEvent(Int_t iEvent);
+  virtual void   SlaveTerminate();
+  virtual void   Terminate();
   virtual Bool_t Run(const char* input = NULL);
+  void           Abort(const char *method, EAbort what);
+  virtual void  SetOption(const char* option) {
+    TSelector::SetOption(option);
+  }
 
   // Trackers
   AliTracker* GetTracker(Int_t idx) { return fTracker[idx]; }
@@ -130,24 +140,29 @@ public:
   void        ImportRunLoader(AliRunLoader* rl) { fRunLoader = rl; }
 
   // Quality Assurance 
-  virtual Bool_t RunQA(AliESDEvent *& esd);
-  void    SetQACycles(const char * detector, const Int_t cycles) { fQACycles[GetDetIndex(detector)] = cycles ; }
+  void    SetQACycles(AliQA::DETECTORINDEX_t det, const Int_t cycles) { fQACycles[det] = cycles ; }
   Bool_t  SetRunQA(TString detAndAction="ALL:ALL") ; 
   void    SetRunGlobalQA(Bool_t flag=kTRUE){fRunGlobalQA = flag;}
-  void    SetInLoopQA(Bool_t flag=kTRUE)   {fInLoopQA    = flag;} 
 
   // Plane Efficiency Evaluation
   void    SetRunPlaneEff(Bool_t flag=kFALSE)  {fRunPlaneEff = flag;}
 
+  enum {
+    fgkNDetectors = 15   // number of detectors
+  };
+  static Int_t   GetDetIndex(const char * detector);
+
 private:
   AliReconstruction(const AliReconstruction& rec);
   AliReconstruction& operator = (const AliReconstruction& rec);
 
-  void                  InitCDB();
-  Bool_t        InitGRP();
-  void                  SetCDBLock();
+  void           InitRun(const char* input);
+  void           InitRawReader(const char* input);
+  void           InitCDB();
+  Bool_t         InitGRP();
+  void           SetCDBLock();
   Bool_t         SetRunNumberFromData();
-  Bool_t         RunLocalReconstruction(const TString& detectors);
+  Bool_t         LoadCDB();
   Bool_t         RunLocalEventReconstruction(const TString& detectors);
   Bool_t         RunVertexFinder(AliESDEvent*& esd);
   Bool_t         RunHLTTracking(AliESDEvent*& esd);
@@ -162,10 +177,7 @@ private:
   Bool_t         InitRunLoader();
   AliReconstructor* GetReconstructor(Int_t iDet);
   Bool_t         CreateVertexer();
-  void           CleanUp(TFile* file = NULL, TFile* fileOld = NULL);
-
-  Bool_t         ReadESD(AliESDEvent*& esd, const char* recStep) const;
-  void           WriteESD(AliESDEvent* esd, const char* recStep) const;
+  void           CleanUp();
 
   //==========================================//
   void           WriteAlignmentData(AliESDEvent* esd);
@@ -173,8 +185,6 @@ private:
   void           FillRawDataErrorLog(Int_t iEvent, AliESDEvent* esd);
 
   //Quality Assurance
-  Int_t                GetDetIndex(const char * detector);
-  const Int_t          GetQACycles(const char * detector) { return fQACycles[GetDetIndex(detector)] ; }
   void                 CheckQA() ;
 
   // Plane Efficiency evaluation
@@ -184,9 +194,14 @@ private:
   Bool_t               InitAliEVE();
   void                 RunAliEVE();
 
+  Bool_t         InitRecoParams(); // init the array with the reconstruciton parameters
+  Bool_t         GetEventInfo();   // fill the event info inside the event loop
+
+  const char    *MatchDetectorList(const char *detectorList, UInt_t detectorMask);
+
   //*** Magnetic field map settings *******************
   Bool_t         fUniformField;       // uniform field tracking flag
-  AliMagF       *fForcedFieldMap;     // independent, not GRP, field map
+  AliMagF       *fForcedFieldMap;     //! independent, not GRP, field map
 
   //*** Global reconstruction flags *******************
   Bool_t         fRunVertexFinder;    // run the vertex finder
@@ -198,7 +213,6 @@ private:
   Bool_t         fStopOnError;        // stop or continue on errors
   Bool_t         fWriteAlignmentData; // write track space-points flag
   Bool_t         fWriteESDfriend;     // write ESD friend flag
-  Bool_t         fWriteAOD;           // write AOD flag
   Bool_t         fFillTriggerESD;     // fill trigger info into ESD
 
   //*** Clean ESD flag and parameters *******************
@@ -211,27 +225,29 @@ private:
   TString        fRunLocalReconstruction; // run the local reconstruction for these detectors
   TString        fRunTracking;        // run the tracking for these detectors
   TString        fFillESD;            // fill ESD for these detectors
+  TString        fLoadCDB;            // prefetch CDB entries and init reco-params for these detectors
   TString        fUseTrackingErrorsForAlignment; // for these detectors
   TString        fGAliceFileName;     // name of the galice file
-  TString        fInput;              // name of input file or directory
+  TString        fRawInput;           // name of input raw-data file or directory
   TString        fEquipIdMap;         // name of file with equipment id map
   Int_t          fFirstEvent;         // index of first event to be reconstr.
   Int_t          fLastEvent;          // index of last event to be reconstr.
   UInt_t         fNumberOfEventsPerFile; // number of events per file in case of raw-data reconstruction
-  Int_t          fCheckPointLevel;    // level of ESD check points
   TObjArray      fOptions;            // options for reconstructor objects
   Bool_t         fLoadAlignFromCDB;   // Load alignment data from CDB and apply it to geometry or not
   TString        fLoadAlignData;      // Load alignment data from CDB for these detectors
   TString        fESDPar;             // String where the esd.par is stored, will be attached to the tree         
   TString        fUseHLTData;        // Detectors for which the HLT data is used as input
+  AliRunInfo*    fRunInfo;            // an object which contains essential global conditions information
+  AliEventInfo   fEventInfo;          // an object which contains essential event information
 
   AliRunLoader*  fRunLoader;          //! current run loader object
   AliRawReader*  fRawReader;          //! current raw data reader
   AliRawReader*  fParentRawReader;    //! parent raw data reader in case of AliRawReaderHLT
 
-  static const Int_t fgkNDetectors = 15;   //! number of detectors
   static const char* fgkDetectorName[fgkNDetectors]; //! names of detectors
   AliReconstructor*  fReconstructor[fgkNDetectors];  //! array of reconstructor objects
+  AliRecoParam   fRecoParam;                      // container for the reco-param objects for detectors
   AliLoader*     fLoader[fgkNDetectors];   //! detector loaders
   AliVertexer*   fVertexer;                //! vertexer for ITS
   AliTracker*    fTracker[fgkNDetectors];  //! trackers
@@ -241,21 +257,20 @@ private:
 
   TMap*          fGRPData;              // Data from the GRP/GRP/Data CDB folder
 
-  TObjArray*    fAlignObjArray;      // array with the alignment objects to be applied to the geometry
+  TObjArray*    fAlignObjArray;      //! array with the alignment objects to be applied to the geometry
 
-  TString       fCDBUri;             // Uri of the default CDB storage
-  TObjArray      fSpecCDBUri;         // Array with detector specific CDB storages
+  TString       fCDBUri;             //! Uri of the default CDB storage
+  TObjArray      fSpecCDBUri;         //! Array with detector specific CDB storages
   Bool_t        fInitCDBCalled;               //! flag to check if CDB storages are already initialized
   Bool_t        fSetRunNumberFromDataCalled;  //! flag to check if run number is already loaded from run loader
 
   //Quality Assurance
   Int_t fQACycles[      fgkNDetectors]; // # events over which QA data are accumulated
   TString               fQADetectors ;  // list of detectors to be QA'ed       
-       AliQADataMakerSteer * fQASteer    ;   // steering class to run QA
+  AliQADataMakerSteer * fQASteer    ;   //! steering class to run QA
   TString               fQATasks ;      // list of QA tasks to be performed    
   Bool_t                fRunQA ;        // Run QA flag
   Bool_t                fRunGlobalQA;   // Run global QA flag
-  Bool_t                fInLoopQA;      // In-loop QA flag
   Bool_t                fSameQACycle;   //! open a new QA data file or not
   // Plane Efficiency Evaluation
   Bool_t         fRunPlaneEff ;      // Evaluate Plane Efficiency
@@ -268,14 +283,13 @@ private:
   TFile*               ffile;       //! Pointer to the ESD file
   TTree*               ftree;       //! Pointer to the ESD tree
   TTree*               fhlttree;    //! Pointer to the HLT ESD tree
-  TFile*               ffileOld;    //! Pointer to the previous ESD file
-  TTree*               ftreeOld;    //! Pointer to the previous ESD tree
-  TTree*               fhlttreeOld; //! Pointer to the previous HLT ESD tree
   AliVertexerTracks*   ftVertexer;  //! Pointer to the vertexer based on ESD tracks
   Bool_t               fIsNewRunLoader; // galice.root created from scratch (real raw data case)
   Bool_t               fRunAliEVE;  // Run AliEVE or not
 
-  ClassDef(AliReconstruction, 24)      // class for running the reconstruction
+  TTree*              fChain;      //! The raw-data chain in case of AliRawReaderChain
+
+  ClassDef(AliReconstruction, 27)      // class for running the reconstruction
 };
 
 #endif