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>
35 ClassImp(AliMUONClusterInfo)
38 //_____________________________________________________________________________
39 AliMUONClusterInfo::AliMUONClusterInfo()
62 fTrackChamberHitMap(0),
64 fPads(new TClonesArray("AliMUONPadInfo",10))
66 /// default constructor
69 //_____________________________________________________________________________
70 AliMUONClusterInfo::AliMUONClusterInfo(TRootIOCtor* /*rio*/)
93 fTrackChamberHitMap(0),
100 //_____________________________________________________________________________
101 AliMUONClusterInfo::AliMUONClusterInfo (const AliMUONClusterInfo& clusterInfo)
102 : TObject(clusterInfo),
103 fRunId(clusterInfo.fRunId),
104 fEventId(clusterInfo.fEventId),
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))
129 AliMUONPadInfo *pad = (AliMUONPadInfo*) clusterInfo.fPads->First();
131 new ((*fPads)[fPads->GetEntriesFast()]) AliMUONPadInfo(*pad);
132 pad = (AliMUONPadInfo*) clusterInfo.fPads->After(pad);
136 //_____________________________________________________________________________
137 AliMUONClusterInfo& AliMUONClusterInfo::operator=(const AliMUONClusterInfo& clusterInfo)
140 if (this == &clusterInfo) return *this;
142 TObject::operator=(clusterInfo); // don't forget to invoke the base class' assignment operator
144 fRunId = clusterInfo.fRunId;
145 fEventId = clusterInfo.fEventId;
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;
165 fTrackChamberHitMap = clusterInfo.fTrackChamberHitMap;
166 fNPads = clusterInfo.fNPads;
169 AliMUONPadInfo *pad = (AliMUONPadInfo*) clusterInfo.fPads->First();
171 new ((*fPads)[fPads->GetEntriesFast()]) AliMUONPadInfo(*pad);
172 pad = (AliMUONPadInfo*) clusterInfo.fPads->After(pad);
178 //__________________________________________________________________________
179 AliMUONClusterInfo::~AliMUONClusterInfo()
185 //__________________________________________________________________________
186 void AliMUONClusterInfo::Clear(Option_t* opt)
193 //_____________________________________________________________________________
194 void AliMUONClusterInfo::Print(Option_t* option) const
196 /// print cluster info content
197 /// print also pad info if option=FULL
200 cout<<Form("eventID=%d", GetEventId())<<endl;
203 cout<<Form("- clusterID=%u (ch=%d, det=%d, index=%d)",
204 GetClusterId(), GetChamberId(), GetDetElemId(), GetClusterIndex())<<endl;
206 cout<<Form(" position=(%5.2f, %5.2f, %5.2f), sigma=(%8.5f, %8.5f, 0.0)",
207 GetClusterX(), GetClusterY(), GetZ(), GetClusterXErr(), GetClusterYErr())<<endl;
209 cout<<Form(" charge=%5.2f, chi2=%5.2f", GetClusterCharge(), GetClusterChi2())<<endl;
212 cout<<Form("- trackID=%u", GetTrackId())<<endl;
214 cout<<Form(" position=(%5.2f, %5.2f, %5.2f), angles=(%5.2f, %5.2f), momentum=%5.2f",
215 GetTrackX(), GetTrackY(), GetZ(), GetTrackThetaX(), GetTrackThetaY(), GetTrackP())<<endl;
217 cout<<Form(" sigma_XY=(%8.5f, %8.5f), charge=%d, chi2=%5.2f",
218 GetTrackXErr(), GetTrackYErr(), GetTrackCharge(), GetTrackChi2())<<endl;
221 if (strstr(option,"FULL")) {
222 AliMUONPadInfo *pad = (AliMUONPadInfo*) fPads->First();
225 pad = (AliMUONPadInfo*) fPads->After(pad);
231 Double_t AliMUONClusterInfo::GetClusterCharge(Int_t iPlaneType) const
233 Double_t lClusterChargeC = 0.;
235 lClusterChargeC = GetClusterCharge()/2.;
238 AliMUONPadInfo *pad = (AliMUONPadInfo*) fPads->First();
240 if (pad->GetPadPlaneType()==iPlaneType) lClusterChargeC += pad->GetPadCharge();
241 pad = (AliMUONPadInfo*) fPads->After(pad);
244 return lClusterChargeC;
247 Int_t AliMUONClusterInfo::GetNPads(Int_t iPlaneType) const
255 AliMUONPadInfo *pad = (AliMUONPadInfo*) fPads->First();
257 if (pad->GetPadPlaneType()==iPlaneType) {
260 pad = (AliMUONPadInfo*) fPads->After(pad);
266 Int_t AliMUONClusterInfo::GetNPadsX(Int_t iPlaneType) const
269 Double_t lPadXMin = 10000.;
270 Double_t lPadXMax = -10000.;
271 Int_t nChangedMin = 0;
272 Int_t nChangedMax = 0;
275 iNPadsX = GetNPads();
278 AliMUONPadInfo *pad = (AliMUONPadInfo*) fPads->First();
280 if (pad->GetPadPlaneType()==iPlaneType) {
281 if (pad->GetPadX()<lPadXMin){
282 lPadXMin = pad->GetPadX();
285 if (pad->GetPadX()>lPadXMax){
286 lPadXMax = pad->GetPadX();
290 pad = (AliMUONPadInfo*) fPads->After(pad);
292 iNPadsX = TMath::Max(nChangedMin+nChangedMax-1,0);
297 Int_t AliMUONClusterInfo::GetNPadsY(Int_t iPlaneType) const
300 Double_t lPadYMin = 10000.;
301 Double_t lPadYMax = -10000.;
302 Int_t nChangedMin = 0;
303 Int_t nChangedMax = 0;
306 iNPadsY = GetNPads();
309 AliMUONPadInfo *pad = (AliMUONPadInfo*) fPads->First();
311 if (pad->GetPadPlaneType()==iPlaneType) {
312 if (pad->GetPadY()<lPadYMin){
313 lPadYMin = pad->GetPadY();
316 if (pad->GetPadY()>lPadYMax){
317 lPadYMax = pad->GetPadY();
321 pad = (AliMUONPadInfo*) fPads->After(pad);
323 iNPadsY = TMath::Max(nChangedMin+nChangedMax-1,0);