1 #ifndef ALIMUONCLUSTERINFO_H
2 #define ALIMUONCLUSTERINFO_H
4 /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
5 * See cxx source for full Copyright notice */
10 /// \class AliMUONClusterInfo
11 /// \brief Class to summarize ESD data at cluster
12 // Author Philippe Pillot, Subatech
16 #include <TClonesArray.h>
17 #include <AliMUONPadInfo.h>
19 class AliMUONClusterInfo : public TObject {
21 AliMUONClusterInfo(); // Constructor
22 AliMUONClusterInfo(TRootIOCtor* /*rio*/); // IO constructor
23 virtual ~AliMUONClusterInfo(); //< Destructor
24 AliMUONClusterInfo(const AliMUONClusterInfo& cluster);
25 AliMUONClusterInfo& operator=(const AliMUONClusterInfo& cluster);
27 virtual void Clear(Option_t* opt = "");
29 void Print(Option_t * option = "") const;
32 // ------ general info ------
34 void SetRunId(Int_t runId) {fRunId = runId;}
36 Int_t GetRunId() const {return fRunId;}
39 void SetEventId(Int_t eventId) {fEventId = eventId;}
41 Int_t GetEventId() const {return fEventId;}
44 /// Set cluster/track Z-position (cm)
45 void SetZ(Double_t z) {fZ = z;}
46 /// Return cluster/track Z-position (cm)
47 Double_t GetZ() const {return fZ;}
50 // ------ cluster info ------
52 void SetClusterId(UInt_t clusterId) {fClusterId = clusterId; SetUniqueID(clusterId);}
54 UInt_t GetClusterId() const {return fClusterId;}
55 /// Return chamber ID (0..), part of the cluster ID
56 Int_t GetChamberId() const {return (fClusterId & 0xF0000000) >> 28;}
57 /// Return detection element ID, part of the cluster ID
58 Int_t GetDetElemId() const {return (fClusterId & 0x0FFE0000) >> 17;}
59 /// Return the index of this cluster (0..), part of the cluster ID
60 Int_t GetClusterIndex() const {return (fClusterId & 0x0001FFFF);}
62 /// Set cluster coordinates (cm)
63 void SetClusterXY(Double_t x, Double_t y) {fClusterX = x; fClusterY = y;}
64 /// Return cluster X-position (cm)
65 Double_t GetClusterX() const {return fClusterX;}
66 /// Return cluster Y-position (cm)
67 Double_t GetClusterY() const {return fClusterY;}
69 /// Set cluster resolution (cm)
70 void SetClusterXYErr(Double_t xErr, Double_t yErr) {fClusterXErr = xErr; fClusterYErr = yErr;}
71 /// Return cluster X-resolution (cm)
72 Double_t GetClusterXErr() const {return fClusterXErr;}
73 /// Return cluster Y-resolution (cm)
74 Double_t GetClusterYErr() const {return fClusterYErr;}
77 void SetClusterChi2(Double_t clusterChi2) {fClusterChi2 = clusterChi2;}
78 /// return cluster Chi2
79 Double_t GetClusterChi2() const {return fClusterChi2;}
81 /// Set the total cluster charge
82 void SetClusterCharge(Double_t charge) {fClusterCharge = charge;}
83 /// Return the total cluster charge
84 Double_t GetClusterCharge() const {return fClusterCharge;}
85 /// Return the cluster charge for cathode iC
86 Double_t GetClusterCharge(Int_t iC) const ;
87 /// Return the bending cluster charge
88 Double_t GetClusterChargeB() const {return GetClusterCharge(0);}
89 /// Return the non bending cluster charge
90 Double_t GetClusterChargeNB() const {return GetClusterCharge(1);}
93 // ------ track info ------
95 void SetTrackId(UInt_t trackId) {fTrackId = trackId;}
97 UInt_t GetTrackId() const {return fTrackId;}
99 /// Set track coordinates (cm)
100 void SetTrackXY(Double_t x, Double_t y) {fTrackX = x; fTrackY = y;}
101 /// Return track X-position (cm)
102 Double_t GetTrackX() const {return fTrackX;}
103 /// Return track Y-position (cm)
104 Double_t GetTrackY() const {return fTrackY;}
105 /// Set track angles (radian)
106 void SetTrackThetaXY(Double_t thetaX, Double_t thetaY) {fTrackThetaX = thetaX; fTrackThetaY = thetaY;}
107 /// Return track ThetaX angle (radian)
108 Double_t GetTrackThetaX() const {return fTrackThetaX;}
109 /// Return track ThetaY angle (radian)
110 Double_t GetTrackThetaY() const {return fTrackThetaY;}
111 /// Set track momentum (MeV/c)
112 void SetTrackP(Double_t p) {fTrackP = p;}
113 /// Return track momentum (MeV/c)
114 Double_t GetTrackP() const {return fTrackP;}
116 /// Set track resolution (cm)
117 void SetTrackXYErr(Double_t xErr, Double_t yErr) {fTrackXErr = xErr; fTrackYErr = yErr;}
118 /// Return track X-resolution (cm)
119 Double_t GetTrackXErr() const {return fTrackXErr;}
120 /// Return track Y-resolution (cm)
121 Double_t GetTrackYErr() const {return fTrackYErr;}
124 void SetTrackChi2(Double_t trackChi2) {fTrackChi2 = trackChi2;}
125 /// return track Chi2
126 Double_t GetTrackChi2() const {return fTrackChi2;}
128 /// Set the muon charge
129 void SetTrackCharge(Short_t charge) {fTrackCharge = charge;}
130 /// Return the muon charge
131 Short_t GetTrackCharge() const {return fTrackCharge;}
133 /// Get the total number of hits associated to the track leaving this cluster
134 UChar_t GetTrackNHits(void) const {return fTrackNHits;}
135 /// Set the total number of hits associated to the track leaving this cluster
136 void SetTrackNHits(UInt_t NHits) {fTrackNHits = NHits;}
138 /// Get the map of hit chambers
139 UInt_t GetTrackChamberHitMap() const {return fTrackChamberHitMap;}
140 /// Set the map of hit chambers
141 void SetTrackChamberHitMap(UInt_t trackChamberHitMap) {fTrackChamberHitMap = trackChamberHitMap;}
142 /// Is chamber hit by track
143 Bool_t IsChamberHit(Int_t chamber) const {return (Bool_t) ((fTrackChamberHitMap & BIT(chamber)) != 0);}
145 // ------ pad info ------
146 /// return the number of pads attached to the cluster
147 Int_t GetNPads() const {return fPads->GetEntriesFast();}
148 /// return the number of pads attached to the cluster in cathode iC
149 Int_t GetNPads(Int_t iC) const ;
150 /// return the number of bending pads attached to the cluster
151 Int_t GetNPadsB() const {return GetNPads(0);}
152 /// return the number of non bending pads attached to the cluster
153 Int_t GetNPadsNB() const {return GetNPads(1);}
154 /// return the number of pads attached to the cluster
155 Int_t GetNPadsX(Int_t iC) const ;
156 /// return the number of pads attached to the cluster
157 Int_t GetNPadsXB() const {return GetNPadsX(0);}
158 /// return the number of pads attached to the cluster
159 Int_t GetNPadsXNB() const {return GetNPadsX(1);}
160 /// return the number of pads attached to the cluster
161 Int_t GetNPadsY(Int_t iC) const ;
162 /// return the number of pads attached to the cluster
163 Int_t GetNPadsYB() const {return GetNPadsY(0);}
164 /// return the number of pads attached to the cluster
165 Int_t GetNPadsYNB() const {return GetNPadsY(1);}
166 /// return the array of pads attached to the cluster
167 TClonesArray& GetPads() const {return *fPads;}
168 /// attach a pad to the cluster
169 void AddPad(const AliMUONPadInfo &pad) {new ((*fPads)[fNPads++]) AliMUONPadInfo(pad);}
175 Int_t fRunId; ///< run number
176 Int_t fEventId; ///< event number
177 Double32_t fZ; ///< track/cluster Z position
180 UInt_t fClusterId; ///< cluster ID
181 Double32_t fClusterX; ///< cluster X position
182 Double32_t fClusterY; ///< cluster Y position
183 Double32_t fClusterXErr; ///< cluster X resolution
184 Double32_t fClusterYErr; ///< cluster Y resolution
185 Double32_t fClusterChi2; ///< cluster chi2
186 Double32_t fClusterCharge; ///< cluster charge
189 UInt_t fTrackId; ///< track ID
190 Double32_t fTrackX; ///< track X position
191 Double32_t fTrackY; ///< track Y position
192 Double32_t fTrackThetaX; ///< track Theta_X angle
193 Double32_t fTrackThetaY; ///< track Theta_Y angle
194 Double32_t fTrackP; ///< track momentum
195 Double32_t fTrackXErr; ///< track X resolution
196 Double32_t fTrackYErr; ///< track Y resolution
197 Double32_t fTrackChi2; ///< track normalized chi2
198 Short_t fTrackCharge; ///< track charge
199 UChar_t fTrackNHits; ///< track number of hits
200 UInt_t fTrackChamberHitMap; ///< Map of clusters in tracking chambers
202 Int_t fNPads; ///< nPads
203 TClonesArray* fPads; ///< Array of pads attached to the cluster
205 ClassDef(AliMUONClusterInfo, 3) //Class to summarize ESD data at cluster