CMS 3D CMS Logo

List of all members | Public Types | Public Member Functions | Static Public Attributes | Protected Member Functions | Protected Attributes | Friends
pat::PackedGenParticle Class Reference

#include <PackedGenParticle.h>

Inheritance diagram for pat::PackedGenParticle:
reco::Candidate

Public Types

typedef reco::CandidateCollection daughters
 collection of daughter candidates More...
 
typedef unsigned int index
 
typedef math::XYZTLorentzVector LorentzVector
 Lorentz vector. More...
 
typedef math::XYZPoint Point
 point in the space More...
 
typedef math::PtEtaPhiMLorentzVector PolarLorentzVector
 Lorentz vector. More...
 
enum  PVAssoc { NoPV = 0, PVLoose = 1, PVTight = 2, PVUsedInFit = 3 }
 
typedef math::XYZVector Vector
 point in the space More...
 
- Public Types inherited from reco::Candidate
enum  { dimension = 3 }
 
enum  { size = dimension * (dimension + 1) / 2 }
 matix size More...
 
typedef int Charge
 electric charge type More...
 
typedef candidate::const_iterator const_iterator
 
typedef math::Error< dimension >::type CovarianceMatrix
 covariance error matrix (3x3) More...
 
typedef unsigned int index
 index type More...
 
typedef candidate::iterator iterator
 
typedef math::XYZTLorentzVector LorentzVector
 Lorentz vector. More...
 
typedef math::XYZPoint Point
 point in the space More...
 
typedef math::PtEtaPhiMLorentzVector PolarLorentzVector
 Lorentz vector. More...
 
typedef size_t size_type
 
typedef math::XYZVector Vector
 point in the space More...
 

Public Member Functions

Vector boostToCM () const override
 
int charge () const override
 electric charge More...
 
PackedGenParticleclone () const override
 returns a clone of the Candidate object More...
 
const reco::Candidatedaughter (size_type) const override
 return daughter at a given position (throws an exception) More...
 
reco::Candidatedaughter (size_type) override
 return daughter at a given position (throws an exception) More...
 
reco::Candidatedaughter (const std::string &s) override
 return daughter with a specified role name More...
 
const reco::Candidatedaughter (const std::string &s) const override
 return daughter with a specified role name More...
 
virtual float dxy () const
 dxy with respect to the PV ref More...
 
virtual float dxy (const Point &p) const
 dxy with respect to another point More...
 
virtual float dz () const
 dz with respect to the PV ref More...
 
virtual float dz (const Point &p) const
 dz with respect to another point More...
 
double energy () const override
 energy More...
 
double et () const override
 transverse energy More...
 
double et2 () const override
 transverse energy squared (use this for cuts)! More...
 
double eta () const override
 momentum pseudorapidity More...
 
void fillVertexCovariance (CovarianceMatrix &v) const override
 fill SMatrix More...
 
bool fromHardProcessFinalState () const
 
bool hasMasterClone () const override
 
bool hasMasterClonePtr () const override
 
bool isCaloMuon () const override
 
bool isConvertedPhoton () const override
 
bool isDirectHardProcessTauDecayProductFinalState () const
 
bool isDirectPromptTauDecayProductFinalState () const
 
bool isElectron () const override
 get a component More...
 
bool isGlobalMuon () const override
 
bool isJet () const override
 
bool isMuon () const override
 
bool isPhoton () const override
 
bool isPromptFinalState () const
 
bool isStandAloneMuon () const override
 
bool isTrackerMuon () const override
 
const reco::GenParticleReflastPrunedRef () const
 last surviving in pruned More...
 
bool longLived () const override
 is long lived? More...
 
double mass () const override
 mass More...
 
bool massConstraint () const override
 do mass constraint? More...
 
double massSqr () const override
 mass squared More...
 
const reco::CandidateBaseRefmasterClone () const override
 
const reco::CandidatePtrmasterClonePtr () const override
 
template<typename Ref >
Ref masterRef () const
 cast master clone reference to a concrete type More...
 
Vector momentum () const override
 spatial momentum vector More...
 
const reco::Candidatemother (size_type) const override
 return mother at a given position (throws an exception) More...
 
reco::GenParticleRef motherRef () const
 direct access to the mother reference (may be null) More...
 
double mt () const override
 transverse mass More...
 
double mtSqr () const override
 transverse mass squared More...
 
size_t numberOfDaughters () const override
 number of daughters More...
 
size_t numberOfMothers () const override
 number of mothers More...
 
size_t numberOfSourceCandidatePtrs () const override
 
PackedGenParticleoperator= (PackedGenParticle &&iOther)
 
PackedGenParticleoperator= (PackedGenParticle const &iOther)
 
double p () const override
 magnitude of momentum vector More...
 
const LorentzVectorp4 () const override
 four-momentum Lorentz vecto r More...
 
 PackedGenParticle ()
 default constructor More...
 
 PackedGenParticle (const reco::GenParticle &c)
 
 PackedGenParticle (const reco::GenParticle &c, const edm::Ref< reco::GenParticleCollection > &mother)
 
 PackedGenParticle (const PackedGenParticle &iOther)
 
 PackedGenParticle (PackedGenParticle &&iOther)
 
int pdgId () const override
 PDG identifier. More...
 
double phi () const override
 momentum azimuthal angle More...
 
const PolarLorentzVectorpolarP4 () const override
 four-momentum Lorentz vector More...
 
double pt () const override
 transverse momentum More...
 
double px () const override
 x coordinate of momentum vector More...
 
double py () const override
 y coordinate of momentum vector More...
 
double pz () const override
 z coordinate of momentum vector More...
 
double rapidity () const override
 rapidity More...
 
void setCharge (int charge) override
 set electric charge More...
 
void setLongLived () override
 set long lived flag More...
 
void setMass (double m) override
 set particle mass More...
 
void setMassConstraint () override
 set mass constraint flag More...
 
void setP4 (const LorentzVector &p4) override
 set 4-momentum More...
 
void setP4 (const PolarLorentzVector &p4) override
 set 4-momentum More...
 
void setPdgId (int pdgId) override
 
void setPz (double pz) override
 
void setStatus (int status) override
 set status word More...
 
void setThreeCharge (int threecharge) override
 set electric charge More...
 
void setVertex (const Point &vertex) override
 set vertex More...
 
reco::CandidatePtr sourceCandidatePtr (size_type i) const override
 
int status () const override
 status word More...
 
const reco::GenStatusFlagsstatusFlags () const
 
reco::GenStatusFlagsstatusFlags ()
 
double theta () const override
 momentum polar angle More...
 
int threeCharge () const override
 electric charge More...
 
const Pointvertex () const override
 vertex position More...
 
double vertexChi2 () const override
 chi-squares More...
 
double vertexCovariance (int i, int j) const override
 (i, j)-th element of error matrix, i, j = 0, ... 2 More...
 
CovarianceMatrix vertexCovariance () const override
 return SMatrix More...
 
double vertexNdof () const override
 
double vertexNormalizedChi2 () const override
 chi-squared divided by n.d.o.f. More...
 
double vx () const override
 x coordinate of vertex position More...
 
double vy () const override
 y coordinate of vertex position More...
 
double vz () const override
 z coordinate of vertex position More...
 
double y () const override
 rapidity More...
 
 ~PackedGenParticle () override
 destructor More...
 
- Public Member Functions inherited from reco::Candidate
const_iterator begin () const
 first daughter const_iterator More...
 
iterator begin ()
 first daughter iterator More...
 
virtual const TrackbestTrack () const
 
 Candidate ()
 default constructor More...
 
virtual float dxyError () const
 uncertainty on dxy More...
 
virtual float dzError () const
 uncertainty on dz More...
 
const_iterator end () const
 last daughter const_iterator More...
 
iterator end ()
 last daughter iterator More...
 
template<typename T >
T get () const
 get a component More...
 
template<typename T , typename Tag >
T get () const
 get a component More...
 
template<typename T >
T get (size_type i) const
 get a component More...
 
template<typename T , typename Tag >
T get (size_type i) const
 get a component More...
 
template<typename Ref >
Ref masterRef () const
 cast master clone reference to a concrete type More...
 
template<typename T >
size_type numberOf () const
 number of components More...
 
template<typename T , typename Tag >
size_type numberOf () const
 number of components More...
 
virtual void setP4 (const PolarLorentzVector &p4)=0
 set 4-momentum More...
 
virtual void setSourceCandidatePtr (const CandidatePtr &ptr)
 Set the ptr to the source Candidate. More...
 
virtual ~Candidate ()
 destructor More...
 

Static Public Attributes

static const unsigned int longLivedTag = 0
 long lived flag More...
 
static const unsigned int massConstraintTag = 0
 do mass constraint flag More...
 

Protected Member Functions

bool overlap (const reco::Candidate &) const override
 check overlap with another Candidate More...
 
void pack (bool unpackAfterwards=true)
 
void unpack () const
 

Protected Attributes

int8_t charge_
 Charge. More...
 
float dphi_
 
float dxy_
 
float dz_
 
reco::GenParticleRef mother_
 Ref to first mother. More...
 
std::atomic< PolarLorentzVector * > p4_
 the four vector More...
 
std::atomic< LorentzVector * > p4c_
 
uint16_t packedM_
 
uint16_t packedPhi_
 
uint16_t packedPt_
 
uint16_t packedY_
 
int pdgId_
 PDG identifier. More...
 
reco::GenStatusFlags statusFlags_
 
Point vertex_
 vertex position More...
 

Friends

class ::OverlapChecker
 
class ::testPackedGenParticle
 
template<typename , typename , typename >
struct component
 
class ShallowCloneCandidate
 
class ShallowClonePtrCandidate
 

Detailed Description

Definition at line 19 of file PackedGenParticle.h.

Member Typedef Documentation

◆ daughters

collection of daughter candidates

Definition at line 24 of file PackedGenParticle.h.

◆ index

typedef unsigned int pat::PackedGenParticle::index

Definition at line 34 of file PackedGenParticle.h.

◆ LorentzVector

Lorentz vector.

Definition at line 26 of file PackedGenParticle.h.

◆ Point

point in the space

Definition at line 30 of file PackedGenParticle.h.

◆ PolarLorentzVector

Lorentz vector.

Definition at line 28 of file PackedGenParticle.h.

◆ Vector

point in the space

Definition at line 32 of file PackedGenParticle.h.

Member Enumeration Documentation

◆ PVAssoc

Constructor & Destructor Documentation

◆ PackedGenParticle() [1/5]

pat::PackedGenParticle::PackedGenParticle ( )
inline

default constructor

Definition at line 37 of file PackedGenParticle.h.

Referenced by clone().

38  : packedPt_(0),
39  packedY_(0),
40  packedPhi_(0),
41  packedM_(0),
42  p4_(nullptr),
43  p4c_(nullptr),
44  vertex_(0, 0, 0),
45  pdgId_(0),
46  charge_(0) {}
Point vertex_
vertex position
int pdgId_
PDG identifier.
std::atomic< LorentzVector * > p4c_
std::atomic< PolarLorentzVector * > p4_
the four vector

◆ PackedGenParticle() [2/5]

pat::PackedGenParticle::PackedGenParticle ( const reco::GenParticle c)
inlineexplicit

Definition at line 47 of file PackedGenParticle.h.

References pack().

48  : p4_(new PolarLorentzVector(c.pt(), c.eta(), c.phi(), c.mass())),
49  p4c_(new LorentzVector(*p4_)),
50  vertex_(0, 0, 0),
51  pdgId_(c.pdgId()),
52  charge_(c.charge()),
53  mother_(c.motherRef(0)),
54  statusFlags_(c.statusFlags()) {
55  pack();
56  }
Point vertex_
vertex position
int pdgId_
PDG identifier.
std::atomic< LorentzVector * > p4c_
void pack(bool unpackAfterwards=true)
reco::GenParticleRef mother_
Ref to first mother.
std::atomic< PolarLorentzVector * > p4_
the four vector
reco::GenStatusFlags statusFlags_
math::PtEtaPhiMLorentzVector PolarLorentzVector
Lorentz vector.
math::XYZTLorentzVector LorentzVector
Lorentz vector.

◆ PackedGenParticle() [3/5]

pat::PackedGenParticle::PackedGenParticle ( const reco::GenParticle c,
const edm::Ref< reco::GenParticleCollection > &  mother 
)
inlineexplicit

Definition at line 57 of file PackedGenParticle.h.

References pack().

58  : p4_(new PolarLorentzVector(c.pt(), c.eta(), c.phi(), c.mass())),
59  p4c_(new LorentzVector(*p4_)),
60  vertex_(0, 0, 0),
61  pdgId_(c.pdgId()),
62  charge_(c.charge()),
63  mother_(mother),
64  statusFlags_(c.statusFlags()) {
65  pack();
66  }
Point vertex_
vertex position
int pdgId_
PDG identifier.
std::atomic< LorentzVector * > p4c_
void pack(bool unpackAfterwards=true)
reco::GenParticleRef mother_
Ref to first mother.
std::atomic< PolarLorentzVector * > p4_
the four vector
const reco::Candidate * mother(size_type) const override
return mother at a given position (throws an exception)
reco::GenStatusFlags statusFlags_
math::PtEtaPhiMLorentzVector PolarLorentzVector
Lorentz vector.
math::XYZTLorentzVector LorentzVector
Lorentz vector.

◆ PackedGenParticle() [4/5]

pat::PackedGenParticle::PackedGenParticle ( const PackedGenParticle iOther)
inline

Definition at line 68 of file PackedGenParticle.h.

References p4_, and p4c_.

69  : packedPt_(iOther.packedPt_),
70  packedY_(iOther.packedY_),
71  packedPhi_(iOther.packedPhi_),
72  packedM_(iOther.packedM_),
73  p4_(nullptr),
74  p4c_(nullptr),
75  vertex_(iOther.vertex_),
76  dxy_(iOther.dxy_),
77  dz_(iOther.dz_),
78  dphi_(iOther.dphi_),
79  pdgId_(iOther.pdgId_),
80  charge_(iOther.charge_),
81  mother_(iOther.mother_),
82  statusFlags_(iOther.statusFlags_) {
83  if (iOther.p4c_) {
84  p4_.store(new PolarLorentzVector(*iOther.p4_));
85  p4c_.store(new LorentzVector(*iOther.p4c_));
86  }
87  }
Point vertex_
vertex position
int pdgId_
PDG identifier.
std::atomic< LorentzVector * > p4c_
reco::GenParticleRef mother_
Ref to first mother.
std::atomic< PolarLorentzVector * > p4_
the four vector
reco::GenStatusFlags statusFlags_
math::PtEtaPhiMLorentzVector PolarLorentzVector
Lorentz vector.
math::XYZTLorentzVector LorentzVector
Lorentz vector.

◆ PackedGenParticle() [5/5]

pat::PackedGenParticle::PackedGenParticle ( PackedGenParticle &&  iOther)
inline

Definition at line 89 of file PackedGenParticle.h.

References p4_, and p4c_.

90  : packedPt_(iOther.packedPt_),
91  packedY_(iOther.packedY_),
92  packedPhi_(iOther.packedPhi_),
93  packedM_(iOther.packedM_),
94  p4_(nullptr),
95  p4c_(nullptr),
96  vertex_(std::move(iOther.vertex_)),
97  dxy_(iOther.dxy_),
98  dz_(iOther.dz_),
99  dphi_(iOther.dphi_),
100  pdgId_(iOther.pdgId_),
101  charge_(iOther.charge_),
102  mother_(iOther.mother_),
103  statusFlags_(iOther.statusFlags_) {
104  if (iOther.p4c_) {
105  p4_.store(p4_.exchange(nullptr));
106  p4c_.store(p4c_.exchange(nullptr));
107  }
108  }
Point vertex_
vertex position
int pdgId_
PDG identifier.
std::atomic< LorentzVector * > p4c_
reco::GenParticleRef mother_
Ref to first mother.
std::atomic< PolarLorentzVector * > p4_
the four vector
reco::GenStatusFlags statusFlags_
def move(src, dest)
Definition: eostools.py:511

◆ ~PackedGenParticle()

pat::PackedGenParticle::~PackedGenParticle ( )
override

destructor

Definition at line 42 of file PackedGenParticle.cc.

42  {
43  delete p4_.load();
44  delete p4c_.load();
45 }
std::atomic< LorentzVector * > p4c_
std::atomic< PolarLorentzVector * > p4_
the four vector

Member Function Documentation

◆ boostToCM()

Vector pat::PackedGenParticle::boostToCM ( ) const
inlineoverridevirtual

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

Implements reco::Candidate.

Definition at line 207 of file PackedGenParticle.h.

References p4c_, and unpack().

207  {
208  if (!p4c_)
209  unpack();
210  return p4c_.load()->BoostToCM();
211  }
std::atomic< LorentzVector * > p4c_

◆ charge()

int pat::PackedGenParticle::charge ( ) const
inlineoverridevirtual

electric charge

Implements reco::Candidate.

Definition at line 180 of file PackedGenParticle.h.

References charge_.

Referenced by setCharge(), and threeCharge().

180 { return charge_; }

◆ clone()

PackedGenParticle* pat::PackedGenParticle::clone ( void  ) const
inlineoverridevirtual

returns a clone of the Candidate object

Implements reco::Candidate.

Definition at line 384 of file PackedGenParticle.h.

References PackedGenParticle().

384 { return new PackedGenParticle(*this); }
PackedGenParticle()
default constructor

◆ daughter() [1/4]

const reco::Candidate * pat::PackedGenParticle::daughter ( size_type  ) const
overridevirtual

return daughter at a given position (throws an exception)

Implements reco::Candidate.

Definition at line 88 of file PackedGenParticle.cc.

88 { return nullptr; }

◆ daughter() [2/4]

reco::Candidate * pat::PackedGenParticle::daughter ( size_type  )
overridevirtual

return daughter at a given position (throws an exception)

Implements reco::Candidate.

Definition at line 104 of file PackedGenParticle.cc.

104 { return nullptr; }

◆ daughter() [3/4]

reco::Candidate * pat::PackedGenParticle::daughter ( const std::string &  s)
overridevirtual

return daughter with a specified role name

Implements reco::Candidate.

Definition at line 98 of file PackedGenParticle.cc.

References Exception, and edm::errors::UnimplementedFeature.

98  {
100  << "This Candidate type does not implement daughter(std::string). "
101  << "Please use CompositeCandidate or NamedCompositeCandidate.\n";
102 }

◆ daughter() [4/4]

const reco::Candidate * pat::PackedGenParticle::daughter ( const std::string &  s) const
overridevirtual

return daughter with a specified role name

Implements reco::Candidate.

Definition at line 92 of file PackedGenParticle.cc.

References Exception, and edm::errors::UnimplementedFeature.

92  {
94  << "This Candidate type does not implement daughter(std::string). "
95  << "Please use CompositeCandidate or NamedCompositeCandidate.\n";
96 }

◆ dxy() [1/2]

virtual float pat::PackedGenParticle::dxy ( ) const
inlinevirtual

dxy with respect to the PV ref

Definition at line 348 of file PackedGenParticle.h.

References dxy_, and unpack().

Referenced by Electron.Electron::cutBasedId(), and ntupleDataFormat.Track::dxyPull().

348  {
349  unpack();
350  return dxy_;
351  }

◆ dxy() [2/2]

float pat::PackedGenParticle::dxy ( const Point p) const
virtual

dxy with respect to another point

Definition at line 47 of file PackedGenParticle.cc.

References funct::cos(), AlCaHLTBitMon_ParallelJobs::p, funct::sin(), and BeamSpotPI::unpack().

Referenced by Electron.Electron::cutBasedId(), and ntupleDataFormat.Track::dxyPull().

47  {
48  unpack();
49  return -(vertex_.X() - p.X()) * std::sin(float(p4_.load()->Phi())) +
50  (vertex_.Y() - p.Y()) * std::cos(float(p4_.load()->Phi()));
51 }
Point vertex_
vertex position
Sin< T >::type sin(const T &t)
Definition: Sin.h:22
Cos< T >::type cos(const T &t)
Definition: Cos.h:22
std::atomic< PolarLorentzVector * > p4_
the four vector
double p() const override
magnitude of momentum vector

◆ dz() [1/2]

virtual float pat::PackedGenParticle::dz ( ) const
inlinevirtual

dz with respect to the PV ref

Definition at line 353 of file PackedGenParticle.h.

References dz_, and unpack().

Referenced by Electron.Electron::cutBasedId(), and ntupleDataFormat.Track::dzPull().

353  {
354  unpack();
355  return dz_;
356  }

◆ dz() [2/2]

float pat::PackedGenParticle::dz ( const Point p) const
virtual

dz with respect to another point

Definition at line 52 of file PackedGenParticle.cc.

References funct::cos(), AlCaHLTBitMon_ParallelJobs::p, funct::sin(), and BeamSpotPI::unpack().

Referenced by Electron.Electron::cutBasedId(), and ntupleDataFormat.Track::dzPull().

52  {
53  unpack();
54  return (vertex_.Z() - p.X()) - ((vertex_.X() - p.X()) * std::cos(float(p4_.load()->Phi())) +
55  (vertex_.Y() - p.Y()) * std::sin(float(p4_.load()->Phi()))) *
56  p4_.load()->Pz() / p4_.load()->Pt();
57 }
Point vertex_
vertex position
Sin< T >::type sin(const T &t)
Definition: Sin.h:22
Cos< T >::type cos(const T &t)
Definition: Cos.h:22
std::atomic< PolarLorentzVector * > p4_
the four vector
double p() const override
magnitude of momentum vector

◆ energy()

double pat::PackedGenParticle::energy ( ) const
inlineoverridevirtual

energy

Implements reco::Candidate.

Definition at line 219 of file PackedGenParticle.h.

References p4c_, and unpack().

Referenced by Jet.Jet::rawEnergy().

219  {
220  if (!p4c_)
221  unpack();
222  return p4c_.load()->E();
223  }
std::atomic< LorentzVector * > p4c_

◆ et()

double pat::PackedGenParticle::et ( ) const
inlineoverridevirtual

transverse energy

Implements reco::Candidate.

Definition at line 225 of file PackedGenParticle.h.

References p4c_, and pt().

225 { return (pt() <= 0) ? 0 : p4c_.load()->Et(); }
std::atomic< LorentzVector * > p4c_
double pt() const override
transverse momentum

◆ et2()

double pat::PackedGenParticle::et2 ( ) const
inlineoverridevirtual

transverse energy squared (use this for cuts)!

Implements reco::Candidate.

Definition at line 227 of file PackedGenParticle.h.

References p4c_, and pt().

227 { return (pt() <= 0) ? 0 : p4c_.load()->Et2(); }
std::atomic< LorentzVector * > p4c_
double pt() const override
transverse momentum

◆ eta()

double pat::PackedGenParticle::eta ( ) const
inlineoverridevirtual

momentum pseudorapidity

Implements reco::Candidate.

Definition at line 290 of file PackedGenParticle.h.

References p4_, p4c_, and unpack().

Referenced by Particle.Particle::__str__(), Jet.Jet::jetID(), and Jet.Jet::puJetId().

290  {
291  if (!p4c_)
292  unpack();
293  return p4_.load()->Eta();
294  }
std::atomic< LorentzVector * > p4c_
std::atomic< PolarLorentzVector * > p4_
the four vector

◆ fillVertexCovariance()

void pat::PackedGenParticle::fillVertexCovariance ( CovarianceMatrix v) const
overridevirtual

fill SMatrix

Implements reco::Candidate.

Definition at line 117 of file PackedGenParticle.cc.

References Exception, and edm::errors::UnimplementedFeature.

Referenced by vertexCovariance().

117  {
119  << "reco::ConcreteCandidate does not implement vertex covariant matrix.\n";
120 }

◆ fromHardProcessFinalState()

bool pat::PackedGenParticle::fromHardProcessFinalState ( ) const
inline

Definition at line 468 of file PackedGenParticle.h.

References reco::GenStatusFlags::fromHardProcess(), status(), and statusFlags_.

468 { return status() == 1 && statusFlags_.fromHardProcess(); }
bool fromHardProcess() const
int status() const override
status word
reco::GenStatusFlags statusFlags_

◆ hasMasterClone()

bool pat::PackedGenParticle::hasMasterClone ( ) const
overridevirtual

returns true if this candidate has a reference to a master clone. This only happens if the concrete Candidate type is ShallowCloneCandidate

Implements reco::Candidate.

Definition at line 66 of file PackedGenParticle.cc.

66 { return false; }

◆ hasMasterClonePtr()

bool pat::PackedGenParticle::hasMasterClonePtr ( ) const
overridevirtual

returns true if this candidate has a ptr to a master clone. This only happens if the concrete Candidate type is ShallowClonePtrCandidate

Implements reco::Candidate.

Definition at line 68 of file PackedGenParticle.cc.

68 { return false; }

◆ isCaloMuon()

bool pat::PackedGenParticle::isCaloMuon ( ) const
overridevirtual

Implements reco::Candidate.

Definition at line 132 of file PackedGenParticle.cc.

132 { return false; }

◆ isConvertedPhoton()

bool pat::PackedGenParticle::isConvertedPhoton ( ) const
overridevirtual

Implements reco::Candidate.

Definition at line 136 of file PackedGenParticle.cc.

136 { return false; }

◆ isDirectHardProcessTauDecayProductFinalState()

bool pat::PackedGenParticle::isDirectHardProcessTauDecayProductFinalState ( ) const
inline

Definition at line 472 of file PackedGenParticle.h.

References reco::GenStatusFlags::isDirectHardProcessTauDecayProduct(), status(), and statusFlags_.

472  {
474  }
bool isDirectHardProcessTauDecayProduct() const
int status() const override
status word
reco::GenStatusFlags statusFlags_

◆ isDirectPromptTauDecayProductFinalState()

bool pat::PackedGenParticle::isDirectPromptTauDecayProductFinalState ( ) const
inline

Definition at line 455 of file PackedGenParticle.h.

References reco::GenStatusFlags::isDirectPromptTauDecayProduct(), status(), and statusFlags_.

455  {
457  }
int status() const override
status word
bool isDirectPromptTauDecayProduct() const
reco::GenStatusFlags statusFlags_

◆ isElectron()

bool pat::PackedGenParticle::isElectron ( ) const
overridevirtual

get a component

Implements reco::Candidate.

Definition at line 122 of file PackedGenParticle.cc.

122 { return false; }

◆ isGlobalMuon()

bool pat::PackedGenParticle::isGlobalMuon ( ) const
overridevirtual

Implements reco::Candidate.

Definition at line 126 of file PackedGenParticle.cc.

Referenced by Muon.Muon::muonID().

126 { return false; }

◆ isJet()

bool pat::PackedGenParticle::isJet ( ) const
overridevirtual

Implements reco::Candidate.

Definition at line 138 of file PackedGenParticle.cc.

138 { return false; }

◆ isMuon()

bool pat::PackedGenParticle::isMuon ( ) const
overridevirtual

Implements reco::Candidate.

Definition at line 124 of file PackedGenParticle.cc.

124 { return false; }

◆ isPhoton()

bool pat::PackedGenParticle::isPhoton ( ) const
overridevirtual

Implements reco::Candidate.

Definition at line 134 of file PackedGenParticle.cc.

134 { return false; }

◆ isPromptFinalState()

bool pat::PackedGenParticle::isPromptFinalState ( ) const
inline

Definition at line 451 of file PackedGenParticle.h.

References reco::GenStatusFlags::isPrompt(), status(), and statusFlags_.

451 { return status() == 1 && statusFlags_.isPrompt(); }
int status() const override
status word
bool isPrompt() const
reco::GenStatusFlags statusFlags_

◆ isStandAloneMuon()

bool pat::PackedGenParticle::isStandAloneMuon ( ) const
overridevirtual

Implements reco::Candidate.

Definition at line 128 of file PackedGenParticle.cc.

128 { return false; }

◆ isTrackerMuon()

bool pat::PackedGenParticle::isTrackerMuon ( ) const
overridevirtual

Implements reco::Candidate.

Definition at line 130 of file PackedGenParticle.cc.

130 { return false; }

◆ lastPrunedRef()

const reco::GenParticleRef& pat::PackedGenParticle::lastPrunedRef ( ) const
inline

last surviving in pruned

Definition at line 164 of file PackedGenParticle.h.

References mother_.

164 { return mother_; }
reco::GenParticleRef mother_
Ref to first mother.

◆ longLived()

bool pat::PackedGenParticle::longLived ( ) const
overridevirtual

is long lived?

Implements reco::Candidate.

Definition at line 140 of file PackedGenParticle.cc.

140 { return false; }

◆ mass()

double pat::PackedGenParticle::mass ( ) const
inlineoverridevirtual

mass

Implements reco::Candidate.

Definition at line 229 of file PackedGenParticle.h.

References p4_, p4c_, and unpack().

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

229  {
230  if (!p4c_)
231  unpack();
232  return p4_.load()->M();
233  }
std::atomic< LorentzVector * > p4c_
std::atomic< PolarLorentzVector * > p4_
the four vector

◆ massConstraint()

bool pat::PackedGenParticle::massConstraint ( ) const
overridevirtual

do mass constraint?

Implements reco::Candidate.

Definition at line 142 of file PackedGenParticle.cc.

142 { return false; }

◆ massSqr()

double pat::PackedGenParticle::massSqr ( ) const
inlineoverridevirtual

mass squared

Implements reco::Candidate.

Definition at line 235 of file PackedGenParticle.h.

References p4_, p4c_, and unpack().

235  {
236  if (!p4c_)
237  unpack();
238  return p4_.load()->M() * p4_.load()->M();
239  }
std::atomic< LorentzVector * > p4c_
std::atomic< PolarLorentzVector * > p4_
the four vector

◆ masterClone()

const reco::CandidateBaseRef & pat::PackedGenParticle::masterClone ( ) const
overridevirtual

returns ptr to master clone, if existing. Throws an exception unless the concrete Candidate type is ShallowCloneCandidate

Implements reco::Candidate.

Definition at line 61 of file PackedGenParticle.cc.

References Exception.

Referenced by masterRef().

61  {
62  throw cms::Exception("Invalid Reference") << "this Candidate has no master clone reference."
63  << "Can't call masterClone() method.\n";
64 }

◆ masterClonePtr()

const reco::CandidatePtr & pat::PackedGenParticle::masterClonePtr ( ) const
overridevirtual

returns ptr to master clone, if existing. Throws an exception unless the concrete Candidate type is ShallowClonePtrCandidate

Implements reco::Candidate.

Definition at line 70 of file PackedGenParticle.cc.

References Exception.

70  {
71  throw cms::Exception("Invalid Reference") << "this Candidate has no master clone ptr."
72  << "Can't call masterClonePtr() method.\n";
73 }

◆ masterRef()

template<typename Ref >
Ref pat::PackedGenParticle::masterRef ( ) const
inline

cast master clone reference to a concrete type

Definition at line 423 of file PackedGenParticle.h.

References masterClone().

423  {
424  return masterClone().template castTo<Ref>();
425  }
const reco::CandidateBaseRef & masterClone() const override

◆ momentum()

Vector pat::PackedGenParticle::momentum ( ) const
inlineoverridevirtual

spatial momentum vector

Implements reco::Candidate.

Definition at line 200 of file PackedGenParticle.h.

References p4c_, and unpack().

200  {
201  if (!p4c_)
202  unpack();
203  return p4c_.load()->Vect();
204  }
std::atomic< LorentzVector * > p4c_

◆ mother()

const reco::Candidate * pat::PackedGenParticle::mother ( size_type  ) const
overridevirtual

return mother at a given position (throws an exception)

Implements reco::Candidate.

Definition at line 90 of file PackedGenParticle.cc.

References reco::Candidate::get().

90 { return motherRef().get(); }
reco::GenParticleRef motherRef() const
direct access to the mother reference (may be null)
T const * get() const
Returns C++ pointer to the item.
Definition: Ref.h:232

◆ motherRef()

reco::GenParticleRef pat::PackedGenParticle::motherRef ( ) const
inline

direct access to the mother reference (may be null)

Definition at line 152 of file PackedGenParticle.h.

References edm::Ref< C, T, F >::isAvailable(), edm::Ref< C, T, F >::isNonnull(), and mother_.

152  {
153  if (mother_.isNonnull() && mother_.isAvailable() &&
154  mother_->status() == 1) { //if pointing to the pruned version of myself
155  if (mother_->numberOfMothers() > 0)
156  return mother_->motherRef(0); // return my mother's (that is actually myself) mother
157  else
158  return edm::Ref<reco::GenParticleCollection>(); // return null ref
159  } else {
160  return mother_; //the stored ref is really my mother, or null, return that
161  }
162  }
bool isNonnull() const
Checks for non-null.
Definition: Ref.h:238
reco::GenParticleRef mother_
Ref to first mother.
bool isAvailable() const
Definition: Ref.h:537

◆ mt()

double pat::PackedGenParticle::mt ( ) const
inlineoverridevirtual

transverse mass

Implements reco::Candidate.

Definition at line 242 of file PackedGenParticle.h.

References p4_, p4c_, and unpack().

242  {
243  if (!p4c_)
244  unpack();
245  return p4_.load()->Mt();
246  }
std::atomic< LorentzVector * > p4c_
std::atomic< PolarLorentzVector * > p4_
the four vector

◆ mtSqr()

double pat::PackedGenParticle::mtSqr ( ) const
inlineoverridevirtual

transverse mass squared

Implements reco::Candidate.

Definition at line 248 of file PackedGenParticle.h.

References p4_, p4c_, and unpack().

248  {
249  if (!p4c_)
250  unpack();
251  return p4_.load()->Mt2();
252  }
std::atomic< LorentzVector * > p4c_
std::atomic< PolarLorentzVector * > p4_
the four vector

◆ numberOfDaughters()

size_t pat::PackedGenParticle::numberOfDaughters ( ) const
overridevirtual

number of daughters

Implements reco::Candidate.

Definition at line 75 of file PackedGenParticle.cc.

75 { return 0; }

◆ numberOfMothers()

size_t pat::PackedGenParticle::numberOfMothers ( ) const
overridevirtual

number of mothers

Implements reco::Candidate.

Definition at line 77 of file PackedGenParticle.cc.

77  {
78  if (motherRef().isNonnull())
79  return 1;
80  return 0;
81 }
reco::GenParticleRef motherRef() const
direct access to the mother reference (may be null)

◆ numberOfSourceCandidatePtrs()

size_t pat::PackedGenParticle::numberOfSourceCandidatePtrs ( ) const
inlineoverridevirtual

return the number of source Candidates ( the candidates used to construct this Candidate)

Implements reco::Candidate.

Definition at line 174 of file PackedGenParticle.h.

174 { return 0; }

◆ operator=() [1/2]

PackedGenParticle& pat::PackedGenParticle::operator= ( PackedGenParticle &&  iOther)
inline

Definition at line 110 of file PackedGenParticle.h.

References charge_, dphi_, dxy_, dz_, mother_, eostools::move(), p4_, p4c_, packedM_, packedPhi_, packedPt_, packedY_, pdgId_, statusFlags_, and vertex_.

110  {
111  if (this != &iOther) {
112  packedPt_ = iOther.packedPt_;
113  packedY_ = iOther.packedY_;
114  packedPhi_ = iOther.packedPhi_;
115  packedM_ = iOther.packedM_;
116  if (p4c_) {
117  delete p4_.exchange(iOther.p4_.exchange(nullptr));
118  delete p4c_.exchange(iOther.p4c_.exchange(nullptr));
119  } else {
120  delete p4_.exchange(nullptr);
121  delete p4c_.exchange(nullptr);
122  }
123  vertex_ = std::move(iOther.vertex_);
124  dxy_ = iOther.dxy_;
125  dz_ = iOther.dz_;
126  dphi_ = iOther.dphi_;
127  pdgId_ = iOther.pdgId_;
128  charge_ = iOther.charge_;
129  mother_ = iOther.mother_;
130  statusFlags_ = iOther.statusFlags_;
131  }
132  return *this;
133  }
Point vertex_
vertex position
int pdgId_
PDG identifier.
std::atomic< LorentzVector * > p4c_
reco::GenParticleRef mother_
Ref to first mother.
std::atomic< PolarLorentzVector * > p4_
the four vector
reco::GenStatusFlags statusFlags_
def move(src, dest)
Definition: eostools.py:511

◆ operator=() [2/2]

PackedGenParticle& pat::PackedGenParticle::operator= ( PackedGenParticle const &  iOther)
inline

Definition at line 135 of file PackedGenParticle.h.

References HltBtagPostValidation_cff::c, and eostools::move().

135  {
136  PackedGenParticle c(iOther);
137  *this = std::move(c);
138  return *this;
139  }
PackedGenParticle()
default constructor
def move(src, dest)
Definition: eostools.py:511

◆ overlap()

bool pat::PackedGenParticle::overlap ( const reco::Candidate o) const
overrideprotectedvirtual

check overlap with another Candidate

Implements reco::Candidate.

Definition at line 83 of file PackedGenParticle.cc.

References ALCARECOTkAlJpsiMuMu_cff::charge, EcalTangentSkim_cfg::o, and bphysicsOniaDQM_cfi::vertex.

83  {
84  return p4() == o.p4() && vertex() == o.vertex() && charge() == o.charge();
85  // return p4() == o.p4() && charge() == o.charge();
86 }
const Point & vertex() const override
vertex position
int charge() const override
electric charge
const LorentzVector & p4() const override
four-momentum Lorentz vecto r

◆ p()

double pat::PackedGenParticle::p ( ) const
inlineoverridevirtual

magnitude of momentum vector

Implements reco::Candidate.

Definition at line 213 of file PackedGenParticle.h.

References p4c_, and unpack().

Referenced by Electron.Electron::ptErr().

213  {
214  if (!p4c_)
215  unpack();
216  return p4c_.load()->P();
217  }
std::atomic< LorentzVector * > p4c_

◆ p4()

const LorentzVector& pat::PackedGenParticle::p4 ( ) const
inlineoverridevirtual

four-momentum Lorentz vecto r

Implements reco::Candidate.

Definition at line 188 of file PackedGenParticle.h.

References p4c_, and unpack().

Referenced by Tau.Tau::dxy_approx(), Tau.Tau::dz(), Lepton.Lepton::p4WithFSR(), and setP4().

188  {
189  if (!p4c_)
190  unpack();
191  return *p4c_;
192  }
std::atomic< LorentzVector * > p4c_

◆ pack()

void pat::PackedGenParticle::pack ( bool  unpackAfterwards = true)
protected

Definition at line 5 of file PackedGenParticle.cc.

References MiniFloatConverter::float32to16(), SiStripPI::max, p4_, p4c_, packedM_, packedPhi_, packedPt_, packedY_, and unpack().

Referenced by PackedGenParticle(), setMass(), setP4(), and setPz().

5  {
7  packedY_ = int16_t(p4_.load()->Rapidity() / 6.0f * std::numeric_limits<int16_t>::max());
8  packedPhi_ = int16_t(p4_.load()->Phi() / 3.2f * std::numeric_limits<int16_t>::max());
10  if (unpackAfterwards) {
11  delete p4_.exchange(nullptr);
12  delete p4c_.exchange(nullptr);
13  unpack(); // force the values to match with the packed ones
14  }
15 }
std::atomic< LorentzVector * > p4c_
static uint16_t float32to16(float x)
Definition: libminifloat.h:17
std::atomic< PolarLorentzVector * > p4_
the four vector

◆ pdgId()

int pat::PackedGenParticle::pdgId ( ) const
inlineoverridevirtual

PDG identifier.

Implements reco::Candidate.

Definition at line 363 of file PackedGenParticle.h.

References pdgId_.

Referenced by Particle.Particle::__str__(), and setPdgId().

363 { return pdgId_; }
int pdgId_
PDG identifier.

◆ phi()

double pat::PackedGenParticle::phi ( ) const
inlineoverridevirtual

momentum azimuthal angle

Implements reco::Candidate.

Definition at line 278 of file PackedGenParticle.h.

References p4_, p4c_, and unpack().

Referenced by Particle.Particle::__str__(), and ntupleDataFormat.Track::phiPull().

278  {
279  if (!p4c_)
280  unpack();
281  return p4_.load()->Phi();
282  }
std::atomic< LorentzVector * > p4c_
std::atomic< PolarLorentzVector * > p4_
the four vector

◆ polarP4()

const PolarLorentzVector& pat::PackedGenParticle::polarP4 ( ) const
inlineoverridevirtual

four-momentum Lorentz vector

Implements reco::Candidate.

Definition at line 194 of file PackedGenParticle.h.

References p4_, p4c_, and unpack().

194  {
195  if (!p4c_)
196  unpack();
197  return *p4_;
198  }
std::atomic< LorentzVector * > p4c_
std::atomic< PolarLorentzVector * > p4_
the four vector

◆ pt()

double pat::PackedGenParticle::pt ( ) const
inlineoverridevirtual

◆ px()

double pat::PackedGenParticle::px ( ) const
inlineoverridevirtual

x coordinate of momentum vector

Implements reco::Candidate.

Definition at line 254 of file PackedGenParticle.h.

References p4c_, and unpack().

254  {
255  if (!p4c_)
256  unpack();
257  return p4c_.load()->Px();
258  }
std::atomic< LorentzVector * > p4c_

◆ py()

double pat::PackedGenParticle::py ( ) const
inlineoverridevirtual

y coordinate of momentum vector

Implements reco::Candidate.

Definition at line 260 of file PackedGenParticle.h.

References p4c_, and unpack().

260  {
261  if (!p4c_)
262  unpack();
263  return p4c_.load()->Py();
264  }
std::atomic< LorentzVector * > p4c_

◆ pz()

double pat::PackedGenParticle::pz ( ) const
inlineoverridevirtual

z coordinate of momentum vector

Implements reco::Candidate.

Definition at line 266 of file PackedGenParticle.h.

References p4c_, and unpack().

Referenced by setPz().

266  {
267  if (!p4c_)
268  unpack();
269  return p4c_.load()->Pz();
270  }
std::atomic< LorentzVector * > p4c_

◆ rapidity()

double pat::PackedGenParticle::rapidity ( ) const
inlineoverridevirtual

rapidity

Implements reco::Candidate.

Definition at line 296 of file PackedGenParticle.h.

References p4_, p4c_, and unpack().

296  {
297  if (!p4c_)
298  unpack();
299  return p4_.load()->Rapidity();
300  }
std::atomic< LorentzVector * > p4c_
std::atomic< PolarLorentzVector * > p4_
the four vector

◆ setCharge()

void pat::PackedGenParticle::setCharge ( int  charge)
inlineoverridevirtual

set electric charge

Implements reco::Candidate.

Definition at line 182 of file PackedGenParticle.h.

References charge(), and charge_.

182 { charge_ = charge; }
int charge() const override
electric charge

◆ setLongLived()

void pat::PackedGenParticle::setLongLived ( )
inlineoverridevirtual

set long lived flag

Implements reco::Candidate.

Definition at line 373 of file PackedGenParticle.h.

373 {} /*FIXME*/

◆ setMass()

void pat::PackedGenParticle::setMass ( double  m)
inlineoverridevirtual

set particle mass

Implements reco::Candidate.

Definition at line 320 of file PackedGenParticle.h.

References visualization-live-secondInstance_cfg::m, p4_, p4c_, pack(), and unpack().

320  {
321  if (!p4c_)
322  unpack();
323  *p4_ = PolarLorentzVector(p4_.load()->Pt(), p4_.load()->Eta(), p4_.load()->Phi(), m);
324  pack();
325  }
std::atomic< LorentzVector * > p4c_
void pack(bool unpackAfterwards=true)
std::atomic< PolarLorentzVector * > p4_
the four vector
math::PtEtaPhiMLorentzVector PolarLorentzVector
Lorentz vector.

◆ setMassConstraint()

void pat::PackedGenParticle::setMassConstraint ( )
inlineoverridevirtual

set mass constraint flag

Implements reco::Candidate.

Definition at line 379 of file PackedGenParticle.h.

379 {} /*FIXME*/

◆ setP4() [1/2]

void pat::PackedGenParticle::setP4 ( const LorentzVector p4)
inlineoverridevirtual

set 4-momentum

Implements reco::Candidate.

Definition at line 308 of file PackedGenParticle.h.

References p4(), p4_, pack(), and unpack().

Referenced by Jet.Jet::setCorrP4().

308  {
309  unpack(); // changing px,py,pz changes also mapping between dxy,dz and x,y,z
310  *p4_ = PolarLorentzVector(p4.Pt(), p4.Eta(), p4.Phi(), p4.M());
311  pack();
312  }
void pack(bool unpackAfterwards=true)
const LorentzVector & p4() const override
four-momentum Lorentz vecto r
std::atomic< PolarLorentzVector * > p4_
the four vector
math::PtEtaPhiMLorentzVector PolarLorentzVector
Lorentz vector.

◆ setP4() [2/2]

void pat::PackedGenParticle::setP4 ( const PolarLorentzVector p4)
inlineoverride

set 4-momentum

Definition at line 314 of file PackedGenParticle.h.

References p4(), p4_, pack(), and unpack().

Referenced by Jet.Jet::setCorrP4().

314  {
315  unpack(); // changing px,py,pz changes also mapping between dxy,dz and x,y,z
316  *p4_ = p4;
317  pack();
318  }
void pack(bool unpackAfterwards=true)
const LorentzVector & p4() const override
four-momentum Lorentz vecto r
std::atomic< PolarLorentzVector * > p4_
the four vector

◆ setPdgId()

void pat::PackedGenParticle::setPdgId ( int  pdgId)
inlineoverridevirtual

Implements reco::Candidate.

Definition at line 365 of file PackedGenParticle.h.

References pdgId(), and pdgId_.

365 { pdgId_ = pdgId; }
int pdgId_
PDG identifier.
int pdgId() const override
PDG identifier.

◆ setPz()

void pat::PackedGenParticle::setPz ( double  pz)
inlineoverridevirtual

Implements reco::Candidate.

Definition at line 326 of file PackedGenParticle.h.

References p4_, p4c_, pack(), pz(), and unpack().

326  {
327  unpack(); // changing px,py,pz changes also mapping between dxy,dz and x,y,z
328  *p4c_ = LorentzVector(p4c_.load()->Px(), p4c_.load()->Py(), pz, p4c_.load()->E());
329  *p4_ = PolarLorentzVector(p4c_.load()->Pt(), p4c_.load()->Eta(), p4c_.load()->Phi(), p4c_.load()->M());
330  pack();
331  }
std::atomic< LorentzVector * > p4c_
void pack(bool unpackAfterwards=true)
double pz() const override
z coordinate of momentum vector
std::atomic< PolarLorentzVector * > p4_
the four vector
math::PtEtaPhiMLorentzVector PolarLorentzVector
Lorentz vector.
math::XYZTLorentzVector LorentzVector
Lorentz vector.

◆ setStatus()

void pat::PackedGenParticle::setStatus ( int  status)
inlineoverridevirtual

set status word

Implements reco::Candidate.

Definition at line 369 of file PackedGenParticle.h.

369 {} /*FIXME*/

◆ setThreeCharge()

void pat::PackedGenParticle::setThreeCharge ( int  threecharge)
inlineoverridevirtual

set electric charge

Implements reco::Candidate.

Definition at line 186 of file PackedGenParticle.h.

186 {}

◆ setVertex()

void pat::PackedGenParticle::setVertex ( const Point vertex)
inlineoverridevirtual

set vertex

Implements reco::Candidate.

Definition at line 343 of file PackedGenParticle.h.

References vertex(), and vertex_.

343 { vertex_ = vertex; }
const Point & vertex() const override
vertex position
Point vertex_
vertex position

◆ sourceCandidatePtr()

reco::CandidatePtr pat::PackedGenParticle::sourceCandidatePtr ( size_type  i) const
inlineoverridevirtual

return a Ptr to one of the source Candidates ( the candidates used to construct this Candidate)

Reimplemented from reco::Candidate.

Definition at line 177 of file PackedGenParticle.h.

177 { return reco::CandidatePtr(); }
edm::Ptr< Candidate > CandidatePtr
persistent reference to an object in a collection of Candidate objects
Definition: CandidateFwd.h:25

◆ status()

int pat::PackedGenParticle::status ( ) const
inlineoverridevirtual

◆ statusFlags() [1/2]

const reco::GenStatusFlags& pat::PackedGenParticle::statusFlags ( ) const
inline

Definition at line 438 of file PackedGenParticle.h.

References statusFlags_.

438 { return statusFlags_; }
reco::GenStatusFlags statusFlags_

◆ statusFlags() [2/2]

reco::GenStatusFlags& pat::PackedGenParticle::statusFlags ( )
inline

Definition at line 439 of file PackedGenParticle.h.

References statusFlags_.

439 { return statusFlags_; }
reco::GenStatusFlags statusFlags_

◆ theta()

double pat::PackedGenParticle::theta ( ) const
inlineoverridevirtual

momentum polar angle

Implements reco::Candidate.

Definition at line 284 of file PackedGenParticle.h.

References p4_, p4c_, and unpack().

Referenced by Tau.Tau::zImpact().

284  {
285  if (!p4c_)
286  unpack();
287  return p4_.load()->Theta();
288  }
std::atomic< LorentzVector * > p4c_
std::atomic< PolarLorentzVector * > p4_
the four vector

◆ threeCharge()

int pat::PackedGenParticle::threeCharge ( ) const
inlineoverridevirtual

electric charge

Implements reco::Candidate.

Definition at line 184 of file PackedGenParticle.h.

References charge().

184 { return charge() * 3; }
int charge() const override
electric charge

◆ unpack()

void pat::PackedGenParticle::unpack ( ) const
protected

Definition at line 17 of file PackedGenParticle.cc.

References PVValHelper::eta, MiniFloatConverter::float16to32(), createfilelist::int, visualization-live-secondInstance_cfg::m, SiStripPI::max, phi, DiDispStaMuonMonitor_cfi::pt, edm::shift, Validation_hcalonly_cfi::sign, mathSSE::sqrt(), nnet::tanh(), and y.

Referenced by boostToCM(), dxy(), dz(), energy(), eta(), mass(), massSqr(), momentum(), mt(), mtSqr(), p(), p4(), pack(), phi(), polarP4(), pt(), px(), py(), pz(), rapidity(), setMass(), setP4(), setPz(), theta(), and y().

17  {
18  float y = int16_t(packedY_) * 6.0f / std::numeric_limits<int16_t>::max();
21  float pz = std::tanh(y) * std::sqrt((m * m + pt * pt) / (1. - std::tanh(y) * std::tanh(y)));
22  float eta = 0;
23  if (pt != 0.) {
24  eta = std::asinh(pz / pt);
25  }
26  double shift = (pt < 1. ? 0.1 * pt : 0.1 / pt); // shift particle phi to break degeneracies in angular separations
27  double sign = ((int(pt * 10) % 2 == 0) ? 1 : -1); // introduce a pseudo-random sign of the shift
28  double phi = int16_t(packedPhi_) * 3.2f / std::numeric_limits<int16_t>::max() +
30  auto p4 = std::make_unique<PolarLorentzVector>(pt, eta, phi, m);
31  PolarLorentzVector* expectp4 = nullptr;
32  if (p4_.compare_exchange_strong(expectp4, p4.get())) {
33  p4.release();
34  }
35  auto p4c = std::make_unique<LorentzVector>(*p4_);
36  LorentzVector* expectp4c = nullptr;
37  if (p4c_.compare_exchange_strong(expectp4c, p4c.get())) {
38  p4c.release();
39  }
40 }
void tanh(data_T data[CONFIG_T::n_in], res_T res[CONFIG_T::n_in])
static float float16to32(uint16_t h)
Definition: libminifloat.h:13
std::atomic< LorentzVector * > p4c_
const LorentzVector & p4() const override
four-momentum Lorentz vecto r
double pz() const override
z coordinate of momentum vector
T sqrt(T t)
Definition: SSEVec.h:19
math::XYZTLorentzVector LorentzVector
double phi() const override
momentum azimuthal angle
std::atomic< PolarLorentzVector * > p4_
the four vector
double y() const override
rapidity
double eta() const override
momentum pseudorapidity
static unsigned int const shift
double pt() const override
transverse momentum
math::PtEtaPhiMLorentzVector PolarLorentzVector
Lorentz vector.

◆ vertex()

const Point& pat::PackedGenParticle::vertex ( ) const
inlineoverridevirtual

vertex position

Implements reco::Candidate.

Definition at line 333 of file PackedGenParticle.h.

References vertex_.

Referenced by Tau.Tau::dxy(), and setVertex().

333  {
334  return vertex_;
335  } //{ if (fromPV_) return Point(0,0,0); else return Point(0,0,100); }
Point vertex_
vertex position

◆ vertexChi2()

double pat::PackedGenParticle::vertexChi2 ( ) const
overridevirtual

chi-squares

Implements reco::Candidate.

Definition at line 106 of file PackedGenParticle.cc.

106 { return 0; }

◆ vertexCovariance() [1/2]

double pat::PackedGenParticle::vertexCovariance ( int  i,
int  j 
) const
overridevirtual

(i, j)-th element of error matrix, i, j = 0, ... 2

Implements reco::Candidate.

Definition at line 112 of file PackedGenParticle.cc.

References Exception, and edm::errors::UnimplementedFeature.

112  {
114  << "reco::ConcreteCandidate does not implement vertex covariant matrix.\n";
115 }

◆ vertexCovariance() [2/2]

CovarianceMatrix pat::PackedGenParticle::vertexCovariance ( ) const
inlineoverridevirtual

return SMatrix

Reimplemented from reco::Candidate.

Definition at line 400 of file PackedGenParticle.h.

References fillVertexCovariance(), and visualization-live-secondInstance_cfg::m.

400  {
403  return m;
404  }
void fillVertexCovariance(CovarianceMatrix &v) const override
fill SMatrix

◆ vertexNdof()

double pat::PackedGenParticle::vertexNdof ( ) const
overridevirtual

Number of degrees of freedom
Meant to be Double32_t for soft-assignment fitters:
tracks may contribute to the vertex with fractional weights.
The ndof is then = to the sum of the track weights.
see e.g. CMS NOTE-2006/032, CMS NOTE-2004/002

Implements reco::Candidate.

Definition at line 108 of file PackedGenParticle.cc.

108 { return 0; }

◆ vertexNormalizedChi2()

double pat::PackedGenParticle::vertexNormalizedChi2 ( ) const
overridevirtual

chi-squared divided by n.d.o.f.

Implements reco::Candidate.

Definition at line 110 of file PackedGenParticle.cc.

110 { return 0; }

◆ vx()

double pat::PackedGenParticle::vx ( ) const
inlineoverridevirtual

x coordinate of vertex position

Implements reco::Candidate.

Definition at line 337 of file PackedGenParticle.h.

References vertex_.

337 { return vertex_.X(); } //{ return 0; }
Point vertex_
vertex position

◆ vy()

double pat::PackedGenParticle::vy ( ) const
inlineoverridevirtual

y coordinate of vertex position

Implements reco::Candidate.

Definition at line 339 of file PackedGenParticle.h.

References vertex_.

339 { return vertex_.Y(); } //{ return 0; }
Point vertex_
vertex position

◆ vz()

double pat::PackedGenParticle::vz ( ) const
inlineoverridevirtual

z coordinate of vertex position

Implements reco::Candidate.

Definition at line 341 of file PackedGenParticle.h.

References vertex_.

341 { return vertex_.Z(); } //{ if (fromPV_) return 0; else return 100; }
Point vertex_
vertex position

◆ y()

double pat::PackedGenParticle::y ( ) const
inlineoverridevirtual

rapidity

Implements reco::Candidate.

Definition at line 302 of file PackedGenParticle.h.

References p4_, p4c_, and unpack().

Referenced by svgfig.Ellipse::__repr__(), geometryXMLparser.Alignable::pos(), ntupleDataFormat._HitObject::r(), and ntupleDataFormat._HitObject::r3D().

302  {
303  if (!p4c_)
304  unpack();
305  return p4_.load()->Rapidity();
306  }
std::atomic< LorentzVector * > p4c_
std::atomic< PolarLorentzVector * > p4_
the four vector

Friends And Related Function Documentation

◆ ::OverlapChecker

friend class ::OverlapChecker
friend

Definition at line 500 of file PackedGenParticle.h.

◆ ::testPackedGenParticle

friend class ::testPackedGenParticle
friend

Definition at line 21 of file PackedGenParticle.h.

◆ component

template<typename , typename , typename >
friend struct component
friend

Definition at line 499 of file PackedGenParticle.h.

◆ ShallowCloneCandidate

friend class ShallowCloneCandidate
friend

Definition at line 501 of file PackedGenParticle.h.

◆ ShallowClonePtrCandidate

friend class ShallowClonePtrCandidate
friend

Definition at line 502 of file PackedGenParticle.h.

Member Data Documentation

◆ charge_

int8_t pat::PackedGenParticle::charge_
protected

Charge.

Definition at line 490 of file PackedGenParticle.h.

Referenced by charge(), operator=(), and setCharge().

◆ dphi_

float pat::PackedGenParticle::dphi_
protected

Definition at line 486 of file PackedGenParticle.h.

Referenced by operator=().

◆ dxy_

float pat::PackedGenParticle::dxy_
protected

Definition at line 486 of file PackedGenParticle.h.

Referenced by dxy(), and operator=().

◆ dz_

float pat::PackedGenParticle::dz_
protected

Definition at line 486 of file PackedGenParticle.h.

Referenced by dz(), and operator=().

◆ longLivedTag

const unsigned int pat::PackedGenParticle::longLivedTag = 0
static

long lived flag

Definition at line 371 of file PackedGenParticle.h.

◆ massConstraintTag

const unsigned int pat::PackedGenParticle::massConstraintTag = 0
static

do mass constraint flag

Definition at line 377 of file PackedGenParticle.h.

◆ mother_

reco::GenParticleRef pat::PackedGenParticle::mother_
protected

Ref to first mother.

Definition at line 492 of file PackedGenParticle.h.

Referenced by lastPrunedRef(), motherRef(), and operator=().

◆ p4_

std::atomic<PolarLorentzVector*> pat::PackedGenParticle::p4_
mutableprotected

◆ p4c_

std::atomic<LorentzVector*> pat::PackedGenParticle::p4c_
mutableprotected

◆ packedM_

uint16_t pat::PackedGenParticle::packedM_
protected

Definition at line 477 of file PackedGenParticle.h.

Referenced by operator=(), and pack().

◆ packedPhi_

uint16_t pat::PackedGenParticle::packedPhi_
protected

Definition at line 477 of file PackedGenParticle.h.

Referenced by operator=(), and pack().

◆ packedPt_

uint16_t pat::PackedGenParticle::packedPt_
protected

Definition at line 477 of file PackedGenParticle.h.

Referenced by operator=(), and pack().

◆ packedY_

uint16_t pat::PackedGenParticle::packedY_
protected

Definition at line 477 of file PackedGenParticle.h.

Referenced by operator=(), and pack().

◆ pdgId_

int pat::PackedGenParticle::pdgId_
protected

PDG identifier.

Definition at line 488 of file PackedGenParticle.h.

Referenced by operator=(), pdgId(), and setPdgId().

◆ statusFlags_

reco::GenStatusFlags pat::PackedGenParticle::statusFlags_
protected

◆ vertex_

Point pat::PackedGenParticle::vertex_
protected

vertex position

Definition at line 485 of file PackedGenParticle.h.

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