AliPhysics  64f4410 (64f4410)
AliReducedJetParticle.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 
17 #include "AliReducedJetParticle.h"
18 
22 
23 namespace HighPtTracks {
24 
28 AliReducedJetParticle::AliReducedJetParticle() :
29  TObject(),
30  fPx(0),
31  fPy(0),
32  fPz(0),
33  fE(0),
34  fDr(0),
35  fPdgCode(0),
36  fNTPCTrackReferences(0),
37  fMatchedTrackContainer(NULL)
38 {
40  fMatchedTrackContainer->SetOwner();
41 }
42 
54 AliReducedJetParticle::AliReducedJetParticle(double px, double py, double pz, double e, int pdgcode) :
55  TObject(),
56  fPx(px),
57  fPy(py),
58  fPz(pz),
59  fE(e),
60  fDr(0),
61  fPdgCode(pdgcode),
64 {
66  fMatchedTrackContainer->SetOwner();
67 }
68 
76  TObject(ref),
77  fPx(ref.fPx),
78  fPy(ref.fPy),
79  fPz(ref.fPz),
80  fE(ref.fE),
81  fDr(ref.fDr),
82  fPdgCode(ref.fPdgCode),
85 {
87  fMatchedTrackContainer->SetOwner();
88 
89  for(TIter trackIter = TIter(ref.fMatchedTrackContainer).Begin(); trackIter != TIter::End(); ++trackIter){
90  AliReducedMatchedTrack *othermatched = static_cast<AliReducedMatchedTrack *>(*trackIter);
91  fMatchedTrackContainer->Add(new AliReducedMatchedTrack(*othermatched));
92  }
93 }
94 
103  if(this != &ref){
104  delete fMatchedTrackContainer;
105 
107  fMatchedTrackContainer->SetOwner();
108 
109  for(TIter trackIter = TIter(ref.fMatchedTrackContainer).Begin(); trackIter != TIter::End(); ++trackIter){
110  AliReducedMatchedTrack *othermatched = static_cast<AliReducedMatchedTrack *>(*trackIter);
111  fMatchedTrackContainer->Add(new AliReducedMatchedTrack(*othermatched));
112  }
113 
114  }
115  return *this;
116 }
117 
122  delete fMatchedTrackContainer;
123 }
124 
131 void AliReducedJetParticle::FillLorentzVector(TLorentzVector& ref) const {
132  ref.SetPxPyPzE(fPx, fPy, fPz, fE);
133 }
134 
142  fMatchedTrackContainer->Add(trk);
143 }
144 
152 double AliReducedJetParticle::GetDeltaPt(int itrk) const {
153  if(itrk >= fMatchedTrackContainer->GetEntries()) return -1000.;
154  TLorentzVector partvec;
155  partvec.SetPxPyPzE(fPx, fPy, fPz, fE);
156  double particlePt = partvec.Pt();
157  AliReducedMatchedTrack *mytrk = static_cast<AliReducedMatchedTrack *>(fMatchedTrackContainer->At(itrk));
158  return (mytrk->Pt()-particlePt)/particlePt;
159 }
160 
161 } /* namespace HighPtTracks */
AliReducedJetParticle & operator=(const AliReducedJetParticle &ref)
Definintion of class AliReducedJetParticle, a structure for a reduced information set of particles as...
double fPy
y-component of the momentum vector
double fDr
Distance to the main jet axis.
void AddMatchedTrack(AliReducedMatchedTrack *trk)
TObjArray * fMatchedTrackContainer
Container for matched tracks at reconstruction level.
void FillLorentzVector(TLorentzVector &ref) const
double fPz
z-component of the momentum vector
int fPdgCode
PDG code of the particle.
Namespace for classes creating trees of events with jets.
Reduced information set of particles associated with a jet.
double fPx
x-component of the momentum vector
Class with reduced track information at reconstruction level.
unsigned short fNTPCTrackReferences
Number of TPC track references associated to the particle.