]> git.uio.no Git - u/mrichter/AliRoot.git/blob - STEER/AliReconstruction.h
framework for reconstruction of raw data
[u/mrichter/AliRoot.git] / STEER / AliReconstruction.h
1 #ifndef ALIRECONSTRUCTION_H
2 #define ALIRECONSTRUCTION_H
3 /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4  * See cxx source for full Copyright notice                               */
5
6 /* $Id$ */
7
8 ///////////////////////////////////////////////////////////////////////////////
9 //                                                                           //
10 // class for running the reconstruction                                      //
11 // Clusters and tracks are created for all detectors and all events by       //
12 // typing:                                                                   //
13 //                                                                           //
14 //   AliReconstruction rec;                                                  //
15 //   rec.Run();                                                              //
16 //                                                                           //
17 ///////////////////////////////////////////////////////////////////////////////
18
19
20 #include <TNamed.h>
21 #include <TString.h>
22 #include <TObjArray.h>
23 #include "AliReconstructor.h"
24 #include "AliDetector.h"
25
26 class AliRunLoader;
27 class AliRawReader;
28 class AliLoader;
29 class AliVertexer;
30 class AliTracker;
31 class AliESD;
32 class TFile;
33
34
35 class AliReconstruction: public TNamed {
36 public:
37   AliReconstruction(const char* gAliceFilename = "galice.root",
38                     const char* name = "AliReconstruction", 
39                     const char* title = "reconstruction");
40   AliReconstruction(const AliReconstruction& rec);
41   AliReconstruction& operator = (const AliReconstruction& rec);
42   virtual ~AliReconstruction();
43
44   void           SetGAliceFile(const char* fileName);
45   void           SetInput(const char* input) {fInput = input;};
46   void           SetOption(const char* detector, const char* option);
47
48   void           SetRunLocalReconstruction(const char* detectors) {
49     fRunLocalReconstruction = detectors;};
50   void           SetRunVertexFinder(Bool_t run) {fRunVertexFinder = run;};
51   void           SetRunTracking(Bool_t run) {fRunTracking = run;};
52   void           SetFillESD(const char* detectors) {fFillESD = detectors;};
53
54   void           SetStopOnError(Bool_t stopOnError) 
55     {fStopOnError = stopOnError;}
56   void           SetCheckPointLevel(Int_t checkPointLevel)
57     {fCheckPointLevel = checkPointLevel;}
58
59   virtual Bool_t Run(const char* input = NULL);
60
61 private:
62   class AliDummyReconstructor: public AliReconstructor {
63   public:
64     AliDummyReconstructor(AliDetector* detector) {fDetector = detector;};
65     virtual ~AliDummyReconstructor() {};
66
67     virtual void         Reconstruct(AliRunLoader* /*runLoader*/) const
68       {fDetector->Reconstruct();};
69     virtual AliVertexer* CreateVertexer(AliRunLoader* /*runLoader*/) const 
70       {return fDetector->CreateVertexer();}
71     virtual AliTracker*  CreateTracker(AliRunLoader* /*runLoader*/) const 
72       {return fDetector->CreateTracker();}
73     virtual void         FillESD(AliRunLoader* /*runLoader*/, AliESD* esd) const
74       {fDetector->FillESD(esd);};
75
76     virtual const char*  GetDetectorName() const
77       {return fDetector->GetName();};
78   private:
79     AliDummyReconstructor(const AliDummyReconstructor &drc):
80       AliReconstructor(drc)
81       {Fatal("copy ctor","Not implemented\n");}
82     AliDummyReconstructor & operator=(const AliDummyReconstructor &)
83       {Fatal("= operator","Not implemented\n"); return *this;}
84     AliDetector*         fDetector;   // detector object
85   };
86
87   Bool_t         RunLocalReconstruction(const TString& detectors);
88   Bool_t         RunVertexFinder(AliESD*& esd);
89   Bool_t         RunTracking(AliESD*& esd);
90   Bool_t         FillESD(AliESD*& esd, const TString& detectors);
91
92   Bool_t         IsSelected(TString detName, TString& detectors) const;
93   AliReconstructor* GetReconstructor(const char* detName) const;
94   Bool_t         CreateVertexer();
95   Bool_t         CreateTrackers();
96   void           CleanUp(TFile* file = NULL);
97
98   Bool_t         ReadESD(AliESD*& esd, const char* recStep) const;
99   void           WriteESD(AliESD* esd, const char* recStep) const;
100
101   TString        fRunLocalReconstruction; // run the local reconstruction for these detectors
102   Bool_t         fRunVertexFinder;    // run the vertex finder
103   Bool_t         fRunTracking;        // run the barrel tracking
104   TString        fFillESD;            // fill ESD for these detectors
105   TString        fGAliceFileName;     // name of the galice file
106   TString        fInput;              // name of input file or directory
107   Bool_t         fStopOnError;        // stop or continue on errors
108   Int_t          fCheckPointLevel;    // level of ESD check points
109
110   AliRunLoader*  fRunLoader;          //! current run loader object
111   AliRawReader*  fRawReader;          //! current raw data reader
112   AliLoader*     fITSLoader;          //! loader for ITS
113   AliVertexer*   fITSVertexer;        //! vertexer for ITS
114   AliTracker*    fITSTracker;         //! tracker for ITS
115   AliLoader*     fTPCLoader;          //! loader for TPC
116   AliTracker*    fTPCTracker;         //! tracker for TPC
117   AliLoader*     fTRDLoader;          //! loader for TRD
118   AliTracker*    fTRDTracker;         //! tracker for TRD
119   AliLoader*     fTOFLoader;          //! loader for TOF
120   AliTracker*    fTOFTracker;         //! tracker for TOF
121
122   static const Int_t fgkNDetectors = 15;   //! number of detectors
123   static const char* fgkDetectorName[fgkNDetectors]; //! names of detectors
124   TObjArray      fReconstructors;     //! array of reconstructor objects
125   TObjArray      fOptions;            // options for reconstructor objects
126
127   ClassDef(AliReconstruction, 2)      // class for running the reconstruction
128 };
129
130 #endif