Bug fixed in GetXY1-4 methods (Valerie)
[u/mrichter/AliRoot.git] / MUON / AliMUONTrackReconstructor.h
CommitLineData
f29ba3e1 1#ifndef ALIMUONTRACKRECONSTRUCTOR_H
29f1b13a 2#define ALIMUONTRACKRECONSTRUCTOR_H
692de412 3/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4 * See cxx source for full Copyright notice */
a9e2aefa 5
692de412 6/* $Id$ */
7
8/// \ingroup rec
9/// \class AliMUONTrackReconstructor
10/// \brief Class for the MUON track reconstruction
11///
12/////////////////////////////////////
13/// MUON track reconstructor in ALICE
14/////////////////////////////////////
3831f268 15
16#include <TObject.h>
190f97ea 17#include "AliMUONConstants.h"
a9e2aefa 18
a9e2aefa 19class AliMUONHitForRec;
20class AliMUONSegment;
21class TClonesArray;
22class TFile;
23class TTree;
52c9bc11 24class AliMUONData;
25class AliRunLoader;
58ff0bd4 26class AliMUONTriggerTrack;
a9e2aefa 27
29f1b13a 28class AliMUONTrackReconstructor : public TObject {
a9e2aefa 29
30 public:
cc9e7528 31 AliMUONTrackReconstructor(AliMUONData* data); // default Constructor
32 virtual ~AliMUONTrackReconstructor(); // Destructor
a9e2aefa 33
29f1b13a 34 // Parameters for track reconstruction: public methods
a9e2aefa 35 // Get and Set, Set to defaults
3831f268 36 Double_t GetMinBendingMomentum(void) const {return fMinBendingMomentum;}
a9e2aefa 37 void SetMinBendingMomentum(Double_t MinBendingMomentum) {fMinBendingMomentum = MinBendingMomentum;}
3831f268 38 Double_t GetMaxBendingMomentum(void) const {return fMaxBendingMomentum;}
d0bfce8d 39 void SetMaxBendingMomentum(Double_t MaxBendingMomentum) {fMaxBendingMomentum = MaxBendingMomentum;}
3831f268 40 Double_t GetMaxChi2(void) const {return fMaxChi2;}
d0bfce8d 41 void SetMaxChi2(Double_t MaxChi2) {fMaxChi2 = MaxChi2;}
3831f268 42 Double_t GetMaxSigma2Distance(void) const {return fMaxSigma2Distance;}
a9e2aefa 43 void SetMaxSigma2Distance(Double_t MaxSigma2Distance) {fMaxSigma2Distance = MaxSigma2Distance;}
3831f268 44 Double_t GetBendingResolution(void) const {return fBendingResolution;}
a9e2aefa 45 void SetBendingResolution(Double_t BendingResolution) {fBendingResolution = BendingResolution;}
3831f268 46 Double_t GetNonBendingResolution(void) const {return fNonBendingResolution;}
a9e2aefa 47 void SetNonBendingResolution(Double_t NonBendingResolution) {fNonBendingResolution = NonBendingResolution;}
3831f268 48 Double_t GetChamberThicknessInX0(void) const {return fChamberThicknessInX0;}
a9e2aefa 49 void SetChamberThicknessInX0(Double_t ChamberThicknessInX0) {fChamberThicknessInX0 = ChamberThicknessInX0;}
3831f268 50 Double_t GetSimpleBValue(void) const {return fSimpleBValue;}
a9e2aefa 51 void SetSimpleBValue(Double_t SimpleBValue) {fSimpleBValue = SimpleBValue;}
3831f268 52 Double_t GetSimpleBLength(void) const {return fSimpleBLength;}
a9e2aefa 53 void SetSimpleBLength(Double_t SimpleBLength) {fSimpleBLength = SimpleBLength;}
3831f268 54 Double_t GetSimpleBPosition(void) const {return fSimpleBPosition;}
a9e2aefa 55 void SetSimpleBPosition(Double_t SimpleBPosition) {fSimpleBPosition = SimpleBPosition;}
3831f268 56 Double_t GetEfficiency(void) const {return fEfficiency;}
a9e2aefa 57 void SetEfficiency(Double_t Efficiency) {fEfficiency = Efficiency;}
a9e2aefa 58 void SetReconstructionParametersToDefaults(void);
59
a9e2aefa 60 // Hits for reconstruction
3831f268 61 Int_t GetNHitsForRec(void) const {return fNHitsForRec;} // Number
8429a5e4 62
63 // Reconstructed tracks
3831f268 64 Int_t GetNRecTracks() const {return fNRecTracks;} // Number
8429a5e4 65 void SetNRecTracks(Int_t NRecTracks) {fNRecTracks = NRecTracks;}
3831f268 66 TClonesArray* GetRecTracksPtr(void) const {return fRecTracksPtr;} // Array
52c9bc11 67
8429a5e4 68 // Hits on reconstructed tracks
3831f268 69 Int_t GetNRecTrackHits() const {return fNRecTrackHits;} // Number
8429a5e4 70 void SetNRecTrackHits(Int_t NRecTrackHits) {fNRecTrackHits = NRecTrackHits;}
3831f268 71 TClonesArray* GetRecTrackHitsPtr(void) const {return fRecTrackHitsPtr;} // Array
a9e2aefa 72
73 // Functions
3831f268 74 Double_t GetImpactParamFromBendingMomentum(Double_t BendingMomentum) const;
75 Double_t GetBendingMomentumFromImpactParam(Double_t ImpactParam) const;
a9e2aefa 76 void EventReconstruct(void);
276c44b7 77 void EventReconstructTrigger(void);
04b5ea16 78 void EventDump(void); // dump reconstructed event
276c44b7 79 void EventDumpTrigger(void); // dump reconstructed trigger event
3f9fc997 80 //PH void FillEvent(); // fill and write tree of reconstructed events
b035a148 81 void SetTrackMethod(Int_t iTrackMethod); //AZ
82 Int_t GetTrackMethod(void) const {return fTrackMethod;}
83 void FillMUONTrack(void); // set track parameters at hits for Kalman track
8574c72f 84 //Int_t fMuons; // AZ - number of muons within acceptance - just for tests
52c9bc11 85
86 AliMUONData* GetMUONData() {return fMUONData;}
87
5e671e06 88 void SetTriggerCircuit(TClonesArray* circuit) {fTriggerCircuit = circuit;}
89
90
a9e2aefa 91 private:
92
343146bf 93 // Constants which should be elsewhere ????
829425a5 94 static const Int_t fgkMaxMuonTrackingChambers = 10; ///< Max number of Muon tracking chambers
95 static const Int_t fgkMaxMuonTrackingStations = 5; ///< Max number of Muon tracking stations
343146bf 96
97 // Defaults parameters for reconstruction
829425a5 98 static const Double_t fgkDefaultMinBendingMomentum; ///< default min. bending momentum for reconstruction
99 static const Double_t fgkDefaultMaxBendingMomentum; ///< default max. bending momentum for reconstruction
100 static const Double_t fgkDefaultMaxChi2; ///< default max. track chi2 for reconstruction
101 static const Double_t fgkDefaultMaxSigma2Distance; ///< default square of max. distance for window size
102 static const Double_t fgkDefaultBendingResolution; ///< default bending coordinate resolution for reconstruction
103 static const Double_t fgkDefaultNonBendingResolution; ///< default non bending coordinate resolution for reconstruction
104 static const Double_t fgkDefaultChamberThicknessInX0; ///< default chamber thickness in X0 for reconstruction
343146bf 105 // Simple magnetic field:
106 // Value taken from macro MUONtracking.C: 0.7 T, hence 7 kG
107 // Length and Position from reco_muon.F, with opposite sign:
108 // Length = ZMAGEND-ZCOIL
109 // Position = (ZMAGEND+ZCOIL)/2
110 // to be ajusted differently from real magnetic field ????
829425a5 111 static const Double_t fgkDefaultSimpleBValue; ///< default value of magnetic field (dipole)
112 static const Double_t fgkDefaultSimpleBLength; ///< default length of magnetic field (dipole)
113 static const Double_t fgkDefaultSimpleBPosition; ///< default position of magnetic field (dipole)
829425a5 114 static const Double_t fgkDefaultEfficiency; ///< default chamber efficiency for track ref. hits recontruction
343146bf 115
343146bf 116
829425a5 117 Int_t fTrackMethod; ///< AZ - tracking method
83dbc640 118
29f1b13a 119 // Parameters for track reconstruction
829425a5 120 Double_t fMinBendingMomentum; ///< minimum value (GeV/c) of momentum in bending plane
29f1b13a 121 // Parameters for track reconstruction
829425a5 122 Double_t fMaxBendingMomentum; ///< maximum value (GeV/c) of momentum in bending plane
123 Double_t fMaxChi2; ///< maximum Chi2 per degree of Freedom
124 Double_t fMaxSigma2Distance; ///< maximum square distance in units of the variance (maximum chi2)
125 Double_t fRMin[fgkMaxMuonTrackingChambers]; ///< minimum radius (cm)
126 Double_t fRMax[fgkMaxMuonTrackingChambers]; ///< maximum radius (cm)
127 Double_t fSegmentMaxDistBending[fgkMaxMuonTrackingStations]; ///< maximum distance (cm) for segments in bending plane
128 Double_t fSegmentMaxDistNonBending[fgkMaxMuonTrackingStations]; ///< maximum distance (cm) for segments in non bending plane
129 Double_t fBendingResolution; ///< chamber resolution (cm) in bending plane
130 Double_t fNonBendingResolution; ///< chamber resolution (cm) in non bending plane
131 Double_t fChamberThicknessInX0; ///< chamber thickness in number of radiation lengths
a9e2aefa 132 // how to take it from simulation ????
829425a5 133 Double_t fSimpleBValue; ///< simple magnetic field: value (kG)
134 Double_t fSimpleBLength; ///< simple magnetic field: length (cm)
135 Double_t fSimpleBPosition; ///< simple magnetic field: Z central position (cm)
829425a5 136 Double_t fEfficiency; ///< chamber efficiency (used for track ref. hits only)
a9e2aefa 137
138 // Hits for reconstruction (should be in AliMUON ????)
829425a5 139 TClonesArray *fHitsForRecPtr; ///< pointer to the array of hits for reconstruction
140 Int_t fNHitsForRec; ///< number of hits for reconstruction
a9e2aefa 141 // Information per chamber (should be in AliMUONChamber ????)
829425a5 142 Int_t fNHitsForRecPerChamber[fgkMaxMuonTrackingChambers]; ///< number of HitsForRec
143 Int_t fIndexOfFirstHitForRecPerChamber[fgkMaxMuonTrackingChambers]; ///< index (0...) of first HitForRec
a9e2aefa 144
145 // Segments inside a station
829425a5 146 TClonesArray *fSegmentsPtr[fgkMaxMuonTrackingStations]; ///< array of pointers to the segments for each station
147 Int_t fNSegments[fgkMaxMuonTrackingStations]; ///< number of segments for each station
a9e2aefa 148
8429a5e4 149 // Reconstructed tracks
829425a5 150 TClonesArray *fRecTracksPtr; ///< pointer to array of reconstructed tracks
151 Int_t fNRecTracks; ///< number of reconstructed tracks
a9e2aefa 152
8429a5e4 153 // Track hits on reconstructed tracks
829425a5 154 TClonesArray *fRecTrackHitsPtr; ///< pointer to array of hits on reconstructed tracks
155 Int_t fNRecTrackHits; ///< number of hits on reconstructed tracks
8429a5e4 156
52c9bc11 157 // data container
829425a5 158 AliMUONData* fMUONData; ///< Data container for MUON subsystem
52c9bc11 159
829425a5 160 Int_t fMuons; ///< AZ - number of muons within acceptance - just for tests
8574c72f 161
58ff0bd4 162 AliMUONTriggerTrack* fTriggerTrack; ///< Trigger track structure
163
5e671e06 164 TClonesArray* fTriggerCircuit; //!< trigger circuit array
165
a9e2aefa 166 // Functions
54d7ba50 167 AliMUONTrackReconstructor (const AliMUONTrackReconstructor& rhs); // copy constructor
168 AliMUONTrackReconstructor& operator=(const AliMUONTrackReconstructor& rhs); // assignment operator
a9e2aefa 169 void ResetHitsForRec(void);
170 void MakeEventToBeReconstructed(void);
a9e2aefa 171 void AddHitsForRecFromRawClusters(TTree* TR);
172 void SortHitsForRecWithIncreasingChamber();
173 void MakeSegments(void);
174 void ResetSegments(void);
175 void MakeSegmentsPerStation(Int_t Station);
176 void MakeTracks(void);
d837040f 177 Bool_t MakeTriggerTracks(void);
8429a5e4 178 void ResetTrackHits(void);
a9e2aefa 179 void ResetTracks(void);
180 Int_t MakeTrackCandidatesWithTwoSegments(AliMUONSegment *BegSegment);
181 Int_t MakeTrackCandidatesWithOneSegmentAndOnePoint(AliMUONSegment *BegSegment);
182 void MakeTrackCandidates(void);
183 void FollowTracks(void);
8429a5e4 184 void RemoveDoubleTracks(void);
d837040f 185 void UpdateTrackParamAtHit(void);
b8dc484b 186 void UpdateHitForRecAtHit(void);
d837040f 187 void ValidateTracksWithTrigger(void);
83dbc640 188
189
190 //AZ - for Kalman Filter
191 void MakeTrackCandidatesK(void);
192 void FollowTracksK(void);
193 void RemoveDoubleTracksK(void);
194 void GoToVertex(void);
30178c30 195 Bool_t CheckCandidateK(Int_t icand, Int_t nSeeds) const;
83dbc640 196
29fc2c86 197
29f1b13a 198 ClassDef(AliMUONTrackReconstructor, 0) // MUON track reconstructor in ALICE
a9e2aefa 199 };
200
201#endif