12 if (unpackAfterwards) {
13 delete p4_.exchange(
nullptr);
14 delete p4c_.exchange(
nullptr);
24 float pz = std::tanh(y)*
std::sqrt((m*m+pt*pt)/(1.-std::tanh(y)*std::tanh(y)));
27 eta = std::asinh(pz/pt);
29 double shift = (pt<1. ? 0.1*pt : 0.1/
pt);
30 double sign = ( (
int(pt*10) % 2 == 0 ) ? 1 : -1 );
32 auto p4 = std::make_unique<PolarLorentzVector>(
pt,
eta,
phi,
m);
34 if(
p4_.compare_exchange_strong(expectp4,
p4.get())) {
37 auto p4c = std::make_unique<LorentzVector>(*p4_);
39 if(
p4c_.compare_exchange_strong(expectp4c,p4c.get())) {
64 <<
"this Candidate has no master clone reference." 65 <<
"Can't call masterClone() method.\n";
79 <<
"this Candidate has no master clone ptr." 80 <<
"Can't call masterClonePtr() method.\n";
107 <<
"This Candidate type does not implement daughter(std::string). " 108 <<
"Please use CompositeCandidate or NamedCompositeCandidate.\n";
113 <<
"This Candidate type does not implement daughter(std::string). " 114 <<
"Please use CompositeCandidate or NamedCompositeCandidate.\n";
137 <<
"reco::ConcreteCandidate does not implement vertex covariant matrix.\n";
142 <<
"reco::ConcreteCandidate does not implement vertex covariant matrix.\n";
bool isConvertedPhoton() const override
const reco::Candidate * mother(size_type) const override
return mother at a given position (throws an exception)
bool isTrackerMuon() const override
Point vertex_
vertex position
bool isElectron() const override
get a component
double eta() const override
momentum pseudorapidity
bool isGlobalMuon() const override
const reco::Candidate * daughter(size_type) const override
return daughter at a given position (throws an exception)
Sin< T >::type sin(const T &t)
CovarianceMatrix vertexCovariance() const override
return SMatrix
bool massConstraint() const override
do mass constraint?
const reco::CandidatePtr & masterClonePtr() const override
bool isPhoton() const override
double pz() const override
z coordinate of momentum vector
static float float16to32(uint16_t h)
std::atomic< LorentzVector * > p4c_
void pack(bool unpackAfterwards=true)
reco::GenParticleRef motherRef() const
direct access to the mother reference (may be null)
double pt() const override
transverse momentum
double p() const override
magnitude of momentum vector
virtual const LorentzVector & p4() const =0
four-momentum Lorentz vector
bool isCaloMuon() const override
static uint16_t float32to16(float x)
bool hasMasterClonePtr() const override
size_t numberOfDaughters() const override
number of daughters
Cos< T >::type cos(const T &t)
~PackedGenParticle() override
destructor
bool longLived() const override
is long lived?
T const * get() const
Returns C++ pointer to the item.
const LorentzVector & p4() const override
four-momentum Lorentz vecto r
std::atomic< PolarLorentzVector * > p4_
the four vector
int charge() const override
electric charge
const Point & vertex() const override
vertex position
double vertexNdof() const override
math::XYZTLorentzVector LorentzVector
Lorentz vector.
bool isJet() const override
virtual int charge() const =0
electric charge
const reco::CandidateBaseRef & masterClone() const override
Structure Point Contains parameters of Gaussian fits to DMRs.
static unsigned int const shift
bool hasMasterClone() const override
double phi() const override
momentum azimuthal angle
virtual const Point & vertex() const =0
vertex position
double y() const override
rapidity
double vertexNormalizedChi2() const override
chi-squared divided by n.d.o.f.
virtual float dz() const
dz with respect to the PV ref
size_t numberOfMothers() const override
number of mothers
void fillVertexCovariance(CovarianceMatrix &v) const override
fill SMatrix
virtual float dxy() const
dxy with respect to the PV ref
bool isStandAloneMuon() const override
bool overlap(const reco::Candidate &) const override
check overlap with another Candidate
double vertexChi2() const override
chi-squares
math::PtEtaPhiMLorentzVector PolarLorentzVector
Lorentz vector.
bool isMuon() const override