8 using namespace logintpack;
15 if (unpackAfterwards)
unpack();
21 float dxPV = vertex_.X() - pv.X(), dyPV = vertex_.Y() - pv.Y();
23 dxy_ = - dxPV * s + dyPV *
c;
27 float pzpt = p4_.Pz()/p4_.Pt();
28 dz_ = vertex_.Z() - pv.Z() - (dxPV*c + dyPV*
s) * pzpt;
40 packedCovarianceDetaDeta_ =
pack8logCeil(detadeta_,-20,-5);
41 packedCovarianceDphiDphi_ =
pack8logCeil(dphidphi_,-15,0);
42 packedCovarianceDphiDxy_ =
pack8log(dphidxy_,-17,-4);
43 packedCovarianceDlambdaDz_ =
pack8log(dlambdadz_,-17,-4);
61 if (unpackAfterwards) unpackVtx();
66 double shift = (pt<1. ? 0.1*pt : 0.1/
pt);
67 double sign = ( ( int(pt*10) % 2 == 0 ) ? 1 : -1 );
83 vertex_ =
Point(pv.X() - dxy_ *
s,
89 dphidxy_ =
unpack8log(packedCovarianceDphiDxy_,-17,-4);
90 dlambdadz_ =
unpack8log(packedCovarianceDlambdaDz_,-17,-4);
91 dptdpt_ =
unpack8log(packedCovarianceDptDpt_,-15,0);
92 detadeta_ =
unpack8log(packedCovarianceDetaDeta_,-20,-5);
93 dphidphi_ =
unpack8log(packedCovarianceDphiDphi_,-15,0);
122 return -(vertex_.X()-p.X()) *
std::sin(
float(p4_.Phi())) + (vertex_.Y()-p.Y()) *
std::cos(
float(p4_.Phi()));
126 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();
135 m(0,0)=dptdpt_/
pt()/
pt();
137 m(2,2)=dphidphi_/
pt()/
pt();
147 int numberOfPixelHits_ = packedHits_ & 0x7 ;
148 int numberOfHits_ = (packedHits_>>3) + numberOfPixelHits_;
150 int ndof = numberOfHits_+numberOfPixelHits_-5;
157 if(innerLost == validHitInFirstPixelBarrelLayer){
161 for(;i<numberOfPixelHits_; i++) {
165 for(;i<numberOfHits_;i++) {
170 case validHitInFirstPixelBarrelLayer:
172 case noLostInnerHits:
174 case oneLostInnerHit:
177 case moreLostInnerHits:
192 <<
"this Candidate has no master clone reference."
193 <<
"Can't call masterClone() method.\n";
207 <<
"this Candidate has no master clone ptr."
208 <<
"Can't call masterClonePtr() method.\n";
234 <<
"This Candidate type does not implement daughter(std::string). "
235 <<
"Please use CompositeCandidate or NamedCompositeCandidate.\n";
240 <<
"This Candidate type does not implement daughter(std::string). "
241 <<
"Please use CompositeCandidate or NamedCompositeCandidate.\n";
264 <<
"reco::ConcreteCandidate does not implement vertex covariant matrix.\n";
269 <<
"reco::ConcreteCandidate does not implement vertex covariant matrix.\n";
281 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]
bool isNonnull() const
Checks for non-null.
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
Geom::Phi< T > phi() const
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.