]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - STEER/AliReconstruction.h
QA ref defaut storage setter in sim and rec
[u/mrichter/AliRoot.git] / STEER / AliReconstruction.h
index 66649ab095ae5f9ce5099cccc9edd5cfe4d5e777..0b16b4a24e1eace3614aa34046b200e1287a3bbd 100644 (file)
 // Clusters and tracks are created for all detectors and all events by       //
 // typing:                                                                   //
 //                                                                           //
-//   AliReconstruction rec;                                                  //
+//   AliReconstruction rec;                                                 QARef //
 //   rec.Run();                                                              //
 //                                                                           //
 ///////////////////////////////////////////////////////////////////////////////
 
 
-#include <TNamed.h>
+#include <TSelector.h>
 #include <TString.h>
 #include <TObjArray.h>
 
@@ -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 AliQADataMaker;
-
-class AliReconstruction: public TNamed {
+class AliQAManager; 
+class TMap;
+class AliRecoParam;
+class AliDetectorRecoParam;
+class AliRunInfo;
+class AliGRPObject;
+#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 AliReconstruction& rec);
-  AliReconstruction& operator = (const AliReconstruction& rec);
+  AliReconstruction(const char* gAliceFilename = "galice.root");
   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;};
@@ -66,24 +75,30 @@ public:
   void           SetLoadAlignFromCDB(Bool_t load)  {fLoadAlignFromCDB = load;};
   void           SetLoadAlignData(const char* detectors) 
     {fLoadAlignData = detectors;};
-  void           SetESDParLocation(const char *c){fESDPar = c;}
-  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 l3Pol=1., Float_t dipPol=1., Float_t benergy=7000., 
+                    const Char_t* btype="pp",  
+                    const Char_t* path="$(ALICE_ROOT)/data/maps/mfchebKGI_sym.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;};
   void SetRunV0Finder(Bool_t flag=kTRUE) {fRunV0Finder=flag;};
   void SetRunCascadeFinder(Bool_t flag=kTRUE) {fRunCascadeFinder=flag;};
   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 SetDiamondProfileSPD(AliESDVertex *dp) {fDiamondProfileSPD=dp;}
   void SetDiamondProfile(AliESDVertex *dp) {fDiamondProfile=dp;}
+  void SetDiamondProfileTPC(AliESDVertex *dp) {fDiamondProfileTPC=dp;}
                   
   void SetCleanESD(Bool_t flag=kTRUE){fCleanESD=flag;}
+  void SetUseHLTData(const char* detectors){fUseHLTData=detectors;}
   void SetV0DCAmax(Float_t d) {fV0DCAmax=d;}
   void SetV0CsPmin(Float_t d) {fV0CsPmin=d;}
   void SetDmax(Float_t d) {fDmax=d;}
@@ -92,9 +107,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);
@@ -106,20 +118,53 @@ public:
                    {fAlignObjArray = array;
                   fLoadAlignFromCDB = kFALSE;}
 
+  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);
+  }
 
-  // AOD creation
-  void ESDFile2AODFile(TFile* esdFile, TFile* aodFile);
+  // Trackers
+  AliTracker* GetTracker(Int_t idx) const { 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);
-//  void    SetQACycles(const char * detector, const Int_t cycles) { fQACycles[GetDetIndex(detector)] = cycles ; }
+  void    SetQACycles(AliQA::DETECTORINDEX_t det, Int_t cycles) { fQACycles[det] = cycles ; }
+  void    SetQAWriteExpert(AliQA::DETECTORINDEX_t det) { fQAWriteExpert[det] = kTRUE ; }
+  Bool_t  SetRunQA(TString detAndAction="ALL:ALL") ; 
+  void    SetRunGlobalQA(Bool_t flag=kTRUE){fRunGlobalQA = flag;}
+  void    SetQARefDefaultStorage(const char* uri);
+  void    InitQA();
+
+
+  // Plane Efficiency Evaluation
+  void    SetRunPlaneEff(Bool_t flag=kFALSE)  {fRunPlaneEff = flag;}
+
+  enum {
+    kNDetectors = 15   // number of detectors
+  };
+  static Int_t   GetDetIndex(const char * detector);
 
 private:
-  void                  InitCDB();
-  void                  SetCDBLock();
+  AliReconstruction(const AliReconstruction& rec);
+  AliReconstruction& operator = (const AliReconstruction& rec);
+
+  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);
@@ -133,12 +178,8 @@ private:
   Bool_t         IsSelected(TString detName, TString& detectors) const;
   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;
-  void           WriteESD(AliESDEvent* esd, const char* recStep) const;
+  AliVertexer*   CreateVertexer();
+  void           CleanUp();
 
   //==========================================//
   void           WriteAlignmentData(AliESDEvent* esd);
@@ -146,15 +187,26 @@ private:
   void           FillRawDataErrorLog(Int_t iEvent, AliESDEvent* esd);
 
   //Quality Assurance
-  Int_t                GetDetIndex(const char * detector);
-//  AliQADataMaker*      GetQADataMaker(Int_t iDet);
-//  const Int_t          GetQACycles(const char * detector) { return fQACycles[GetDetIndex(detector)] ; }
   void                 CheckQA() ;
-  void        SetQA(const Bool_t val) { fRunQA = val ; } 
 
-  //*** Global reconstruction flags *******************
+  // Plane Efficiency evaluation
+  Bool_t  FinishPlaneEff(); //ultimate tasks related to Plane Eff. evaluation 
+  Bool_t  InitPlaneEff();   // initialize what is needed for Plane Eff. evaluation
+
+  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
+
+  //*** 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
   Bool_t         fRunMuonTracking;    // run the HLT tracking
   Bool_t         fRunV0Finder;        // run the ESD V0 finder
@@ -162,7 +214,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 *******************
@@ -175,46 +226,72 @@ 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
-  AliLoader*     fLoader[fgkNDetectors];   //! detector loaders
-  AliVertexer*   fVertexer;                //! vertexer for ITS
-  AliTracker*    fTracker[fgkNDetectors];  //! trackers
-  AliESDVertex*  fDiamondProfile;          // (x,y) diamond profile for AliVertexerTracks
+  static const char* fgkDetectorName[kNDetectors]; //! names of detectors
+  AliReconstructor*  fReconstructor[kNDetectors];  //! array of reconstructor objects
+  AliRecoParam   fRecoParam;                      // container for the reco-param objects for detectors
+  AliLoader*     fLoader[kNDetectors];   //! detector loaders
+  AliTracker*    fTracker[kNDetectors];  //! trackers
+  AliESDVertex*  fDiamondProfileSPD;       // (x,y) diamond profile from SPD for AliITSVertexer3D(Z)
+  AliESDVertex*  fDiamondProfile;          // (x,y) diamond profile for AliVertexerTracks (ITS+TPC)
+  AliESDVertex*  fDiamondProfileTPC;       // (x,y) diamond profile from TPC for AliVertexerTracks
 
-  TList*         fGRPList;            // TList from the GRP/GRP/Data CDB folder
+  AliGRPObject*  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
+  TString       fQARefUri;         //! Uri of the default QA reference 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
-//  AliQADataMaker * fQADataMaker[fgkNDetectors];  //! array of QA data maker objects
-//  Int_t                 fQACycles[fgkNDetectors] ;         // cycle length (# events) over which QA data are accumulated
-  Bool_t              fRunQA ;                        // Runs the QA at the end of simulation
-
-  ClassDef(AliReconstruction, 17)      // class for running the reconstruction
+  Int_t  fQACycles[     AliQA::kNDET];  // # events over which QA data are accumulated
+  Bool_t fQAWriteExpert[AliQA::kNDET];  // Flag to save or not expert QA data
+  TString               fQADetectors ;  // list of detectors to be QA'ed       
+  AliQAManager * fQAManager    ;   //! 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                fSameQACycle;   //! open a new QA data file or not
+  Bool_t                fInitQACalled;  //! control of QA intialisation
+  // Plane Efficiency Evaluation
+  Bool_t         fRunPlaneEff ;      // Evaluate Plane Efficiency
+
+  // 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
+  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
+
+  TTree*              fChain;      //! The raw-data chain in case of AliRawReaderChain
+
+  ClassDef(AliReconstruction, 31)      // class for running the reconstruction
 };
 
 #endif