AliPhysics  58ae0ed (58ae0ed)
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
AliReducedEmcalCluster.cxx
Go to the documentation of this file.
1 /**************************************************************************
2  * Copyright(c) 1998-2015, ALICE Experiment at CERN, All rights reserved. *
3  * *
4  * Author: The ALICE Off-line Project. *
5  * Contributors are mentioned in the code where appropriate. *
6  * *
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  **************************************************************************/
15 #include <TArrayD.h>
16 #include <TLorentzVector.h>
17 #include <TObjArray.h>
18 
19 #include "AliReducedEmcalCluster.h"
20 
23 ClassImp(HighPtTracks::AliReducedEmcalCluster)
25 
26 namespace HighPtTracks {
27 
31 AliReducedEmcalCluster::AliReducedEmcalCluster() :
32  fClusterID(-1),
33  fEnergy(-1),
34  fEta(-100),
35  fPhi(-100),
36  fM02(-1),
37  fM20(-1),
38  fContributors(NULL)
39 {
40  memset(fCellEnergies, 0, sizeof(Float_t) * 3);
41 }
42 
53  TObject(),
54  fClusterID(id),
55  fEnergy(energy),
56  fEta(eta),
57  fPhi(phi),
58  fM02(m02),
59  fM20(m20),
60  fContributors(NULL)
61 {
62  memset(fCellEnergies, 0, sizeof(Float_t)*3);
63 }
64 
70  TObject(ref),
71  fClusterID(ref.fClusterID),
72  fEnergy(ref.fEnergy),
73  fEta(ref.fEta),
74  fPhi(ref.fPhi),
75  fM02(ref.fM02),
76  fM20(ref.fM20),
77  fContributors(NULL)
78 {
79  ref.Copy(*this);
80 }
81 
88  if(&ref != this){
90  TObject::operator=(ref);
91  ref.Copy(*this);
92  }
93  return *this;
94 }
95 
100  if(fContributors) delete fContributors;
101 }
102 
108  AliReducedEmcalCluster *targetcluster = dynamic_cast<AliReducedEmcalCluster *>(&target);
109  if(!targetcluster) return;
110  targetcluster->fClusterID = fClusterID;
111  targetcluster->fEnergy = fEnergy;
112  targetcluster->fEta = fEta;
113  targetcluster->fPhi = fPhi;
114  targetcluster->fM02 = fM02;
115  targetcluster->fM20 = fM20;
116  targetcluster->fContributors = NULL;
117  memcpy(targetcluster->fCellEnergies, fCellEnergies, sizeof(Float_t)*3);
118  if(fContributors){
119  targetcluster->fContributors = new TObjArray;
120  targetcluster->fContributors->SetOwner(kTRUE);
121  for(TIter contiter = TIter(fContributors).Begin(); contiter != TIter::End(); ++contiter){
122  targetcluster->fContributors->Add(new AliReducedClusterParticle(*(static_cast<AliReducedClusterParticle *>(*contiter))));
123  }
124  }
125 }
126 
132  target.Set(3);
133  for(Int_t icell = 0; icell < 3; icell++) target[icell] = fCellEnergies[icell];
134 }
135 
145  if(!fContributors){
146  fContributors = new TObjArray;
147  fContributors->SetOwner(kTRUE);
148  }
149  fContributors->Add(new AliReducedClusterParticle(pdg, px, py, pz, energy));
150 }
151 
156  fPdg(0),
157  fEnergy(0)
158 {
159  memset(fPvec, 0, sizeof(Float_t) * 3);
160 }
161 
171  Double_t px, Double_t py, Double_t pz, Double_t energy) :
172  fPdg(pdg),
173  fEnergy(energy)
174 {
175  fPvec[0] = px;
176  fPvec[1] = py;
177  fPvec[2] = pz;
178 }
179 
184 
190  target.SetPxPyPzE(fPvec[0],fPvec[1],fPvec[2],fEnergy);
191 }
192 
193 } /* namespace HighPtTracks */
194 
Int_t pdg
Reduced EMCAL cluster information.
double Double_t
Definition: External.C:58
Float_t fCellEnergies[3]
Leading cell energies.
Float_t fM20
M20 shower shape parameter.
energy
Definition: HFPtSpectrum.C:44
Double_t fPvec[3]
Particle momentum vector.
int Int_t
Definition: External.C:63
void AddTrueContributor(Int_t pdg, Double_t px, Double_t py, Double_t pz, Double_t energy)
float Float_t
Definition: External.C:68
TObjArray * fContributors
True particles contributing to the cluster.
Float_t fEnergy
Energy of the cluster.
MC true contributor to a reconstructed EMCAL cluster.
Float_t fEta
Cluster position in relative to the primary vertex.
void FillLorentzVector(TLorentzVector &target) const
Reduced information about reconstructed EMCAL clusters.
Float_t fPhi
Cluster position in relative to the primary vertex.
Float_t fM02
M02 shower shape parameter.
AliReducedEmcalCluster & operator=(const AliReducedEmcalCluster &ref)