1 /**************************************************************************
2 * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4 * Author: The ALICE Off-line Project. *
5 * Contributors are mentioned in the code where appropriate. *
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 **************************************************************************/
18 //-----------------------------------------------------------------------------
19 /// \class AliMUONClusterInfo
21 /// Class to summarize ESD data at cluster
23 /// \author Philippe Pillot, Subatech
24 //-----------------------------------------------------------------------------
26 #include "AliMUONClusterInfo.h"
30 #include <Riostream.h>
33 ClassImp(AliMUONClusterInfo)
36 //_____________________________________________________________________________
37 AliMUONClusterInfo::AliMUONClusterInfo()
60 fTrackChamberHitMap(0),
62 fPads(new TClonesArray("AliMUONPadInfo",10))
64 /// default constructor
67 //_____________________________________________________________________________
68 AliMUONClusterInfo::AliMUONClusterInfo (const AliMUONClusterInfo& clusterInfo)
69 : TObject(clusterInfo),
70 fRunId(clusterInfo.fRunId),
71 fEventId(clusterInfo.fEventId),
73 fClusterId(clusterInfo.fClusterId),
74 fClusterX(clusterInfo.fClusterX),
75 fClusterY(clusterInfo.fClusterY),
76 fClusterXErr(clusterInfo.fClusterXErr),
77 fClusterYErr(clusterInfo.fClusterYErr),
78 fClusterChi2(clusterInfo.fClusterChi2),
79 fClusterCharge(clusterInfo.fClusterCharge),
80 fTrackId(clusterInfo.fTrackId),
81 fTrackX(clusterInfo.fTrackX),
82 fTrackY(clusterInfo.fTrackY),
83 fTrackThetaX(clusterInfo.fTrackThetaX),
84 fTrackThetaY(clusterInfo.fTrackThetaY),
85 fTrackP(clusterInfo.fTrackP),
86 fTrackXErr(clusterInfo.fTrackXErr),
87 fTrackYErr(clusterInfo.fTrackYErr),
88 fTrackChi2(clusterInfo.fTrackChi2),
89 fTrackCharge(clusterInfo.fTrackCharge),
90 fTrackNHits(clusterInfo.fTrackNHits),
91 fTrackChamberHitMap(clusterInfo.fTrackChamberHitMap),
92 fNPads(clusterInfo.fNPads),
93 fPads(new TClonesArray("AliMUONPadInfo",clusterInfo.fNPads))
96 AliMUONPadInfo *pad = (AliMUONPadInfo*) clusterInfo.fPads->First();
98 new ((*fPads)[fPads->GetEntriesFast()]) AliMUONPadInfo(*pad);
99 pad = (AliMUONPadInfo*) clusterInfo.fPads->After(pad);
103 //_____________________________________________________________________________
104 AliMUONClusterInfo& AliMUONClusterInfo::operator=(const AliMUONClusterInfo& clusterInfo)
107 if (this == &clusterInfo) return *this;
109 TObject::operator=(clusterInfo); // don't forget to invoke the base class' assignment operator
111 fRunId = clusterInfo.fRunId;
112 fEventId = clusterInfo.fEventId;
114 fClusterId = clusterInfo.fClusterId;
115 fClusterX = clusterInfo.fClusterX;
116 fClusterY = clusterInfo.fClusterY;
117 fClusterXErr = clusterInfo.fClusterXErr;
118 fClusterYErr = clusterInfo.fClusterYErr;
119 fClusterChi2 = clusterInfo.fClusterChi2;
120 fClusterCharge = clusterInfo.fClusterCharge;
121 fTrackId = clusterInfo.fTrackId;
122 fTrackX = clusterInfo.fTrackX;
123 fTrackY = clusterInfo.fTrackY;
124 fTrackThetaX = clusterInfo.fTrackThetaX;
125 fTrackThetaY = clusterInfo.fTrackThetaY;
126 fTrackP = clusterInfo.fTrackP;
127 fTrackXErr = clusterInfo.fTrackXErr;
128 fTrackYErr = clusterInfo.fTrackYErr;
129 fTrackChi2 = clusterInfo.fTrackChi2;
130 fTrackCharge = clusterInfo.fTrackCharge;
131 fTrackNHits = clusterInfo.fTrackNHits;
132 fTrackChamberHitMap = clusterInfo.fTrackChamberHitMap;
133 fNPads = clusterInfo.fNPads;
136 AliMUONPadInfo *pad = (AliMUONPadInfo*) clusterInfo.fPads->First();
138 new ((*fPads)[fPads->GetEntriesFast()]) AliMUONPadInfo(*pad);
139 pad = (AliMUONPadInfo*) clusterInfo.fPads->After(pad);
145 //__________________________________________________________________________
146 AliMUONClusterInfo::~AliMUONClusterInfo()
152 //__________________________________________________________________________
153 void AliMUONClusterInfo::Clear(Option_t* opt)
160 //_____________________________________________________________________________
161 void AliMUONClusterInfo::Print(Option_t* option) const
163 /// print cluster info content
164 /// print also pad info if option=FULL
167 cout<<Form("eventID=%d", GetEventId())<<endl;
170 cout<<Form("- clusterID=%u (ch=%d, det=%d, index=%d)",
171 GetClusterId(), GetChamberId(), GetDetElemId(), GetClusterIndex())<<endl;
173 cout<<Form(" position=(%5.2f, %5.2f, %5.2f), sigma=(%8.5f, %8.5f, 0.0)",
174 GetClusterX(), GetClusterY(), GetZ(), GetClusterXErr(), GetClusterYErr())<<endl;
176 cout<<Form(" charge=%5.2f, chi2=%5.2f", GetClusterCharge(), GetClusterChi2())<<endl;
179 cout<<Form("- trackID=%u", GetTrackId())<<endl;
181 cout<<Form(" position=(%5.2f, %5.2f, %5.2f), angles=(%5.2f, %5.2f), momentum=%5.2f",
182 GetTrackX(), GetTrackY(), GetZ(), GetTrackThetaX(), GetTrackThetaY(), GetTrackP())<<endl;
184 cout<<Form(" sigma_XY=(%8.5f, %8.5f), charge=%d, chi2=%5.2f",
185 GetTrackXErr(), GetTrackYErr(), GetTrackCharge(), GetTrackChi2())<<endl;
188 if (strstr(option,"FULL")) {
189 AliMUONPadInfo *pad = (AliMUONPadInfo*) fPads->First();
192 pad = (AliMUONPadInfo*) fPads->After(pad);
198 Double_t AliMUONClusterInfo::GetClusterCharge(Int_t iPlaneType) const
200 Double_t lClusterChargeC = 0.;
202 lClusterChargeC = GetClusterCharge()/2.;
205 AliMUONPadInfo *pad = (AliMUONPadInfo*) fPads->First();
207 if (pad->GetPadPlaneType()==iPlaneType) lClusterChargeC += pad->GetPadCharge();
208 pad = (AliMUONPadInfo*) fPads->After(pad);
211 return lClusterChargeC;
214 Int_t AliMUONClusterInfo::GetNPads(Int_t iPlaneType) const
222 AliMUONPadInfo *pad = (AliMUONPadInfo*) fPads->First();
224 if (pad->GetPadPlaneType()==iPlaneType) {
227 pad = (AliMUONPadInfo*) fPads->After(pad);
233 Int_t AliMUONClusterInfo::GetNPadsX(Int_t iPlaneType) const
236 Double_t lPadXMin = 10000.;
237 Double_t lPadXMax = -10000.;
238 Int_t nChangedMin = 0;
239 Int_t nChangedMax = 0;
242 iNPadsX = GetNPads();
245 AliMUONPadInfo *pad = (AliMUONPadInfo*) fPads->First();
247 if (pad->GetPadPlaneType()==iPlaneType) {
248 if (pad->GetPadX()<lPadXMin){
249 lPadXMin = pad->GetPadX();
252 if (pad->GetPadX()>lPadXMax){
253 lPadXMax = pad->GetPadX();
257 pad = (AliMUONPadInfo*) fPads->After(pad);
259 iNPadsX = TMath::Max(nChangedMin+nChangedMax-1,0);
264 Int_t AliMUONClusterInfo::GetNPadsY(Int_t iPlaneType) const
267 Double_t lPadYMin = 10000.;
268 Double_t lPadYMax = -10000.;
269 Int_t nChangedMin = 0;
270 Int_t nChangedMax = 0;
273 iNPadsY = GetNPads();
276 AliMUONPadInfo *pad = (AliMUONPadInfo*) fPads->First();
278 if (pad->GetPadPlaneType()==iPlaneType) {
279 if (pad->GetPadY()<lPadYMin){
280 lPadYMin = pad->GetPadY();
283 if (pad->GetPadY()>lPadYMax){
284 lPadYMax = pad->GetPadY();
288 pad = (AliMUONPadInfo*) fPads->After(pad);
290 iNPadsY = TMath::Max(nChangedMin+nChangedMax-1,0);