]> git.uio.no Git - u/mrichter/AliRoot.git/blob - STEER/AliReconstruction.h
Coding Convention Violations
[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 AliLoader;
28 class AliVertexer;
29 class AliTracker;
30 class AliESD;
31 class TFile;
32
33
34 class AliReconstruction: public TNamed {
35 public:
36   AliReconstruction(const char* gAliceFilename = "galice.root",
37                     const char* name = "AliReconstruction", 
38                     const char* title = "reconstruction");
39   AliReconstruction(const AliReconstruction& rec);
40   AliReconstruction& operator = (const AliReconstruction& rec);
41   virtual ~AliReconstruction();
42
43   void           SetGAliceFile(const char* fileName);
44
45   void           SetRunLocalReconstruction(const char* detectors) {
46     fRunLocalReconstruction = detectors;};
47   void           SetRunVertexFinder(Bool_t run) {fRunVertexFinder = run;};
48   void           SetRunTracking(Bool_t run) {fRunTracking = run;};
49   void           SetFillESD(const char* detectors) {fFillESD = detectors;};
50
51   void           SetStopOnError(Bool_t stopOnError) 
52     {fStopOnError = stopOnError;}
53   void           SetCheckPointLevel(Int_t checkPointLevel)
54     {fCheckPointLevel = checkPointLevel;}
55
56   virtual Bool_t Run();
57
58 private:
59   class AliDummyReconstructor: public AliReconstructor {
60   public:
61     AliDummyReconstructor(AliDetector* detector) {fDetector = detector;};
62     virtual ~AliDummyReconstructor() {};
63
64     virtual void         Reconstruct(AliRunLoader* /*runLoader*/) const
65       {fDetector->Reconstruct();};
66     virtual AliVertexer* CreateVertexer(AliRunLoader* /*runLoader*/) const 
67       {return fDetector->CreateVertexer();}
68     virtual AliTracker*  CreateTracker(AliRunLoader* /*runLoader*/) const 
69       {return fDetector->CreateTracker();}
70     virtual void         FillESD(AliRunLoader* /*runLoader*/, AliESD* esd) const
71       {fDetector->FillESD(esd);};
72
73     virtual const char*  GetDetectorName() const
74       {return fDetector->GetName();};
75   private:
76     AliDummyReconstructor(const AliDummyReconstructor &drc):
77       AliReconstructor(drc)
78       {Fatal("copy ctor","Not implemented\n");}
79     AliDummyReconstructor & operator=(const AliDummyReconstructor &)
80       {Fatal("= operator","Not implemented\n"); return *this;}
81     AliDetector*         fDetector;   // detector object
82   };
83
84   Bool_t         RunLocalReconstruction(const TString& detectors);
85   Bool_t         RunVertexFinder(AliESD*& esd);
86   Bool_t         RunTracking(AliESD*& esd);
87   Bool_t         FillESD(AliESD*& esd, const TString& detectors);
88
89   Bool_t         IsSelected(TString detName, TString& detectors) const;
90   AliReconstructor* GetReconstructor(const char* detName) const;
91   Bool_t         CreateVertexer();
92   Bool_t         CreateTrackers();
93   void           CleanUp(TFile* file = NULL);
94
95   Bool_t         ReadESD(AliESD*& esd, const char* recStep) const;
96   void           WriteESD(AliESD* esd, const char* recStep) const;
97
98   TString        fRunLocalReconstruction; // run the local reconstruction for these detectors
99   Bool_t         fRunVertexFinder;    // run the vertex finder
100   Bool_t         fRunTracking;        // run the barrel tracking
101   TString        fFillESD;            // fill ESD for these detectors
102   TString        fGAliceFileName;     // name of the galice file
103   Bool_t         fStopOnError;        // stop or continue on errors
104   Int_t          fCheckPointLevel;    // level of ESD check points
105
106   AliRunLoader*  fRunLoader;          //! current run loader object
107   AliLoader*     fITSLoader;          //! loader for ITS
108   AliVertexer*   fITSVertexer;        //! vertexer for ITS
109   AliTracker*    fITSTracker;         //! tracker for ITS
110   AliLoader*     fTPCLoader;          //! loader for TPC
111   AliTracker*    fTPCTracker;         //! tracker for TPC
112   AliLoader*     fTRDLoader;          //! loader for TRD
113   AliTracker*    fTRDTracker;         //! tracker for TRD
114   AliLoader*     fTOFLoader;          //! loader for TOF
115   AliTracker*    fTOFTracker;         //! tracker for TOF
116
117   static const Int_t fgkNDetectors = 14;   //! number of detectors
118   static const char* fgkDetectorName[fgkNDetectors]; //! names of detectors
119   TObjArray      fReconstructors;     //! array of reconstructor objects
120
121   ClassDef(AliReconstruction, 1)      // class for running the reconstruction
122 };
123
124 #endif