]> git.uio.no Git - u/mrichter/AliRoot.git/blame - MUON/AliMUONESDInterface.h
New versions of the DA executables to comply with DAQ DA file naming conventions
[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;
26class AliMUONTrackParam;
27class AliESDEvent;
28class AliESDMuonTrack;
29class AliESDMuonCluster;
30class AliESDMuonPad;
31class TIterator;
32
33class AliMUONESDInterface : public TObject
34{
35public: // methods to play with internal objects
36
37 AliMUONESDInterface();
38 virtual ~AliMUONESDInterface();
39
40 virtual void Clear(Option_t* = "");
41
42 void LoadEvent(AliESDEvent& esdEvent);
43
44 /// Return internal track store
45 AliMUONVTrackStore* GetTracks() const {return fTracks;}
46 /// Return internal track store
47 AliMUONVDigitStore* GetDigits() const {return fDigits;}
48
49 // Return numbers of tracks/clusters/digits
50 Int_t GetNTracks() const;
51 Int_t GetNClusters() const;
630711ed 52 Int_t GetNClusters(UInt_t trackId) const;
103e6575 53 Int_t GetNDigits() const;
630711ed 54 Int_t GetNDigits(UInt_t trackId) const;
55 Int_t GetNDigits(UInt_t trackId, UInt_t clusterId) const;
103e6575 56 Int_t GetNDigitsInCluster(UInt_t clusterId) const;
57
630711ed 58 // Find internal MUON objects
59 AliMUONTrack* FindTrack(UInt_t trackId) const;
103e6575 60 AliMUONVCluster* FindCluster(UInt_t clusterId) const;
630711ed 61 AliMUONVCluster* FindCluster(UInt_t trackId, UInt_t clusterId) const;
103e6575 62 AliMUONVDigit* FindDigit(UInt_t digitId) const;
63
64 // iterate over internal MUON objects
65 TIterator* CreateTrackIterator() const;
66 TIterator* CreateClusterIterator() const;
630711ed 67 TIterator* CreateClusterIterator(UInt_t trackId) const;
103e6575 68 TIterator* CreateDigitIterator() const;
630711ed 69 TIterator* CreateDigitIterator(UInt_t trackId) const;
70 TIterator* CreateDigitIterator(UInt_t trackId, UInt_t clusterId) const;
103e6575 71 TIterator* CreateDigitIteratorInCluster(UInt_t clusterId) const;
72
73
74public: // static methods
75
76 /// Set the version of track store
77 static void UseTrackStore(TString name) {fgTrackStoreName = name;}
78 /// Set the version of cluster store
79 static void UseClusterStore(TString name) {fgClusterStoreName = name;}
80 /// Set the version of digit store
81 static void UseDigitStore(TString name) {fgDigitStoreName = name;}
82
83 // Create empty stores (use the version defined in this interface)
84 static AliMUONVTrackStore* NewTrackStore();
85 static AliMUONVClusterStore* NewClusterStore();
86 static AliMUONVDigitStore* NewDigitStore();
87
88 // ESD track parameters --> MUON track parameters
89 static void GetParamAtVertex(const AliESDMuonTrack& esdTrack, AliMUONTrackParam& trackParam);
90 static void GetParamAtDCA(const AliESDMuonTrack& esdTrack, AliMUONTrackParam& trackParam);
91 static void GetParamAtFirstCluster(const AliESDMuonTrack& esdTrack, AliMUONTrackParam& trackParam);
92 static void GetParamCov(const AliESDMuonTrack& esdTrack, AliMUONTrackParam& trackParam);
93
94 // MUON track parameters --> ESD track parameters
95 static void SetParamAtVertex(const AliMUONTrackParam& trackParam, AliESDMuonTrack& esdTrack);
96 static void SetParamAtDCA(const AliMUONTrackParam& trackParam, AliESDMuonTrack& esdTrack);
97 static void SetParamAtFirstCluster(const AliMUONTrackParam& trackParam, AliESDMuonTrack& esdTrack);
98 static void SetParamCov(const AliMUONTrackParam& trackParam, AliESDMuonTrack& esdTrack);
99
100 // ESDMuon objects --> MUON objects conversion
101 static void ESDToMUON(const AliESDMuonTrack& esdTrack, AliMUONTrack& track);
102 static void ESDToMUON(const AliESDMuonCluster& esdCluster, AliMUONVCluster& cluster);
103 static void ESDToMUON(const AliESDMuonPad& esdPad, AliMUONVDigit& digit);
104
105 // MUON objects --> ESDMuon objects conversion
106 static void MUONToESD(const AliMUONTrack& track, AliESDMuonTrack& esdTrack, const Double_t vertex[3], const AliMUONVDigitStore* digits = 0x0);
107 static void MUONToESD(const AliMUONVCluster& cluster, AliESDMuonCluster& esdCluster, const AliMUONVDigitStore* digits = 0x0);
108 static void MUONToESD(const AliMUONVDigit& digit, AliESDMuonPad& esdPad);
109
110 // Add ESD object into the corresponding MUON store
111 // return a pointer to the corresponding MUON object into the store
112 static AliMUONTrack* Add(const AliESDMuonTrack& esdTrack, AliMUONVTrackStore& trackStore);
113 static AliMUONVCluster* Add(const AliESDMuonCluster& esdCluster, AliMUONVClusterStore& clusterStore);
114 static AliMUONVDigit* Add(const AliESDMuonPad& esdPad, AliMUONVDigitStore& digitStore);
115
116
117protected:
118
119 AliMUONESDInterface (const AliMUONESDInterface&); ///< copy constructor
120 AliMUONESDInterface& operator=(const AliMUONESDInterface&); ///< assignment operator
121
122
123private:
124
125 void Reset();
126 AliMUONVCluster* FindClusterInTrack(const AliMUONTrack& track, UInt_t clusterId) const;
127
128
129private:
130
131 static TString fgTrackStoreName; ///< class name of the track store to use
132 static TString fgClusterStoreName; ///< class name of the cluster store to use
133 static TString fgDigitStoreName; ///< class name of the digit store to use
134
135 // data containers
136 AliMUONVTrackStore* fTracks; ///< track container
137 AliMUONVDigitStore* fDigits; ///< digit container
138
139 // maps (to speed up data retrieval)
630711ed 140 AliMpExMap* fClusterMap; ///< map of clusters
141 AliMpExMap* fDigitMap; ///< map of digits
103e6575 142
143
144 ClassDef(AliMUONESDInterface,0)
145};
146
103e6575 147#endif
148