]>
Commit | Line | Data |
---|---|---|
1 | #ifndef ALIMUONESDINTERFACE_H | |
2 | #define ALIMUONESDINTERFACE_H | |
3 | ||
4 | /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. * | |
5 | * See cxx source for full Copyright notice */ | |
6 | ||
7 | // $Id$ | |
8 | ||
9 | /// \ingroup rec | |
10 | /// \class AliMUONESDInterface | |
11 | /// \brief Converter between MUON track/cluster/digit and ESDMuon track/cluster/pad | |
12 | /// | |
13 | // Author Philippe Pillot | |
14 | ||
15 | #include <AliMpExMap.h> | |
16 | #include <TObject.h> | |
17 | #include <TString.h> | |
18 | #include "AliLog.h" | |
19 | ||
20 | class AliMUONTrack; | |
21 | class AliMUONVTrackStore; | |
22 | class AliMUONVCluster; | |
23 | class AliMUONVClusterStore; | |
24 | class AliMUONVDigit; | |
25 | class AliMUONVDigitStore; | |
26 | class AliMUONLocalTrigger; | |
27 | class AliMUONTriggerTrack; | |
28 | class AliMUONVTriggerStore; | |
29 | class AliMUONTrackParam; | |
30 | class AliMUONVTrackReconstructor; | |
31 | class AliESDEvent; | |
32 | class AliESDMuonTrack; | |
33 | class AliESDMuonCluster; | |
34 | class AliESDMuonPad; | |
35 | class TIterator; | |
36 | class AliMUONRecoParam; | |
37 | ||
38 | class AliMUONESDInterface : public TObject | |
39 | { | |
40 | public: // methods to play with internal objects | |
41 | ||
42 | AliMUONESDInterface(); | |
43 | virtual ~AliMUONESDInterface(); | |
44 | ||
45 | virtual void Clear(Option_t* = ""); | |
46 | ||
47 | void LoadEvent(AliESDEvent& esdEvent); | |
48 | ||
49 | /// Return internal track store | |
50 | AliMUONVTrackStore* GetTracks() const {return fTracks;} | |
51 | /// Return internal track store | |
52 | AliMUONVDigitStore* GetDigits() const {return fDigits;} | |
53 | /// Return internal trigger store | |
54 | AliMUONVTriggerStore* GetTriggers() const {return fTriggers;} | |
55 | ||
56 | // Return numbers of tracks/clusters/digits | |
57 | Int_t GetNTracks() const; | |
58 | Int_t GetNClusters() const; | |
59 | Int_t GetNClusters(UInt_t trackId) const; | |
60 | Int_t GetNDigits() const; | |
61 | Int_t GetNDigits(UInt_t trackId) const; | |
62 | Int_t GetNDigits(UInt_t trackId, UInt_t clusterId) const; | |
63 | Int_t GetNDigitsInCluster(UInt_t clusterId) const; | |
64 | Int_t GetNTriggers() const; | |
65 | ||
66 | // Find internal MUON objects | |
67 | AliMUONTrack* FindTrack(UInt_t trackId) const; | |
68 | AliMUONVCluster* FindCluster(UInt_t clusterId) const; | |
69 | AliMUONVCluster* FindCluster(UInt_t trackId, UInt_t clusterId) const; | |
70 | AliMUONVDigit* FindDigit(UInt_t digitId) const; | |
71 | AliMUONLocalTrigger* FindLocalTrigger(Int_t boardNumber) const; | |
72 | ||
73 | // iterate over internal MUON objects | |
74 | TIterator* CreateTrackIterator() const; | |
75 | TIterator* CreateClusterIterator() const; | |
76 | TIterator* CreateClusterIterator(UInt_t trackId) const; | |
77 | TIterator* CreateDigitIterator() const; | |
78 | TIterator* CreateDigitIterator(UInt_t trackId) const; | |
79 | TIterator* CreateDigitIterator(UInt_t trackId, UInt_t clusterId) const; | |
80 | TIterator* CreateDigitIteratorInCluster(UInt_t clusterId) const; | |
81 | TIterator* CreateLocalTriggerIterator() const; | |
82 | ||
83 | ||
84 | public: // static methods | |
85 | ||
86 | /// Reset the MUON tracker (using "recoParam" if provided) | |
87 | static void ResetTracker(const AliMUONRecoParam* recoParam = 0x0); | |
88 | ||
89 | /// Set the version of track store | |
90 | static void UseTrackStore(TString name) {fgTrackStoreName = name;} | |
91 | /// Set the version of cluster store | |
92 | static void UseClusterStore(TString name) {fgClusterStoreName = name;} | |
93 | /// Set the version of digit store | |
94 | static void UseDigitStore(TString name) {fgDigitStoreName = name;} | |
95 | /// Set the version of trigger store | |
96 | static void UseTriggerStore(TString name) {fgTriggerStoreName = name;} | |
97 | ||
98 | // Create empty stores (use the version defined in this interface) | |
99 | static AliMUONVTrackStore* NewTrackStore(); | |
100 | static AliMUONVClusterStore* NewClusterStore(); | |
101 | static AliMUONVDigitStore* NewDigitStore(); | |
102 | static AliMUONVTriggerStore* NewTriggerStore(); | |
103 | ||
104 | // ESD track parameters --> MUON track parameters | |
105 | static void GetParamAtVertex(const AliESDMuonTrack& esdTrack, AliMUONTrackParam& trackParam); | |
106 | static void GetParamAtDCA(const AliESDMuonTrack& esdTrack, AliMUONTrackParam& trackParam); | |
107 | static void GetParamAtFirstCluster(const AliESDMuonTrack& esdTrack, AliMUONTrackParam& trackParam); | |
108 | static void GetParamCov(const AliESDMuonTrack& esdTrack, AliMUONTrackParam& trackParam); | |
109 | ||
110 | // MUON track parameters --> ESD track parameters | |
111 | static void SetParamAtVertex(const AliMUONTrackParam& trackParam, AliESDMuonTrack& esdTrack); | |
112 | static void SetParamAtDCA(const AliMUONTrackParam& trackParam, AliESDMuonTrack& esdTrack); | |
113 | static void SetParamAtFirstCluster(const AliMUONTrackParam& trackParam, AliESDMuonTrack& esdTrack); | |
114 | static void SetParamCov(const AliMUONTrackParam& trackParam, AliESDMuonTrack& esdTrack); | |
115 | ||
116 | // ESDMuon objects --> MUON objects conversion | |
117 | static void ESDToMUON(const AliESDMuonTrack& esdTrack, AliMUONTrack& track); | |
118 | static void ESDToMUON(const AliESDMuonTrack& esdTrack, AliMUONLocalTrigger& locTrg); | |
119 | static void ESDToMUON(const AliESDMuonCluster& esdCluster, AliMUONVCluster& cluster); | |
120 | static void ESDToMUON(const AliESDMuonPad& esdPad, AliMUONVDigit& digit); | |
121 | ||
122 | // MUON objects --> ESDMuon objects conversion | |
123 | static void MUONToESD(const AliMUONTrack& track, AliESDMuonTrack& esdTrack, const Double_t vertex[3], | |
124 | const AliMUONVDigitStore* digits = 0x0, const AliMUONLocalTrigger* locTrg = 0x0); | |
125 | static void MUONToESD(const AliMUONLocalTrigger& locTrg, AliESDMuonTrack& esdTrack, UInt_t trackId, | |
126 | const AliMUONTriggerTrack* triggerTrack = 0x0); | |
127 | static void MUONToESD(const AliMUONVCluster& cluster, AliESDMuonCluster& esdCluster, const AliMUONVDigitStore* digits = 0x0); | |
128 | static void MUONToESD(const AliMUONVDigit& digit, AliESDMuonPad& esdPad); | |
129 | ||
130 | // Add ESD object into the corresponding MUON store | |
131 | // return a pointer to the corresponding MUON object into the store | |
132 | static AliMUONTrack* Add(const AliESDMuonTrack& esdTrack, AliMUONVTrackStore& trackStore); | |
133 | static void Add(const AliESDMuonTrack& esdTrack, AliMUONVTriggerStore& triggerStore); | |
134 | static AliMUONVCluster* Add(const AliESDMuonCluster& esdCluster, AliMUONVClusterStore& clusterStore); | |
135 | static AliMUONVDigit* Add(const AliESDMuonPad& esdPad, AliMUONVDigitStore& digitStore); | |
136 | ||
137 | ||
138 | protected: | |
139 | ||
140 | AliMUONESDInterface (const AliMUONESDInterface&); ///< copy constructor | |
141 | AliMUONESDInterface& operator=(const AliMUONESDInterface&); ///< assignment operator | |
142 | ||
143 | ||
144 | private: | |
145 | ||
146 | void Reset(); | |
147 | AliMUONVCluster* FindClusterInTrack(const AliMUONTrack& track, UInt_t clusterId) const; | |
148 | ||
149 | ||
150 | private: | |
151 | ||
152 | static AliMUONRecoParam* fgRecoParam; ///< reconstruction parameters for refitting | |
153 | static AliMUONVTrackReconstructor* fgTracker; ///< track reconstructor for refitting | |
154 | ||
155 | static TString fgTrackStoreName; ///< class name of the track store to use | |
156 | static TString fgClusterStoreName; ///< class name of the cluster store to use | |
157 | static TString fgDigitStoreName; ///< class name of the digit store to use | |
158 | static TString fgTriggerStoreName; ///< class name of the trigger store to use | |
159 | ||
160 | // data containers | |
161 | AliMUONVTrackStore* fTracks; ///< track container | |
162 | AliMUONVDigitStore* fDigits; ///< digit container | |
163 | AliMUONVTriggerStore* fTriggers; ///< trigger container | |
164 | ||
165 | // maps (to speed up data retrieval) | |
166 | AliMpExMap* fClusterMap; ///< map of clusters | |
167 | AliMpExMap* fDigitMap; ///< map of digits | |
168 | ||
169 | ||
170 | ClassDef(AliMUONESDInterface,0) | |
171 | }; | |
172 | ||
173 | #endif | |
174 |