CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Types | Public Member Functions | Static Public Attributes | Protected Member Functions | Protected Attributes
reco::Particle Class Reference

#include <Particle.h>

Public Types

typedef int Charge
 electric charge type More...
 
typedef math::XYZTLorentzVector LorentzVector
 Lorentz vector. More...
 
typedef math::XYZPoint Point
 point in the space More...
 
typedef
math::PtEtaPhiMLorentzVector 
PolarLorentzVector
 Lorentz vector. More...
 
typedef math::XYZVector Vector
 point in the space More...
 

Public Member Functions

Vector boostToCM () const
 
int charge () const
 electric charge More...
 
double energy () const
 energy More...
 
double et () const
 transverse energy More...
 
double eta () const
 momentum pseudorapidity More...
 
bool longLived () const
 is long lived? More...
 
double mass () const
 mass More...
 
double massSqr () const
 mass squared More...
 
Vector momentum () const
 spatial momentum vector More...
 
double mt () const
 transverse mass More...
 
double mtSqr () const
 transverse mass squared More...
 
Particleoperator= (const Particle &rhs)
 
double p () const
 magnitude of momentum vector More...
 
const LorentzVectorp4 () const
 four-momentum Lorentz vector More...
 
 Particle ()
 default constructor More...
 
 Particle (Charge q, const LorentzVector &p4, const Point &vertex=Point(0, 0, 0), int pdgId=0, int status=0, bool integerCharge=true)
 constructor from values More...
 
 Particle (Charge q, const PolarLorentzVector &p4, const Point &vertex=Point(0, 0, 0), int pdgId=0, int status=0, bool integerCharge=true)
 constructor from values More...
 
 Particle (const Particle &srv)
 
int pdgId () const
 PDG identifier. More...
 
double phi () const
 momentum azimuthal angle More...
 
const PolarLorentzVectorpolarP4 () const
 four-momentum Lorentz vector More...
 
double pt () const
 transverse momentum More...
 
double px () const
 x coordinate of momentum vector More...
 
double py () const
 y coordinate of momentum vector More...
 
double pz () const
 z coordinate of momentum vector More...
 
double rapidity () const
 repidity More...
 
void setCharge (Charge q)
 set electric charge More...
 
void setLongLived ()
 set long lived flag More...
 
void setMass (double m)
 set particle mass More...
 
void setP4 (const LorentzVector &p4)
 set 4-momentum More...
 
void setP4 (const PolarLorentzVector &p4)
 set 4-momentum More...
 
void setPdgId (int pdgId)
 
void setPz (double pz)
 set Pz More...
 
void setStatus (int status)
 set status word More...
 
void setThreeCharge (Charge qx3)
 set electric charge More...
 
void setVertex (const Point &vertex)
 set vertex More...
 
int status () const
 status word More...
 
void swap (Particle &other)
 
double theta () const
 momentum polar angle More...
 
int threeCharge () const
 electric charge More...
 
const Pointvertex () const
 vertex position More...
 
double vx () const
 x coordinate of vertex position More...
 
double vy () const
 y coordinate of vertex position More...
 
double vz () const
 z coordinate of vertex position More...
 
double y () const
 repidity More...
 
virtual ~Particle ()
 destructor More...
 

Static Public Attributes

static const unsigned int longLivedTag = 65536
 long lived flag More...
 

Protected Member Functions

void cacheCartesian () const
 set internal cache More...
 
void cachePolar () const
 set internal cache More...
 
void clearCache () const
 clear internal cache More...
 

Protected Attributes

float eta_
 
float mass_
 
std::atomic< LorentzVector * > p4Cartesian_
 internal cache for p4 More...
 
std::atomic< PolarLorentzVector * > p4Polar_
 internal cache for p4 More...
 
int pdgId_
 PDG identifier. More...
 
float phi_
 
float pt_
 four-momentum Lorentz vector More...
 
Charge qx3_
 electric charge More...
 
int status_
 status word More...
 
Point vertex_
 vertex position More...
 

Detailed Description

Base class describing a generic reconstructed particle its main subclass is Candidate

Author
Luca Lista, INFN

Definition at line 22 of file Particle.h.

Member Typedef Documentation

electric charge type

Definition at line 25 of file Particle.h.

Lorentz vector.

Definition at line 27 of file Particle.h.

point in the space

Definition at line 31 of file Particle.h.

Lorentz vector.

Definition at line 29 of file Particle.h.

point in the space

Definition at line 33 of file Particle.h.

Constructor & Destructor Documentation

default constructor

Definition at line 9 of file Particle.cc.

10  : qx3_(0), pt_(0), eta_(0), phi_(0), mass_(0),
11  vertex_(0, 0, 0), pdgId_(0), status_(0),
12  p4Polar_(nullptr), p4Cartesian_(nullptr)
13 {
14 }
int pdgId_
PDG identifier.
Definition: Particle.h:139
Charge qx3_
electric charge
Definition: Particle.h:133
Point vertex_
vertex position
Definition: Particle.h:137
int status_
status word
Definition: Particle.h:141
std::atomic< LorentzVector * > p4Cartesian_
internal cache for p4
Definition: Particle.h:146
float pt_
four-momentum Lorentz vector
Definition: Particle.h:135
std::atomic< PolarLorentzVector * > p4Polar_
internal cache for p4
Definition: Particle.h:144
Particle::Particle ( Charge  q,
const LorentzVector p4,
const Point vertex = Point( 0, 0, 0 ),
int  pdgId = 0,
int  status = 0,
bool  integerCharge = true 
)

constructor from values

Definition at line 16 of file Particle.cc.

References qx3_.

18  : qx3_( q ), pt_( p4.pt() ), eta_( p4.eta() ), phi_( p4.phi() ), mass_( p4.mass() ),
20  p4Polar_(nullptr), p4Cartesian_(nullptr)
21 {
22  if ( integerCharge ) qx3_ *= 3;
23 }
int pdgId_
PDG identifier.
Definition: Particle.h:139
int status() const
status word
Definition: Particle.cc:254
Charge qx3_
electric charge
Definition: Particle.h:133
Point vertex_
vertex position
Definition: Particle.h:137
int status_
status word
Definition: Particle.h:141
const LorentzVector & p4() const
four-momentum Lorentz vector
Definition: Particle.cc:86
std::atomic< LorentzVector * > p4Cartesian_
internal cache for p4
Definition: Particle.h:146
float pt_
four-momentum Lorentz vector
Definition: Particle.h:135
std::atomic< PolarLorentzVector * > p4Polar_
internal cache for p4
Definition: Particle.h:144
const Point & vertex() const
vertex position
Definition: Particle.cc:226
int pdgId() const
PDG identifier.
Definition: Particle.cc:246
Particle::Particle ( Charge  q,
const PolarLorentzVector p4,
const Point vertex = Point( 0, 0, 0 ),
int  pdgId = 0,
int  status = 0,
bool  integerCharge = true 
)

constructor from values

Definition at line 25 of file Particle.cc.

References qx3_.

27  : qx3_( q ), pt_( p4.pt() ), eta_( p4.eta() ), phi_( p4.phi() ), mass_( p4.mass() ),
29  p4Polar_(nullptr), p4Cartesian_(nullptr)
30 {
31  if ( integerCharge ) qx3_ *= 3;
32 }
int pdgId_
PDG identifier.
Definition: Particle.h:139
int status() const
status word
Definition: Particle.cc:254
Charge qx3_
electric charge
Definition: Particle.h:133
Point vertex_
vertex position
Definition: Particle.h:137
int status_
status word
Definition: Particle.h:141
const LorentzVector & p4() const
four-momentum Lorentz vector
Definition: Particle.cc:86
std::atomic< LorentzVector * > p4Cartesian_
internal cache for p4
Definition: Particle.h:146
float pt_
four-momentum Lorentz vector
Definition: Particle.h:135
std::atomic< PolarLorentzVector * > p4Polar_
internal cache for p4
Definition: Particle.h:144
const Point & vertex() const
vertex position
Definition: Particle.cc:226
int pdgId() const
PDG identifier.
Definition: Particle.cc:246
Particle::~Particle ( )
virtual

destructor

dtor

Definition at line 65 of file Particle.cc.

References clearCache().

65  {
66  clearCache();
67 }
void clearCache() const
clear internal cache
Definition: Particle.cc:292
Particle::Particle ( const Particle srv)

Definition at line 34 of file Particle.cc.

35  : qx3_(src.qx3_), pt_(src.pt_), eta_(src.eta_), phi_(src.phi_), mass_(src.mass_),
36  vertex_(src.vertex_), pdgId_(src.pdgId_), status_(src.status_),
37  p4Polar_(nullptr), p4Cartesian_(nullptr)
38 {
39 }
int pdgId_
PDG identifier.
Definition: Particle.h:139
Charge qx3_
electric charge
Definition: Particle.h:133
Point vertex_
vertex position
Definition: Particle.h:137
int status_
status word
Definition: Particle.h:141
std::atomic< LorentzVector * > p4Cartesian_
internal cache for p4
Definition: Particle.h:146
float pt_
four-momentum Lorentz vector
Definition: Particle.h:135
std::atomic< PolarLorentzVector * > p4Polar_
internal cache for p4
Definition: Particle.h:144

Member Function Documentation

Particle::Vector Particle::boostToCM ( ) const

boost vector to boost a Lorentz vector to the particle center of mass system

Definition at line 102 of file Particle.cc.

References cacheCartesian(), and p4Cartesian_.

102  {
103  cacheCartesian();
104  return (*p4Cartesian_.load(std::memory_order_acquire)).BoostToCM();
105 }
std::atomic< LorentzVector * > p4Cartesian_
internal cache for p4
Definition: Particle.h:146
void cacheCartesian() const
set internal cache
Definition: Particle.cc:281
void Particle::cacheCartesian ( ) const
protected

set internal cache

Definition at line 281 of file Particle.cc.

References cachePolar(), p4Cartesian_, and p4Polar_.

Referenced by boostToCM(), energy(), momentum(), p(), p4(), px(), py(), pz(), setP4(), setPz(), and theta().

281  {
282  if(!p4Cartesian_.load(std::memory_order_acquire)) {
283  cachePolar();
284  std::unique_ptr<LorentzVector> ptr{new LorentzVector(*p4Polar_.load(std::memory_order_acquire))};
285  LorentzVector* expected = nullptr;
286  if( p4Cartesian_.compare_exchange_strong(expected, ptr.get(), std::memory_order_acq_rel) ) {
287  ptr.release();
288  }
289  }
290 }
std::atomic< LorentzVector * > p4Cartesian_
internal cache for p4
Definition: Particle.h:146
void cachePolar() const
set internal cache
Definition: Particle.cc:271
std::atomic< PolarLorentzVector * > p4Polar_
internal cache for p4
Definition: Particle.h:144
ROOT::Math::LorentzVector< ROOT::Math::PxPyPzE4D< float > > LorentzVector
Definition: analysisEnums.h:9
math::XYZTLorentzVector LorentzVector
Lorentz vector.
Definition: Particle.h:27
void Particle::cachePolar ( ) const
protected

set internal cache

Definition at line 271 of file Particle.cc.

References eta_, mass_, p4Polar_, phi_, and pt_.

Referenced by cacheCartesian(), et(), mt(), mtSqr(), polarP4(), rapidity(), setP4(), and setPz().

271  {
272  if(!p4Polar_.load(std::memory_order_acquire)) {
273  std::unique_ptr<PolarLorentzVector> ptr{new PolarLorentzVector(pt_,eta_,phi_,mass_)};
274  PolarLorentzVector* expect = nullptr;
275  if(p4Polar_.compare_exchange_strong(expect, ptr.get(), std::memory_order_acq_rel)) {
276  ptr.release();
277  }
278  }
279 }
float pt_
four-momentum Lorentz vector
Definition: Particle.h:135
std::atomic< PolarLorentzVector * > p4Polar_
internal cache for p4
Definition: Particle.h:144
math::PtEtaPhiMLorentzVector PolarLorentzVector
Lorentz vector.
Definition: Particle.h:29
int Particle::charge ( ) const

electric charge

Definition at line 70 of file Particle.cc.

References qx3_.

Referenced by ParticleReplacerZtautau::produce().

70  {
71  return qx3_ / 3;
72 }
Charge qx3_
electric charge
Definition: Particle.h:133
void Particle::clearCache ( ) const
protected

clear internal cache

Definition at line 292 of file Particle.cc.

References p4Cartesian_, and p4Polar_.

Referenced by setMass(), and ~Particle().

292  {
293  delete p4Polar_.exchange(nullptr, std::memory_order_acq_rel);
294  delete p4Cartesian_.exchange(nullptr, std::memory_order_acq_rel);
295 }
std::atomic< LorentzVector * > p4Cartesian_
internal cache for p4
Definition: Particle.h:146
std::atomic< PolarLorentzVector * > p4Polar_
internal cache for p4
Definition: Particle.h:144
double Particle::energy ( ) const

energy

Definition at line 112 of file Particle.cc.

References cacheCartesian(), and p4Cartesian_.

Referenced by EmDQMReco::analyze().

112  {
113  cacheCartesian();
114  return (*p4Cartesian_.load(std::memory_order_acquire)).E();
115 }
std::atomic< LorentzVector * > p4Cartesian_
internal cache for p4
Definition: Particle.h:146
void cacheCartesian() const
set internal cache
Definition: Particle.cc:281
double Particle::et ( ) const

transverse energy

Definition at line 117 of file Particle.cc.

References cachePolar(), and p4Polar_.

117  {
118  cachePolar();
119  return (*p4Polar_.load(std::memory_order_acquire)).Et();
120 }
void cachePolar() const
set internal cache
Definition: Particle.cc:271
std::atomic< PolarLorentzVector * > p4Polar_
internal cache for p4
Definition: Particle.h:144
double Particle::eta ( ) const

momentum pseudorapidity

Definition at line 168 of file Particle.cc.

References eta_.

Referenced by Particle.Particle::__str__(), Muon.Muon::absEffAreaIso(), DQMExample_Step1::analyze(), Jet.Jet::jetID(), and Jet.Jet::puJetId().

168  {
169  return eta_;
170 }
bool Particle::longLived ( ) const

is long lived?

Definition at line 266 of file Particle.cc.

References longLivedTag, and status_.

266  {
267  return status_ & longLivedTag;
268 }
int status_
status word
Definition: Particle.h:141
static const unsigned int longLivedTag
long lived flag
Definition: Particle.h:125
double Particle::mass ( ) const

mass

Definition at line 122 of file Particle.cc.

References mass_.

Referenced by Particle.Particle::__str__(), and DiObject.DiMuon::__str__().

122  {
123  return mass_;
124 }
double Particle::massSqr ( ) const

mass squared

Definition at line 126 of file Particle.cc.

References mass_.

126  {
127  return mass_ * mass_;
128 }
Particle::Vector Particle::momentum ( ) const

spatial momentum vector

Definition at line 96 of file Particle.cc.

References cacheCartesian(), and p4Cartesian_.

96  {
98  return (*p4Cartesian_.load(std::memory_order_acquire)).Vect();
99 }
std::atomic< LorentzVector * > p4Cartesian_
internal cache for p4
Definition: Particle.h:146
void cacheCartesian() const
set internal cache
Definition: Particle.cc:281
double Particle::mt ( ) const

transverse mass

Definition at line 130 of file Particle.cc.

References cachePolar(), and p4Polar_.

130  {
131  cachePolar();
132  return (*p4Polar_.load(std::memory_order_acquire)).Mt();
133 }
void cachePolar() const
set internal cache
Definition: Particle.cc:271
std::atomic< PolarLorentzVector * > p4Polar_
internal cache for p4
Definition: Particle.h:144
double Particle::mtSqr ( ) const

transverse mass squared

Definition at line 135 of file Particle.cc.

References cachePolar(), and p4Polar_.

135  {
136  cachePolar();
137  return (*p4Polar_.load(std::memory_order_acquire)).Mt2();
138 }
void cachePolar() const
set internal cache
Definition: Particle.cc:271
std::atomic< PolarLorentzVector * > p4Polar_
internal cache for p4
Definition: Particle.h:144
Particle & Particle::operator= ( const Particle rhs)

Definition at line 42 of file Particle.cc.

References swap(), and groupFilesInBlocks::temp.

42  {
43  Particle temp(rhs);
44  temp.swap(*this);
45  return *this;
46 }
double Particle::p ( ) const

magnitude of momentum vector

Definition at line 107 of file Particle.cc.

References cacheCartesian(), P, and p4Cartesian_.

107  {
108  cacheCartesian();
109  return (*p4Cartesian_.load(std::memory_order_acquire)).P();
110 }
std::atomic< LorentzVector * > p4Cartesian_
internal cache for p4
Definition: Particle.h:146
#define P
void cacheCartesian() const
set internal cache
Definition: Particle.cc:281
const Particle::LorentzVector & Particle::p4 ( ) const

four-momentum Lorentz vector

Definition at line 86 of file Particle.cc.

References cacheCartesian(), and p4Cartesian_.

Referenced by Tau.Tau::dxy(), Tau.Tau::dz(), Jet.Jet::jetID(), TtDilepLRSignalSelObservables::operator()(), TtSemiLRJetCombObservables::operator()(), CandidateTriggerObjectProducer::produce(), ParticleReplacerZtautau::produce(), setP4(), ParticleReplacerZtautau::transformMuMu2LepLep(), and ParticleReplacerZtautau::transformMuMu2TauNu().

86  {
88  return (*p4Cartesian_.load(std::memory_order_acquire));
89 }
std::atomic< LorentzVector * > p4Cartesian_
internal cache for p4
Definition: Particle.h:146
void cacheCartesian() const
set internal cache
Definition: Particle.cc:281
int Particle::pdgId ( ) const
double Particle::phi ( ) const

momentum azimuthal angle

Definition at line 159 of file Particle.cc.

References phi_.

Referenced by Particle.Particle::__str__(), and DQMExample_Step1::analyze().

159  {
160  return phi_;
161 }
const Particle::PolarLorentzVector & Particle::polarP4 ( ) const

four-momentum Lorentz vector

Definition at line 91 of file Particle.cc.

References cachePolar(), and p4Polar_.

91  {
92  cachePolar();
93  return (*p4Polar_.load(std::memory_order_acquire));
94 }
void cachePolar() const
set internal cache
Definition: Particle.cc:271
std::atomic< PolarLorentzVector * > p4Polar_
internal cache for p4
Definition: Particle.h:144
double Particle::pt ( ) const
double Particle::px ( ) const

x coordinate of momentum vector

Definition at line 140 of file Particle.cc.

References cacheCartesian(), and p4Cartesian_.

Referenced by ParticleReplacerZtautau::produce().

140  {
141  cacheCartesian();
142  return (*p4Cartesian_.load(std::memory_order_acquire)).Px();
143 }
std::atomic< LorentzVector * > p4Cartesian_
internal cache for p4
Definition: Particle.h:146
void cacheCartesian() const
set internal cache
Definition: Particle.cc:281
double Particle::py ( ) const

y coordinate of momentum vector

Definition at line 145 of file Particle.cc.

References cacheCartesian(), and p4Cartesian_.

Referenced by ParticleReplacerZtautau::produce().

145  {
146  cacheCartesian();
147  return (*p4Cartesian_.load(std::memory_order_acquire)).Py();
148 }
std::atomic< LorentzVector * > p4Cartesian_
internal cache for p4
Definition: Particle.h:146
void cacheCartesian() const
set internal cache
Definition: Particle.cc:281
double Particle::pz ( ) const

z coordinate of momentum vector

Definition at line 150 of file Particle.cc.

References cacheCartesian(), and p4Cartesian_.

Referenced by ParticleReplacerZtautau::produce().

150  {
151  cacheCartesian();
152  return (*p4Cartesian_.load(std::memory_order_acquire)).Pz();
153 }
std::atomic< LorentzVector * > p4Cartesian_
internal cache for p4
Definition: Particle.h:146
void cacheCartesian() const
set internal cache
Definition: Particle.cc:281
double Particle::rapidity ( ) const

repidity

Definition at line 172 of file Particle.cc.

References cachePolar(), and p4Polar_.

Referenced by y().

172  {
173  cachePolar();
174  return (*p4Polar_.load(std::memory_order_acquire)).Rapidity();
175 }
void cachePolar() const
set internal cache
Definition: Particle.cc:271
std::atomic< PolarLorentzVector * > p4Polar_
internal cache for p4
Definition: Particle.h:144
void Particle::setCharge ( Charge  q)

set electric charge

Definition at line 74 of file Particle.cc.

References qx3_.

74  {
75  qx3_ = q * 3;
76 }
Charge qx3_
electric charge
Definition: Particle.h:133
void Particle::setLongLived ( )

set long lived flag

Definition at line 262 of file Particle.cc.

References longLivedTag, and status_.

262  {
264 }
int status_
status word
Definition: Particle.h:141
static const unsigned int longLivedTag
long lived flag
Definition: Particle.h:125
void Particle::setMass ( double  m)

set particle mass

Definition at line 208 of file Particle.cc.

References clearCache(), m, and mass_.

208  {
209  mass_ = m;
210  clearCache();
211 }
void clearCache() const
clear internal cache
Definition: Particle.cc:292
void Particle::setP4 ( const LorentzVector p4)

set 4-momentum

Definition at line 182 of file Particle.cc.

References cacheCartesian(), cachePolar(), eta_, mass_, p4(), p4Cartesian_, p4Polar_, phi_, and pt_.

Referenced by ParticleReplacerZtautau::transformMuMu2LepLep(), and ParticleReplacerZtautau::transformMuMu2TauNu().

182  {
183  // ensure that we have non-null pointers
184  cacheCartesian();
185  *p4Cartesian_.load(std::memory_order_acquire) = p4;
186  // ensure that we have non-null pointers
187  cachePolar();
188  *p4Polar_.load(std::memory_order_acquire) = p4;
189  auto const* p4Polar = p4Polar_.load(std::memory_order_acquire);
190  pt_ = p4Polar->pt();
191  eta_ = p4Polar->eta();
192  phi_ = p4Polar->phi();
193  mass_ = p4Polar->mass();
194 }
const LorentzVector & p4() const
four-momentum Lorentz vector
Definition: Particle.cc:86
std::atomic< LorentzVector * > p4Cartesian_
internal cache for p4
Definition: Particle.h:146
void cacheCartesian() const
set internal cache
Definition: Particle.cc:281
void cachePolar() const
set internal cache
Definition: Particle.cc:271
float pt_
four-momentum Lorentz vector
Definition: Particle.h:135
std::atomic< PolarLorentzVector * > p4Polar_
internal cache for p4
Definition: Particle.h:144
void Particle::setP4 ( const PolarLorentzVector p4)

set 4-momentum

Definition at line 196 of file Particle.cc.

References cachePolar(), eta_, mass_, p4(), p4Cartesian_, p4Polar_, phi_, and pt_.

196  {
197  // ensure that we have non-null pointers
198  cachePolar();
199  *p4Polar_.load(std::memory_order_acquire) = p4;
200  auto const* p4Polar = p4Polar_.load(std::memory_order_acquire);
201  pt_ = p4Polar->pt();
202  eta_ = p4Polar->eta();
203  phi_ = p4Polar->phi();
204  mass_ = p4Polar->mass();
205  delete p4Cartesian_.exchange(nullptr, std::memory_order_acq_rel);
206 }
const LorentzVector & p4() const
four-momentum Lorentz vector
Definition: Particle.cc:86
std::atomic< LorentzVector * > p4Cartesian_
internal cache for p4
Definition: Particle.h:146
void cachePolar() const
set internal cache
Definition: Particle.cc:271
float pt_
four-momentum Lorentz vector
Definition: Particle.h:135
std::atomic< PolarLorentzVector * > p4Polar_
internal cache for p4
Definition: Particle.h:144
void Particle::setPdgId ( int  pdgId)

Definition at line 250 of file Particle.cc.

References pdgId(), and pdgId_.

Referenced by TtDilepEvtSolution::getLeptNeg(), TtDilepEvtSolution::getLeptPos(), ParticleReplacerZtautau::transformMuMu2LepLep(), and ParticleReplacerZtautau::transformMuMu2TauNu().

250  {
251  pdgId_ = pdgId;
252 }
int pdgId_
PDG identifier.
Definition: Particle.h:139
int pdgId() const
PDG identifier.
Definition: Particle.cc:246
void Particle::setPz ( double  pz)

set Pz

Definition at line 212 of file Particle.cc.

References cacheCartesian(), cachePolar(), eta_, mass_, p4Cartesian_, p4Polar_, phi_, and pt_.

212  {
213  // ensure that we have non-null pointers
214  cacheCartesian();
215  (*p4Cartesian_.load(std::memory_order_acquire)).SetPz(pz);
216  // ensure that we have non-null pointers
217  cachePolar();
218  (*p4Polar_.load(std::memory_order_acquire)) = (*p4Cartesian_.load(std::memory_order_acquire));
219  auto const* p4Polar = p4Polar_.load(std::memory_order_acquire);
220  pt_ = p4Polar->pt();
221  eta_ = p4Polar->eta();
222  phi_ = p4Polar->phi();
223  mass_ = p4Polar->mass();
224 }
std::atomic< LorentzVector * > p4Cartesian_
internal cache for p4
Definition: Particle.h:146
void cacheCartesian() const
set internal cache
Definition: Particle.cc:281
void cachePolar() const
set internal cache
Definition: Particle.cc:271
float pt_
four-momentum Lorentz vector
Definition: Particle.h:135
std::atomic< PolarLorentzVector * > p4Polar_
internal cache for p4
Definition: Particle.h:144
double pz() const
z coordinate of momentum vector
Definition: Particle.cc:150
void Particle::setStatus ( int  status)

set status word

Definition at line 258 of file Particle.cc.

References status(), and status_.

Referenced by ParticleReplacerZtautau::produce(), ParticleReplacerZtautau::transformMuMu2LepLep(), and ParticleReplacerZtautau::transformMuMu2TauNu().

258  {
259  status_ = status;
260 }
int status() const
status word
Definition: Particle.cc:254
int status_
status word
Definition: Particle.h:141
void Particle::setThreeCharge ( Charge  qx3)

set electric charge

Definition at line 82 of file Particle.cc.

References qx3_.

82  {
83  qx3_ = qx3;
84 }
Charge qx3_
electric charge
Definition: Particle.h:133
void Particle::setVertex ( const Point vertex)

set vertex

Definition at line 242 of file Particle.cc.

References vertex(), and vertex_.

242  {
243  vertex_ = vertex;
244 }
Point vertex_
vertex position
Definition: Particle.h:137
const Point & vertex() const
vertex position
Definition: Particle.cc:226
int Particle::status ( ) const

status word

Definition at line 254 of file Particle.cc.

References status_.

Referenced by setStatus().

254  {
255  return status_;
256 }
int status_
status word
Definition: Particle.h:141
void Particle::swap ( Particle other)

Definition at line 48 of file Particle.cc.

References eta_, mass_, p4Cartesian_, p4Polar_, pdgId_, phi_, pt_, qx3_, status_, std::swap(), and vertex_.

Referenced by operator=().

48  {
49  std::swap(qx3_, other.qx3_);
50  std::swap(pt_, other.pt_);
51  std::swap(eta_, other.eta_);
52  std::swap(phi_, other.phi_);
53  std::swap(mass_, other.mass_);
54  std::swap(vertex_, other.vertex_);
55  std::swap(pdgId_, other.pdgId_);
56  std::swap(status_, other.status_);
57  other.p4Polar_.exchange(
58  p4Polar_.exchange(other.p4Polar_, std::memory_order_acq_rel),
59  std::memory_order_acq_rel);
60  other.p4Cartesian_.exchange(
61  p4Cartesian_.exchange(other.p4Cartesian_, std::memory_order_acq_rel),
62  std::memory_order_acq_rel);
63 }
int pdgId_
PDG identifier.
Definition: Particle.h:139
Charge qx3_
electric charge
Definition: Particle.h:133
Point vertex_
vertex position
Definition: Particle.h:137
int status_
status word
Definition: Particle.h:141
std::atomic< LorentzVector * > p4Cartesian_
internal cache for p4
Definition: Particle.h:146
float pt_
four-momentum Lorentz vector
Definition: Particle.h:135
void swap(edm::DataFrameContainer &lhs, edm::DataFrameContainer &rhs)
std::atomic< PolarLorentzVector * > p4Polar_
internal cache for p4
Definition: Particle.h:144
double Particle::theta ( ) const

momentum polar angle

Definition at line 163 of file Particle.cc.

References cacheCartesian(), and p4Cartesian_.

Referenced by Tau.Tau::zImpact().

163  {
164  cacheCartesian();
165  return (*p4Cartesian_.load(std::memory_order_acquire)).Theta();
166 }
std::atomic< LorentzVector * > p4Cartesian_
internal cache for p4
Definition: Particle.h:146
void cacheCartesian() const
set internal cache
Definition: Particle.cc:281
int Particle::threeCharge ( ) const

electric charge

Definition at line 78 of file Particle.cc.

References qx3_.

78  {
79  return qx3_;
80 }
Charge qx3_
electric charge
Definition: Particle.h:133
const Particle::Point & Particle::vertex ( ) const

vertex position

Definition at line 226 of file Particle.cc.

References vertex_.

Referenced by Tau.Tau::dxy(), Tau.Tau::dz(), ParticleReplacerZtautau::produce(), and setVertex().

226  {
227  return vertex_;
228 }
Point vertex_
vertex position
Definition: Particle.h:137
double Particle::vx ( ) const

x coordinate of vertex position

Definition at line 230 of file Particle.cc.

References vertex_.

Referenced by ParticleReplacerParticleGun::produce().

230  {
231  return vertex_.X();
232 }
Point vertex_
vertex position
Definition: Particle.h:137
double Particle::vy ( ) const

y coordinate of vertex position

Definition at line 234 of file Particle.cc.

References vertex_.

Referenced by ParticleReplacerParticleGun::produce().

234  {
235  return vertex_.Y();
236 }
Point vertex_
vertex position
Definition: Particle.h:137
double Particle::vz ( ) const

z coordinate of vertex position

Definition at line 238 of file Particle.cc.

References vertex_.

Referenced by ParticleReplacerParticleGun::produce().

238  {
239  return vertex_.Z();
240 }
Point vertex_
vertex position
Definition: Particle.h:137
double Particle::y ( ) const

Member Data Documentation

float reco::Particle::eta_
protected

Definition at line 135 of file Particle.h.

Referenced by cachePolar(), eta(), setP4(), setPz(), and swap().

const unsigned int Particle::longLivedTag = 65536
static

long lived flag

Definition at line 125 of file Particle.h.

Referenced by longLived(), and setLongLived().

float reco::Particle::mass_
protected

Definition at line 135 of file Particle.h.

Referenced by cachePolar(), mass(), massSqr(), setMass(), setP4(), setPz(), and swap().

std::atomic<LorentzVector*> reco::Particle::p4Cartesian_
mutableprotected

internal cache for p4

Definition at line 146 of file Particle.h.

Referenced by boostToCM(), cacheCartesian(), clearCache(), energy(), momentum(), p(), p4(), px(), py(), pz(), setP4(), setPz(), swap(), and theta().

std::atomic<PolarLorentzVector*> reco::Particle::p4Polar_
mutableprotected

internal cache for p4

Definition at line 144 of file Particle.h.

Referenced by cacheCartesian(), cachePolar(), clearCache(), et(), mt(), mtSqr(), polarP4(), rapidity(), setP4(), setPz(), and swap().

int reco::Particle::pdgId_
protected

PDG identifier.

Definition at line 139 of file Particle.h.

Referenced by pdgId(), setPdgId(), and swap().

float reco::Particle::phi_
protected

Definition at line 135 of file Particle.h.

Referenced by cachePolar(), phi(), setP4(), setPz(), and swap().

float reco::Particle::pt_
protected

four-momentum Lorentz vector

Definition at line 135 of file Particle.h.

Referenced by cachePolar(), pt(), setP4(), setPz(), and swap().

Charge reco::Particle::qx3_
protected

electric charge

Definition at line 133 of file Particle.h.

Referenced by charge(), Particle(), setCharge(), setThreeCharge(), swap(), and threeCharge().

int reco::Particle::status_
protected

status word

Definition at line 141 of file Particle.h.

Referenced by longLived(), setLongLived(), setStatus(), status(), and swap().

Point reco::Particle::vertex_
protected

vertex position

Definition at line 137 of file Particle.h.

Referenced by setVertex(), swap(), vertex(), vx(), vy(), and vz().