Incremented class version
[u/mrichter/AliRoot.git] / STEER / AliReconstruction.h
CommitLineData
596a855f 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
af7ba10c 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
596a855f 20#include <TNamed.h>
21#include <TString.h>
59697224 22#include <TObjArray.h>
596a855f 23
b8cd5251 24class AliReconstructor;
596a855f 25class AliRunLoader;
b649205a 26class AliRawReader;
596a855f 27class AliLoader;
28class AliTracker;
c84a5e9e 29class AliVertexer;
596a855f 30class AliESD;
e583c30d 31class TFile;
596a855f 32
f3a97c86 33class AliRunTag;
34class AliLHCTag;
35class AliDetectorTag;
36class AliEventTag;
37
596a855f 38
39class AliReconstruction: public TNamed {
40public:
e583c30d 41 AliReconstruction(const char* gAliceFilename = "galice.root",
024cf675 42 const char* cdbUri = "local://$ALICE_ROOT",
e583c30d 43 const char* name = "AliReconstruction",
596a855f 44 const char* title = "reconstruction");
45 AliReconstruction(const AliReconstruction& rec);
46 AliReconstruction& operator = (const AliReconstruction& rec);
47 virtual ~AliReconstruction();
48
49 void SetGAliceFile(const char* fileName);
b649205a 50 void SetInput(const char* input) {fInput = input;};
b26c3770 51 void SetEventRange(Int_t firstEvent = 0, Int_t lastEvent = -1)
52 {fFirstEvent = firstEvent; fLastEvent = lastEvent;};
efd2085e 53 void SetOption(const char* detector, const char* option);
596a855f 54
59697224 55 void SetRunLocalReconstruction(const char* detectors) {
56 fRunLocalReconstruction = detectors;};
2257f27e 57 void SetRunVertexFinder(Bool_t run) {fRunVertexFinder = run;};
b8cd5251 58 void SetRunTracking(const char* detectors) {
59 fRunTracking = detectors;};
596a855f 60 void SetFillESD(const char* detectors) {fFillESD = detectors;};
b8cd5251 61 void SetRunReconstruction(const char* detectors) {
62 SetRunLocalReconstruction(detectors);
63 SetRunTracking(detectors);
64 SetFillESD(detectors);};
6bae477a 65 void SetLoadAlignFromCDB(Bool_t load) {fLoadAlignFromCDB = load;};
66 void SetLoadAlignData(const char* detectors)
67 {fLoadAlignData = detectors;};
596a855f 68
c84a5e9e 69 void SetUniformFieldTracking(){fUniformField=kTRUE;}
70 void SetNonuniformFieldTracking(){fUniformField=kFALSE;}
71
24f7a148 72 void SetStopOnError(Bool_t stopOnError)
73 {fStopOnError = stopOnError;}
74 void SetCheckPointLevel(Int_t checkPointLevel)
75 {fCheckPointLevel = checkPointLevel;}
024cf675 76
77 // CDB storage activation
78 void InitCDBStorage();
79 void SetDefaultStorage(const char* uri);
80 void SetSpecificStorage(const char* detName, const char* uri);
24f7a148 81
6bae477a 82 Bool_t SetRunNumber();
83
84 Bool_t SetAlignObjArraySingleDet(const char* detName);
85 Bool_t MisalignGeometry(const TString& detectors);
86
87 void SetAlignObjArray(TObjArray *array)
88 {fAlignObjArray = array;
89 fLoadAlignFromCDB = kFALSE;}
90 Bool_t ApplyAlignObjsToGeom(TObjArray* alObjArray);
91
b26c3770 92 virtual Bool_t Run(const char* input,
93 Int_t firstEvent, Int_t lastEvent = -1);
94 Bool_t Run(const char* input = NULL)
95 {return Run(input, fFirstEvent, fLastEvent);};
96 Bool_t Run(Int_t firstEvent, Int_t lastEvent = -1)
97 {return Run(NULL, firstEvent, lastEvent);};
596a855f 98
98937d93 99 void SetWriteAlignmentData(){fWriteAlignmentData=kTRUE;}
100
596a855f 101private:
59697224 102 Bool_t RunLocalReconstruction(const TString& detectors);
b26c3770 103 Bool_t RunLocalEventReconstruction(const TString& detectors);
2257f27e 104 Bool_t RunVertexFinder(AliESD*& esd);
1f46a9ae 105 Bool_t RunHLTTracking(AliESD*& esd);
24f7a148 106 Bool_t RunTracking(AliESD*& esd);
107 Bool_t FillESD(AliESD*& esd, const TString& detectors);
596a855f 108
e583c30d 109 Bool_t IsSelected(TString detName, TString& detectors) const;
f08fc9f5 110 Bool_t InitRunLoader();
b8cd5251 111 AliReconstructor* GetReconstructor(Int_t iDet);
2257f27e 112 Bool_t CreateVertexer();
b8cd5251 113 Bool_t CreateTrackers(const TString& detectors);
b26c3770 114 void CleanUp(TFile* file = NULL, TFile* fileOld = NULL);
e583c30d 115
24f7a148 116 Bool_t ReadESD(AliESD*& esd, const char* recStep) const;
117 void WriteESD(AliESD* esd, const char* recStep) const;
118
f3a97c86 119
120 //===========================================//
121 void CreateTag(TFile* file);
122 //==========================================//
123
98937d93 124 void WriteAlignmentData(AliESD* esd);
f3a97c86 125
126
127
59697224 128 TString fRunLocalReconstruction; // run the local reconstruction for these detectors
c84a5e9e 129 Bool_t fUniformField; // uniform field tracking flag
2257f27e 130 Bool_t fRunVertexFinder; // run the vertex finder
1f46a9ae 131 Bool_t fRunHLTTracking; // run the HLT tracking
b8cd5251 132 TString fRunTracking; // run the tracking for these detectors
596a855f 133 TString fFillESD; // fill ESD for these detectors
596a855f 134 TString fGAliceFileName; // name of the galice file
b649205a 135 TString fInput; // name of input file or directory
b26c3770 136 Int_t fFirstEvent; // index of first event to be reconstr.
137 Int_t fLastEvent; // index of last event to be reconstr.
e583c30d 138 Bool_t fStopOnError; // stop or continue on errors
24f7a148 139 Int_t fCheckPointLevel; // level of ESD check points
b8cd5251 140 TObjArray fOptions; // options for reconstructor objects
6bae477a 141 Bool_t fLoadAlignFromCDB; // Load alignment data from CDB and apply it to geometry or not
142 TString fLoadAlignData; // Load alignment data from CDB for these detectors
596a855f 143
144 AliRunLoader* fRunLoader; //! current run loader object
b649205a 145 AliRawReader* fRawReader; //! current raw data reader
596a855f 146
482070f2 147 static const Int_t fgkNDetectors = 15; //! number of detectors
c757bafd 148 static const char* fgkDetectorName[fgkNDetectors]; //! names of detectors
b8cd5251 149 AliReconstructor* fReconstructor[fgkNDetectors]; //! array of reconstructor objects
150 AliLoader* fLoader[fgkNDetectors]; //! detector loaders
151 AliVertexer* fVertexer; //! vertexer for ITS
152 AliTracker* fTracker[fgkNDetectors]; //! trackers
59697224 153
6bae477a 154 TObjArray* fAlignObjArray; // array with the alignment objects to be applied to the geometry
98937d93 155 Bool_t fWriteAlignmentData; // write track space-points flag
156
024cf675 157 TString fCDBUri; // Uri of the default CDB storage
158
98937d93 159 ClassDef(AliReconstruction, 6) // class for running the reconstruction
596a855f 160};
161
162#endif