ESD file is added to the list of proof output files. It is then automatically merged...
[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
a0dc65b4 41 AliMUONESDInterface(AliMUONRecoParam* recoParam);
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
a0dc65b4 82 const AliMUONRecoParam* GetRecoParam() const { return fRecoParam; }
103e6575 83
84public: // static methods
85
86 /// Set the version of track store
87 static void UseTrackStore(TString name) {fgTrackStoreName = name;}
88 /// Set the version of cluster store
89 static void UseClusterStore(TString name) {fgClusterStoreName = name;}
90 /// Set the version of digit store
91 static void UseDigitStore(TString name) {fgDigitStoreName = name;}
b1fea02e 92 /// Set the version of trigger store
93 static void UseTriggerStore(TString name) {fgTriggerStoreName = name;}
103e6575 94
95 // Create empty stores (use the version defined in this interface)
96 static AliMUONVTrackStore* NewTrackStore();
97 static AliMUONVClusterStore* NewClusterStore();
98 static AliMUONVDigitStore* NewDigitStore();
b1fea02e 99 static AliMUONVTriggerStore* NewTriggerStore();
103e6575 100
101 // ESD track parameters --> MUON track parameters
102 static void GetParamAtVertex(const AliESDMuonTrack& esdTrack, AliMUONTrackParam& trackParam);
103 static void GetParamAtDCA(const AliESDMuonTrack& esdTrack, AliMUONTrackParam& trackParam);
104 static void GetParamAtFirstCluster(const AliESDMuonTrack& esdTrack, AliMUONTrackParam& trackParam);
105 static void GetParamCov(const AliESDMuonTrack& esdTrack, AliMUONTrackParam& trackParam);
106
107 // MUON track parameters --> ESD track parameters
108 static void SetParamAtVertex(const AliMUONTrackParam& trackParam, AliESDMuonTrack& esdTrack);
109 static void SetParamAtDCA(const AliMUONTrackParam& trackParam, AliESDMuonTrack& esdTrack);
110 static void SetParamAtFirstCluster(const AliMUONTrackParam& trackParam, AliESDMuonTrack& esdTrack);
111 static void SetParamCov(const AliMUONTrackParam& trackParam, AliESDMuonTrack& esdTrack);
112
113 // ESDMuon objects --> MUON objects conversion
a0dc65b4 114 static void ESDToMUON(const AliMUONRecoParam* recoParam, const AliESDMuonTrack& esdTrack, AliMUONTrack& track);
b1fea02e 115 static void ESDToMUON(const AliESDMuonTrack& esdTrack, AliMUONLocalTrigger& locTrg);
103e6575 116 static void ESDToMUON(const AliESDMuonCluster& esdCluster, AliMUONVCluster& cluster);
117 static void ESDToMUON(const AliESDMuonPad& esdPad, AliMUONVDigit& digit);
118
119 // MUON objects --> ESDMuon objects conversion
b1fea02e 120 static void MUONToESD(const AliMUONTrack& track, AliESDMuonTrack& esdTrack, const Double_t vertex[3],
121 const AliMUONVDigitStore* digits = 0x0, const AliMUONLocalTrigger* locTrg = 0x0);
122 static void MUONToESD(const AliMUONLocalTrigger& locTrg, AliESDMuonTrack& esdTrack, UInt_t trackId);
103e6575 123 static void MUONToESD(const AliMUONVCluster& cluster, AliESDMuonCluster& esdCluster, const AliMUONVDigitStore* digits = 0x0);
124 static void MUONToESD(const AliMUONVDigit& digit, AliESDMuonPad& esdPad);
125
126 // Add ESD object into the corresponding MUON store
127 // return a pointer to the corresponding MUON object into the store
a0dc65b4 128 static AliMUONTrack* Add(const AliMUONRecoParam* recoParam, const AliESDMuonTrack& esdTrack, AliMUONVTrackStore& trackStore);
b1fea02e 129 static void Add(const AliESDMuonTrack& esdTrack, AliMUONVTriggerStore& triggerStore);
103e6575 130 static AliMUONVCluster* Add(const AliESDMuonCluster& esdCluster, AliMUONVClusterStore& clusterStore);
131 static AliMUONVDigit* Add(const AliESDMuonPad& esdPad, AliMUONVDigitStore& digitStore);
132
133
134protected:
135
136 AliMUONESDInterface (const AliMUONESDInterface&); ///< copy constructor
137 AliMUONESDInterface& operator=(const AliMUONESDInterface&); ///< assignment operator
138
139
140private:
141
142 void Reset();
143 AliMUONVCluster* FindClusterInTrack(const AliMUONTrack& track, UInt_t clusterId) const;
144
145
146private:
147
b1fea02e 148 static AliMUONVTrackReconstructor* fgTracker; ///< track reconstructor for refitting
149
103e6575 150 static TString fgTrackStoreName; ///< class name of the track store to use
151 static TString fgClusterStoreName; ///< class name of the cluster store to use
152 static TString fgDigitStoreName; ///< class name of the digit store to use
b1fea02e 153 static TString fgTriggerStoreName; ///< class name of the trigger store to use
103e6575 154
155 // data containers
b1fea02e 156 AliMUONVTrackStore* fTracks; ///< track container
157 AliMUONVDigitStore* fDigits; ///< digit container
158 AliMUONVTriggerStore* fTriggers; ///< trigger container
103e6575 159
160 // maps (to speed up data retrieval)
630711ed 161 AliMpExMap* fClusterMap; ///< map of clusters
162 AliMpExMap* fDigitMap; ///< map of digits
b1fea02e 163
a0dc65b4 164 const AliMUONRecoParam* fRecoParam; ///< get reco param
165
103e6575 166 ClassDef(AliMUONESDInterface,0)
167};
168
103e6575 169#endif
170