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