8 using namespace logintpack;
15 if (unpackAfterwards)
unpack();
19 Point pv = pvRef_.isNonnull() ? pvRef_->position() :
Point();
20 float dxPV = vertex_.X() - pv.X(), dyPV = vertex_.Y() - pv.Y();
22 dxy_ = - dxPV * s + dyPV *
c;
26 float pzpt = p4_.Pz()/p4_.Pt();
27 dz_ = vertex_.Z() - pv.Z() - (dxPV*c + dyPV*
s) * pzpt;
39 packedCovarianceDetaDeta_ =
pack8logCeil(detadeta_,-20,-5);
40 packedCovarianceDphiDphi_ =
pack8logCeil(dphidphi_,-15,0);
41 packedCovarianceDphiDxy_ =
pack8log(dphidxy_,-17,-4);
42 packedCovarianceDlambdaDz_ =
pack8log(dlambdadz_,-17,-4);
60 if (unpackAfterwards) unpackVtx();
65 double shift = (pt<1. ? 0.1*pt : 0.1/
pt);
66 double sign = ( ( int(pt*10) % 2 == 0 ) ? 1 : -1 );
79 Point pv = pvRef_.isNonnull() ? pvRef_->position() :
Point();
81 vertex_ =
Point(pv.X() - dxy_ *
s,
87 dphidxy_ =
unpack8log(packedCovarianceDphiDxy_,-17,-4);
88 dlambdadz_ =
unpack8log(packedCovarianceDlambdaDz_,-17,-4);
89 dptdpt_ =
unpack8log(packedCovarianceDptDpt_,-15,0);
90 detadeta_ =
unpack8log(packedCovarianceDetaDeta_,-20,-5);
91 dphidphi_ =
unpack8log(packedCovarianceDphiDphi_,-15,0);
120 return -(vertex_.X()-p.X()) *
std::sin(
float(p4_.Phi())) + (vertex_.Y()-p.Y()) *
std::cos(
float(p4_.Phi()));
124 return (vertex_.Z()-p.Z()) - ((vertex_.X()-p.X()) *
std::cos(
float(p4_.Phi())) + (vertex_.Y()-p.Y()) *
std::sin(
float(p4_.Phi()))) * p4_.Pz()/p4_.Pt();
133 m(0,0)=dptdpt_/
pt()/
pt();
135 m(2,2)=dphidphi_/
pt()/
pt();
145 int numberOfPixelHits_ = packedHits_ & 0x7 ;
146 int numberOfHits_ = (packedHits_>>3) + numberOfPixelHits_;
148 int ndof = numberOfHits_+numberOfPixelHits_-5;
155 if(innerLost == validHitInFirstPixelBarrelLayer){
159 for(;i<numberOfPixelHits_; i++) {
163 for(;i<numberOfHits_;i++) {
168 case validHitInFirstPixelBarrelLayer:
170 case noLostInnerHits:
172 case oneLostInnerHit:
175 case moreLostInnerHits:
190 <<
"this Candidate has no master clone reference."
191 <<
"Can't call masterClone() method.\n";
205 <<
"this Candidate has no master clone ptr."
206 <<
"Can't call masterClonePtr() method.\n";
232 <<
"This Candidate type does not implement daughter(std::string). "
233 <<
"Please use CompositeCandidate or NamedCompositeCandidate.\n";
238 <<
"This Candidate type does not implement daughter(std::string). "
239 <<
"Please use CompositeCandidate or NamedCompositeCandidate.\n";
262 <<
"reco::ConcreteCandidate does not implement vertex covariant matrix.\n";
267 <<
"reco::ConcreteCandidate does not implement vertex covariant matrix.\n";
280 packedPuppiweightNoLepDiff_ =
pack8logClosed((p_nolep-0.5)*2,-2,0,64) - packedPuppiweight_;
float puppiWeight() const
Set both weights at once (with option for only full PUPPI)
virtual float dz(size_t ipv=0) const
dz with respect to the PV[ipv]
virtual size_t numberOfMothers() const
number of mothers
virtual bool hasMasterClonePtr() const
float puppiWeightNoLep() const
Weight from full PUPPI.
void setPuppiWeight(float p, float p_nolep=0.0)
double unpack8log(int8_t i, double lmin, double lmax, uint8_t base=128)
int8_t pack8log(double x, double lmin, double lmax, uint8_t base=128)
virtual void fillVertexCovariance(CovarianceMatrix &v) const
fill SMatrix
Sin< T >::type sin(const T &t)
virtual double vertexNdof() const
virtual bool overlap(const reco::Candidate &) const
check overlap with another Candidate
RhoEtaPhiVectorD RhoEtaPhiVector
spatial vector with cylindrical internal representation using pseudorapidity
static float float16to32(uint16_t h)
int8_t pack8logCeil(double x, double lmin, double lmax, uint8_t base=128)
virtual const reco::Candidate * daughter(size_type) const
return daughter at a given position (throws an exception)
int8_t pack8logClosed(double x, double lmin, double lmax, uint8_t base=128)
static uint16_t float32to16(float x)
Cos< T >::type cos(const T &t)
virtual const reco::CandidateBaseRef & masterClone() const
bool appendHitPattern(const TrackingRecHit &hit)
append a single hit to the HitPattern
virtual const Point & vertex() const =0
vertex position
virtual double vertexNormalizedChi2() const
chi-squared divided by n.d.o.f.
virtual int charge() const =0
electric charge
virtual const reco::CandidatePtr & masterClonePtr() const
LostInnerHits
Enumerator specifying the.
virtual bool massConstraint() const
do mass constraint?
XYZVectorD XYZVector
spatial vector with cartesian internal representation
virtual size_t numberOfDaughters() const
number of daughters
CovarianceMatrix vertexCovariance() const
return SMatrix
double unpack8logClosed(int8_t i, double lmin, double lmax, uint8_t base=128)
reverse of pack8logClosed
virtual bool longLived() const
is long lived?
virtual const reco::Candidate * mother(size_type) const
return mother at a given position (throws an exception)
void packVtx(bool unpackAfterwards=true)
static unsigned int const shift
math::XYZPoint Point
point in the space
void pack(bool unpackAfterwards=true)
virtual float dxy() const
dxy with respect to the PV ref
virtual double vertexChi2() const
chi-squares
virtual ~PackedCandidate()
destructor
math::Error< dimension >::type CovarianceMatrix
5 parameter covariance matrix
virtual bool hasMasterClone() const
virtual const LorentzVector & p4() const =0
four-momentum Lorentz vector
math::PtEtaPhiMLorentzVector PolarLorentzVector
Lorentz vector.