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