]> git.uio.no Git - u/mrichter/AliRoot.git/blob - STEER/AliReconstruction.h
157b1b83efcc037e6fdca80bcfbf717afb3fab14
[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
24 class AliReconstructor;
25 class AliRunLoader;
26 class AliRawReader;
27 class AliLoader;
28 class AliTracker;
29 class AliVertexer;
30 class AliESD;
31 class TFile;
32
33 class AliRunTag;
34 class AliLHCTag;
35 class AliDetectorTag;
36 class AliEventTag;
37
38
39 class AliReconstruction: public TNamed {
40 public:
41   AliReconstruction(const char* gAliceFilename = "galice.root",
42                     const char* name = "AliReconstruction", 
43                     const char* title = "reconstruction");
44   AliReconstruction(const AliReconstruction& rec);
45   AliReconstruction& operator = (const AliReconstruction& rec);
46   virtual ~AliReconstruction();
47
48   void           SetGAliceFile(const char* fileName);
49   void           SetInput(const char* input) {fInput = input;};
50   void           SetEventRange(Int_t firstEvent = 0, Int_t lastEvent = -1) 
51     {fFirstEvent = firstEvent; fLastEvent = lastEvent;};
52   void           SetOption(const char* detector, const char* option);
53
54   void           SetRunLocalReconstruction(const char* detectors) {
55     fRunLocalReconstruction = detectors;};
56   void           SetRunVertexFinder(Bool_t run) {fRunVertexFinder = run;};
57   void           SetRunTracking(const char* detectors) {
58     fRunTracking = detectors;};
59   void           SetFillESD(const char* detectors) {fFillESD = detectors;};
60   void           SetRunReconstruction(const char* detectors) {
61     SetRunLocalReconstruction(detectors); 
62     SetRunTracking(detectors);
63     SetFillESD(detectors);};
64
65    void SetUniformFieldTracking(){fUniformField=kTRUE;} 
66    void SetNonuniformFieldTracking(){fUniformField=kFALSE;} 
67
68   void           SetStopOnError(Bool_t stopOnError) 
69     {fStopOnError = stopOnError;}
70   void           SetCheckPointLevel(Int_t checkPointLevel)
71     {fCheckPointLevel = checkPointLevel;}
72
73   virtual Bool_t Run(const char* input, 
74                      Int_t firstEvent, Int_t lastEvent = -1);
75   Bool_t         Run(const char* input = NULL)
76     {return Run(input, fFirstEvent, fLastEvent);};
77   Bool_t         Run(Int_t firstEvent, Int_t lastEvent = -1)
78     {return Run(NULL, firstEvent, lastEvent);};
79
80   void SetWriteAlignmentData(){fWriteAlignmentData=kTRUE;}
81
82 private:
83   Bool_t         RunLocalReconstruction(const TString& detectors);
84   Bool_t         RunLocalEventReconstruction(const TString& detectors);
85   Bool_t         RunVertexFinder(AliESD*& esd);
86   Bool_t         RunHLTTracking(AliESD*& esd);
87   Bool_t         RunTracking(AliESD*& esd);
88   Bool_t         FillESD(AliESD*& esd, const TString& detectors);
89
90   Bool_t         IsSelected(TString detName, TString& detectors) const;
91   Bool_t         InitRunLoader();
92   AliReconstructor* GetReconstructor(Int_t iDet);
93   Bool_t         CreateVertexer();
94   Bool_t         CreateTrackers(const TString& detectors);
95   void           CleanUp(TFile* file = NULL, TFile* fileOld = NULL);
96
97   Bool_t         ReadESD(AliESD*& esd, const char* recStep) const;
98   void           WriteESD(AliESD* esd, const char* recStep) const;
99
100  
101   //===========================================//
102   void           CreateTag(TFile* file);
103   //==========================================//
104
105   void           WriteAlignmentData(AliESD* esd);
106
107
108
109   TString        fRunLocalReconstruction; // run the local reconstruction for these detectors
110   Bool_t         fUniformField;       // uniform field tracking flag
111   Bool_t         fRunVertexFinder;    // run the vertex finder
112   Bool_t         fRunHLTTracking;     // run the HLT tracking
113   TString        fRunTracking;        // run the tracking for these detectors
114   TString        fFillESD;            // fill ESD for these detectors
115   TString        fGAliceFileName;     // name of the galice file
116   TString        fInput;              // name of input file or directory
117   Int_t          fFirstEvent;         // index of first event to be reconstr.
118   Int_t          fLastEvent;          // index of last event to be reconstr.
119   Bool_t         fStopOnError;        // stop or continue on errors
120   Int_t          fCheckPointLevel;    // level of ESD check points
121   TObjArray      fOptions;            // options for reconstructor objects
122
123   AliRunLoader*  fRunLoader;          //! current run loader object
124   AliRawReader*  fRawReader;          //! current raw data reader
125
126   static const Int_t fgkNDetectors = 15;   //! number of detectors
127   static const char* fgkDetectorName[fgkNDetectors]; //! names of detectors
128   AliReconstructor*  fReconstructor[fgkNDetectors];  //! array of reconstructor objects
129   AliLoader*     fLoader[fgkNDetectors];   //! detector loaders
130   AliVertexer*   fVertexer;                //! vertexer for ITS
131   AliTracker*    fTracker[fgkNDetectors];  //! trackers
132
133   Bool_t         fWriteAlignmentData; // write track space-points flag
134
135   ClassDef(AliReconstruction, 6)      // class for running the reconstruction
136 };
137
138 #endif