Changed declarations to be in the order public, protected, private required by coding...
[u/mrichter/AliRoot.git] / MUON / AliMUONEventReconstructor.h
CommitLineData
a9e2aefa 1#ifndef ALIMUONEVENTRECONSTRUCTOR_H
2#define ALIMUONEVENTRECONSTRUCTOR_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
3831f268 8////////////////////////////////////
9// MUON event reconstructor in ALICE
10////////////////////////////////////
11
12#include <TObject.h>
a9e2aefa 13
14class AliMUONHit;
15class AliMUONHitForRec;
16class AliMUONSegment;
17class TClonesArray;
18class TFile;
19class TTree;
c7ba256d 20class AliMUONRecoEvent;
52c9bc11 21class AliMUONData;
22class AliRunLoader;
23class AliLoader;
a9e2aefa 24
25// Constants which should be elsewhere ????
9cbdf048 26const Int_t kMaxMuonTrackingChambers = 10;
27const Int_t kMaxMuonTrackingStations = kMaxMuonTrackingChambers / 2;
a9e2aefa 28
29class AliMUONEventReconstructor : public TObject {
30
31 public:
52c9bc11 32 AliMUONEventReconstructor(AliLoader* ); // default Constructor
a9e2aefa 33 virtual ~AliMUONEventReconstructor(void); // Destructor
9cbdf048 34 AliMUONEventReconstructor (const AliMUONEventReconstructor& Reconstructor); // copy constructor
35 AliMUONEventReconstructor& operator=(const AliMUONEventReconstructor& Reconstructor); // assignment operator
a9e2aefa 36
37 // Parameters for event reconstruction: public methods
38 // Get and Set, Set to defaults
3831f268 39 Double_t GetMinBendingMomentum(void) const {return fMinBendingMomentum;}
a9e2aefa 40 void SetMinBendingMomentum(Double_t MinBendingMomentum) {fMinBendingMomentum = MinBendingMomentum;}
3831f268 41 Double_t GetMaxBendingMomentum(void) const {return fMaxBendingMomentum;}
d0bfce8d 42 void SetMaxBendingMomentum(Double_t MaxBendingMomentum) {fMaxBendingMomentum = MaxBendingMomentum;}
3831f268 43 Double_t GetMaxChi2(void) const {return fMaxChi2;}
d0bfce8d 44 void SetMaxChi2(Double_t MaxChi2) {fMaxChi2 = MaxChi2;}
3831f268 45 Double_t GetMaxSigma2Distance(void) const {return fMaxSigma2Distance;}
a9e2aefa 46 void SetMaxSigma2Distance(Double_t MaxSigma2Distance) {fMaxSigma2Distance = MaxSigma2Distance;}
3831f268 47 Double_t GetBendingResolution(void) const {return fBendingResolution;}
a9e2aefa 48 void SetBendingResolution(Double_t BendingResolution) {fBendingResolution = BendingResolution;}
3831f268 49 Double_t GetNonBendingResolution(void) const {return fNonBendingResolution;}
a9e2aefa 50 void SetNonBendingResolution(Double_t NonBendingResolution) {fNonBendingResolution = NonBendingResolution;}
3831f268 51 Double_t GetChamberThicknessInX0(void) const {return fChamberThicknessInX0;}
a9e2aefa 52 void SetChamberThicknessInX0(Double_t ChamberThicknessInX0) {fChamberThicknessInX0 = ChamberThicknessInX0;}
3831f268 53 Double_t GetSimpleBValue(void) const {return fSimpleBValue;}
a9e2aefa 54 void SetSimpleBValue(Double_t SimpleBValue) {fSimpleBValue = SimpleBValue;}
3831f268 55 Double_t GetSimpleBLength(void) const {return fSimpleBLength;}
a9e2aefa 56 void SetSimpleBLength(Double_t SimpleBLength) {fSimpleBLength = SimpleBLength;}
3831f268 57 Double_t GetSimpleBPosition(void) const {return fSimpleBPosition;}
a9e2aefa 58 void SetSimpleBPosition(Double_t SimpleBPosition) {fSimpleBPosition = SimpleBPosition;}
3831f268 59 Int_t GetRecGeantHits(void) const {return fRecGeantHits;}
a9e2aefa 60 void SetRecGeantHits(Int_t RecGeantHits) {fRecGeantHits = RecGeantHits;}
3831f268 61 Double_t GetEfficiency(void) const {return fEfficiency;}
a9e2aefa 62 void SetEfficiency(Double_t Efficiency) {fEfficiency = Efficiency;}
3831f268 63 Int_t GetPrintLevel(void) const {return fPrintLevel;}
a9e2aefa 64 void SetPrintLevel(Int_t PrintLevel) {fPrintLevel = PrintLevel;}
65 void SetReconstructionParametersToDefaults(void);
66
67 // Parameters for GEANT background events
3831f268 68 TFile* GetBkgGeantFile(void) const {return fBkgGeantFile;}
a9e2aefa 69 void SetBkgGeantFile(Text_t *BkgGeantFileName); // set background file for GEANT hits
70 void NextBkgGeantEvent(void); // next event in background file for GEANT hits
71
72 // Hits for reconstruction
3831f268 73 Int_t GetNHitsForRec(void) const {return fNHitsForRec;} // Number
8429a5e4 74
75 // Reconstructed tracks
3831f268 76 Int_t GetNRecTracks() const {return fNRecTracks;} // Number
8429a5e4 77 void SetNRecTracks(Int_t NRecTracks) {fNRecTracks = NRecTracks;}
3831f268 78 TClonesArray* GetRecTracksPtr(void) const {return fRecTracksPtr;} // Array
52c9bc11 79
80 // Reconstructed trigger tracks
81 Int_t GetNRecTriggerTracks() const {return fNRecTriggerTracks;} // Number
82 void SetNRecTriggerTracks(Int_t NRecTriggerTracks) {fNRecTriggerTracks = NRecTriggerTracks;}
83 TClonesArray* GetRecTriggerTracksPtr(void) const {return fRecTriggerTracksPtr;} // Array
8429a5e4 84
85 // Hits on reconstructed tracks
3831f268 86 Int_t GetNRecTrackHits() const {return fNRecTrackHits;} // Number
8429a5e4 87 void SetNRecTrackHits(Int_t NRecTrackHits) {fNRecTrackHits = NRecTrackHits;}
3831f268 88 TClonesArray* GetRecTrackHitsPtr(void) const {return fRecTrackHitsPtr;} // Array
a9e2aefa 89
90 // Functions
3831f268 91 Double_t GetImpactParamFromBendingMomentum(Double_t BendingMomentum) const;
92 Double_t GetBendingMomentumFromImpactParam(Double_t ImpactParam) const;
a9e2aefa 93 void EventReconstruct(void);
276c44b7 94 void EventReconstructTrigger(void);
04b5ea16 95 void EventDump(void); // dump reconstructed event
276c44b7 96 void EventDumpTrigger(void); // dump reconstructed trigger event
c7ba256d 97 void FillEvent(); // fill and write tree of reconstructed events
83dbc640 98 void SetTrackMethod(Int_t TrackMethod) {fTrackMethod = TrackMethod;} //AZ
99 Int_t GetTrackMethod(void) const {return fTrackMethod;} //AZ
100 Int_t fMuons; // AZ - number of muons within acceptance - just for tests
52c9bc11 101
102 AliMUONData* GetMUONData() {return fMUONData;}
103
9cbdf048 104 protected:
105
a9e2aefa 106 private:
107
83dbc640 108 Int_t fTrackMethod; // AZ - tracking method
109
a9e2aefa 110 // Parameters for event reconstruction
111 Double_t fMinBendingMomentum; // minimum value (GeV/c) of momentum in bending plane
d0bfce8d 112 // Parameters for event reconstruction
113 Double_t fMaxBendingMomentum; // maximum value (GeV/c) of momentum in bending plane
114 Double_t fMaxChi2; // maximum Chi2 per degree of Freedom
a9e2aefa 115 Double_t fMaxSigma2Distance; // maximum square distance in units of the variance (maximum chi2)
9cbdf048 116 Double_t fRMin[kMaxMuonTrackingChambers]; // minimum radius (cm)
117 Double_t fRMax[kMaxMuonTrackingChambers]; // maximum radius (cm)
118 Double_t fSegmentMaxDistBending[kMaxMuonTrackingStations]; // maximum distance (cm) for segments in bending plane
ba5b68db 119 Double_t fSegmentMaxDistNonBending[kMaxMuonTrackingStations]; // maximum distance (cm) for segments in non bending plane
a9e2aefa 120 Double_t fBendingResolution; // chamber resolution (cm) in bending plane
121 Double_t fNonBendingResolution; // chamber resolution (cm) in non bending plane
122 Double_t fChamberThicknessInX0; // chamber thickness in number of radiation lengths
123 // how to take it from simulation ????
124 Double_t fSimpleBValue; // simple magnetic field: value (kG)
125 Double_t fSimpleBLength; // simple magnetic field: length (cm)
126 Double_t fSimpleBPosition; // simple magnetic field: Z central position (cm)
127 Int_t fRecGeantHits; // reconstruction from raw clusters (0) or from GEANT hits (1)
128 Double_t fEfficiency; // chamber efficiency (used for GEANT hits only)
129 Int_t fPrintLevel; // print level
130
131 // Parameters for GEANT background events
132 // should be in AliMUON class ????
133 TFile *fBkgGeantFile; // pointer to file
134 TTree *fBkgGeantTK; // pointer to tree TK
135 TClonesArray *fBkgGeantParticles; // pointer to list of particles in tree TK
136 TTree *fBkgGeantTH; // pointer to tree TH
137 TClonesArray *fBkgGeantHits; // pointer to list of hits in tree TH
138 Int_t fBkgGeantEventNumber; // event number
139
140 // Hits for reconstruction (should be in AliMUON ????)
141 TClonesArray *fHitsForRecPtr; // pointer to the array of hits for reconstruction
142 Int_t fNHitsForRec; // number of hits for reconstruction
143 // Information per chamber (should be in AliMUONChamber ????)
9cbdf048 144 Int_t fNHitsForRecPerChamber[kMaxMuonTrackingChambers]; // number of HitsForRec
145 Int_t fIndexOfFirstHitForRecPerChamber[kMaxMuonTrackingChambers]; // index (0...) of first HitForRec
a9e2aefa 146
147 // Segments inside a station
9cbdf048 148 TClonesArray *fSegmentsPtr[kMaxMuonTrackingStations]; // array of pointers to the segments for each station
149 Int_t fNSegments[kMaxMuonTrackingStations]; // number of segments for each station
a9e2aefa 150
8429a5e4 151 // Reconstructed tracks
a9e2aefa 152 TClonesArray *fRecTracksPtr; // pointer to array of reconstructed tracks
153 Int_t fNRecTracks; // number of reconstructed tracks
154
276c44b7 155 // Reconstructed trigger tracks
156 TClonesArray *fRecTriggerTracksPtr; // pointer to array of reconstructed trigger tracks
157 Int_t fNRecTriggerTracks; // number of reconstructed trigger tracks
158
8429a5e4 159 // Track hits on reconstructed tracks
160 TClonesArray *fRecTrackHitsPtr; // pointer to array of hits on reconstructed tracks
161 Int_t fNRecTrackHits; // number of hits on reconstructed tracks
162
c7ba256d 163 // Objects needed for tree writing
164 AliMUONRecoEvent *fRecoEvent; // the reconstructed event
165 TTree *fEventTree; // tree of reconstructed events
166 TFile *fTreeFile; // file where the tree is outputed
167
52c9bc11 168 // data container
169 AliMUONData* fMUONData;
170
171 // alice loader
172 AliLoader* fLoader;
173
a9e2aefa 174 // Functions
175 void ResetHitsForRec(void);
176 void MakeEventToBeReconstructed(void);
177 void AddHitsForRecFromGEANT(TTree *TH);
178 void AddHitsForRecFromBkgGEANT(TTree *TH, TClonesArray *Hits);
179 AliMUONHitForRec* NewHitForRecFromGEANT(AliMUONHit* Hit, Int_t TrackNumber, Int_t HitNumber, Int_t Signal);
180/* void AddHitsForRecFromCathodeCorrelations(TTree* TC); */
181 void AddHitsForRecFromRawClusters(TTree* TR);
182 void SortHitsForRecWithIncreasingChamber();
183 void MakeSegments(void);
184 void ResetSegments(void);
185 void MakeSegmentsPerStation(Int_t Station);
186 void MakeTracks(void);
d837040f 187 Bool_t MakeTriggerTracks(void);
8429a5e4 188 void ResetTrackHits(void);
a9e2aefa 189 void ResetTracks(void);
276c44b7 190 void ResetTriggerTracks(void);
a9e2aefa 191 Int_t MakeTrackCandidatesWithTwoSegments(AliMUONSegment *BegSegment);
192 Int_t MakeTrackCandidatesWithOneSegmentAndOnePoint(AliMUONSegment *BegSegment);
193 void MakeTrackCandidates(void);
194 void FollowTracks(void);
8429a5e4 195 void RemoveDoubleTracks(void);
d837040f 196 void UpdateTrackParamAtHit(void);
197 void ValidateTracksWithTrigger(void);
83dbc640 198
199
200 //AZ - for Kalman Filter
201 void MakeTrackCandidatesK(void);
202 void FollowTracksK(void);
203 void RemoveDoubleTracksK(void);
204 void GoToVertex(void);
205 Bool_t CheckCandidateK(Int_t icand, Int_t nSeeds);
206
ecfa008b 207 ClassDef(AliMUONEventReconstructor, 0) // MUON event reconstructor in ALICE
a9e2aefa 208 };
209
210#endif