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