]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - STEER/AliReconstruction.h
Correcting the treatment of the current signs and magnet polarities.
[u/mrichter/AliRoot.git] / STEER / AliReconstruction.h
index 83c0f350cb4a9b4ad488bb61c63c0a9447d8bd2a..39172e4a1737d25bae3bb365b5cf4d1ee0637ddc 100644 (file)
@@ -26,26 +26,28 @@ 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 AliQADataMakerRec;
+class TMap;
 
 class AliReconstruction: public TNamed {
 public:
   AliReconstruction(const char* gAliceFilename = "galice.root",
-                   const char* cdbUri = "local://$ALICE_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;};
@@ -71,9 +73,16 @@ 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;};
   void SetRunV0Finder(Bool_t flag=kTRUE) {fRunV0Finder=flag;};
   void SetRunCascadeFinder(Bool_t flag=kTRUE) {fRunCascadeFinder=flag;};
@@ -83,39 +92,61 @@ public:
   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;}
+  void SetMeanVertexConstraint(Bool_t flag=kTRUE){fMeanVertexConstraint=flag;}
                   
   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;}
   void SetZmax(Float_t z) {fZmax=z;}
+  Float_t GetV0DCAmax() const {return fV0DCAmax;}
+  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 InitCDBStorage();
   void SetDefaultStorage(const char* uri);
-  void SetRemoteStorage(const char* uri);
   void SetSpecificStorage(const char* calibType, const char* uri);
 
-  Bool_t SetRunNumber();
-
   Bool_t MisalignGeometry(const TString& detectors);
 
   void           SetAlignObjArray(TObjArray *array)
                    {fAlignObjArray = array;
                   fLoadAlignFromCDB = 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);
 
-  // AOD creation
-  void ESDFile2AODFile(TFile* esdFile, TFile* aodFile);
+  // 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);
-//  void    SetQACycles(const char * detector, const Int_t cycles) { fQACycles[GetDetIndex(detector)] = cycles ; }
+  virtual Bool_t RunQA(AliESDEvent *& esd);
+  void    SetQACycles(const char * detector, const Int_t cycles) { fQACycles[GetDetIndex(detector)] = 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;}
 
 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);
   Bool_t         RunLocalEventReconstruction(const TString& detectors);
   Bool_t         RunVertexFinder(AliESDEvent*& esd);
@@ -131,7 +162,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;
@@ -144,14 +174,24 @@ private:
 
   //Quality Assurance
   Int_t                GetDetIndex(const char * detector);
-//  AliQADataMaker*      GetQADataMaker(Int_t iDet);
-//  const Int_t          GetQACycles(const char * detector) { return fQACycles[GetDetIndex(detector)] ; }
+  AliQADataMakerRec*   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();
+
+  //*** 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
   Bool_t         fRunMuonTracking;    // run the HLT tracking
   Bool_t         fRunV0Finder;        // run the ESD V0 finder
@@ -164,6 +204,8 @@ private:
 
   //*** Clean ESD flag and parameters *******************
   Bool_t         fCleanESD;      // clean ESD flag
+  Float_t        fV0DCAmax;      // max. allowed DCA between V0 daugthers 
+  Float_t        fV0CsPmin;      // min. allowed cosine of V0 pointing angle 
   Float_t        fDmax;          // max. allowed transverse impact parameter 
   Float_t        fZmax;          // max. allowed longitudinal impact parameter 
 
@@ -182,10 +224,11 @@ private:
   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
 
   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
@@ -194,21 +237,46 @@ private:
   AliVertexer*   fVertexer;                //! vertexer for ITS
   AliTracker*    fTracker[fgkNDetectors];  //! trackers
   AliESDVertex*  fDiamondProfile;          // (x,y) diamond profile for AliVertexerTracks
+  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
 
   TString       fCDBUri;             // Uri of the default CDB storage
-  TString       fRemoteCDBUri;       // Uri of the remote 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
-//  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, 16)      // class for running the reconstruction
+  AliQADataMakerRec *fQADataMaker[fgkNDetectors+1];  //! array of QA data makers
+  Int_t fQACycles[   fgkNDetectors];// # events over which QA data are accumulated
+  TString            fQADetectors ;  // list of detectors to be QA'ed  
+  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
+
+  // 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, 24)      // class for running the reconstruction
 };
 
 #endif