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