]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - STEER/AliReconstruction.h
Speed-up of reordering loop.
[u/mrichter/AliRoot.git] / STEER / AliReconstruction.h
index ac05845c6fea6c48092badec1338dcc17a5b9701..4aa168e8669f5947386ea67349aba40b4ebe52cc 100644 (file)
 
 /* $Id$ */
 
+///////////////////////////////////////////////////////////////////////////////
+//                                                                           //
+// class for running the reconstruction                                      //
+// Clusters and tracks are created for all detectors and all events by       //
+// typing:                                                                   //
+//                                                                           //
+//   AliReconstruction rec;                                                  //
+//   rec.Run();                                                              //
+//                                                                           //
+///////////////////////////////////////////////////////////////////////////////
+
+
 #include <TNamed.h>
 #include <TString.h>
+#include <TObjArray.h>
 
+class AliReconstructor;
 class AliRunLoader;
+class AliRawReader;
 class AliLoader;
+class AliVertexer;
 class AliTracker;
 class AliESD;
+class TFile;
 
 
 class AliReconstruction: public TNamed {
 public:
-  AliReconstruction(const char* name = "AliReconstruction", 
+  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           SetRunReconstruction(const char* detectors) {
-    fRunReconstruction = detectors;};
-  void           SetRunTracking(Bool_t run) {fRunTracking = run;};
+  void           SetInput(const char* input) {fInput = input;};
+  void           SetEventRange(Int_t firstEvent = 0, Int_t lastEvent = -1) 
+    {fFirstEvent = firstEvent; fLastEvent = lastEvent;};
+  void           SetOption(const char* detector, const char* option);
+
+  void           SetRunLocalReconstruction(const char* detectors) {
+    fRunLocalReconstruction = detectors;};
+  void           SetRunVertexFinder(Bool_t run) {fRunVertexFinder = run;};
+  void           SetRunTracking(const char* detectors) {
+    fRunTracking = detectors;};
   void           SetFillESD(const char* detectors) {fFillESD = detectors;};
-
-  virtual Bool_t Run();
+  void           SetRunReconstruction(const char* detectors) {
+    SetRunLocalReconstruction(detectors); 
+    SetRunTracking(detectors);
+    SetFillESD(detectors);};
+
+  void           SetStopOnError(Bool_t stopOnError) 
+    {fStopOnError = stopOnError;}
+  void           SetCheckPointLevel(Int_t checkPointLevel)
+    {fCheckPointLevel = checkPointLevel;}
+
+  virtual Bool_t Run(const char* input, 
+                    Int_t firstEvent, Int_t lastEvent = -1);
+  Bool_t         Run(const char* input = NULL)
+    {return Run(input, fFirstEvent, fLastEvent);};
+  Bool_t         Run(Int_t firstEvent, Int_t lastEvent = -1)
+    {return Run(NULL, firstEvent, lastEvent);};
 
 private:
-  void           Init();
+  Bool_t         RunLocalReconstruction(const TString& detectors);
+  Bool_t         RunLocalEventReconstruction(const TString& detectors);
+  Bool_t         RunVertexFinder(AliESD*& esd);
+  Bool_t         RunHLTTracking(AliESD*& esd);
+  Bool_t         RunTracking(AliESD*& esd);
+  Bool_t         FillESD(AliESD*& esd, const TString& detectors);
 
   Bool_t         IsSelected(TString detName, TString& detectors) const;
-
-  Bool_t         RunReconstruction(const TString& detectors);
-  Bool_t         RunTracking(AliESD* esd);
-  Bool_t         FillESD(AliESD* esd, const TString& detectors);
-
-  TString        fRunReconstruction;  // run the reconstr. for these detectors
-  Bool_t         fRunTracking;        // run the barrel tracking
+  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(AliESD*& esd, const char* recStep) const;
+  void           WriteESD(AliESD* esd, const char* recStep) const;
+
+  TString        fRunLocalReconstruction; // run the local reconstruction for these detectors
+  Bool_t         fRunVertexFinder;    // run the vertex finder
+  Bool_t         fRunHLTTracking;     // run the HLT tracking
+  TString        fRunTracking;        // run the tracking for these detectors
   TString        fFillESD;            // fill ESD for these detectors
-  Bool_t         fStopOnError;        // stop or continue on errors
-
   TString        fGAliceFileName;     // name of the galice file
+  TString        fInput;              // name of input file or directory
+  Int_t          fFirstEvent;         // index of first event to be reconstr.
+  Int_t          fLastEvent;          // index of last event to be reconstr.
+  Bool_t         fStopOnError;        // stop or continue on errors
+  Int_t          fCheckPointLevel;    // level of ESD check points
+  TObjArray      fOptions;            // options for reconstructor objects
 
   AliRunLoader*  fRunLoader;          //! current run loader object
-  AliLoader*     fITSLoader;          //! loader for ITS
-  AliTracker*    fITSTracker;         //! tracker for ITS
-  AliLoader*     fTPCLoader;          //! loader for TPC
-  AliTracker*    fTPCTracker;         //! tracker for TPC
-  AliLoader*     fTRDLoader;          //! loader for TRD
-  AliTracker*    fTRDTracker;         //! tracker for TRD
-  AliLoader*     fTOFLoader;          //! loader for TOF
-  AliTracker*    fTOFTracker;         //! tracker for TOF
-
-  ClassDef(AliReconstruction, 1)      // class for running the reconstruction
+  AliRawReader*  fRawReader;          //! current raw data reader
+
+  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
+
+  ClassDef(AliReconstruction, 4)      // class for running the reconstruction
 };
 
 #endif