AliRoot Core  a565103 (a565103)
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
AliMUONClusterInfo.cxx
Go to the documentation of this file.
1 /**************************************************************************
2 * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
3 * *
4 * Author: The ALICE Off-line Project. *
5 * Contributors are mentioned in the code where appropriate. *
6 * *
7 * Permission to use, copy, modify and distribute this software and its *
8 * documentation strictly for non-commercial purposes is hereby granted *
9 * without fee, provided that the above copyright notice appears in all *
10 * copies and that both the copyright notice and this permission notice *
11 * appear in the supporting documentation. The authors make no claims *
12 * about the suitability of this software for any purpose. It is *
13 * provided "as is" without express or implied warranty. *
14 **************************************************************************/
15 
16 // $Id$
17 
18 //-----------------------------------------------------------------------------
24 //-----------------------------------------------------------------------------
25 
26 #include "AliMUONClusterInfo.h"
27 
28 #include "AliLog.h"
29 
30 #include <Riostream.h>
31 
32 using std::cout;
33 using std::endl;
37 
38 //_____________________________________________________________________________
40 : TObject(),
41  fRunId(0),
42  fEventId(0),
43  fZ(0.),
44  fClusterId(0),
45  fClusterX(0.),
46  fClusterY(0.),
47  fClusterXErr(0.),
48  fClusterYErr(0.),
49  fClusterChi2(0.),
50  fClusterCharge(0.),
51  fTrackId(0),
52  fTrackX(0.),
53  fTrackY(0.),
54  fTrackThetaX(0.),
55  fTrackThetaY(0.),
56  fTrackP(0.),
57  fTrackXErr(0.),
58  fTrackYErr(0.),
59  fTrackChi2(0.),
60  fTrackCharge(0),
61  fTrackNHits(0),
62  fTrackChamberHitMap(0),
63  fNPads(0),
64  fPads(new TClonesArray("AliMUONPadInfo",10))
65 {
67 }
68 
69 //_____________________________________________________________________________
71 : TObject(),
72 fRunId(0),
73 fEventId(0),
74 fZ(0.),
75 fClusterId(0),
76 fClusterX(0.),
77 fClusterY(0.),
78 fClusterXErr(0.),
79 fClusterYErr(0.),
80 fClusterChi2(0.),
81 fClusterCharge(0.),
82 fTrackId(0),
83 fTrackX(0.),
84 fTrackY(0.),
85 fTrackThetaX(0.),
86 fTrackThetaY(0.),
87 fTrackP(0.),
88 fTrackXErr(0.),
89 fTrackYErr(0.),
90 fTrackChi2(0.),
91 fTrackCharge(0),
92 fTrackNHits(0),
93 fTrackChamberHitMap(0),
94 fNPads(0),
95 fPads(0x0)
96 {
98 }
99 
100 //_____________________________________________________________________________
102 : TObject(clusterInfo),
103  fRunId(clusterInfo.fRunId),
104  fEventId(clusterInfo.fEventId),
105  fZ(clusterInfo.fZ),
106  fClusterId(clusterInfo.fClusterId),
107  fClusterX(clusterInfo.fClusterX),
108  fClusterY(clusterInfo.fClusterY),
109  fClusterXErr(clusterInfo.fClusterXErr),
110  fClusterYErr(clusterInfo.fClusterYErr),
111  fClusterChi2(clusterInfo.fClusterChi2),
112  fClusterCharge(clusterInfo.fClusterCharge),
113  fTrackId(clusterInfo.fTrackId),
114  fTrackX(clusterInfo.fTrackX),
115  fTrackY(clusterInfo.fTrackY),
116  fTrackThetaX(clusterInfo.fTrackThetaX),
117  fTrackThetaY(clusterInfo.fTrackThetaY),
118  fTrackP(clusterInfo.fTrackP),
119  fTrackXErr(clusterInfo.fTrackXErr),
120  fTrackYErr(clusterInfo.fTrackYErr),
121  fTrackChi2(clusterInfo.fTrackChi2),
122  fTrackCharge(clusterInfo.fTrackCharge),
123  fTrackNHits(clusterInfo.fTrackNHits),
124  fTrackChamberHitMap(clusterInfo.fTrackChamberHitMap),
125  fNPads(clusterInfo.fNPads),
126  fPads(new TClonesArray("AliMUONPadInfo",clusterInfo.fNPads))
127 {
129  AliMUONPadInfo *pad = (AliMUONPadInfo*) clusterInfo.fPads->First();
130  while (pad) {
131  new ((*fPads)[fPads->GetEntriesFast()]) AliMUONPadInfo(*pad);
132  pad = (AliMUONPadInfo*) clusterInfo.fPads->After(pad);
133  }
134 }
135 
136 //_____________________________________________________________________________
138 {
140  if (this == &clusterInfo) return *this;
141 
142  TObject::operator=(clusterInfo); // don't forget to invoke the base class' assignment operator
143 
144  fRunId = clusterInfo.fRunId;
145  fEventId = clusterInfo.fEventId;
146  fZ = clusterInfo.fZ;
147  fClusterId = clusterInfo.fClusterId;
148  fClusterX = clusterInfo.fClusterX;
149  fClusterY = clusterInfo.fClusterY;
150  fClusterXErr = clusterInfo.fClusterXErr;
151  fClusterYErr = clusterInfo.fClusterYErr;
152  fClusterChi2 = clusterInfo.fClusterChi2;
153  fClusterCharge = clusterInfo.fClusterCharge;
154  fTrackId = clusterInfo.fTrackId;
155  fTrackX = clusterInfo.fTrackX;
156  fTrackY = clusterInfo.fTrackY;
157  fTrackThetaX = clusterInfo.fTrackThetaX;
158  fTrackThetaY = clusterInfo.fTrackThetaY;
159  fTrackP = clusterInfo.fTrackP;
160  fTrackXErr = clusterInfo.fTrackXErr;
161  fTrackYErr = clusterInfo.fTrackYErr;
162  fTrackChi2 = clusterInfo.fTrackChi2;
163  fTrackCharge = clusterInfo.fTrackCharge;
164  fTrackNHits = clusterInfo.fTrackNHits;
166  fNPads = clusterInfo.fNPads;
167 
168  fPads->Clear("C");
169  AliMUONPadInfo *pad = (AliMUONPadInfo*) clusterInfo.fPads->First();
170  while (pad) {
171  new ((*fPads)[fPads->GetEntriesFast()]) AliMUONPadInfo(*pad);
172  pad = (AliMUONPadInfo*) clusterInfo.fPads->After(pad);
173  }
174 
175  return *this;
176 }
177 
178 //__________________________________________________________________________
180 {
182  delete fPads;
183 }
184 
185 //__________________________________________________________________________
186 void AliMUONClusterInfo::Clear(Option_t* opt)
187 {
189  fPads->Clear(opt);
190  fNPads = 0;
191 }
192 
193 //_____________________________________________________________________________
194 void AliMUONClusterInfo::Print(Option_t* option) const
195 {
198 
199  // global info
200  cout<<Form("eventID=%d", GetEventId())<<endl;
201 
202  // cluster info
203  cout<<Form("- clusterID=%u (ch=%d, det=%d, index=%d)",
205 
206  cout<<Form(" position=(%5.2f, %5.2f, %5.2f), sigma=(%8.5f, %8.5f, 0.0)",
208 
209  cout<<Form(" charge=%5.2f, chi2=%5.2f", GetClusterCharge(), GetClusterChi2())<<endl;
210 
211  // track info
212  cout<<Form("- trackID=%u", GetTrackId())<<endl;
213 
214  cout<<Form(" position=(%5.2f, %5.2f, %5.2f), angles=(%5.2f, %5.2f), momentum=%5.2f",
216 
217  cout<<Form(" sigma_XY=(%8.5f, %8.5f), charge=%d, chi2=%5.2f",
219 
220  // pad info
221  if (strstr(option,"FULL")) {
222  AliMUONPadInfo *pad = (AliMUONPadInfo*) fPads->First();
223  while (pad) {
224  pad->Print("FULL");
225  pad = (AliMUONPadInfo*) fPads->After(pad);
226  }
227  }
228 
229 }
230 
231 Double_t AliMUONClusterInfo::GetClusterCharge(Int_t iPlaneType) const
232 {
233  Double_t lClusterChargeC = 0.;
234  if (!fPads) {
235  lClusterChargeC = GetClusterCharge()/2.;
236  }
237  else {
238  AliMUONPadInfo *pad = (AliMUONPadInfo*) fPads->First();
239  while (pad) {
240  if (pad->GetPadPlaneType()==iPlaneType) lClusterChargeC += pad->GetPadCharge();
241  pad = (AliMUONPadInfo*) fPads->After(pad);
242  }
243  }
244  return lClusterChargeC;
245 }
246 
247 Int_t AliMUONClusterInfo::GetNPads(Int_t iPlaneType) const
248 {
249  Int_t iNPads = 0;
250 
251  if (!fPads) {
252  iNPads = GetNPads();
253  }
254  else {
255  AliMUONPadInfo *pad = (AliMUONPadInfo*) fPads->First();
256  while (pad) {
257  if (pad->GetPadPlaneType()==iPlaneType) {
258  iNPads++;
259  }
260  pad = (AliMUONPadInfo*) fPads->After(pad);
261  }
262  }
263  return iNPads;
264 }
265 
266 Int_t AliMUONClusterInfo::GetNPadsX(Int_t iPlaneType) const
267 {
268  Int_t iNPadsX = 0;
269  Double_t lPadXMin = 10000.;
270  Double_t lPadXMax = -10000.;
271  Int_t nChangedMin = 0;
272  Int_t nChangedMax = 0;
273 
274  if (!fPads) {
275  iNPadsX = GetNPads();
276  }
277  else {
278  AliMUONPadInfo *pad = (AliMUONPadInfo*) fPads->First();
279  while (pad) {
280  if (pad->GetPadPlaneType()==iPlaneType) {
281  if (pad->GetPadX()<lPadXMin){
282  lPadXMin = pad->GetPadX();
283  nChangedMin++;
284  }
285  if (pad->GetPadX()>lPadXMax){
286  lPadXMax = pad->GetPadX();
287  nChangedMax++;
288  }
289  }
290  pad = (AliMUONPadInfo*) fPads->After(pad);
291  }
292  iNPadsX = TMath::Max(nChangedMin+nChangedMax-1,0);
293  }
294  return iNPadsX;
295 }
296 
297 Int_t AliMUONClusterInfo::GetNPadsY(Int_t iPlaneType) const
298 {
299  Int_t iNPadsY = 0;
300  Double_t lPadYMin = 10000.;
301  Double_t lPadYMax = -10000.;
302  Int_t nChangedMin = 0;
303  Int_t nChangedMax = 0;
304 
305  if (!fPads) {
306  iNPadsY = GetNPads();
307  }
308  else {
309  AliMUONPadInfo *pad = (AliMUONPadInfo*) fPads->First();
310  while (pad) {
311  if (pad->GetPadPlaneType()==iPlaneType) {
312  if (pad->GetPadY()<lPadYMin){
313  lPadYMin = pad->GetPadY();
314  nChangedMin++;
315  }
316  if (pad->GetPadY()>lPadYMax){
317  lPadYMax = pad->GetPadY();
318  nChangedMax++;
319  }
320  }
321  pad = (AliMUONPadInfo*) fPads->After(pad);
322  }
323  iNPadsY = TMath::Max(nChangedMin+nChangedMax-1,0);
324  }
325  return iNPadsY;
326 }
327 
Int_t GetClusterIndex() const
Return the index of this cluster (0..), part of the cluster ID.
Double_t GetTrackX() const
Return track X-position (cm)
Double32_t fTrackChi2
track normalized chi2
Double_t GetTrackYErr() const
Return track Y-resolution (cm)
Int_t GetPadPlaneType() const
Return the plane type 0=Bending 1=NonBending.
Int_t GetNPads() const
return the number of pads attached to the cluster
Double_t GetTrackXErr() const
Return track X-resolution (cm)
Short_t fTrackCharge
track charge
Double32_t fTrackThetaX
track Theta_X angle
Double_t GetTrackP() const
Return track momentum (MeV/c)
UInt_t fTrackId
track ID
Double_t GetTrackY() const
Return track Y-position (cm)
void Print(Option_t *option="") const
Int_t fEventId
event number
Double32_t fClusterCharge
cluster charge
Double_t GetTrackThetaY() const
Return track ThetaY angle (radian)
Double32_t fTrackX
track X position
void Print(Option_t *option="") const
Double_t GetPadCharge() const
Return the calibrated charge.
Int_t GetDetElemId() const
Return detection element ID, part of the cluster ID.
Double_t GetPadY() const
Return pad Y-position (cm)
Int_t GetEventId() const
return event ID
Int_t fRunId
run number
Double32_t fTrackP
track momentum
ClassImp(TPCGenInfo)
Definition: AliTPCCmpNG.C:254
Double_t GetClusterX() const
Return cluster X-position (cm)
TClonesArray * fPads
Array of pads attached to the cluster.
UInt_t fTrackChamberHitMap
Map of clusters in tracking chambers.
virtual void Clear(Option_t *opt="")
Double32_t fClusterChi2
cluster chi2
Double32_t fTrackXErr
track X resolution
Int_t GetNPadsY(Int_t iC) const
return the number of pads attached to the cluster
Double32_t fClusterYErr
cluster Y resolution
Short_t GetTrackCharge() const
Return the muon charge.
Double32_t fZ
track/cluster Z position
Double_t GetClusterYErr() const
Return cluster Y-resolution (cm)
Double_t GetZ() const
Return cluster/track Z-position (cm)
Double32_t fClusterXErr
cluster X resolution
Double32_t fClusterY
cluster Y position
Double_t GetClusterXErr() const
Return cluster X-resolution (cm)
Double32_t fClusterX
cluster X position
Double_t GetClusterCharge() const
Return the total cluster charge.
Int_t GetNPadsX(Int_t iC) const
return the number of pads attached to the cluster
AliMUONClusterInfo & operator=(const AliMUONClusterInfo &cluster)
Double32_t fTrackY
track Y position
UInt_t fClusterId
cluster ID
Double_t GetClusterChi2() const
return cluster Chi2
Int_t GetChamberId() const
Return chamber ID (0..), part of the cluster ID.
Double_t GetPadX() const
Return pad X-position (cm)
Double32_t fTrackYErr
track Y resolution
Class to summarize ESD data at cluster.
Class to summarize ESD data at pad.
Double32_t fTrackThetaY
track Theta_Y angle
UInt_t GetClusterId() const
return cluster ID
Double_t GetTrackChi2() const
return track Chi2
Double_t GetTrackThetaX() const
Return track ThetaX angle (radian)
UChar_t fTrackNHits
track number of hits
Double_t GetClusterY() const
Return cluster Y-position (cm)
UInt_t GetTrackId() const
return track ID