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()
59 fPads(new TClonesArray("AliMUONPadInfo",10))
61 /// default constructor
64 //_____________________________________________________________________________
65 AliMUONClusterInfo::AliMUONClusterInfo (const AliMUONClusterInfo& clusterInfo)
66 : TObject(clusterInfo),
67 fEventId(clusterInfo.fEventId),
69 fClusterId(clusterInfo.fClusterId),
70 fClusterX(clusterInfo.fClusterX),
71 fClusterY(clusterInfo.fClusterY),
72 fClusterXErr(clusterInfo.fClusterXErr),
73 fClusterYErr(clusterInfo.fClusterYErr),
74 fClusterChi2(clusterInfo.fClusterChi2),
75 fClusterCharge(clusterInfo.fClusterCharge),
76 fTrackId(clusterInfo.fTrackId),
77 fTrackX(clusterInfo.fTrackX),
78 fTrackY(clusterInfo.fTrackY),
79 fTrackThetaX(clusterInfo.fTrackThetaX),
80 fTrackThetaY(clusterInfo.fTrackThetaY),
81 fTrackP(clusterInfo.fTrackP),
82 fTrackXErr(clusterInfo.fTrackXErr),
83 fTrackYErr(clusterInfo.fTrackYErr),
84 fTrackChi2(clusterInfo.fTrackChi2),
85 fTrackCharge(clusterInfo.fTrackCharge),
86 fNPads(clusterInfo.fNPads),
87 fPads(new TClonesArray("AliMUONPadInfo",clusterInfo.fNPads))
90 AliMUONPadInfo *pad = (AliMUONPadInfo*) clusterInfo.fPads->First();
92 new ((*fPads)[fPads->GetEntriesFast()]) AliMUONPadInfo(*pad);
93 pad = (AliMUONPadInfo*) clusterInfo.fPads->After(pad);
97 //_____________________________________________________________________________
98 AliMUONClusterInfo& AliMUONClusterInfo::operator=(const AliMUONClusterInfo& clusterInfo)
101 if (this == &clusterInfo) return *this;
103 TObject::operator=(clusterInfo); // don't forget to invoke the base class' assignment operator
105 fEventId = clusterInfo.fEventId;
107 fClusterId = clusterInfo.fClusterId;
108 fClusterX = clusterInfo.fClusterX;
109 fClusterY = clusterInfo.fClusterY;
110 fClusterXErr = clusterInfo.fClusterXErr;
111 fClusterYErr = clusterInfo.fClusterYErr;
112 fClusterChi2 = clusterInfo.fClusterChi2;
113 fClusterCharge = clusterInfo.fClusterCharge;
114 fTrackId = clusterInfo.fTrackId;
115 fTrackX = clusterInfo.fTrackX;
116 fTrackY = clusterInfo.fTrackY;
117 fTrackThetaX = clusterInfo.fTrackThetaX;
118 fTrackThetaY = clusterInfo.fTrackThetaY;
119 fTrackP = clusterInfo.fTrackP;
120 fTrackXErr = clusterInfo.fTrackXErr;
121 fTrackYErr = clusterInfo.fTrackYErr;
122 fTrackChi2 = clusterInfo.fTrackChi2;
123 fTrackCharge = clusterInfo.fTrackCharge;
124 fNPads = clusterInfo.fNPads;
127 AliMUONPadInfo *pad = (AliMUONPadInfo*) clusterInfo.fPads->First();
129 new ((*fPads)[fPads->GetEntriesFast()]) AliMUONPadInfo(*pad);
130 pad = (AliMUONPadInfo*) clusterInfo.fPads->After(pad);
136 //__________________________________________________________________________
137 AliMUONClusterInfo::~AliMUONClusterInfo()
143 //__________________________________________________________________________
144 void AliMUONClusterInfo::Clear(Option_t* opt)
151 //_____________________________________________________________________________
152 void AliMUONClusterInfo::Print(Option_t* option) const
154 /// print cluster info content
155 /// print also pad info if option=FULL
158 cout<<Form("eventID=%d", GetEventId())<<endl;
161 cout<<Form("- clusterID=%u (ch=%d, det=%d, index=%d)",
162 GetClusterId(), GetChamberId(), GetDetElemId(), GetClusterIndex())<<endl;
164 cout<<Form(" position=(%5.2f, %5.2f, %5.2f), sigma=(%8.5f, %8.5f, 0.0)",
165 GetClusterX(), GetClusterY(), GetZ(), GetClusterXErr(), GetClusterYErr())<<endl;
167 cout<<Form(" charge=%5.2f, chi2=%5.2f", GetClusterCharge(), GetClusterChi2())<<endl;
170 cout<<Form("- trackID=%u", GetTrackId())<<endl;
172 cout<<Form(" position=(%5.2f, %5.2f, %5.2f), angles=(%5.2f, %5.2f), momentum=%5.2f",
173 GetTrackX(), GetTrackY(), GetZ(), GetTrackThetaX(), GetTrackThetaY(), GetTrackP())<<endl;
175 cout<<Form(" sigma_XY=(%8.5f, %8.5f), charge=%d, chi2=%5.2f",
176 GetTrackXErr(), GetTrackYErr(), GetTrackCharge(), GetTrackChi2())<<endl;
179 if (strstr(option,"FULL")) {
180 AliMUONPadInfo *pad = (AliMUONPadInfo*) fPads->First();
183 pad = (AliMUONPadInfo*) fPads->After(pad);