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