Test for clusterisation, tracker and ESD filling of MUON for ALICE reconstruction...
[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
276c44b7 77 // Reconstructed trigger tracks
78 Int_t GetNRecTriggerTracks() const {return fNRecTriggerTracks;} // Number
79 void SetNRecTriggerTracks(Int_t NRecTriggerTracks) {fNRecTriggerTracks = NRecTriggerTracks;}
80 TClonesArray* GetRecTriggerTracksPtr(void) const {return fRecTriggerTracksPtr;} // Array
81
8429a5e4 82 // Hits on reconstructed tracks
3831f268 83 Int_t GetNRecTrackHits() const {return fNRecTrackHits;} // Number
8429a5e4 84 void SetNRecTrackHits(Int_t NRecTrackHits) {fNRecTrackHits = NRecTrackHits;}
3831f268 85 TClonesArray* GetRecTrackHitsPtr(void) const {return fRecTrackHitsPtr;} // Array
a9e2aefa 86
87 // Functions
3831f268 88 Double_t GetImpactParamFromBendingMomentum(Double_t BendingMomentum) const;
89 Double_t GetBendingMomentumFromImpactParam(Double_t ImpactParam) const;
a9e2aefa 90 void EventReconstruct(void);
276c44b7 91 void EventReconstructTrigger(void);
04b5ea16 92 void EventDump(void); // dump reconstructed event
276c44b7 93 void EventDumpTrigger(void); // dump reconstructed trigger event
c7ba256d 94 void FillEvent(); // fill and write tree of reconstructed events
83dbc640 95 void SetTrackMethod(Int_t TrackMethod) {fTrackMethod = TrackMethod;} //AZ
96 Int_t GetTrackMethod(void) const {return fTrackMethod;} //AZ
97 Int_t fMuons; // AZ - number of muons within acceptance - just for tests
9cbdf048 98 protected:
99
a9e2aefa 100 private:
101
83dbc640 102 Int_t fTrackMethod; // AZ - tracking method
103
a9e2aefa 104 // Parameters for event reconstruction
105 Double_t fMinBendingMomentum; // minimum value (GeV/c) of momentum in bending plane
d0bfce8d 106 // Parameters for event reconstruction
107 Double_t fMaxBendingMomentum; // maximum value (GeV/c) of momentum in bending plane
108 Double_t fMaxChi2; // maximum Chi2 per degree of Freedom
a9e2aefa 109 Double_t fMaxSigma2Distance; // maximum square distance in units of the variance (maximum chi2)
9cbdf048 110 Double_t fRMin[kMaxMuonTrackingChambers]; // minimum radius (cm)
111 Double_t fRMax[kMaxMuonTrackingChambers]; // maximum radius (cm)
112 Double_t fSegmentMaxDistBending[kMaxMuonTrackingStations]; // maximum distance (cm) for segments in bending plane
ba5b68db 113 Double_t fSegmentMaxDistNonBending[kMaxMuonTrackingStations]; // maximum distance (cm) for segments in non bending plane
a9e2aefa 114 Double_t fBendingResolution; // chamber resolution (cm) in bending plane
115 Double_t fNonBendingResolution; // chamber resolution (cm) in non bending plane
116 Double_t fChamberThicknessInX0; // chamber thickness in number of radiation lengths
117 // how to take it from simulation ????
118 Double_t fSimpleBValue; // simple magnetic field: value (kG)
119 Double_t fSimpleBLength; // simple magnetic field: length (cm)
120 Double_t fSimpleBPosition; // simple magnetic field: Z central position (cm)
121 Int_t fRecGeantHits; // reconstruction from raw clusters (0) or from GEANT hits (1)
122 Double_t fEfficiency; // chamber efficiency (used for GEANT hits only)
123 Int_t fPrintLevel; // print level
124
125 // Parameters for GEANT background events
126 // should be in AliMUON class ????
127 TFile *fBkgGeantFile; // pointer to file
128 TTree *fBkgGeantTK; // pointer to tree TK
129 TClonesArray *fBkgGeantParticles; // pointer to list of particles in tree TK
130 TTree *fBkgGeantTH; // pointer to tree TH
131 TClonesArray *fBkgGeantHits; // pointer to list of hits in tree TH
132 Int_t fBkgGeantEventNumber; // event number
133
134 // Hits for reconstruction (should be in AliMUON ????)
135 TClonesArray *fHitsForRecPtr; // pointer to the array of hits for reconstruction
136 Int_t fNHitsForRec; // number of hits for reconstruction
137 // Information per chamber (should be in AliMUONChamber ????)
9cbdf048 138 Int_t fNHitsForRecPerChamber[kMaxMuonTrackingChambers]; // number of HitsForRec
139 Int_t fIndexOfFirstHitForRecPerChamber[kMaxMuonTrackingChambers]; // index (0...) of first HitForRec
a9e2aefa 140
141 // Segments inside a station
9cbdf048 142 TClonesArray *fSegmentsPtr[kMaxMuonTrackingStations]; // array of pointers to the segments for each station
143 Int_t fNSegments[kMaxMuonTrackingStations]; // number of segments for each station
a9e2aefa 144
8429a5e4 145 // Reconstructed tracks
a9e2aefa 146 TClonesArray *fRecTracksPtr; // pointer to array of reconstructed tracks
147 Int_t fNRecTracks; // number of reconstructed tracks
148
276c44b7 149 // Reconstructed trigger tracks
150 TClonesArray *fRecTriggerTracksPtr; // pointer to array of reconstructed trigger tracks
151 Int_t fNRecTriggerTracks; // number of reconstructed trigger tracks
152
8429a5e4 153 // Track hits on reconstructed tracks
154 TClonesArray *fRecTrackHitsPtr; // pointer to array of hits on reconstructed tracks
155 Int_t fNRecTrackHits; // number of hits on reconstructed tracks
156
c7ba256d 157 // Objects needed for tree writing
158 AliMUONRecoEvent *fRecoEvent; // the reconstructed event
159 TTree *fEventTree; // tree of reconstructed events
160 TFile *fTreeFile; // file where the tree is outputed
161
a9e2aefa 162 // Functions
163 void ResetHitsForRec(void);
164 void MakeEventToBeReconstructed(void);
165 void AddHitsForRecFromGEANT(TTree *TH);
166 void AddHitsForRecFromBkgGEANT(TTree *TH, TClonesArray *Hits);
167 AliMUONHitForRec* NewHitForRecFromGEANT(AliMUONHit* Hit, Int_t TrackNumber, Int_t HitNumber, Int_t Signal);
168/* void AddHitsForRecFromCathodeCorrelations(TTree* TC); */
169 void AddHitsForRecFromRawClusters(TTree* TR);
170 void SortHitsForRecWithIncreasingChamber();
171 void MakeSegments(void);
172 void ResetSegments(void);
173 void MakeSegmentsPerStation(Int_t Station);
174 void MakeTracks(void);
276c44b7 175 void MakeTriggerTracks(void);
8429a5e4 176 void ResetTrackHits(void);
a9e2aefa 177 void ResetTracks(void);
276c44b7 178 void ResetTriggerTracks(void);
a9e2aefa 179 Int_t MakeTrackCandidatesWithTwoSegments(AliMUONSegment *BegSegment);
180 Int_t MakeTrackCandidatesWithOneSegmentAndOnePoint(AliMUONSegment *BegSegment);
181 void MakeTrackCandidates(void);
182 void FollowTracks(void);
8429a5e4 183 void RemoveDoubleTracks(void);
a9e2aefa 184
83dbc640 185
186
187 //AZ - for Kalman Filter
188 void MakeTrackCandidatesK(void);
189 void FollowTracksK(void);
190 void RemoveDoubleTracksK(void);
191 void GoToVertex(void);
192 Bool_t CheckCandidateK(Int_t icand, Int_t nSeeds);
193
ecfa008b 194 ClassDef(AliMUONEventReconstructor, 0) // MUON event reconstructor in ALICE
a9e2aefa 195 };
196
197#endif