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 Types | Protected Member Functions | Protected Attributes | Private Types | Friends
pat::PackedCandidate Class Reference

#include <PackedCandidate.h>

Inheritance diagram for pat::PackedCandidate:
reco::Candidate

Public Types

typedef reco::CandidateCollection daughters
 collection of daughter candidates More...
 
typedef unsigned int index
 
typedef math::XYZTLorentzVector LorentzVector
 Lorentz vector. More...
 
enum  LostInnerHits { validHitInFirstPixelBarrelLayer =-1, noLostInnerHits =0, oneLostInnerHit =1, moreLostInnerHits =2 }
 Enumerator specifying the. 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

virtual const_iterator begin () const
 first daughter const_iterator More...
 
virtual iterator begin ()
 first daughter iterator More...
 
virtual const reco::TrackbestTrack () const
 return a pointer to the track if present. otherwise, return a null pointer More...
 
virtual Vector boostToCM () const
 
virtual int charge () const
 electric charge More...
 
virtual PackedCandidateclone () const
 returns a clone of the Candidate object More...
 
virtual const reco::Candidatedaughter (size_type) const
 return daughter at a given position (throws an exception) More...
 
virtual reco::Candidatedaughter (size_type)
 return daughter at a given position (throws an exception) More...
 
virtual reco::Candidatedaughter (const std::string &s)
 return daughter with a specified role name More...
 
virtual const reco::Candidatedaughter (const std::string &s) const
 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 dxyError () const
 uncertainty on dxy 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...
 
virtual float dzError () const
 uncertainty on dz More...
 
virtual const_iterator end () const
 last daughter const_iterator More...
 
virtual iterator end ()
 last daughter iterator More...
 
virtual double energy () const
 energy More...
 
virtual double et () const
 transverse energy More...
 
virtual float eta () const
 momentum pseudorapidity More...
 
virtual void fillVertexCovariance (CovarianceMatrix &v) const
 fill SMatrix More...
 
const PVAssoc fromPV () const
 
virtual bool hasMasterClone () const
 
virtual bool hasMasterClonePtr () const
 
virtual bool isCaloMuon () const
 
virtual bool isConvertedPhoton () const
 
virtual bool isElectron () const
 get a component More...
 
virtual bool isGlobalMuon () const
 
virtual bool isJet () const
 
virtual bool isMuon () const
 
virtual bool isPhoton () const
 
virtual bool isStandAloneMuon () const
 
virtual bool isTrackerMuon () const
 
virtual bool longLived () const
 is long lived? More...
 
LostInnerHits lostInnerHits () const
 
virtual float mass () const
 mass More...
 
virtual bool massConstraint () const
 do mass constraint? More...
 
virtual float massSqr () const
 mass squared More...
 
virtual const
reco::CandidateBaseRef
masterClone () const
 
virtual const reco::CandidatePtrmasterClonePtr () const
 
template<typename Ref >
Ref masterRef () const
 cast master clone reference to a concrete type More...
 
virtual Vector momentum () const
 spatial momentum vector More...
 
virtual const reco::Candidatemother (size_type) const
 return mother at a given position (throws an exception) More...
 
virtual double mt () const
 transverse mass More...
 
virtual double mtSqr () const
 transverse mass squared More...
 
virtual size_t numberOfDaughters () const
 number of daughters More...
 
int numberOfHits () const
 
virtual size_t numberOfMothers () const
 number of mothers More...
 
int numberOfPixelHits () const
 
virtual size_t numberOfSourceCandidatePtrs () const
 
virtual double p () const
 magnitude of momentum vector More...
 
virtual const LorentzVectorp4 () const
 four-momentum Lorentz vecto r More...
 
 PackedCandidate ()
 default constructor More...
 
 PackedCandidate (const reco::Candidate &c, const reco::VertexRef &pv)
 
 PackedCandidate (const PolarLorentzVector &p4, const Point &vtx, float phiAtVtx, int pdgId, const reco::VertexRef &pv)
 
 PackedCandidate (const LorentzVector &p4, const Point &vtx, float phiAtVtx, int pdgId, const reco::VertexRef &pv)
 
virtual int pdgId () const
 PDG identifier. More...
 
virtual float phi () const
 momentum azimuthal angle More...
 
virtual float phiAtVtx () const
 momentum azimuthal angle from the track (normally identical to phi()) More...
 
virtual const PolarLorentzVectorpolarP4 () const
 four-momentum Lorentz vector More...
 
virtual const reco::TrackpseudoTrack () const
 Return reference to a pseudo track made with candidate kinematics, parameterized error for eta,phi,pt and full IP covariance. More...
 
virtual float pt () const
 transverse momentum More...
 
virtual double px () const
 x coordinate of momentum vector More...
 
virtual double py () const
 y coordinate of momentum vector More...
 
virtual double pz () const
 z coordinate of momentum vector More...
 
virtual double rapidity () const
 rapidity More...
 
virtual void setCharge (int charge)
 set electric charge More...
 
void setFromPV (PVAssoc fromPV)
 
virtual void setLongLived ()
 set long lived flag More...
 
void setLostInnerHits (LostInnerHits hits)
 
virtual void setMass (double m)
 set particle mass More...
 
virtual void setMassConstraint ()
 set mass constraint flag More...
 
void setMuonID (bool isStandAlone, bool isGlobal)
 
virtual void setP4 (const LorentzVector &p4)
 set 4-momentum More...
 
virtual void setP4 (const PolarLorentzVector &p4)
 set 4-momentum More...
 
virtual void setPdgId (int pdgId)
 
virtual void setPz (double pz)
 
virtual void setStatus (int status)
 set status word More...
 
virtual void setThreeCharge (int threecharge)
 set electric charge More...
 
void setTrackHighPurity (bool highPurity)
 set to true if the track had the highPurity quality bit More...
 
virtual void setTrackProperties (const reco::Track &tk, const reco::Track::CovarianceMatrix &covariance)
 set impact parameters covariance More...
 
virtual void setTrackProperties (const reco::Track &tk)
 
virtual void setVertex (const Point &vertex)
 set vertex More...
 
void setVertexRef (const reco::VertexRef &vertexRef)
 set reference to the primary vertex More...
 
virtual reco::CandidatePtr sourceCandidatePtr (size_type i) const
 
virtual int status () const
 status word More...
 
virtual double theta () const
 momentum polar angle More...
 
virtual int threeCharge () const
 electric charge More...
 
bool trackHighPurity () const
 true if the track had the highPurity quality bit More...
 
virtual const Pointvertex () const
 vertex position More...
 
virtual double vertexChi2 () const
 chi-squares More...
 
virtual double vertexCovariance (int i, int j) const
 (i, j)-th element of error matrix, i, j = 0, ... 2 More...
 
CovarianceMatrix vertexCovariance () const
 return SMatrix More...
 
virtual double vertexNdof () const
 
virtual double vertexNormalizedChi2 () const
 chi-squared divided by n.d.o.f. More...
 
const reco::VertexRef vertexRef () const
 
virtual double vx () const
 x coordinate of vertex position More...
 
virtual double vy () const
 y coordinate of vertex position More...
 
virtual double vz () const
 z coordinate of vertex position More...
 
virtual double y () const
 rapidity More...
 
virtual ~PackedCandidate ()
 destructor More...
 
- Public Member Functions inherited from reco::Candidate
template<typename S >
daughter_iterator< S >::type beginFilter (const S &s) const
 
 Candidate ()
 default constructor More...
 
template<typename S >
daughter_iterator< S >::type endFilter (const S &s) const
 
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 void setVertex (const Point &vertex)=0
 set vertex 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 Types

enum  qualityFlagsShiftsAndMasks {
  fromPVMask = 0x3, fromPVShift = 0, trackHighPurityMask = 0x4, trackHighPurityShift =2,
  lostInnerHitsMask = 0x18, lostInnerHitsShift =3, muonFlagsMask = 0x0300, muonFlagsShift =8
}
 

Protected Member Functions

void maybeUnpackBoth () const
 
virtual bool overlap (const reco::Candidate &) const
 check overlap with another Candidate More...
 
void pack (bool unpackAfterwards=true)
 
void packBoth ()
 
void packVtx (bool unpackAfterwards=true)
 
void unpack () const
 
void unpackTrk () const
 
void unpackVtx () const
 

Protected Attributes

float detadeta_
 
float dlambdadz_
 
float dphi_
 
float dphidphi_
 
float dphidxy_
 
float dptdpt_
 
float dxy_
 
float dxydxy_
 IP covariance. More...
 
float dxydz_
 
float dz_
 
float dzdz_
 
uint8_t normalizedChi2_
 track quality information More...
 
PolarLorentzVector p4_
 the four vector More...
 
LorentzVector p4c_
 
int8_t packedCovarianceDetaDeta_
 
int8_t packedCovarianceDlambdaDz_
 
int8_t packedCovarianceDphiDphi_
 
int8_t packedCovarianceDphiDxy_
 
int8_t packedCovarianceDptDpt_
 
uint16_t packedCovarianceDxyDxy_
 
uint16_t packedCovarianceDxyDz_
 
uint16_t packedCovarianceDzDz_
 
uint16_t packedDPhi_
 
uint16_t packedDxy_
 
uint16_t packedDz_
 
uint16_t packedEta_
 
uint8_t packedHits_
 
uint16_t packedM_
 
uint16_t packedPhi_
 
uint16_t packedPt_
 
int pdgId_
 PDG identifier. More...
 
edm::Ref< reco::VertexCollectionpvRef_
 Ref to primary vertex. More...
 
uint16_t qualityFlags_
 
reco::Track track_
 reco::Track More...
 
bool unpacked_
 
bool unpackedTrk_
 
bool unpackedVtx_
 
Point vertex_
 vertex position More...
 

Private Types

typedef
reco::candidate::const_iterator_imp_specific
< daughters
const_iterator_imp_specific
 
typedef
reco::candidate::iterator_imp_specific
< daughters
iterator_imp_specific
 

Friends

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

Detailed Description

Definition at line 15 of file PackedCandidate.h.

Member Typedef Documentation

Definition at line 443 of file PackedCandidate.h.

collection of daughter candidates

Definition at line 18 of file PackedCandidate.h.

typedef unsigned int pat::PackedCandidate::index

Definition at line 28 of file PackedCandidate.h.

Definition at line 445 of file PackedCandidate.h.

Lorentz vector.

Definition at line 20 of file PackedCandidate.h.

point in the space

Definition at line 24 of file PackedCandidate.h.

Lorentz vector.

Definition at line 22 of file PackedCandidate.h.

point in the space

Definition at line 26 of file PackedCandidate.h.

Member Enumeration Documentation

Enumerator specifying the.

Enumerator
validHitInFirstPixelBarrelLayer 
noLostInnerHits 
oneLostInnerHit 
moreLostInnerHits 

Definition at line 250 of file PackedCandidate.h.

Constructor & Destructor Documentation

pat::PackedCandidate::PackedCandidate ( )
inline

default constructor

Definition at line 31 of file PackedCandidate.h.

Referenced by clone().

32  : p4_(0,0,0,0), p4c_(0,0,0,0), vertex_(0,0,0), dphi_(0), pdgId_(0), qualityFlags_(0), unpacked_(false), unpackedVtx_(true), unpackedTrk_(false), dxydxy_(0),dzdz_(0),dxydz_(0),dlambdadz_(0),dphidxy_(0),packedHits_(0),normalizedChi2_(0) { }
PolarLorentzVector p4_
the four vector
Point vertex_
vertex position
uint8_t normalizedChi2_
track quality information
float dxydxy_
IP covariance.
int pdgId_
PDG identifier.
pat::PackedCandidate::PackedCandidate ( const reco::Candidate c,
const reco::VertexRef pv 
)
inlineexplicit

Definition at line 33 of file PackedCandidate.h.

References packBoth().

34  : p4_(c.pt(), c.eta(), c.phi(), c.mass()), p4c_(p4_), vertex_(c.vertex()), dphi_(0), pdgId_(c.pdgId()), qualityFlags_(0), pvRef_(pv), unpacked_(true) , unpackedVtx_(true), unpackedTrk_(false), dxydxy_(0),dzdz_(0),dxydz_(0),dlambdadz_(0),dphidxy_(0),packedHits_(0),normalizedChi2_(0) { packBoth(); }
virtual float mass() const =0
mass
virtual float eta() const =0
momentum pseudorapidity
virtual float phi() const =0
momentum azimuthal angle
PolarLorentzVector p4_
the four vector
virtual float pt() const =0
transverse momentum
virtual const Point & vertex() const =0
vertex position
Point vertex_
vertex position
virtual int pdgId() const =0
PDG identifier.
uint8_t normalizedChi2_
track quality information
float dxydxy_
IP covariance.
edm::Ref< reco::VertexCollection > pvRef_
Ref to primary vertex.
int pdgId_
PDG identifier.
pat::PackedCandidate::PackedCandidate ( const PolarLorentzVector p4,
const Point vtx,
float  phiAtVtx,
int  pdgId,
const reco::VertexRef pv 
)
inlineexplicit

Definition at line 36 of file PackedCandidate.h.

References packBoth().

PolarLorentzVector p4_
the four vector
Point vertex_
vertex position
double deltaPhi(double phi1, double phi2)
Definition: deltaPhi.h:12
uint8_t normalizedChi2_
track quality information
float dxydxy_
IP covariance.
edm::Ref< reco::VertexCollection > pvRef_
Ref to primary vertex.
virtual float phiAtVtx() const
momentum azimuthal angle from the track (normally identical to phi())
int pdgId_
PDG identifier.
virtual const LorentzVector & p4() const
four-momentum Lorentz vecto r
virtual int pdgId() const
PDG identifier.
pat::PackedCandidate::PackedCandidate ( const LorentzVector p4,
const Point vtx,
float  phiAtVtx,
int  pdgId,
const reco::VertexRef pv 
)
inlineexplicit

Definition at line 39 of file PackedCandidate.h.

References packBoth().

40  : p4_(p4.Pt(), p4.Eta(), p4.Phi(), p4.M()), p4c_(p4), vertex_(vtx), dphi_(reco::deltaPhi(phiAtVtx,p4_.phi())), pdgId_(pdgId), qualityFlags_(0), pvRef_(pv), unpacked_(true), unpackedVtx_(true), unpackedTrk_(false),dxydxy_(0),dzdz_(0),dxydz_(0),dlambdadz_(0),dphidxy_(0),packedHits_(0),normalizedChi2_(0) { packBoth(); }
PolarLorentzVector p4_
the four vector
Point vertex_
vertex position
double deltaPhi(double phi1, double phi2)
Definition: deltaPhi.h:12
uint8_t normalizedChi2_
track quality information
float dxydxy_
IP covariance.
edm::Ref< reco::VertexCollection > pvRef_
Ref to primary vertex.
virtual float phiAtVtx() const
momentum azimuthal angle from the track (normally identical to phi())
int pdgId_
PDG identifier.
virtual const LorentzVector & p4() const
four-momentum Lorentz vecto r
virtual int pdgId() const
PDG identifier.
pat::PackedCandidate::~PackedCandidate ( )
virtual

destructor

Definition at line 111 of file PackedCandidate.cc.

111 { }

Member Function Documentation

pat::PackedCandidate::const_iterator pat::PackedCandidate::begin ( void  ) const
virtual

first daughter const_iterator

Implements reco::Candidate.

Definition at line 184 of file PackedCandidate.cc.

184  {
186 }
candidate::const_iterator const_iterator
Definition: Candidate.h:35
reco::candidate::const_iterator_imp_specific< daughters > const_iterator_imp_specific
pat::PackedCandidate::iterator pat::PackedCandidate::begin ( void  )
virtual

first daughter iterator

Implements reco::Candidate.

Definition at line 192 of file PackedCandidate.cc.

192  {
193  return iterator( new iterator_imp_specific );
194 }
candidate::iterator iterator
Definition: Candidate.h:36
reco::candidate::iterator_imp_specific< daughters > iterator_imp_specific
virtual const reco::Track* pat::PackedCandidate::bestTrack ( ) const
inlinevirtual

return a pointer to the track if present. otherwise, return a null pointer

Reimplemented from reco::Candidate.

Definition at line 235 of file PackedCandidate.h.

References packedHits_, track_, unpackedTrk_, and unpackTrk().

235  {
236  if (packedHits_!=0) {
237  if (!unpackedTrk_) unpackTrk();
238  return &track_;
239  }
240  else
241  return nullptr;
242  }
reco::Track track_
reco::Track
virtual Vector pat::PackedCandidate::boostToCM ( ) const
inlinevirtual

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

Implements reco::Candidate.

Definition at line 103 of file PackedCandidate.h.

References p4c_, unpack(), and unpacked_.

103 { if (!unpacked_) unpack(); return p4c_.BoostToCM(); }
virtual int pat::PackedCandidate::charge ( ) const
inlinevirtual

electric charge

Implements reco::Candidate.

Definition at line 79 of file PackedCandidate.h.

References funct::abs(), and pdgId_.

Referenced by pat::PATTrackAndVertexUnpacker::produce(), and threeCharge().

79  {
80  switch (abs(pdgId_)) {
81  case 211: return (pdgId_>0)-(pdgId_<0);
82  case 11: return (-1)*(pdgId_>0)-(pdgId_<0); //e
83  case 13: return (-1)*(pdgId_>0)-(pdgId_<0); //mu
84  case 15: return (-1)*(pdgId_>0)-(pdgId_<0); //tau
85  case 24: return (-1)*(pdgId_>0)-(pdgId_<0); //W
86  default: return 0; //FIXME: charge is not defined
87  }
88  }
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
int pdgId_
PDG identifier.
virtual PackedCandidate* pat::PackedCandidate::clone ( void  ) const
inlinevirtual

returns a clone of the Candidate object

Implements reco::Candidate.

Definition at line 292 of file PackedCandidate.h.

References PackedCandidate().

292  {
293  return new PackedCandidate( *this );
294  }
PackedCandidate()
default constructor
const reco::Candidate * pat::PackedCandidate::daughter ( size_type  ) const
virtual

return daughter at a given position (throws an exception)

Implements reco::Candidate.

Definition at line 234 of file PackedCandidate.cc.

234  {
235  return 0;
236 }
reco::Candidate * pat::PackedCandidate::daughter ( size_type  )
virtual

return daughter at a given position (throws an exception)

Implements reco::Candidate.

Definition at line 256 of file PackedCandidate.cc.

256  {
257  return 0;
258 }
reco::Candidate * pat::PackedCandidate::daughter ( const std::string &  s)
virtual

return daughter with a specified role name

Implements reco::Candidate.

Definition at line 248 of file PackedCandidate.cc.

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

248  {
250  << "This Candidate type does not implement daughter(std::string). "
251  << "Please use CompositeCandidate or NamedCompositeCandidate.\n";
252 }
const reco::Candidate * pat::PackedCandidate::daughter ( const std::string &  s) const
virtual

return daughter with a specified role name

Implements reco::Candidate.

Definition at line 242 of file PackedCandidate.cc.

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

242  {
244  << "This Candidate type does not implement daughter(std::string). "
245  << "Please use CompositeCandidate or NamedCompositeCandidate.\n";
246 }
virtual float pat::PackedCandidate::dxy ( ) const
inlinevirtual

dxy with respect to the PV ref

Definition at line 217 of file PackedCandidate.h.

References dxy_, and maybeUnpackBoth().

Referenced by HTauTauElectron.HTauTauElectron::__str__(), and PuppiProducer::produce().

217 { maybeUnpackBoth(); return dxy_; }
void maybeUnpackBoth() const
float pat::PackedCandidate::dxy ( const Point p) const
virtual

dxy with respect to another point

Definition at line 114 of file PackedCandidate.cc.

References funct::cos(), and funct::sin().

Referenced by HTauTauElectron.HTauTauElectron::__str__().

114  {
115  maybeUnpackBoth();
116  return -(vertex_.X()-p.X()) * std::sin(float(p4_.Phi())) + (vertex_.Y()-p.Y()) * std::cos(float(p4_.Phi()));
117 }
void maybeUnpackBoth() const
Sin< T >::type sin(const T &t)
Definition: Sin.h:22
PolarLorentzVector p4_
the four vector
Cos< T >::type cos(const T &t)
Definition: Cos.h:22
Point vertex_
vertex position
virtual double p() const
magnitude of momentum vector
virtual float pat::PackedCandidate::dxyError ( ) const
inlinevirtual

uncertainty on dxy

Definition at line 228 of file PackedCandidate.h.

References dxydxy_, maybeUnpackBoth(), and mathSSE::sqrt().

228 { maybeUnpackBoth(); return sqrt(dxydxy_); }
void maybeUnpackBoth() const
T sqrt(T t)
Definition: SSEVec.h:48
float dxydxy_
IP covariance.
virtual float pat::PackedCandidate::dz ( ) const
inlinevirtual

dz with respect to the PV ref

Definition at line 219 of file PackedCandidate.h.

References dz_, and maybeUnpackBoth().

Referenced by HTauTauElectron.HTauTauElectron::__str__(), HTauTauElectron.HTauTauElectron::looseIdForEleTau(), and PuppiProducer::produce().

219 { maybeUnpackBoth(); return dz_; }
void maybeUnpackBoth() const
float pat::PackedCandidate::dz ( const Point p) const
virtual

dz with respect to another point

Definition at line 118 of file PackedCandidate.cc.

References funct::cos(), and funct::sin().

Referenced by HTauTauElectron.HTauTauElectron::__str__(), and HTauTauElectron.HTauTauElectron::looseIdForEleTau().

118  {
119  maybeUnpackBoth();
120  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();
121 }
void maybeUnpackBoth() const
Sin< T >::type sin(const T &t)
Definition: Sin.h:22
PolarLorentzVector p4_
the four vector
Cos< T >::type cos(const T &t)
Definition: Cos.h:22
Point vertex_
vertex position
virtual double p() const
magnitude of momentum vector
virtual float pat::PackedCandidate::dzError ( ) const
inlinevirtual

uncertainty on dz

Definition at line 226 of file PackedCandidate.h.

References dzdz_, maybeUnpackBoth(), and mathSSE::sqrt().

226 { maybeUnpackBoth(); return sqrt(dzdz_); }
void maybeUnpackBoth() const
T sqrt(T t)
Definition: SSEVec.h:48
pat::PackedCandidate::const_iterator pat::PackedCandidate::end ( void  ) const
virtual

last daughter const_iterator

Implements reco::Candidate.

Definition at line 188 of file PackedCandidate.cc.

Referenced by Types.LuminosityBlockRange::cppID(), and Types.EventRange::cppID().

188  {
190 }
candidate::const_iterator const_iterator
Definition: Candidate.h:35
reco::candidate::const_iterator_imp_specific< daughters > const_iterator_imp_specific
pat::PackedCandidate::iterator pat::PackedCandidate::end ( void  )
virtual

last daughter iterator

Implements reco::Candidate.

Definition at line 196 of file PackedCandidate.cc.

Referenced by Types.LuminosityBlockRange::cppID(), and Types.EventRange::cppID().

196  {
197  return iterator( new iterator_imp_specific );
198 }
candidate::iterator iterator
Definition: Candidate.h:36
reco::candidate::iterator_imp_specific< daughters > iterator_imp_specific
virtual double pat::PackedCandidate::energy ( ) const
inlinevirtual

energy

Implements reco::Candidate.

Definition at line 107 of file PackedCandidate.h.

References p4c_, unpack(), and unpacked_.

107 { if (!unpacked_) unpack(); return p4c_.E(); }
virtual double pat::PackedCandidate::et ( ) const
inlinevirtual

transverse energy

Implements reco::Candidate.

Definition at line 109 of file PackedCandidate.h.

References p4_, unpack(), and unpacked_.

109 { if (!unpacked_) unpack(); return p4_.Et(); }
PolarLorentzVector p4_
the four vector
virtual float pat::PackedCandidate::eta ( ) const
inlinevirtual

momentum pseudorapidity

Implements reco::Candidate.

Definition at line 140 of file PackedCandidate.h.

References p4_, unpack(), and unpacked_.

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

140 { if (!unpacked_) unpack(); return p4_.Eta(); }
PolarLorentzVector p4_
the four vector
void pat::PackedCandidate::fillVertexCovariance ( CovarianceMatrix v) const
virtual

fill SMatrix

Implements reco::Candidate.

Definition at line 277 of file PackedCandidate.cc.

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

Referenced by vertexCovariance().

277  {
279  << "reco::ConcreteCandidate does not implement vertex covariant matrix.\n";
280 }
const PVAssoc pat::PackedCandidate::fromPV ( ) const
inline
bool pat::PackedCandidate::hasMasterClone ( ) const
virtual

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 206 of file PackedCandidate.cc.

206  {
207  return false;
208 }
bool pat::PackedCandidate::hasMasterClonePtr ( ) const
virtual

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 210 of file PackedCandidate.cc.

210  {
211  return false;
212 }
virtual bool pat::PackedCandidate::isCaloMuon ( ) const
inlinevirtual

Implements reco::Candidate.

Definition at line 382 of file PackedCandidate.h.

382 { return false; }
virtual bool pat::PackedCandidate::isConvertedPhoton ( ) const
inlinevirtual

Implements reco::Candidate.

Definition at line 384 of file PackedCandidate.h.

384 { return false; }
virtual bool pat::PackedCandidate::isElectron ( ) const
inlinevirtual

get a component

Implements reco::Candidate.

Definition at line 377 of file PackedCandidate.h.

377 { return false; }
virtual bool pat::PackedCandidate::isGlobalMuon ( ) const
inlinevirtual
virtual bool pat::PackedCandidate::isJet ( ) const
inlinevirtual

Implements reco::Candidate.

Definition at line 385 of file PackedCandidate.h.

385 { return false; }
virtual bool pat::PackedCandidate::isMuon ( ) const
inlinevirtual

Implements reco::Candidate.

Definition at line 378 of file PackedCandidate.h.

378 { return false; }
virtual bool pat::PackedCandidate::isPhoton ( ) const
inlinevirtual

Implements reco::Candidate.

Definition at line 383 of file PackedCandidate.h.

383 { return false; }
virtual bool pat::PackedCandidate::isStandAloneMuon ( ) const
inlinevirtual
virtual bool pat::PackedCandidate::isTrackerMuon ( ) const
inlinevirtual

Implements reco::Candidate.

Definition at line 381 of file PackedCandidate.h.

381 { return false; }
bool pat::PackedCandidate::longLived ( ) const
virtual

is long lived?

Implements reco::Candidate.

Definition at line 283 of file PackedCandidate.cc.

283 {return false;}
LostInnerHits pat::PackedCandidate::lostInnerHits ( ) const
inline
virtual float pat::PackedCandidate::mass ( ) const
inlinevirtual

mass

Implements reco::Candidate.

Definition at line 111 of file PackedCandidate.h.

References p4_, unpack(), and unpacked_.

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

111 { if (!unpacked_) unpack(); return p4_.M(); }
PolarLorentzVector p4_
the four vector
bool pat::PackedCandidate::massConstraint ( ) const
virtual

do mass constraint?

Implements reco::Candidate.

Definition at line 285 of file PackedCandidate.cc.

285 {return false;}
virtual float pat::PackedCandidate::massSqr ( ) const
inlinevirtual

mass squared

Implements reco::Candidate.

Definition at line 113 of file PackedCandidate.h.

References p4_, unpack(), and unpacked_.

113 { if (!unpacked_) unpack(); return p4_.M()*p4_.M(); }
PolarLorentzVector p4_
the four vector
const reco::CandidateBaseRef & pat::PackedCandidate::masterClone ( ) const
virtual

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

Implements reco::Candidate.

Definition at line 200 of file PackedCandidate.cc.

References edm::hlt::Exception.

Referenced by masterRef().

200  {
201  throw cms::Exception("Invalid Reference")
202  << "this Candidate has no master clone reference."
203  << "Can't call masterClone() method.\n";
204 }
const reco::CandidatePtr & pat::PackedCandidate::masterClonePtr ( ) const
virtual

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

Implements reco::Candidate.

Definition at line 215 of file PackedCandidate.cc.

References edm::hlt::Exception.

215  {
216  throw cms::Exception("Invalid Reference")
217  << "this Candidate has no master clone ptr."
218  << "Can't call masterClonePtr() method.\n";
219 }
template<typename Ref >
Ref pat::PackedCandidate::masterRef ( ) const
inline

cast master clone reference to a concrete type

Definition at line 329 of file PackedCandidate.h.

References masterClone().

329 { return masterClone().template castTo<Ref>(); }
virtual const reco::CandidateBaseRef & masterClone() const
void pat::PackedCandidate::maybeUnpackBoth ( ) const
inlineprotected
virtual Vector pat::PackedCandidate::momentum ( ) const
inlinevirtual

spatial momentum vector

Implements reco::Candidate.

Definition at line 100 of file PackedCandidate.h.

References p4c_, unpack(), and unpacked_.

100 { if (!unpacked_) unpack(); return p4c_.Vect(); }
const reco::Candidate * pat::PackedCandidate::mother ( size_type  ) const
virtual

return mother at a given position (throws an exception)

Implements reco::Candidate.

Definition at line 238 of file PackedCandidate.cc.

238  {
239  return 0;
240 }
virtual double pat::PackedCandidate::mt ( ) const
inlinevirtual

transverse mass

Implements reco::Candidate.

Definition at line 116 of file PackedCandidate.h.

References p4_, unpack(), and unpacked_.

116 { if (!unpacked_) unpack(); return p4_.Mt(); }
PolarLorentzVector p4_
the four vector
virtual double pat::PackedCandidate::mtSqr ( ) const
inlinevirtual

transverse mass squared

Implements reco::Candidate.

Definition at line 118 of file PackedCandidate.h.

References p4_, unpack(), and unpacked_.

118 { if (!unpacked_) unpack(); return p4_.Mt2(); }
PolarLorentzVector p4_
the four vector
size_t pat::PackedCandidate::numberOfDaughters ( ) const
virtual

number of daughters

Implements reco::Candidate.

Definition at line 221 of file PackedCandidate.cc.

221  {
222  return 0;
223 }
int pat::PackedCandidate::numberOfHits ( void  ) const
inline

Definition at line 195 of file PackedCandidate.h.

References numberOfPixelHits(), and packedHits_.

Referenced by pat::PATTrackAndVertexUnpacker::produce().

195 { return (packedHits_ >> 3) + numberOfPixelHits(); }
int numberOfPixelHits() const
size_t pat::PackedCandidate::numberOfMothers ( ) const
virtual

number of mothers

Implements reco::Candidate.

Definition at line 225 of file PackedCandidate.cc.

225  {
226  return 0;
227 }
int pat::PackedCandidate::numberOfPixelHits ( ) const
inline

Definition at line 194 of file PackedCandidate.h.

References packedHits_.

Referenced by numberOfHits().

194 { return packedHits_ & 0x7; }
virtual size_t pat::PackedCandidate::numberOfSourceCandidatePtrs ( ) const
inlinevirtual

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

Implements reco::Candidate.

Definition at line 71 of file PackedCandidate.h.

71 {return 0;}
bool pat::PackedCandidate::overlap ( const reco::Candidate o) const
protectedvirtual

check overlap with another Candidate

Implements reco::Candidate.

Definition at line 229 of file PackedCandidate.cc.

References reco::Candidate::charge(), reco::Candidate::p4(), p4, and reco::Candidate::vertex().

229  {
230  return p4() == o.p4() && vertex() == o.vertex() && charge() == o.charge();
231 // return p4() == o.p4() && charge() == o.charge();
232 }
virtual int charge() const
electric charge
virtual const Point & vertex() const =0
vertex position
virtual int charge() const =0
electric charge
virtual const Point & vertex() const
vertex position
virtual const LorentzVector & p4() const
four-momentum Lorentz vecto r
virtual const LorentzVector & p4() const =0
four-momentum Lorentz vector
virtual double pat::PackedCandidate::p ( ) const
inlinevirtual

magnitude of momentum vector

Implements reco::Candidate.

Definition at line 105 of file PackedCandidate.h.

References p4c_, unpack(), and unpacked_.

105 { if (!unpacked_) unpack(); return p4c_.P(); }
virtual const LorentzVector& pat::PackedCandidate::p4 ( ) const
inlinevirtual

four-momentum Lorentz vecto r

Implements reco::Candidate.

Definition at line 96 of file PackedCandidate.h.

References p4c_, unpack(), and unpacked_.

Referenced by Tau.Tau::dxy(), Tau.Tau::dz(), Jet.Jet::jetID(), and setP4().

96 { if (!unpacked_) unpack(); return p4c_; }
void pat::PackedCandidate::pack ( bool  unpackAfterwards = true)
protected

Definition at line 10 of file PackedCandidate.cc.

References MiniFloatConverter::float32to16(), bookConverter::max, and timeUnitHelper::unpack().

Referenced by pyrootRender.interactiveRender::draw(), packBoth(), and setMass().

10  {
12  packedEta_ = int16_t(std::round(p4_.Eta()/6.0f*std::numeric_limits<int16_t>::max()));
13  packedPhi_ = int16_t(std::round(p4_.Phi()/3.2f*std::numeric_limits<int16_t>::max()));
15  if (unpackAfterwards) unpack(); // force the values to match with the packed ones
16 }
PolarLorentzVector p4_
the four vector
static uint16_t float32to16(float x)
Definition: libminifloat.h:15
void pat::PackedCandidate::packBoth ( )
inlineprotected

Definition at line 398 of file PackedCandidate.h.

References pack(), packVtx(), unpack(), and unpackVtx().

Referenced by PackedCandidate(), setP4(), setPz(), and setTrackProperties().

398 { pack(false); packVtx(false); unpack(); unpackVtx(); } // do it this way, so that we don't loose precision on the angles before computing dxy,dz
void unpackVtx() const
void packVtx(bool unpackAfterwards=true)
void pack(bool unpackAfterwards=true)
void pat::PackedCandidate::packVtx ( bool  unpackAfterwards = true)
protected

Definition at line 18 of file PackedCandidate.cc.

References EnergyCorrector::c, funct::cos(), f, MiniFloatConverter::float32to16(), bookConverter::max, logintpack::pack8log(), logintpack::pack8logCeil(), MetAnalyzer::pv(), alignCSCRings::s, and funct::sin().

Referenced by packBoth(), setVertex(), and setVertexRef().

18  {
19  Point pv = pvRef_.isNonnull() ? pvRef_->position() : Point();
20  float dxPV = vertex_.X() - pv.X(), dyPV = vertex_.Y() - pv.Y(); //, rPV = std::hypot(dxPV, dyPV);
21  float s = std::sin(float(p4_.Phi())+dphi_), c = std::cos(float(p4_.Phi()+dphi_)); // not the fastest option, but we're in reduced precision already, so let's avoid more roundoffs
22  dxy_ = - dxPV * s + dyPV * c;
23  // if we want to go back to the full x,y,z we need to store also
24  // float dl = dxPV * c + dyPV * s;
25  // float xRec = - dxy_ * s + dl * c, yRec = dxy_ * c + dl * s;
26  float pzpt = p4_.Pz()/p4_.Pt();
27  dz_ = vertex_.Z() - pv.Z() - (dxPV*c + dyPV*s) * pzpt;
29  packedDz_ = pvRef_.isNonnull() ? MiniFloatConverter::float32to16(dz_*100) : int16_t(std::round(dz_/40.f*std::numeric_limits<int16_t>::max()));
30  packedDPhi_ = int16_t(std::round(dphi_/3.2f*std::numeric_limits<int16_t>::max()));
34 // packedCovarianceDxyDxy_ = pack8log(dxydxy_,-15,-1); // MiniFloatConverter::float32to16(dxydxy_*10000.);
35 // packedCovarianceDxyDz_ = pack8log(dxydz_,-20,-1); //MiniFloatConverter::float32to16(dxydz_*10000.);
36 // packedCovarianceDzDz_ = pack8log(dzdz_,-13,-1); //MiniFloatConverter::float32to16(dzdz_*10000.);
37 
41  packedCovarianceDphiDxy_ = pack8log(dphidxy_,-17,-4); // MiniFloatConverter::float32to16(dphidxy_*10000.);
42  packedCovarianceDlambdaDz_ = pack8log(dlambdadz_,-17,-4); // MiniFloatConverter::float32to16(dlambdadz_*10000.);
43 
44  /*packedCovarianceDptDpt_ = pack8logCeil(dptdpt_,-15,5,32);
45  packedCovarianceDetaDeta_ = pack8logCeil(detadeta_,-20,0,32);
46  packedCovarianceDphiDphi_ = pack8logCeil(dphidphi_,-15,5,32);
47  packedCovarianceDphiDxy_ = pack8log(dphidxy_,-17,-4); // MiniFloatConverter::float32to16(dphidxy_*10000.);
48  packedCovarianceDlambdaDz_ = pack8log(dlambdadz_,-17,-4); // MiniFloatConverter::float32to16(dlambdadz_*10000.);
49 
50 */
51 /* packedCovarianceDphiDxy_ = MiniFloatConverter::float32to16(dphidxy_*10000.);
52  packedCovarianceDlambdaDz_ = MiniFloatConverter::float32to16(dlambdadz_*10000.);
53  packedCovarianceDetaDeta_ = MiniFloatConverter::float32to16(detadeta_*10000.);
54  packedCovarianceDphiDphi_ = MiniFloatConverter::float32to16(dphidphi_*10000.);
55  packedCovarianceDptDpt_ = MiniFloatConverter::float32to16(dptdpt_*10000.);
56 */
57 // packedCovarianceDphiDxy_ = pack8log(dphidxy_,-17,-4); // MiniFloatConverter::float32to16(dphidxy_*10000.);
58 // packedCovarianceDlambdaDz_ = pack8log(dlambdadz_,-17,-4); // MiniFloatConverter::float32to16(dlambdadz_*10000.);
59 
60  if (unpackAfterwards) unpackVtx();
61 }
bool isNonnull() const
Checks for non-null.
Definition: Ref.h:250
int8_t pack8log(double x, double lmin, double lmax, uint8_t base=128)
Definition: liblogintpack.h:20
Sin< T >::type sin(const T &t)
Definition: Sin.h:22
math::XYZPoint Point
point in the space
void unpackVtx() const
PolarLorentzVector p4_
the four vector
int8_t pack8logCeil(double x, double lmin, double lmax, uint8_t base=128)
Definition: liblogintpack.h:8
static uint16_t float32to16(float x)
Definition: libminifloat.h:15
Cos< T >::type cos(const T &t)
Definition: Cos.h:22
math::XYZPoint Point
double f[11][100]
Point vertex_
vertex position
float dxydxy_
IP covariance.
edm::Ref< reco::VertexCollection > pvRef_
Ref to primary vertex.
uint16_t packedCovarianceDxyDxy_
virtual int pat::PackedCandidate::pdgId ( ) const
inlinevirtual

PDG identifier.

Implements reco::Candidate.

Definition at line 271 of file PackedCandidate.h.

References pdgId_.

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

271 { return pdgId_; }
int pdgId_
PDG identifier.
virtual float pat::PackedCandidate::phi ( ) const
inlinevirtual

momentum azimuthal angle

Implements reco::Candidate.

Definition at line 128 of file PackedCandidate.h.

References p4_, unpack(), and unpacked_.

Referenced by Particle.Particle::__str__().

128 { if (!unpacked_) unpack(); return p4_.Phi(); }
PolarLorentzVector p4_
the four vector
virtual float pat::PackedCandidate::phiAtVtx ( ) const
inlinevirtual

momentum azimuthal angle from the track (normally identical to phi())

Definition at line 130 of file PackedCandidate.h.

References dphi_, M_PI, maybeUnpackBoth(), p4_, and run_regression::ret.

130  {
131  maybeUnpackBoth();
132  float ret = p4_.Phi() + dphi_;
133  while (ret > float(M_PI)) ret -= 2*float(M_PI);
134  while (ret < -float(M_PI)) ret += 2*float(M_PI);
135  return ret;
136  }
void maybeUnpackBoth() const
PolarLorentzVector p4_
the four vector
#define M_PI
virtual const PolarLorentzVector& pat::PackedCandidate::polarP4 ( ) const
inlinevirtual

four-momentum Lorentz vector

Implements reco::Candidate.

Definition at line 98 of file PackedCandidate.h.

References p4_, unpack(), and unpacked_.

98 { if (!unpacked_) unpack(); return p4_; }
PolarLorentzVector p4_
the four vector
virtual const reco::Track& pat::PackedCandidate::pseudoTrack ( ) const
inlinevirtual

Return reference to a pseudo track made with candidate kinematics, parameterized error for eta,phi,pt and full IP covariance.

Definition at line 232 of file PackedCandidate.h.

References track_, unpackedTrk_, and unpackTrk().

Referenced by pat::PATTrackAndVertexUnpacker::produce().

232 { if (!unpackedTrk_) unpackTrk(); return track_; }
reco::Track track_
reco::Track
virtual float pat::PackedCandidate::pt ( ) const
inlinevirtual
virtual double pat::PackedCandidate::px ( ) const
inlinevirtual

x coordinate of momentum vector

Implements reco::Candidate.

Definition at line 120 of file PackedCandidate.h.

References p4c_, unpack(), and unpacked_.

120 { if (!unpacked_) unpack(); return p4c_.Px(); }
virtual double pat::PackedCandidate::py ( ) const
inlinevirtual

y coordinate of momentum vector

Implements reco::Candidate.

Definition at line 122 of file PackedCandidate.h.

References p4c_, unpack(), and unpacked_.

122 { if (!unpacked_) unpack(); return p4c_.Py(); }
virtual double pat::PackedCandidate::pz ( ) const
inlinevirtual

z coordinate of momentum vector

Implements reco::Candidate.

Definition at line 124 of file PackedCandidate.h.

References p4c_, unpack(), and unpacked_.

Referenced by setPz().

124 { if (!unpacked_) unpack(); return p4c_.Pz(); }
virtual double pat::PackedCandidate::rapidity ( ) const
inlinevirtual

rapidity

Implements reco::Candidate.

Definition at line 142 of file PackedCandidate.h.

References p4_, unpack(), and unpacked_.

142 { if (!unpacked_) unpack(); return p4_.Rapidity(); }
PolarLorentzVector p4_
the four vector
virtual void pat::PackedCandidate::setCharge ( int  charge)
inlinevirtual

set electric charge

Implements reco::Candidate.

Definition at line 90 of file PackedCandidate.h.

90 {}
void pat::PackedCandidate::setFromPV ( PVAssoc  fromPV)
inline
virtual void pat::PackedCandidate::setLongLived ( )
inlinevirtual

set long lived flag

Implements reco::Candidate.

Definition at line 281 of file PackedCandidate.h.

281 {} /*FIXME*/
void pat::PackedCandidate::setLostInnerHits ( LostInnerHits  hits)
inline

Definition at line 259 of file PackedCandidate.h.

References lostInnerHitsMask, lostInnerHitsShift, and qualityFlags_.

259  {
260  int lost = hits; if (lost > 2) lost = 2; // protection against misuse
261  lost++; // shift so it's 0 .. 3 instead of (-1) .. 2
263  }
virtual void pat::PackedCandidate::setMass ( double  m)
inlinevirtual

set particle mass

Implements reco::Candidate.

Definition at line 158 of file PackedCandidate.h.

References m, p4_, pack(), unpack(), and unpacked_.

158  {
159  if (!unpacked_) unpack();
160  p4_ = PolarLorentzVector(p4_.Pt(), p4_.Eta(), p4_.Phi(), m);
161  pack();
162  }
math::PtEtaPhiMLorentzVector PolarLorentzVector
Lorentz vector.
PolarLorentzVector p4_
the four vector
void pack(bool unpackAfterwards=true)
virtual void pat::PackedCandidate::setMassConstraint ( )
inlinevirtual

set mass constraint flag

Implements reco::Candidate.

Definition at line 287 of file PackedCandidate.h.

287 {} /*FIXME*/
void pat::PackedCandidate::setMuonID ( bool  isStandAlone,
bool  isGlobal 
)
inline

Definition at line 265 of file PackedCandidate.h.

References muonFlagsMask, muonFlagsShift, and qualityFlags_.

265  {
266  int16_t muonFlags = isStandAlone | (2*isGlobal);
268  }
virtual void pat::PackedCandidate::setP4 ( const LorentzVector p4)
inlinevirtual

set 4-momentum

Implements reco::Candidate.

Definition at line 146 of file PackedCandidate.h.

References maybeUnpackBoth(), p4_, and packBoth().

146  {
147  maybeUnpackBoth(); // changing px,py,pz changes also mapping between dxy,dz and x,y,z
148  p4_ = PolarLorentzVector(p4.Pt(), p4.Eta(), p4.Phi(), p4.M());
149  packBoth();
150  }
void maybeUnpackBoth() const
math::PtEtaPhiMLorentzVector PolarLorentzVector
Lorentz vector.
PolarLorentzVector p4_
the four vector
virtual const LorentzVector & p4() const
four-momentum Lorentz vecto r
virtual void pat::PackedCandidate::setP4 ( const PolarLorentzVector p4)
inlinevirtual

set 4-momentum

Definition at line 152 of file PackedCandidate.h.

References maybeUnpackBoth(), p4(), p4_, and packBoth().

152  {
153  maybeUnpackBoth(); // changing px,py,pz changes also mapping between dxy,dz and x,y,z
154  p4_ = p4;
155  packBoth();
156  }
void maybeUnpackBoth() const
PolarLorentzVector p4_
the four vector
virtual const LorentzVector & p4() const
four-momentum Lorentz vecto r
virtual void pat::PackedCandidate::setPdgId ( int  pdgId)
inlinevirtual

Implements reco::Candidate.

Definition at line 273 of file PackedCandidate.h.

References pdgId(), and pdgId_.

273 { pdgId_ = pdgId; }
int pdgId_
PDG identifier.
virtual int pdgId() const
PDG identifier.
virtual void pat::PackedCandidate::setPz ( double  pz)
inlinevirtual

Implements reco::Candidate.

Definition at line 163 of file PackedCandidate.h.

References maybeUnpackBoth(), p4_, p4c_, packBoth(), and pz().

163  {
164  maybeUnpackBoth(); // changing px,py,pz changes also mapping between dxy,dz and x,y,z
165  p4c_ = LorentzVector(p4c_.Px(), p4c_.Py(), pz, p4c_.E());
166  p4_ = PolarLorentzVector(p4c_.Pt(), p4c_.Eta(), p4c_.Phi(), p4c_.M());
167  packBoth();
168  }
void maybeUnpackBoth() const
math::PtEtaPhiMLorentzVector PolarLorentzVector
Lorentz vector.
PolarLorentzVector p4_
the four vector
math::XYZTLorentzVector LorentzVector
Lorentz vector.
virtual double pz() const
z coordinate of momentum vector
virtual void pat::PackedCandidate::setStatus ( int  status)
inlinevirtual

set status word

Implements reco::Candidate.

Definition at line 277 of file PackedCandidate.h.

277 {} /*FIXME*/
virtual void pat::PackedCandidate::setThreeCharge ( int  threecharge)
inlinevirtual

set electric charge

Implements reco::Candidate.

Definition at line 94 of file PackedCandidate.h.

94 {}
void pat::PackedCandidate::setTrackHighPurity ( bool  highPurity)
inline
virtual void pat::PackedCandidate::setTrackProperties ( const reco::Track tk,
const reco::Track::CovarianceMatrix covariance 
)
inlinevirtual

set impact parameters covariance

Definition at line 171 of file PackedCandidate.h.

References detadeta_, dlambdadz_, dphidphi_, dphidxy_, dptdpt_, dxydxy_, dxydz_, dzdz_, reco::TrackBase::hitPattern(), reco::TrackBase::normalizedChi2(), normalizedChi2_, reco::HitPattern::numberOfValidHits(), reco::HitPattern::numberOfValidPixelHits(), packBoth(), packedHits_, and pt().

Referenced by setTrackProperties().

171  {
172  dxydxy_ = covariance(3,3);
173  dxydz_ = covariance(3,4);
174  dzdz_ = covariance(4,4);
175  dphidxy_ = covariance(2,3);
176  dlambdadz_ = covariance(1,4);
177  dptdpt_ = covariance(0,0)*pt()*pt();
178  detadeta_ = covariance(1,1);
179  dphidphi_ = covariance(2,2)*pt()*pt();
180 
182  int numberOfPixelHits_ = tk.hitPattern().numberOfValidPixelHits();
183  if (numberOfPixelHits_ > 7) numberOfPixelHits_ = 7;
184  int numberOfStripHits_ = tk.hitPattern().numberOfValidHits() - numberOfPixelHits_;
185  if (numberOfStripHits_ > 31) numberOfStripHits_ = 31;
186  packedHits_ = (numberOfPixelHits_&0x7) | (numberOfStripHits_ << 3);
187  packBoth();
188  }
double normalizedChi2() const
chi-squared divided by n.d.o.f. (or chi-squared * 1e6 if n.d.o.f. is zero)
Definition: TrackBase.h:609
int numberOfValidHits() const
Definition: HitPattern.h:734
virtual float pt() const
transverse momentum
uint8_t normalizedChi2_
track quality information
const HitPattern & hitPattern() const
Access the hit pattern, indicating in which Tracker layers the track has hits.
Definition: TrackBase.h:384
float dxydxy_
IP covariance.
int numberOfValidPixelHits() const
Definition: HitPattern.h:749
virtual void pat::PackedCandidate::setTrackProperties ( const reco::Track tk)
inlinevirtual

Definition at line 190 of file PackedCandidate.h.

References reco::TrackBase::covariance(), and setTrackProperties().

190  {
192  }
virtual void setTrackProperties(const reco::Track &tk, const reco::Track::CovarianceMatrix &covariance)
set impact parameters covariance
CovarianceMatrix covariance() const
return track covariance matrix
Definition: TrackBase.h:779
virtual void pat::PackedCandidate::setVertex ( const Point vertex)
inlinevirtual

set vertex

Definition at line 206 of file PackedCandidate.h.

References maybeUnpackBoth(), packVtx(), vertex(), and vertex_.

void maybeUnpackBoth() const
Point vertex_
vertex position
virtual const Point & vertex() const
vertex position
void packVtx(bool unpackAfterwards=true)
void pat::PackedCandidate::setVertexRef ( const reco::VertexRef vertexRef)
inline

set reference to the primary vertex

Definition at line 213 of file PackedCandidate.h.

References maybeUnpackBoth(), packVtx(), pvRef_, and vertexRef().

void maybeUnpackBoth() const
const reco::VertexRef vertexRef() const
edm::Ref< reco::VertexCollection > pvRef_
Ref to primary vertex.
void packVtx(bool unpackAfterwards=true)
virtual reco::CandidatePtr pat::PackedCandidate::sourceCandidatePtr ( size_type  i) const
inlinevirtual

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

Reimplemented from reco::Candidate.

Definition at line 74 of file PackedCandidate.h.

74  {
75  return reco::CandidatePtr();
76  }
edm::Ptr< Candidate > CandidatePtr
persistent reference to an object in a collection of Candidate objects
Definition: CandidateFwd.h:25
virtual int pat::PackedCandidate::status ( ) const
inlinevirtual

status word

Implements reco::Candidate.

Definition at line 275 of file PackedCandidate.h.

References qualityFlags_.

275 { return qualityFlags_; } /*FIXME*/
virtual double pat::PackedCandidate::theta ( ) const
inlinevirtual

momentum polar angle

Implements reco::Candidate.

Definition at line 138 of file PackedCandidate.h.

References p4_, unpack(), and unpacked_.

Referenced by Tau.Tau::zImpact().

138 { if (!unpacked_) unpack(); return p4_.Theta(); }
PolarLorentzVector p4_
the four vector
virtual int pat::PackedCandidate::threeCharge ( ) const
inlinevirtual

electric charge

Implements reco::Candidate.

Definition at line 92 of file PackedCandidate.h.

References charge().

92 {return charge()*3;}
virtual int charge() const
electric charge
bool pat::PackedCandidate::trackHighPurity ( ) const
inline
void pat::PackedCandidate::unpack ( ) const
protected

Definition at line 63 of file PackedCandidate.cc.

References f, MiniFloatConverter::float16to32(), and bookConverter::max.

Referenced by boostToCM(), energy(), et(), eta(), mass(), massSqr(), maybeUnpackBoth(), momentum(), mt(), mtSqr(), p(), p4(), packBoth(), phi(), polarP4(), pt(), px(), py(), pz(), rapidity(), setMass(), theta(), and y().

63  {
68  p4c_ = p4_;
69  unpacked_ = true;
70 }
static float float16to32(uint16_t h)
Definition: libminifloat.h:10
math::PtEtaPhiMLorentzVector PolarLorentzVector
Lorentz vector.
PolarLorentzVector p4_
the four vector
double f[11][100]
void pat::PackedCandidate::unpackTrk ( ) const
protected

Definition at line 123 of file PackedCandidate.cc.

References reco::TrackBase::appendHitPattern(), reco::TrackBase::highPurity, AnalysisDataFormats_SUSYBSMObjects::hp, i, reco::TrackBase::loose, m, TrackingRecHit::missing_inner, p3, EnergyCorrector::pt, reco::TrackBase::undefAlgorithm, and TrackingRecHit::valid.

Referenced by bestTrack(), and pseudoTrack().

123  {
124  maybeUnpackBoth();
126 // m(0,0)=0.5e-4/pt()/pt(); //TODO: tune
127 // m(1,1)=6e-6; //TODO: tune
128 // m(2,2)=1.5e-5/pt()/pt(); //TODO: tune
129  m(0,0)=dptdpt_/pt()/pt(); //TODO: tune
130  m(1,1)=detadeta_; //TODO: tune
131  m(2,2)=dphidphi_/pt()/pt(); //TODO: tune
132  m(2,3)=dphidxy_;
133  m(3,2)=dphidxy_;
134  m(4,1)=dlambdadz_;
135  m(1,4)=dlambdadz_;
136  m(3,3)=dxydxy_;
137  m(3,4)=dxydz_;
138  m(4,3)=dxydz_;
139  m(4,4)=dzdz_;
140  math::RhoEtaPhiVector p3(p4_.pt(),p4_.eta(),phiAtVtx());
141  int numberOfPixelHits_ = packedHits_ & 0x7 ;
142  int numberOfHits_ = (packedHits_>>3) + numberOfPixelHits_;
143 
144  int ndof = numberOfHits_+numberOfPixelHits_-5;
145  reco::HitPattern hp, hpExpIn;
146  int i=0;
147  LostInnerHits innerLost = lostInnerHits();
148 
150 
151  if(innerLost == validHitInFirstPixelBarrelLayer){
153  i++;
154  }
155  for(;i<numberOfPixelHits_; i++) {
156  track_.appendHitPattern(PXBDetId(i > 1 ? 3 : 2, 0, 0), TrackingRecHit::valid);
157  }
158 
159  for(;i<numberOfHits_;i++) {
161  }
162 
163  switch (innerLost) {
165  break;
166  case noLostInnerHits:
167  break;
168  case oneLostInnerHit:
170  break;
171  case moreLostInnerHits:
174  break;
175  };
176 
178 
179  unpackedTrk_ = true;
180 }
int i
Definition: DBlmapReader.cc:9
void maybeUnpackBoth() const
virtual float pt() const
transverse momentum
RhoEtaPhiVectorD RhoEtaPhiVector
spatial vector with cylindrical internal representation using pseudorapidity
Definition: Vector3D.h:32
PolarLorentzVector p4_
the four vector
void setQuality(const TrackQuality, bool set=true)
Definition: TrackBase.h:565
reco::Track track_
reco::Track
susybsm::HSCParticleRefProd hp
Definition: classes.h:27
bool trackHighPurity() const
true if the track had the highPurity quality bit
LostInnerHits lostInnerHits() const
virtual int charge() const
electric charge
bool appendHitPattern(const TrackingRecHit &hit)
append a single hit to the HitPattern
Definition: TrackBase.h:394
Point vertex_
vertex position
LostInnerHits
Enumerator specifying the.
uint8_t normalizedChi2_
track quality information
float dxydxy_
IP covariance.
XYZVectorD XYZVector
spatial vector with cartesian internal representation
Definition: Vector3D.h:30
virtual float phiAtVtx() const
momentum azimuthal angle from the track (normally identical to phi())
math::Error< dimension >::type CovarianceMatrix
5 parameter covariance matrix
Definition: TrackBase.h:76
double p3[4]
Definition: TauolaWrapper.h:91
void pat::PackedCandidate::unpackVtx ( ) const
protected

Definition at line 71 of file PackedCandidate.cc.

References EnergyCorrector::c, funct::cos(), MiniFloatConverter::float16to32(), bookConverter::max, phi, MetAnalyzer::pv(), alignCSCRings::s, funct::sin(), and logintpack::unpack8log().

Referenced by maybeUnpackBoth(), and packBoth().

71  {
75  Point pv = pvRef_.isNonnull() ? pvRef_->position() : Point();
76  float phi = p4_.Phi()+dphi_, s = std::sin(phi), c = std::cos(phi);
77  vertex_ = Point(pv.X() - dxy_ * s,
78  pv.Y() + dxy_ * c,
79  pv.Z() + dz_ ); // for our choice of using the PCA to the PV, by definition the remaining term -(dx*cos(phi) + dy*sin(phi))*(pz/pt) is zero
80 // dxydxy_ = unpack8log(packedCovarianceDxyDxy_,-15,-1);
81 // dxydz_ = unpack8log(packedCovarianceDxyDz_,-20,-1);
82 // dzdz_ = unpack8log(packedCovarianceDzDz_,-13,-1);
88 /*
89  dphidxy_ = unpack8log(packedCovarianceDphiDxy_,-17,-4);
90  dlambdadz_ = unpack8log(packedCovarianceDlambdaDz_,-17,-4);
91  dptdpt_ = unpack8log(packedCovarianceDptDpt_,-15,5,32);
92  detadeta_ = unpack8log(packedCovarianceDetaDeta_,-20,0,32);
93  dphidphi_ = unpack8log(packedCovarianceDphiDphi_,-15,5,32);
94 */
95 
96 /* dphidxy_ = MiniFloatConverter::float16to32(packedCovarianceDphiDxy_)/10000.;
97  dlambdadz_ = MiniFloatConverter::float16to32(packedCovarianceDlambdaDz_)/10000.;
98  dptdpt_ = MiniFloatConverter::float16to32(packedCovarianceDptDpt_)/10000.;
99  detadeta_ = MiniFloatConverter::float16to32(packedCovarianceDetaDeta_)/10000.;
100  dphidphi_ = MiniFloatConverter::float16to32(packedCovarianceDphiDphi_)/10000.;
101 */
105 /* dphidxy_ = MiniFloatConverter::float16to32(packedCovarianceDphiDxy_)/10000.;
106  dlambdadz_ =MiniFloatConverter::float16to32(packedCovarianceDlambdaDz_)/10000.;
107 */
108  unpackedVtx_ = true;
109 }
bool isNonnull() const
Checks for non-null.
Definition: Ref.h:250
virtual float phi() const
momentum azimuthal angle
double unpack8log(int8_t i, double lmin, double lmax, uint8_t base=128)
Definition: liblogintpack.h:32
Sin< T >::type sin(const T &t)
Definition: Sin.h:22
math::XYZPoint Point
point in the space
static float float16to32(uint16_t h)
Definition: libminifloat.h:10
PolarLorentzVector p4_
the four vector
Cos< T >::type cos(const T &t)
Definition: Cos.h:22
math::XYZPoint Point
Point vertex_
vertex position
float dxydxy_
IP covariance.
edm::Ref< reco::VertexCollection > pvRef_
Ref to primary vertex.
uint16_t packedCovarianceDxyDxy_
virtual const Point& pat::PackedCandidate::vertex ( ) const
inlinevirtual

vertex position

Implements reco::Candidate.

Definition at line 198 of file PackedCandidate.h.

References maybeUnpackBoth(), and vertex_.

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

198 { maybeUnpackBoth(); return vertex_; }//{ if (fromPV_) return Point(0,0,0); else return Point(0,0,100); }
void maybeUnpackBoth() const
Point vertex_
vertex position
double pat::PackedCandidate::vertexChi2 ( ) const
virtual

chi-squares

Implements reco::Candidate.

Definition at line 260 of file PackedCandidate.cc.

260  {
261  return 0;
262 }
double pat::PackedCandidate::vertexCovariance ( int  i,
int  j 
) const
virtual

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

Implements reco::Candidate.

Definition at line 272 of file PackedCandidate.cc.

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

272  {
274  << "reco::ConcreteCandidate does not implement vertex covariant matrix.\n";
275 }
CovarianceMatrix pat::PackedCandidate::vertexCovariance ( ) const
inlinevirtual

return SMatrix

Reimplemented from reco::Candidate.

Definition at line 310 of file PackedCandidate.h.

References fillVertexCovariance(), and m.

310 { CovarianceMatrix m; fillVertexCovariance(m); return m; }
virtual void fillVertexCovariance(CovarianceMatrix &v) const
fill SMatrix
double pat::PackedCandidate::vertexNdof ( ) const
virtual

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 264 of file PackedCandidate.cc.

264  {
265  return 0;
266 }
double pat::PackedCandidate::vertexNormalizedChi2 ( ) const
virtual

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

Implements reco::Candidate.

Definition at line 268 of file PackedCandidate.cc.

268  {
269  return 0;
270 }
const reco::VertexRef pat::PackedCandidate::vertexRef ( ) const
inline

Definition at line 214 of file PackedCandidate.h.

References pvRef_.

Referenced by PuppiProducer::produce(), and setVertexRef().

214 { return pvRef_; }
edm::Ref< reco::VertexCollection > pvRef_
Ref to primary vertex.
virtual double pat::PackedCandidate::vx ( ) const
inlinevirtual

x coordinate of vertex position

Implements reco::Candidate.

Definition at line 200 of file PackedCandidate.h.

References maybeUnpackBoth(), and vertex_.

200 { maybeUnpackBoth(); return vertex_.X(); }//{ return 0; }
void maybeUnpackBoth() const
Point vertex_
vertex position
virtual double pat::PackedCandidate::vy ( ) const
inlinevirtual

y coordinate of vertex position

Implements reco::Candidate.

Definition at line 202 of file PackedCandidate.h.

References maybeUnpackBoth(), and vertex_.

202 { maybeUnpackBoth(); return vertex_.Y(); }//{ return 0; }
void maybeUnpackBoth() const
Point vertex_
vertex position
virtual double pat::PackedCandidate::vz ( ) const
inlinevirtual

z coordinate of vertex position

Implements reco::Candidate.

Definition at line 204 of file PackedCandidate.h.

References maybeUnpackBoth(), and vertex_.

204 { maybeUnpackBoth(); return vertex_.Z(); }//{ if (fromPV_) return 0; else return 100; }
void maybeUnpackBoth() const
Point vertex_
vertex position
virtual double pat::PackedCandidate::y ( ) const
inlinevirtual

Friends And Related Function Documentation

friend class ::OverlapChecker
friend

Definition at line 431 of file PackedCandidate.h.

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

Definition at line 430 of file PackedCandidate.h.

friend class ShallowCloneCandidate
friend

Definition at line 432 of file PackedCandidate.h.

friend class ShallowClonePtrCandidate
friend

Definition at line 433 of file PackedCandidate.h.

Member Data Documentation

float pat::PackedCandidate::detadeta_
mutableprotected

Definition at line 421 of file PackedCandidate.h.

Referenced by setTrackProperties().

float pat::PackedCandidate::dlambdadz_
mutableprotected

Definition at line 421 of file PackedCandidate.h.

Referenced by setTrackProperties().

float pat::PackedCandidate::dphi_
mutableprotected

Definition at line 406 of file PackedCandidate.h.

Referenced by phiAtVtx().

float pat::PackedCandidate::dphidphi_
mutableprotected

Definition at line 421 of file PackedCandidate.h.

Referenced by setTrackProperties().

float pat::PackedCandidate::dphidxy_
mutableprotected

Definition at line 421 of file PackedCandidate.h.

Referenced by setTrackProperties().

float pat::PackedCandidate::dptdpt_
mutableprotected

Definition at line 421 of file PackedCandidate.h.

Referenced by setTrackProperties().

float pat::PackedCandidate::dxy_
mutableprotected

Definition at line 406 of file PackedCandidate.h.

Referenced by dxy().

float pat::PackedCandidate::dxydxy_
mutableprotected

IP covariance.

Definition at line 421 of file PackedCandidate.h.

Referenced by dxyError(), and setTrackProperties().

float pat::PackedCandidate::dxydz_
mutableprotected

Definition at line 421 of file PackedCandidate.h.

Referenced by setTrackProperties().

float pat::PackedCandidate::dz_
mutableprotected

Definition at line 406 of file PackedCandidate.h.

Referenced by dz().

float pat::PackedCandidate::dzdz_
mutableprotected

Definition at line 421 of file PackedCandidate.h.

Referenced by dzError(), and setTrackProperties().

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

long lived flag

Definition at line 279 of file PackedCandidate.h.

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

do mass constraint flag

Definition at line 285 of file PackedCandidate.h.

uint8_t pat::PackedCandidate::normalizedChi2_
protected

track quality information

Definition at line 424 of file PackedCandidate.h.

Referenced by setTrackProperties().

PolarLorentzVector pat::PackedCandidate::p4_
mutableprotected

the four vector

Definition at line 402 of file PackedCandidate.h.

Referenced by et(), eta(), mass(), massSqr(), mt(), mtSqr(), phi(), phiAtVtx(), polarP4(), pt(), rapidity(), setMass(), setP4(), setPz(), theta(), and y().

LorentzVector pat::PackedCandidate::p4c_
mutableprotected

Definition at line 403 of file PackedCandidate.h.

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

int8_t pat::PackedCandidate::packedCovarianceDetaDeta_
protected

Definition at line 392 of file PackedCandidate.h.

int8_t pat::PackedCandidate::packedCovarianceDlambdaDz_
protected

Definition at line 391 of file PackedCandidate.h.

int8_t pat::PackedCandidate::packedCovarianceDphiDphi_
protected

Definition at line 392 of file PackedCandidate.h.

int8_t pat::PackedCandidate::packedCovarianceDphiDxy_
protected

Definition at line 391 of file PackedCandidate.h.

int8_t pat::PackedCandidate::packedCovarianceDptDpt_
protected

Definition at line 392 of file PackedCandidate.h.

uint16_t pat::PackedCandidate::packedCovarianceDxyDxy_
protected

Definition at line 390 of file PackedCandidate.h.

uint16_t pat::PackedCandidate::packedCovarianceDxyDz_
protected

Definition at line 390 of file PackedCandidate.h.

uint16_t pat::PackedCandidate::packedCovarianceDzDz_
protected

Definition at line 390 of file PackedCandidate.h.

uint16_t pat::PackedCandidate::packedDPhi_
protected

Definition at line 389 of file PackedCandidate.h.

uint16_t pat::PackedCandidate::packedDxy_
protected

Definition at line 389 of file PackedCandidate.h.

uint16_t pat::PackedCandidate::packedDz_
protected

Definition at line 389 of file PackedCandidate.h.

uint16_t pat::PackedCandidate::packedEta_
protected

Definition at line 388 of file PackedCandidate.h.

uint8_t pat::PackedCandidate::packedHits_
protected

Definition at line 422 of file PackedCandidate.h.

Referenced by bestTrack(), numberOfHits(), numberOfPixelHits(), and setTrackProperties().

uint16_t pat::PackedCandidate::packedM_
protected

Definition at line 388 of file PackedCandidate.h.

uint16_t pat::PackedCandidate::packedPhi_
protected

Definition at line 388 of file PackedCandidate.h.

uint16_t pat::PackedCandidate::packedPt_
protected

Definition at line 388 of file PackedCandidate.h.

int pat::PackedCandidate::pdgId_
protected

PDG identifier.

Definition at line 410 of file PackedCandidate.h.

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

edm::Ref<reco::VertexCollection> pat::PackedCandidate::pvRef_
protected

Ref to primary vertex.

Definition at line 413 of file PackedCandidate.h.

Referenced by setVertexRef(), and vertexRef().

uint16_t pat::PackedCandidate::qualityFlags_
protected
reco::Track pat::PackedCandidate::track_
mutableprotected

reco::Track

Definition at line 408 of file PackedCandidate.h.

Referenced by bestTrack(), and pseudoTrack().

bool pat::PackedCandidate::unpacked_
mutableprotected
bool pat::PackedCandidate::unpackedTrk_
mutableprotected

Definition at line 419 of file PackedCandidate.h.

Referenced by bestTrack(), and pseudoTrack().

bool pat::PackedCandidate::unpackedVtx_
mutableprotected

Definition at line 417 of file PackedCandidate.h.

Referenced by maybeUnpackBoth().

Point pat::PackedCandidate::vertex_
mutableprotected

vertex position

Definition at line 405 of file PackedCandidate.h.

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