Include AliMUONTriggerTrack
[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;
a9e2aefa 21
22// Constants which should be elsewhere ????
9cbdf048 23const Int_t kMaxMuonTrackingChambers = 10;
24const Int_t kMaxMuonTrackingStations = kMaxMuonTrackingChambers / 2;
a9e2aefa 25
26class AliMUONEventReconstructor : public TObject {
27
28 public:
29 AliMUONEventReconstructor(void); // Constructor
30 virtual ~AliMUONEventReconstructor(void); // Destructor
9cbdf048 31 AliMUONEventReconstructor (const AliMUONEventReconstructor& Reconstructor); // copy constructor
32 AliMUONEventReconstructor& operator=(const AliMUONEventReconstructor& Reconstructor); // assignment operator
a9e2aefa 33
34 // Parameters for event reconstruction: public methods
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 Int_t GetRecGeantHits(void) const {return fRecGeantHits;}
a9e2aefa 57 void SetRecGeantHits(Int_t RecGeantHits) {fRecGeantHits = RecGeantHits;}
3831f268 58 Double_t GetEfficiency(void) const {return fEfficiency;}
a9e2aefa 59 void SetEfficiency(Double_t Efficiency) {fEfficiency = Efficiency;}
3831f268 60 Int_t GetPrintLevel(void) const {return fPrintLevel;}
a9e2aefa 61 void SetPrintLevel(Int_t PrintLevel) {fPrintLevel = PrintLevel;}
62 void SetReconstructionParametersToDefaults(void);
63
64 // Parameters for GEANT background events
3831f268 65 TFile* GetBkgGeantFile(void) const {return fBkgGeantFile;}
a9e2aefa 66 void SetBkgGeantFile(Text_t *BkgGeantFileName); // set background file for GEANT hits
67 void NextBkgGeantEvent(void); // next event in background file for GEANT hits
68
69 // Hits for reconstruction
3831f268 70 Int_t GetNHitsForRec(void) const {return fNHitsForRec;} // Number
8429a5e4 71
72 // Reconstructed tracks
3831f268 73 Int_t GetNRecTracks() const {return fNRecTracks;} // Number
8429a5e4 74 void SetNRecTracks(Int_t NRecTracks) {fNRecTracks = NRecTracks;}
3831f268 75 TClonesArray* GetRecTracksPtr(void) const {return fRecTracksPtr;} // Array
8429a5e4 76
77 // Hits on reconstructed tracks
3831f268 78 Int_t GetNRecTrackHits() const {return fNRecTrackHits;} // Number
8429a5e4 79 void SetNRecTrackHits(Int_t NRecTrackHits) {fNRecTrackHits = NRecTrackHits;}
3831f268 80 TClonesArray* GetRecTrackHitsPtr(void) const {return fRecTrackHitsPtr;} // Array
a9e2aefa 81
82 // Functions
3831f268 83 Double_t GetImpactParamFromBendingMomentum(Double_t BendingMomentum) const;
84 Double_t GetBendingMomentumFromImpactParam(Double_t ImpactParam) const;
a9e2aefa 85 void EventReconstruct(void);
04b5ea16 86 void EventDump(void); // dump reconstructed event
c7ba256d 87 void FillEvent(); // fill and write tree of reconstructed events
83dbc640 88 void SetTrackMethod(Int_t TrackMethod) {fTrackMethod = TrackMethod;} //AZ
89 Int_t GetTrackMethod(void) const {return fTrackMethod;} //AZ
90 Int_t fMuons; // AZ - number of muons within acceptance - just for tests
9cbdf048 91 protected:
92
a9e2aefa 93 private:
94
83dbc640 95 Int_t fTrackMethod; // AZ - tracking method
96
a9e2aefa 97 // Parameters for event reconstruction
98 Double_t fMinBendingMomentum; // minimum value (GeV/c) of momentum in bending plane
d0bfce8d 99 // Parameters for event reconstruction
100 Double_t fMaxBendingMomentum; // maximum value (GeV/c) of momentum in bending plane
101 Double_t fMaxChi2; // maximum Chi2 per degree of Freedom
a9e2aefa 102 Double_t fMaxSigma2Distance; // maximum square distance in units of the variance (maximum chi2)
9cbdf048 103 Double_t fRMin[kMaxMuonTrackingChambers]; // minimum radius (cm)
104 Double_t fRMax[kMaxMuonTrackingChambers]; // maximum radius (cm)
105 Double_t fSegmentMaxDistBending[kMaxMuonTrackingStations]; // maximum distance (cm) for segments in bending plane
ba5b68db 106 Double_t fSegmentMaxDistNonBending[kMaxMuonTrackingStations]; // maximum distance (cm) for segments in non bending plane
a9e2aefa 107 Double_t fBendingResolution; // chamber resolution (cm) in bending plane
108 Double_t fNonBendingResolution; // chamber resolution (cm) in non bending plane
109 Double_t fChamberThicknessInX0; // chamber thickness in number of radiation lengths
110 // how to take it from simulation ????
111 Double_t fSimpleBValue; // simple magnetic field: value (kG)
112 Double_t fSimpleBLength; // simple magnetic field: length (cm)
113 Double_t fSimpleBPosition; // simple magnetic field: Z central position (cm)
114 Int_t fRecGeantHits; // reconstruction from raw clusters (0) or from GEANT hits (1)
115 Double_t fEfficiency; // chamber efficiency (used for GEANT hits only)
116 Int_t fPrintLevel; // print level
117
118 // Parameters for GEANT background events
119 // should be in AliMUON class ????
120 TFile *fBkgGeantFile; // pointer to file
121 TTree *fBkgGeantTK; // pointer to tree TK
122 TClonesArray *fBkgGeantParticles; // pointer to list of particles in tree TK
123 TTree *fBkgGeantTH; // pointer to tree TH
124 TClonesArray *fBkgGeantHits; // pointer to list of hits in tree TH
125 Int_t fBkgGeantEventNumber; // event number
126
127 // Hits for reconstruction (should be in AliMUON ????)
128 TClonesArray *fHitsForRecPtr; // pointer to the array of hits for reconstruction
129 Int_t fNHitsForRec; // number of hits for reconstruction
130 // Information per chamber (should be in AliMUONChamber ????)
9cbdf048 131 Int_t fNHitsForRecPerChamber[kMaxMuonTrackingChambers]; // number of HitsForRec
132 Int_t fIndexOfFirstHitForRecPerChamber[kMaxMuonTrackingChambers]; // index (0...) of first HitForRec
a9e2aefa 133
134 // Segments inside a station
9cbdf048 135 TClonesArray *fSegmentsPtr[kMaxMuonTrackingStations]; // array of pointers to the segments for each station
136 Int_t fNSegments[kMaxMuonTrackingStations]; // number of segments for each station
a9e2aefa 137
8429a5e4 138 // Reconstructed tracks
a9e2aefa 139 TClonesArray *fRecTracksPtr; // pointer to array of reconstructed tracks
140 Int_t fNRecTracks; // number of reconstructed tracks
141
8429a5e4 142 // Track hits on reconstructed tracks
143 TClonesArray *fRecTrackHitsPtr; // pointer to array of hits on reconstructed tracks
144 Int_t fNRecTrackHits; // number of hits on reconstructed tracks
145
c7ba256d 146 // Objects needed for tree writing
147 AliMUONRecoEvent *fRecoEvent; // the reconstructed event
148 TTree *fEventTree; // tree of reconstructed events
149 TFile *fTreeFile; // file where the tree is outputed
150
a9e2aefa 151 // Functions
152 void ResetHitsForRec(void);
153 void MakeEventToBeReconstructed(void);
154 void AddHitsForRecFromGEANT(TTree *TH);
155 void AddHitsForRecFromBkgGEANT(TTree *TH, TClonesArray *Hits);
156 AliMUONHitForRec* NewHitForRecFromGEANT(AliMUONHit* Hit, Int_t TrackNumber, Int_t HitNumber, Int_t Signal);
157/* void AddHitsForRecFromCathodeCorrelations(TTree* TC); */
158 void AddHitsForRecFromRawClusters(TTree* TR);
159 void SortHitsForRecWithIncreasingChamber();
160 void MakeSegments(void);
161 void ResetSegments(void);
162 void MakeSegmentsPerStation(Int_t Station);
163 void MakeTracks(void);
8429a5e4 164 void ResetTrackHits(void);
a9e2aefa 165 void ResetTracks(void);
166 Int_t MakeTrackCandidatesWithTwoSegments(AliMUONSegment *BegSegment);
167 Int_t MakeTrackCandidatesWithOneSegmentAndOnePoint(AliMUONSegment *BegSegment);
168 void MakeTrackCandidates(void);
169 void FollowTracks(void);
8429a5e4 170 void RemoveDoubleTracks(void);
a9e2aefa 171
83dbc640 172
173
174 //AZ - for Kalman Filter
175 void MakeTrackCandidatesK(void);
176 void FollowTracksK(void);
177 void RemoveDoubleTracksK(void);
178 void GoToVertex(void);
179 Bool_t CheckCandidateK(Int_t icand, Int_t nSeeds);
180
ecfa008b 181 ClassDef(AliMUONEventReconstructor, 0) // MUON event reconstructor in ALICE
a9e2aefa 182 };
183
184#endif