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(TRootIOCtor* /*rio*/)
91 fTrackChamberHitMap(0),
98 //_____________________________________________________________________________
99 AliMUONClusterInfo::AliMUONClusterInfo (const AliMUONClusterInfo& clusterInfo)
100 : TObject(clusterInfo),
101 fRunId(clusterInfo.fRunId),
102 fEventId(clusterInfo.fEventId),
104 fClusterId(clusterInfo.fClusterId),
105 fClusterX(clusterInfo.fClusterX),
106 fClusterY(clusterInfo.fClusterY),
107 fClusterXErr(clusterInfo.fClusterXErr),
108 fClusterYErr(clusterInfo.fClusterYErr),
109 fClusterChi2(clusterInfo.fClusterChi2),
110 fClusterCharge(clusterInfo.fClusterCharge),
111 fTrackId(clusterInfo.fTrackId),
112 fTrackX(clusterInfo.fTrackX),
113 fTrackY(clusterInfo.fTrackY),
114 fTrackThetaX(clusterInfo.fTrackThetaX),
115 fTrackThetaY(clusterInfo.fTrackThetaY),
116 fTrackP(clusterInfo.fTrackP),
117 fTrackXErr(clusterInfo.fTrackXErr),
118 fTrackYErr(clusterInfo.fTrackYErr),
119 fTrackChi2(clusterInfo.fTrackChi2),
120 fTrackCharge(clusterInfo.fTrackCharge),
121 fTrackNHits(clusterInfo.fTrackNHits),
122 fTrackChamberHitMap(clusterInfo.fTrackChamberHitMap),
123 fNPads(clusterInfo.fNPads),
124 fPads(new TClonesArray("AliMUONPadInfo",clusterInfo.fNPads))
127 AliMUONPadInfo *pad = (AliMUONPadInfo*) clusterInfo.fPads->First();
129 new ((*fPads)[fPads->GetEntriesFast()]) AliMUONPadInfo(*pad);
130 pad = (AliMUONPadInfo*) clusterInfo.fPads->After(pad);
134 //_____________________________________________________________________________
135 AliMUONClusterInfo& AliMUONClusterInfo::operator=(const AliMUONClusterInfo& clusterInfo)
138 if (this == &clusterInfo) return *this;
140 TObject::operator=(clusterInfo); // don't forget to invoke the base class' assignment operator
142 fRunId = clusterInfo.fRunId;
143 fEventId = clusterInfo.fEventId;
145 fClusterId = clusterInfo.fClusterId;
146 fClusterX = clusterInfo.fClusterX;
147 fClusterY = clusterInfo.fClusterY;
148 fClusterXErr = clusterInfo.fClusterXErr;
149 fClusterYErr = clusterInfo.fClusterYErr;
150 fClusterChi2 = clusterInfo.fClusterChi2;
151 fClusterCharge = clusterInfo.fClusterCharge;
152 fTrackId = clusterInfo.fTrackId;
153 fTrackX = clusterInfo.fTrackX;
154 fTrackY = clusterInfo.fTrackY;
155 fTrackThetaX = clusterInfo.fTrackThetaX;
156 fTrackThetaY = clusterInfo.fTrackThetaY;
157 fTrackP = clusterInfo.fTrackP;
158 fTrackXErr = clusterInfo.fTrackXErr;
159 fTrackYErr = clusterInfo.fTrackYErr;
160 fTrackChi2 = clusterInfo.fTrackChi2;
161 fTrackCharge = clusterInfo.fTrackCharge;
162 fTrackNHits = clusterInfo.fTrackNHits;
163 fTrackChamberHitMap = clusterInfo.fTrackChamberHitMap;
164 fNPads = clusterInfo.fNPads;
167 AliMUONPadInfo *pad = (AliMUONPadInfo*) clusterInfo.fPads->First();
169 new ((*fPads)[fPads->GetEntriesFast()]) AliMUONPadInfo(*pad);
170 pad = (AliMUONPadInfo*) clusterInfo.fPads->After(pad);
176 //__________________________________________________________________________
177 AliMUONClusterInfo::~AliMUONClusterInfo()
183 //__________________________________________________________________________
184 void AliMUONClusterInfo::Clear(Option_t* opt)
191 //_____________________________________________________________________________
192 void AliMUONClusterInfo::Print(Option_t* option) const
194 /// print cluster info content
195 /// print also pad info if option=FULL
198 cout<<Form("eventID=%d", GetEventId())<<endl;
201 cout<<Form("- clusterID=%u (ch=%d, det=%d, index=%d)",
202 GetClusterId(), GetChamberId(), GetDetElemId(), GetClusterIndex())<<endl;
204 cout<<Form(" position=(%5.2f, %5.2f, %5.2f), sigma=(%8.5f, %8.5f, 0.0)",
205 GetClusterX(), GetClusterY(), GetZ(), GetClusterXErr(), GetClusterYErr())<<endl;
207 cout<<Form(" charge=%5.2f, chi2=%5.2f", GetClusterCharge(), GetClusterChi2())<<endl;
210 cout<<Form("- trackID=%u", GetTrackId())<<endl;
212 cout<<Form(" position=(%5.2f, %5.2f, %5.2f), angles=(%5.2f, %5.2f), momentum=%5.2f",
213 GetTrackX(), GetTrackY(), GetZ(), GetTrackThetaX(), GetTrackThetaY(), GetTrackP())<<endl;
215 cout<<Form(" sigma_XY=(%8.5f, %8.5f), charge=%d, chi2=%5.2f",
216 GetTrackXErr(), GetTrackYErr(), GetTrackCharge(), GetTrackChi2())<<endl;
219 if (strstr(option,"FULL")) {
220 AliMUONPadInfo *pad = (AliMUONPadInfo*) fPads->First();
223 pad = (AliMUONPadInfo*) fPads->After(pad);
229 Double_t AliMUONClusterInfo::GetClusterCharge(Int_t iPlaneType) const
231 Double_t lClusterChargeC = 0.;
233 lClusterChargeC = GetClusterCharge()/2.;
236 AliMUONPadInfo *pad = (AliMUONPadInfo*) fPads->First();
238 if (pad->GetPadPlaneType()==iPlaneType) lClusterChargeC += pad->GetPadCharge();
239 pad = (AliMUONPadInfo*) fPads->After(pad);
242 return lClusterChargeC;
245 Int_t AliMUONClusterInfo::GetNPads(Int_t iPlaneType) const
253 AliMUONPadInfo *pad = (AliMUONPadInfo*) fPads->First();
255 if (pad->GetPadPlaneType()==iPlaneType) {
258 pad = (AliMUONPadInfo*) fPads->After(pad);
264 Int_t AliMUONClusterInfo::GetNPadsX(Int_t iPlaneType) const
267 Double_t lPadXMin = 10000.;
268 Double_t lPadXMax = -10000.;
269 Int_t nChangedMin = 0;
270 Int_t nChangedMax = 0;
273 iNPadsX = GetNPads();
276 AliMUONPadInfo *pad = (AliMUONPadInfo*) fPads->First();
278 if (pad->GetPadPlaneType()==iPlaneType) {
279 if (pad->GetPadX()<lPadXMin){
280 lPadXMin = pad->GetPadX();
283 if (pad->GetPadX()>lPadXMax){
284 lPadXMax = pad->GetPadX();
288 pad = (AliMUONPadInfo*) fPads->After(pad);
290 iNPadsX = TMath::Max(nChangedMin+nChangedMax-1,0);
295 Int_t AliMUONClusterInfo::GetNPadsY(Int_t iPlaneType) const
298 Double_t lPadYMin = 10000.;
299 Double_t lPadYMax = -10000.;
300 Int_t nChangedMin = 0;
301 Int_t nChangedMax = 0;
304 iNPadsY = GetNPads();
307 AliMUONPadInfo *pad = (AliMUONPadInfo*) fPads->First();
309 if (pad->GetPadPlaneType()==iPlaneType) {
310 if (pad->GetPadY()<lPadYMin){
311 lPadYMin = pad->GetPadY();
314 if (pad->GetPadY()>lPadYMax){
315 lPadYMax = pad->GetPadY();
319 pad = (AliMUONPadInfo*) fPads->After(pad);
321 iNPadsY = TMath::Max(nChangedMin+nChangedMax-1,0);