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