1 /**************************************************************************
2 * Copyright(c) 1998-2007, 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 // AOD cluster base class
20 // Author: Markus Oldenburg, CERN
21 //-------------------------------------------------------------------------
23 #include "AliAODCluster.h"
25 ClassImp(AliAODCluster)
27 //______________________________________________________________________________
28 AliAODCluster::AliAODCluster() :
39 // default constructor
41 SetPosition((Float_t*)NULL);
42 SetPID((Float_t*)NULL);
45 //______________________________________________________________________________
46 AliAODCluster::AliAODCluster(Int_t id,
50 Double_t covMatrix[10],
52 AliAODVertex *prodVertex,
53 AliAODTrack *primTrack,
61 fProdVertex(prodVertex),
62 fPrimTrack(primTrack),
68 if(covMatrix) SetCovMatrix(covMatrix);
73 //______________________________________________________________________________
74 AliAODCluster::AliAODCluster(Int_t id,
78 Float_t covMatrix[10],
80 AliAODVertex *prodVertex,
81 AliAODTrack *primTrack,
89 fProdVertex(prodVertex),
90 fPrimTrack(primTrack),
96 if(covMatrix) SetCovMatrix(covMatrix);
102 //______________________________________________________________________________
103 AliAODCluster::~AliAODCluster()
110 //______________________________________________________________________________
111 AliAODCluster::AliAODCluster(const AliAODCluster& clus) :
112 AliVirtualParticle(clus),
113 fEnergy(clus.fEnergy),
118 fProdVertex(clus.fProdVertex),
119 fPrimTrack(clus.fPrimTrack),
124 clus.GetPosition(fPosition);
125 if(clus.fCovMatrix) fCovMatrix=new AliAODRedCov<4>(*clus.fCovMatrix);
130 //______________________________________________________________________________
131 AliAODCluster& AliAODCluster::operator=(const AliAODCluster& clus)
133 // Assignment operator
136 AliVirtualParticle::operator=(clus);
138 clus.GetPosition(fPosition);
141 fEnergy = clus.fEnergy;
145 fLabel = clus.fLabel;
148 if(clus.fCovMatrix) fCovMatrix=new AliAODRedCov<4>(*clus.fCovMatrix);
149 else fCovMatrix=NULL;
150 fProdVertex = clus.fProdVertex;
151 fPrimTrack = clus.fPrimTrack;
159 //______________________________________________________________________________
160 template <class T> void AliAODCluster::SetPosition(const T *x)
170 fPosition[0] = -999.;
171 fPosition[1] = -999.;
172 fPosition[2] = -999.;
176 //______________________________________________________________________________
177 AliAODCluster::AODCluPID_t AliAODCluster::GetMostProbablePID() const
179 // Returns the most probable PID array element.
183 AODCluPID_t loc = kUnknown;
185 Bool_t allTheSame = kTRUE;
187 for (Int_t iPID = 0; iPID < nPID; iPID++) {
188 if (fPID[iPID] >= max) {
189 if (fPID[iPID] > max) {
192 loc = (AODCluPID_t)iPID;
199 return allTheSame ? kUnknown : loc;
205 //______________________________________________________________________________
206 void AliAODCluster::Print(Option_t* /* option */) const
208 // prints information about AliAODCluster
210 printf("Object name: %s Cluster type: %s\n", GetName(), GetTitle());
211 printf(" energy = %f\n", E());
212 printf(" chi2 = %f\n", Chi2());
213 printf(" PID object: %p\n", PID());