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.),
35 fEmcCpvDistance(-999.),
42 // default constructor
46 //______________________________________________________________________________
47 AliAODCaloCluster::AliAODCaloCluster(Int_t id,
55 AliAODCluster(id, nLabel, label, energy, x, pid, ttype, selectInfo),
56 fDistToBadChannel(-999.),
61 fEmcCpvDistance(-999.),
72 //______________________________________________________________________________
73 AliAODCaloCluster::AliAODCaloCluster(Int_t id,
81 AliAODCluster(id, nLabel, label, energy, x, pid, ttype, selectInfo),
82 fDistToBadChannel(-999.),
87 fEmcCpvDistance(-999.),
98 //______________________________________________________________________________
99 AliAODCaloCluster::~AliAODCaloCluster()
102 if(fCellsAmpFraction) delete[] fCellsAmpFraction; fCellsAmpFraction=0;
103 if(fCellsAbsId) delete[] fCellsAbsId; fCellsAbsId = 0;
107 //______________________________________________________________________________
108 AliAODCaloCluster::AliAODCaloCluster(const AliAODCaloCluster& clus) :
110 fDistToBadChannel(clus.fDistToBadChannel),
111 fDispersion(clus.fDispersion),
115 fEmcCpvDistance(clus.fEmcCpvDistance),
116 fNExMax(clus.fNExMax),
117 fTracksMatched(clus.fTracksMatched),
118 fNCells(clus.fNCells),
124 if (clus.fNCells > 0) {
126 if(clus.fCellsAbsId){
127 fCellsAbsId = new UShort_t[clus.fNCells];
128 for (Int_t i=0; i<clus.fNCells; i++)
129 fCellsAbsId[i]=clus.fCellsAbsId[i];
132 if(clus.fCellsAmpFraction){
133 fCellsAmpFraction = new Double32_t[clus.fNCells];
134 for (Int_t i=0; i<clus.fNCells; i++)
135 fCellsAmpFraction[i]=clus.fCellsAmpFraction[i];
142 //______________________________________________________________________________
143 AliAODCaloCluster& AliAODCaloCluster::operator=(const AliAODCaloCluster& clus)
145 // Assignment operator
148 AliAODCluster::operator=(clus);
150 fDistToBadChannel = clus.fDistToBadChannel;
151 fDispersion = clus.fDispersion;
155 fEmcCpvDistance = clus.fEmcCpvDistance;
156 fNExMax = clus.fNExMax;
157 fTracksMatched = clus.fTracksMatched;
159 fNCells= clus. fNCells;
160 if (clus.fNCells > 0) {
162 if(clus.fCellsAbsId){
163 fCellsAbsId = new UShort_t[clus.fNCells];
164 for (Int_t i=0; i<clus.fNCells; i++)
165 fCellsAbsId[i]=clus.fCellsAbsId[i];
168 if(clus.fCellsAmpFraction){
169 fCellsAmpFraction = new Double32_t[clus.fNCells];
170 for (Int_t i=0; i<clus.fNCells; i++)
171 fCellsAmpFraction[i]=clus.fCellsAmpFraction[i];
181 //_______________________________________________________________________
182 Bool_t AliAODCaloCluster::HasTrackMatched(TObject *trk) const
184 // Checks if the given track contributed to this cluster.
186 TRefArrayIter iter(&fTracksMatched);
187 while (TObject *track = iter.Next()) {
188 if (trk == track) return kTRUE;