AliPhysics  d565ceb (d565ceb)
AliReducedJetInfo.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 <TLorentzVector.h>
16 #include <TObjArray.h>
17 
19 #include "AliReducedJetInfo.h"
20 #include "AliReducedJetParticle.h"
21 
25 
26 namespace HighPtTracks {
27 
28 /***
29  * Dummy (I/O) constructor, not to be used by the user. Containers are not allocated.
30  */
31 AliReducedJetInfo::AliReducedJetInfo() :
32  TObject(),
33  fPx(0.),
34  fPy(0.),
35  fPz(0.),
36  fE(0),
37  fConstituents(NULL),
38  fParticlesInCone(NULL)
39 {
40 }
41 
52 AliReducedJetInfo::AliReducedJetInfo(double px, double py, double pz, double e) :
53  TObject(),
54  fPx(px),
55  fPy(py),
56  fPz(pz),
57  fE(e),
58  fConstituents(NULL),
59  fParticlesInCone(NULL)
60 {
62  fParticlesInCone->SetOwner(true);
64  fConstituents->SetOwner(true);
65 }
66 
75  TObject(ref),
76  fPx(ref.fPx),
77  fPy(ref.fPy),
78  fPz(ref.fPz),
79  fE(ref.fE),
80  fConstituents(NULL),
81  fParticlesInCone(NULL)
82 {
84  fParticlesInCone->SetOwner(true);
86  fConstituents->SetOwner(true);
87 
88  AliReducedJetParticle *mypart(NULL);
89  TIter particleIter(ref.fParticlesInCone);
90  while((mypart = dynamic_cast<AliReducedJetParticle *>(particleIter()))){
91  fParticlesInCone->Add(new AliReducedJetParticle(*mypart));
92  }
93  AliReducedJetConstituent *myconst(NULL);
94  TIter constIter(ref.fConstituents);
95  while((myconst = dynamic_cast<AliReducedJetConstituent *>(constIter()))){
96  fConstituents->Add(new AliReducedJetConstituent(*myconst));
97  }
98 }
99 
109  TObject::operator=(ref);
110  if(&ref != this){
111  fPx = ref.fPx;
112  fPy = ref.fPy;
113  fPz = ref.fPz;
114  fE = ref.fE;
115 
116  fParticlesInCone->Clear();
117  AliReducedJetParticle *mypart(NULL);
118  TIter particleIter(ref.fParticlesInCone);
119  while((mypart = dynamic_cast<AliReducedJetParticle *>(particleIter()))){
120  fParticlesInCone->Add(new AliReducedJetParticle(*mypart));
121  }
122 
123  fConstituents->Clear();
124  AliReducedJetConstituent *myconst(NULL);
125  TIter constIter(ref.fConstituents);
126  while((myconst = dynamic_cast<AliReducedJetConstituent *>(constIter()))){
127  fConstituents->Add(new AliReducedJetConstituent(*myconst));
128  }
129  }
130  return *this;
131 }
132 
137  delete fParticlesInCone;
138  delete fConstituents;
139 }
140 
148  if(fParticlesInCone) fParticlesInCone->Add(part);
149 }
150 
156 void AliReducedJetInfo::FillLorentzVector(TLorentzVector& vec) const {
157  vec.SetPxPyPzE(fPx, fPy, fPx, fE);
158 }
159 
166  if(!fParticlesInCone) return 0;
167  return fParticlesInCone->GetEntries();
168 }
169 
177  if(fConstituents) fConstituents->Add(con);
178 }
179 
187  if(!fParticlesInCone || ipart >= fParticlesInCone->GetEntries()) return NULL;
188  return dynamic_cast<AliReducedJetParticle *>(fParticlesInCone->At(ipart));
189 }
190 
191 } /* namespace HighPtTracks */
Minimal stucture for jet constituents associated to a jet by the jet clustering algorithm.
Definintion of class AliReducedJetParticle, a structure for a reduced information set of particles as...
double fPy
y-component of the 4-momentum vector
void AddParticleInCone(AliReducedJetParticle *part)
double fE
reconstructed jet energy
TString part
use mixed event to constrain combinatorial background
Definition: InvMassFit.C:52
void AddConstituent(AliReducedJetConstituent *con)
double fPx
x-component of the 4-momentum vector
Namespace for classes creating trees of events with jets.
AliReducedJetParticle * GetMatchedParticle(int ipart) const
Reduced information about a reconstructed jet.
TObjArray * fConstituents
Constituents found by the jet clustering algorithm.
Reduced information set of particles associated with a jet.
void FillLorentzVector(TLorentzVector &vec) const
Definition of class AliReducedJetConstituent, a minimal stucture for jet constituents associated to a...
TObjArray * fParticlesInCone
Particles associated to this jet via distance to the main jet axis.
double fPz
z-component of the 4-momentum vector
AliReducedJetInfo & operator=(const AliReducedJetInfo &ref)
Definition of class AliReducedJetInfo, a structure for reduced information about a reconstructed jet...