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 calorimeter cluster class (for PHOS and EMCAL)
20 // Author: Markus Oldenburg, CERN
21 //-------------------------------------------------------------------------
23 #include "AliAODCaloCluster.h"
25 ClassImp(AliAODCaloCluster)
27 //______________________________________________________________________________
28 AliAODCaloCluster::AliAODCaloCluster() :
30 fDistToBadChannel(-999.),
36 fEmcCpvDistance(-999.),
43 // default constructor
47 //______________________________________________________________________________
48 AliAODCaloCluster::AliAODCaloCluster(Int_t id,
56 AliAODCluster(id, nLabel, label, energy, x, pid, ttype, selectInfo),
57 fDistToBadChannel(-999.),
63 fEmcCpvDistance(-999.),
74 //______________________________________________________________________________
75 AliAODCaloCluster::AliAODCaloCluster(Int_t id,
83 AliAODCluster(id, nLabel, label, energy, x, pid, ttype, selectInfo),
84 fDistToBadChannel(-999.),
90 fEmcCpvDistance(-999.),
101 //______________________________________________________________________________
102 AliAODCaloCluster::~AliAODCaloCluster()
105 if(fCellsAmpFraction) delete[] fCellsAmpFraction; fCellsAmpFraction=0;
106 if(fCellsAbsId) delete[] fCellsAbsId; fCellsAbsId = 0;
110 //______________________________________________________________________________
111 AliAODCaloCluster::AliAODCaloCluster(const AliAODCaloCluster& clus) :
113 fDistToBadChannel(clus.fDistToBadChannel),
114 fDispersion(clus.fDispersion),
119 fEmcCpvDistance(clus.fEmcCpvDistance),
120 fNExMax(clus.fNExMax),
121 fTracksMatched(clus.fTracksMatched),
122 fNCells(clus.fNCells),
128 if (clus.fNCells > 0) {
130 if(clus.fCellsAbsId){
131 fCellsAbsId = new UShort_t[clus.fNCells];
132 for (Int_t i=0; i<clus.fNCells; i++)
133 fCellsAbsId[i]=clus.fCellsAbsId[i];
136 if(clus.fCellsAmpFraction){
137 fCellsAmpFraction = new Double32_t[clus.fNCells];
138 for (Int_t i=0; i<clus.fNCells; i++)
139 fCellsAmpFraction[i]=clus.fCellsAmpFraction[i];
146 //______________________________________________________________________________
147 AliAODCaloCluster& AliAODCaloCluster::operator=(const AliAODCaloCluster& clus)
149 // Assignment operator
152 AliAODCluster::operator=(clus);
154 fDistToBadChannel = clus.fDistToBadChannel;
155 fDispersion = clus.fDispersion;
160 fEmcCpvDistance = clus.fEmcCpvDistance;
161 fNExMax = clus.fNExMax;
162 fTracksMatched = clus.fTracksMatched;
164 fNCells= clus. fNCells;
165 if (clus.fNCells > 0) {
167 if(clus.fCellsAbsId){
168 fCellsAbsId = new UShort_t[clus.fNCells];
169 for (Int_t i=0; i<clus.fNCells; i++)
170 fCellsAbsId[i]=clus.fCellsAbsId[i];
173 if(clus.fCellsAmpFraction){
174 fCellsAmpFraction = new Double32_t[clus.fNCells];
175 for (Int_t i=0; i<clus.fNCells; i++)
176 fCellsAmpFraction[i]=clus.fCellsAmpFraction[i];
186 //_______________________________________________________________________
187 Bool_t AliAODCaloCluster::HasTrackMatched(TObject *trk) const
189 // Checks if the given track contributed to this cluster.
191 TRefArrayIter iter(&fTracksMatched);
192 while (TObject *track = iter.Next()) {
193 if (trk == track) return kTRUE;