]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - STEER/AliReconstruction.h
Major commit related to steering of the reco parameters: AliDAQ and trigger classes...
[u/mrichter/AliRoot.git] / STEER / AliReconstruction.h
index 5b66333a08e0e066484661445ce8c2b145f850c3..90785d6043c4b410262451c580786fe701d9dcfe 100644 (file)
@@ -26,31 +26,40 @@ class AliRunLoader;
 class AliRawReader;
 class AliLoader;
 class AliTracker;
+class AliMagF;
 class AliVertexer;
 class AliESDVertex;
 class AliESDEvent;
+class AliESDfriend;
+class AliVertexerTracks;
 class TFile;
 class TTree;
 class TList;
-class AliQADataMakerRec;
+class AliQADataMakerSteer; 
+class TMap;
+class AliRecoParam;
+class AliDetectorRecoParam;
+class AliRunInfo;
+#include "AliEventInfo.h"
+#include "AliRecoParam.h"
 
 class AliReconstruction: public TNamed {
 public:
   AliReconstruction(const char* gAliceFilename = "galice.root",
                    const char* name = "AliReconstruction", 
                    const char* title = "reconstruction");
-  AliReconstruction(const AliReconstruction& rec);
-  AliReconstruction& operator = (const AliReconstruction& rec);
   virtual ~AliReconstruction();
 
   void           SetGAliceFile(const char* fileName);
-  void           SetInput(const char* input) {fInput = input;};
+  void           SetInput(const char* input);
+
   void           SetEquipmentIdMap(const char *mapFile) {fEquipIdMap = mapFile;};
   void           SetEventRange(Int_t firstEvent = 0, Int_t lastEvent = -1) 
     {fFirstEvent = firstEvent; fLastEvent = lastEvent;};
   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;};
@@ -70,8 +79,14 @@ public:
   TNamed *CopyFileToTNamed(TString fPath,TString fName);
   void  TNamedToFile(TTree* fTree, TString fName);
 
-  //*** Global reconstruction flag setters
+  //*** Magnetic field setters
   void SetUniformFieldTracking(Bool_t flag=kTRUE){fUniformField=flag;} 
+  Bool_t 
+  SetFieldMap(Float_t l3Current=30000., Float_t diCurrent=6000., 
+             Float_t factor=1., 
+              const char *path="$(ALICE_ROOT)/data/maps/mfchebKGI_meas.root");
+
+  //*** Global reconstruction flag setters
   void SetRunVertexFinder(Bool_t flag=kTRUE) {fRunVertexFinder=flag;};
   void SetRunVertexFinderTracks(Bool_t flag=kTRUE) {fRunVertexFinderTracks=flag;};
   void SetRunHLTTracking(Bool_t flag=kTRUE) {fRunHLTTracking=flag;};
@@ -110,20 +125,37 @@ public:
                    {fAlignObjArray = array;
                   fLoadAlignFromCDB = kFALSE;}
 
-  virtual Bool_t Run(const char* input = NULL,Bool_t IsOnline = kFALSE);
+  virtual Bool_t InitRun(const char* input);
+  virtual Bool_t RunEvent(Int_t iEvent);
+  virtual Bool_t FinishRun();
+  virtual Bool_t Run(const char* input = NULL);
+
+  // Trackers
+  AliTracker* GetTracker(Int_t idx) { return fTracker[idx]; }
+  Bool_t      CreateTrackers(const TString& detectors);
+  void        ImportRunLoader(AliRunLoader* rl) { fRunLoader = rl; }
 
   // Quality Assurance 
-  virtual Bool_t RunQA(const char* detectors, AliESDEvent *& esd);
+  virtual Bool_t RunQA(AliESDEvent *& esd);
   void    SetQACycles(const char * detector, const Int_t cycles) { fQACycles[GetDetIndex(detector)] = cycles ; }
-  void    SetRunQA(Bool_t flag=kTRUE)      {fRunQA = flag ;} 
+  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();
   Bool_t         SetRunNumberFromData();
   Bool_t         RunLocalReconstruction(const TString& detectors);
@@ -141,7 +173,6 @@ private:
   Bool_t         InitRunLoader();
   AliReconstructor* GetReconstructor(Int_t iDet);
   Bool_t         CreateVertexer();
-  Bool_t         CreateTrackers(const TString& detectors);
   void           CleanUp(TFile* file = NULL, TFile* fileOld = NULL);
 
   Bool_t         ReadESD(AliESDEvent*& esd, const char* recStep) const;
@@ -153,8 +184,6 @@ private:
   void           FillRawDataErrorLog(Int_t iEvent, AliESDEvent* esd);
 
   //Quality Assurance
-  Int_t                GetDetIndex(const char * detector);
-  AliQADataMakerRec*   GetQADataMaker(Int_t iDet);
   const Int_t          GetQACycles(const char * detector) { return fQACycles[GetDetIndex(detector)] ; }
   void                 CheckQA() ;
 
@@ -162,8 +191,19 @@ private:
   Bool_t  FinishPlaneEff(); //ultimate tasks related to Plane Eff. evaluation 
   Bool_t  InitPlaneEff();   // initialize what is needed for Plane Eff. evaluation
 
-  //*** Global reconstruction flags *******************
+  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
+
+  //*** Global reconstruction flags *******************
   Bool_t         fRunVertexFinder;    // run the vertex finder
   Bool_t         fRunVertexFinderTracks;    // run the vertex finder with tracks
   Bool_t         fRunHLTTracking;     // run the HLT tracking
@@ -199,14 +239,16 @@ private:
   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
@@ -214,7 +256,7 @@ private:
   AliESDVertex*  fDiamondProfileTPC;       // (x,y) diamond profile from TPC for AliVertexerTracks
   Bool_t         fMeanVertexConstraint; // use fDiamondProfile in AliVertexerTracks
 
-  TList*         fGRPList;            // TList from the GRP/GRP/Data CDB folder
+  TMap*          fGRPData;              // Data from the GRP/GRP/Data CDB folder
 
   TObjArray*    fAlignObjArray;      // array with the alignment objects to be applied to the geometry
 
@@ -224,15 +266,33 @@ private:
   Bool_t        fSetRunNumberFromDataCalled;  //! flag to check if run number is already loaded from run loader
 
   //Quality Assurance
-  AliQADataMakerRec *fQADataMaker[fgkNDetectors+1];  //! array of QA data makers
-  Int_t fQACycles[   fgkNDetectors];// # events over which QA data are accumulated
-  Bool_t             fRunQA ;        // Run QA flag
-  Bool_t             fRunGlobalQA;   // Run global QA flag
-  Bool_t             fInLoopQA;      // In-loop QA flag
+  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
+  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
 
-  ClassDef(AliReconstruction, 21)      // class for running the reconstruction
+  // New members needed in order to split Run method
+  // into InitRun,RunEvent,FinishRun methods
+  AliESDEvent*         fesd;        //! Pointer to the ESD event object
+  AliESDEvent*         fhltesd;     //! Pointer to the HLT ESD event object
+  AliESDfriend*        fesdf;       //! Pointer to the ESD friend object
+  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, 25)      // class for running the reconstruction
 };
 
 #endif