CMS 3D CMS Logo

List of all members | Public Types | Public Member Functions | Static Public Attributes | Private Member Functions | Private Attributes | Friends
reco::PFCandidate Class Reference

Particle reconstructed by the particle flow algorithm. More...

#include <PFCandidate.h>

Inheritance diagram for reco::PFCandidate:
reco::CompositeCandidate reco::LeafCandidate reco::Candidate pat::PATObject< reco::PFCandidate > reco::IsolatedPFCandidate reco::PileUpPFCandidate pat::PFParticle

Public Types

typedef edm::RefVector< reco::PFBlockCollectionBlocks
 
typedef std::pair< reco::PFBlockRef, unsigned > ElementInBlock
 return indices of elements used in the block More...
 
typedef std::vector< unsigned > Elements
 
typedef std::vector< ElementInBlockElementsInBlocks
 
enum  Flags {
  NORMAL = 0, E_PHI_SMODULES, E_ETA_0, E_ETA_MODULES,
  E_BARREL_ENDCAP, E_PRESHOWER_EDGE, E_PRESHOWER, E_ENDCAP_EDGE,
  H_ETA_0, H_BARREL_ENDCAP, H_ENDCAP_VFCAL, H_VFCAL_EDGE,
  T_TO_DISP, T_FROM_DISP, T_FROM_V0, T_FROM_GAMMACONV,
  GAMMA_TO_GAMMACONV
}
 
enum  ParticleType {
  X = 0, h, e, mu,
  gamma, h0, h_HF, egamma_HF
}
 particle types More...
 
enum  PFVertexType {
  kCandVertex = 0, kTrkVertex = 1, kComMuonVertex = 2, kSAMuonVertex = 3,
  kTrkMuonVertex = 4, kGSFVertex = 5, kTPFMSMuonVertex = 6, kPickyMuonVertex = 7,
  kDYTMuonVertex = 8
}
 
- Public Types inherited from reco::CompositeCandidate
typedef CandidateCollection daughters
 collection of daughters More...
 
typedef std::vector< std::string > role_collection
 
- Public Types inherited from reco::LeafCandidate
typedef int Charge
 electric charge type More...
 
typedef 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...
 
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

void addElementInBlock (const reco::PFBlockRef &blockref, unsigned elementIndex)
 add an element to the current PFCandidate More...
 
const reco::Muon::MuonTrackType bestMuonTrackType () const
 get the Best Muon Track Ref More...
 
const reco::TrackbestTrack () const override
 
PFCandidateclone () const override
 return a clone More...
 
reco::ConversionRef conversionRef () const
 return a reference to the original conversion More...
 
double deltaP () const
 uncertainty on 3-momentum More...
 
reco::PFDisplacedVertexRef displacedVertexRef (Flags type) const
 
float dnn_e_bkgNonIsolated () const
 
float dnn_e_bkgPhoton () const
 
float dnn_e_bkgTau () const
 
float dnn_e_sigIsolated () const
 
float dnn_e_sigNonIsolated () const
 
float dnn_gamma () const
 
float dxyError () const override
 uncertainty on dxy More...
 
float dzError () const override
 uncertainty on dz More...
 
double ecalEnergy () const
 return corrected Ecal energy More...
 
reco::PFCandidateEGammaExtraRef egammaExtraRef () const
 return a reference to the EGamma extra More...
 
reco::PFCandidateElectronExtraRef electronExtraRef () const
 return a reference to the electron extra More...
 
const ElementsInBlockselementsInBlocks () const
 
bool flag (Flags theFlag) const
 return a given flag More...
 
reco::GsfElectronRef gsfElectronRef () const
 return a reference to the corresponding GsfElectron if any More...
 
reco::GsfTrackRef gsfTrackRef () const
 
float hcalDepthEnergyFraction (unsigned int depth) const
 fraction of hcal energy at a given depth (depth = 1 .. 7) More...
 
const std::array< float, 7 > & hcalDepthEnergyFractions () const
 fraction of hcal energy at a given depth (index 0..6 for depth 1..7) More...
 
double hcalEnergy () const
 return corrected Hcal energy More...
 
double hoEnergy () const
 return corrected Hcal energy More...
 
bool isTimeValid () const
 do we have a valid time information More...
 
reco::MuonRef muonRef () const
 
float mva_e_mu () const
 mva for electron-muon discrimination More...
 
float mva_e_pi () const
 mva for electron-pion discrimination More...
 
float mva_gamma_nh () const
 mva for neutral hadron - gamma discrimination More...
 
float mva_Isolated () const
 
float mva_nothing_gamma () const
 mva for gamma detection More...
 
float mva_nothing_nh () const
 mva for neutral hadron detection More...
 
float mva_pi_mu () const
 mva for pi-muon discrimination More...
 
size_t numberOfSourceCandidatePtrs () const override
 
PFCandidateoperator= (PFCandidate const &)
 
virtual ParticleType particleId () const
 
 PFCandidate ()
 default constructor More...
 
 PFCandidate (const PFCandidatePtr &sourcePtr)
 constructor from a reference (keeps track of source relationship) More...
 
 PFCandidate (Charge q, const LorentzVector &p4, ParticleType particleId)
 
 PFCandidate (const PFCandidate &)
 copy constructor More...
 
reco::PFCandidatePhotonExtraRef photonExtraRef () const
 return a reference to the photon extra More...
 
reco::PhotonRef photonRef () const
 return a reference to the corresponding Photon if any More...
 
const math::XYZPointFpositionAtECALEntrance () const
 
double pS1Energy () const
 return corrected PS1 energy More...
 
double pS2Energy () const
 return corrected PS2 energy More...
 
double rawEcalEnergy () const
 return corrected Ecal energy More...
 
double rawHcalEnergy () const
 return raw Hcal energy More...
 
double rawHoEnergy () const
 return raw Hcal energy More...
 
void rescaleMomentum (double rescaleFactor)
 particle momentum *= rescaleFactor More...
 
void set_dnn_e_bkgNonIsolated (float mva)
 
void set_dnn_e_bkgPhoton (float mva)
 
void set_dnn_e_bkgTau (float mva)
 
void set_dnn_e_sigIsolated (float mva)
 
void set_dnn_e_sigNonIsolated (float mva)
 
void set_dnn_gamma (float mva)
 
void set_mva_e_mu (float mva)
 set mva for electron-muon discrimination More...
 
void set_mva_e_pi (float mvaNI)
 
void set_mva_gamma_nh (float mva)
 set mva for neutral hadron - gamma discrimination More...
 
void set_mva_Isolated (float mvaI)
 
void set_mva_nothing_gamma (float mva)
 set mva for gamma detection More...
 
void set_mva_nothing_nh (float mva)
 set mva for neutral hadron detection More...
 
void set_mva_pi_mu (float mva)
 set mva for pi-muon discrimination More...
 
void setConversionRef (const reco::ConversionRef &ref)
 set ref to original reco conversion More...
 
void setDeltaP (double dp)
 set uncertainty on momentum More...
 
void setDisplacedVertexRef (const reco::PFDisplacedVertexRef &ref, Flags flag)
 set displaced vertex reference More...
 
void setEcalEnergy (float eeRaw, float eeCorr)
 set corrected Ecal energy More...
 
void setFlag (Flags theFlag, bool value)
 set a given flag More...
 
void setGsfElectronRef (const reco::GsfElectronRef &ref)
 set GsfElectronRef More...
 
void setGsfTrackRef (const reco::GsfTrackRef &ref)
 set gsftrack reference More...
 
void setHcalDepthEnergyFractions (const std::array< float, 7 > &fracs)
 set the fraction of hcal energy as function of depth (index 0..6 for depth 1..7) More...
 
void setHcalEnergy (float ehRaw, float ehCorr)
 set corrected Hcal energy More...
 
void setHoEnergy (float eoRaw, float eoCorr)
 set corrected Hcal energy More...
 
void setMuonRef (const reco::MuonRef &ref)
 set muon reference More...
 
void setMuonTrackType (const reco::Muon::MuonTrackType &type)
 set the Best Muon Track Ref More...
 
void setParticleType (ParticleType type)
 set Particle Type More...
 
void setPFEGammaExtraRef (const reco::PFCandidateEGammaExtraRef &ref)
 set the PF EGamma Extra Ref More...
 
void setPFElectronExtraRef (const reco::PFCandidateElectronExtraRef &ref)
 set the PF Electron Extra Ref More...
 
void setPFPhotonExtraRef (const reco::PFCandidatePhotonExtraRef &ref)
 set the PF Photon Extra Ref More...
 
void setPhotonRef (const reco::PhotonRef &phRef)
 set ref to the corresponding reco::Photon if any More...
 
void setPositionAtECALEntrance (const math::XYZPointF &pos)
 set position at ECAL entrance More...
 
void setPs1Energy (float e1)
 set corrected PS1 energy More...
 
void setPs2Energy (float e2)
 set corrected PS2 energy More...
 
void setSourceCandidatePtr (const PFCandidatePtr &ptr)
 
void setSuperClusterRef (const reco::SuperClusterRef &scRef)
 
void setTime (float time, float timeError=0.f)
 the timing information More...
 
void setTrackRef (const reco::TrackRef &ref)
 set track reference More...
 
void setV0Ref (const reco::VertexCompositeCandidateRef &ref)
 set ref to original reco conversion More...
 
CandidatePtr sourceCandidatePtr (size_type i) const override
 
reco::SuperClusterRef superClusterRef () const
 return a reference to the corresponding SuperCluster if any More...
 
float time () const
 
float timeError () const
 
reco::TrackRef trackRef () const
 
ParticleType translatePdgIdToType (int pdgid) const
 
int translateTypeToPdgId (ParticleType type) const
 
reco::VertexCompositeCandidateRef v0Ref () const
 return a reference to the original conversion More...
 
const Pointvertex () const override
 vertex position (overwritten by PF...) 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...
 
 ~PFCandidate () override
 destructor More...
 
- Public Member Functions inherited from reco::CompositeCandidate
void addDaughter (const Candidate &, const std::string &s="")
 add a clone of the passed candidate as daughter More...
 
void addDaughter (std::unique_ptr< Candidate >, const std::string &s="")
 add a clone of the passed candidate as daughter More...
 
void applyRoles ()
 
void clearDaughters ()
 clear daughters More...
 
void clearRoles ()
 
 CompositeCandidate (std::string name="")
 default constructor More...
 
template<typename P4 >
 CompositeCandidate (Charge q, const P4 &p4, const Point &vtx=Point(0, 0, 0), int pdgId=0, int status=0, bool integerCharge=true, std::string name="")
 constructor from values More...
 
 CompositeCandidate (const Candidate &p, const std::string &name="")
 constructor from values More...
 
 CompositeCandidate (const Candidate &p, const std::string &name, role_collection const &roles)
 constructor from values More...
 
const Candidatedaughter (size_type) const override
 return daughter at a given position, i = 0, ... numberOfDaughters() - 1 (read only mode) More...
 
Candidatedaughter (size_type) override
 return daughter at a given position, i = 0, ... numberOfDaughters() - 1 More...
 
Candidatedaughter (const std::string &s) override
 return daughter with a specified role name More...
 
const Candidatedaughter (const std::string &s) const override
 return daughter with a specified role name More...
 
const Candidatemother (size_type i=0) const override
 return pointer to mother More...
 
std::string name () const
 get the name of the candidate More...
 
size_type numberOfDaughters () const override
 number of daughters More...
 
size_type numberOfMothers () const override
 number of mothers (zero or one in most of but not all the cases) More...
 
role_collection const & roles () const
 get the roles More...
 
void setName (std::string name)
 set the name of the candidate More...
 
void setRoles (const role_collection &roles)
 set the roles More...
 
 ~CompositeCandidate () override
 destructor More...
 
- Public Member Functions inherited from reco::LeafCandidate
Vector boostToCM () const final
 
int charge () const final
 electric charge More...
 
void construct (int qx3, float pt, float eta, float phi, float mass, const Point &vtx, int pdgId, int status)
 
const Candidatedaughter (size_type) const override
 return daughter at a given position (throws an exception) More...
 
Candidatedaughter (size_type) override
 return daughter at a given position (throws an exception) More...
 
Candidatedaughter (const std::string &s) override
 return daughter with a specified role name More...
 
const Candidatedaughter (const std::string &s) const override
 return daughter with a specified role name More...
 
double energy () const final
 energy More...
 
double et () const final
 transverse energy More...
 
double et2 () const final
 transverse energy squared (use this for cut!) More...
 
double eta () const final
 momentum pseudorapidity More...
 
void fillVertexCovariance (CovarianceMatrix &v) const override
 fill SMatrix 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...
 
bool hasMasterClone () const override
 
bool hasMasterClonePtr () const override
 
bool isCaloMuon () const override
 
bool isConvertedPhoton () const override
 
bool isElectron () const override
 
bool isGlobalMuon () const override
 
bool isJet () const override
 
bool isMuon () const override
 
bool isPhoton () const override
 
bool isStandAloneMuon () const override
 
bool isTrackerMuon () const override
 
 LeafCandidate ()
 
 LeafCandidate (const Candidate &c)
 
template<typename... Args>
 LeafCandidate (Args &&... args)
 
 LeafCandidate (LeafCandidate &rh)
 
 LeafCandidate (LeafCandidate &&)=default
 
 LeafCandidate (LeafCandidate const &)=default
 
bool longLived () const final
 is long lived? More...
 
double mass () const final
 mass More...
 
bool massConstraint () const final
 do mass constraint? More...
 
double massSqr () const final
 mass squared More...
 
const CandidateBaseRefmasterClone () const override
 
const CandidatePtrmasterClonePtr () const override
 
template<typename Ref >
Ref masterRef () const
 cast master clone reference to a concrete type More...
 
Vector momentum () const final
 spatial momentum vector More...
 
const Candidatemother (size_type) const override
 return mother at a given position (throws an exception) More...
 
double mt () const final
 transverse mass More...
 
double mtSqr () const final
 transverse mass squared 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...
 
size_t numberOfDaughters () const override
 number of daughters More...
 
size_t numberOfMothers () const override
 number of mothers More...
 
LeafCandidateoperator= (LeafCandidate &&)=default
 
LeafCandidateoperator= (LeafCandidate const &)=default
 
double p () const final
 magnitude of momentum vector More...
 
const LorentzVectorp4 () const final
 four-momentum Lorentz vector More...
 
int pdgId () const final
 PDG identifier. More...
 
double phi () const final
 momentum azimuthal angle More...
 
const PolarLorentzVectorpolarP4 () const final
 four-momentum Lorentz vector More...
 
double pt () const final
 transverse momentum More...
 
double px () const final
 x coordinate of momentum vector More...
 
double py () const final
 y coordinate of momentum vector More...
 
double pz () const final
 z coordinate of momentum vector More...
 
double rapidity () const final
 rapidity More...
 
void setCharge (Charge q) final
 set electric charge More...
 
void setLongLived () final
 
void setMass (double m) final
 set particle mass More...
 
void setMassConstraint () final
 
void setP4 (const LorentzVector &p4) final
 set 4-momentum More...
 
void setP4 (const PolarLorentzVector &p4) final
 set 4-momentum More...
 
void setPdgId (int pdgId) final
 
void setPz (double pz) final
 
void setStatus (int status) final
 set status word More...
 
void setThreeCharge (Charge qx3) final
 set electric charge More...
 
void setVertex (const Point &vertex) override
 set vertex More...
 
int status () const final
 status word More...
 
double theta () const final
 momentum polar angle More...
 
int threeCharge () const final
 electric charge 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 final
 return SMatrix More...
 
double vertexNdof () const override
 
double vertexNormalizedChi2 () const override
 chi-squared divided by n.d.o.f. More...
 
double y () const final
 rapidity More...
 
 ~LeafCandidate () 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...
 
 Candidate ()
 default constructor 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 setSourceCandidatePtr (const CandidatePtr &ptr)
 Set the ptr to the source Candidate. More...
 
virtual ~Candidate ()
 destructor More...
 

Static Public Attributes

static constexpr float bigMva_ = -999.
 

Private Member Functions

bool flag (unsigned shift, unsigned flag) const
 
bool getRefInfo (unsigned int iMask, unsigned int iBit, edm::ProductID &oProdID, size_t &oIndex, size_t &aIndex) const
 
bool overlap (const Candidate &) const override
 Polymorphic overlap. More...
 
void setFlag (unsigned shift, unsigned flag, bool value)
 
void storeRefInfo (unsigned int iMask, unsigned int iBit, bool iIsValid, const edm::RefCore &iCore, size_t iKey, const edm::EDProductGetter *)
 
const math::XYZPointvertexLegacy (PFCandidate::PFVertexType vertexType) const
 

Private Attributes

Blocks blocksStorage_
 
float deltaP_
 uncertainty on 3-momentum More...
 
float dnn_e_bkgNonIsolated_
 DNN for electron PFid: non-isolated bkg. More...
 
float dnn_e_bkgPhoton_
 DNN for electron PFid: photon bkg. More...
 
float dnn_e_bkgTau_
 DNN for electron PFid: tau bkg. More...
 
float dnn_e_sigIsolated_
 DNN for electron PFid: isolated signal. More...
 
float dnn_e_sigNonIsolated_
 DNN for electron PFid: non-isolated signal. More...
 
float dnn_gamma_
 
float ecalERatio_
 corrected ECAL energy ratio (corrected/raw) More...
 
std::atomic< ElementsInBlocks * > elementsInBlocks_
 
Elements elementsStorage_
 
unsigned flags_
 all flags, packed (ecal regional, hcal regional, tracking) More...
 
const edm::EDProductGettergetter_
 
std::array< float, 7 > hcalDepthEnergyFractions_
 
float hcalERatio_
 corrected HCAL energy ratio (corrected/raw) More...
 
float hoERatio_
 corrected HO energy ratio (corrected/raw) More...
 
reco::Muon::MuonTrackType muonTrackType_
 
float mva_e_mu_
 mva for electron-muon discrimination More...
 
float mva_e_pi_
 mva for electron-pion discrimination More...
 
float mva_gamma_nh_
 mva for neutral hadron - gamma discrimination More...
 
float mva_Isolated_
 
float mva_nothing_gamma_
 mva for gamma detection More...
 
float mva_nothing_nh_
 mva for neutral hadron detection More...
 
float mva_pi_mu_
 mva for pi-muon discrimination More...
 
math::XYZPointF positionAtECALEntrance_
 position at ECAL entrance, from the PFRecTrack More...
 
float ps1Energy_
 corrected PS1 energy More...
 
float ps2Energy_
 corrected PS2 energy More...
 
float rawEcalEnergy_
 raw ECAL energy More...
 
float rawHcalEnergy_
 raw HCAL energy More...
 
float rawHoEnergy_
 raw HO energy More...
 
std::vector< const void * > refsCollectionCache_
 
std::vector< unsigned long long > refsInfo_
 
PFCandidatePtr sourcePtr_
 reference to the source PFCandidate, if any More...
 
unsigned short storedRefsBitPattern_
 
float time_
 timing information (valid if timeError_ >= 0) More...
 
float timeError_
 timing information uncertainty (<0 if timing not available) More...
 
PFVertexType vertexType_
 

Friends

std::ostream & operator<< (std::ostream &out, const PFCandidate &c)
 

Additional Inherited Members

Detailed Description

Particle reconstructed by the particle flow algorithm.

particle candidate from particle flow

Author
Colin Bernet
Date
February 2007

Definition at line 41 of file PFCandidate.h.

Member Typedef Documentation

◆ Blocks

Definition at line 406 of file PFCandidate.h.

◆ ElementInBlock

return indices of elements used in the block

return elements return elements in blocks

Definition at line 403 of file PFCandidate.h.

◆ Elements

typedef std::vector<unsigned> reco::PFCandidate::Elements

Definition at line 407 of file PFCandidate.h.

◆ ElementsInBlocks

Definition at line 404 of file PFCandidate.h.

Member Enumeration Documentation

◆ Flags

Enumerator
NORMAL 
E_PHI_SMODULES 
E_ETA_0 
E_ETA_MODULES 
E_BARREL_ENDCAP 
E_PRESHOWER_EDGE 
E_PRESHOWER 
E_ENDCAP_EDGE 
H_ETA_0 
H_BARREL_ENDCAP 
H_ENDCAP_VFCAL 
H_VFCAL_EDGE 
T_TO_DISP 
T_FROM_DISP 
T_FROM_V0 
T_FROM_GAMMACONV 
GAMMA_TO_GAMMACONV 

Definition at line 55 of file PFCandidate.h.

◆ ParticleType

particle types

Enumerator
mu 
gamma 
h0 
h_HF 
egamma_HF 

Definition at line 44 of file PFCandidate.h.

44  {
45  X = 0, // undefined
46  h, // charged hadron
47  e, // electron
48  mu, // muon
49  gamma, // photon
50  h0, // neutral hadron
51  h_HF, // HF tower identified as a hadron
52  egamma_HF // HF tower identified as an EM particle
53  };

◆ PFVertexType

Enumerator
kCandVertex 
kTrkVertex 
kComMuonVertex 
kSAMuonVertex 
kTrkMuonVertex 
kGSFVertex 
kTPFMSMuonVertex 
kPickyMuonVertex 
kDYTMuonVertex 

Definition at line 75 of file PFCandidate.h.

Constructor & Destructor Documentation

◆ PFCandidate() [1/4]

PFCandidate::PFCandidate ( )

default constructor

Definition at line 23 of file PFCandidate.cc.

References ntuplemaker::fill, hcalDepthEnergyFractions_, muonTrackType_, reco::Muon::None, refsInfo_, reco::LeafCandidate::setPdgId(), translateTypeToPdgId(), and X.

Referenced by clone().

24  : elementsInBlocks_(nullptr),
25  ecalERatio_(1.),
26  hcalERatio_(1.),
27  hoERatio_(1.),
28  rawEcalEnergy_(0.),
29  rawHcalEnergy_(0.),
30  rawHoEnergy_(0.),
31  ps1Energy_(0.),
32  ps2Energy_(0.),
33  flags_(0),
34  deltaP_(0.),
49  getter_(nullptr),
51  time_(0.f),
52  timeError_(-1.f) {
54 
56  refsInfo_.reserve(3);
58 }
float deltaP_
uncertainty on 3-momentum
Definition: PFCandidate.h:494
reco::Muon::MuonTrackType muonTrackType_
Definition: PFCandidate.h:464
const edm::EDProductGetter * getter_
Definition: PFCandidate.h:551
float timeError_
timing information uncertainty (<0 if timing not available)
Definition: PFCandidate.h:559
float hcalERatio_
corrected HCAL energy ratio (corrected/raw)
Definition: PFCandidate.h:470
float rawHcalEnergy_
raw HCAL energy
Definition: PFCandidate.h:479
unsigned flags_
all flags, packed (ecal regional, hcal regional, tracking)
Definition: PFCandidate.h:491
float dnn_e_bkgTau_
DNN for electron PFid: tau bkg.
Definition: PFCandidate.h:530
float dnn_e_sigNonIsolated_
DNN for electron PFid: non-isolated signal.
Definition: PFCandidate.h:524
float mva_e_mu_
mva for electron-muon discrimination
Definition: PFCandidate.h:506
float mva_nothing_nh_
mva for neutral hadron detection
Definition: PFCandidate.h:515
float hoERatio_
corrected HO energy ratio (corrected/raw)
Definition: PFCandidate.h:473
float mva_gamma_nh_
mva for neutral hadron - gamma discrimination
Definition: PFCandidate.h:518
float ecalERatio_
corrected ECAL energy ratio (corrected/raw)
Definition: PFCandidate.h:467
float mva_pi_mu_
mva for pi-muon discrimination
Definition: PFCandidate.h:509
float dnn_e_bkgPhoton_
DNN for electron PFid: photon bkg.
Definition: PFCandidate.h:533
float rawEcalEnergy_
raw ECAL energy
Definition: PFCandidate.h:476
float mva_e_pi_
mva for electron-pion discrimination
Definition: PFCandidate.h:503
std::vector< unsigned long long > refsInfo_
Definition: PFCandidate.h:553
float ps1Energy_
corrected PS1 energy
Definition: PFCandidate.h:485
unsigned short storedRefsBitPattern_
Definition: PFCandidate.h:552
double f[11][100]
float rawHoEnergy_
raw HO energy
Definition: PFCandidate.h:482
int translateTypeToPdgId(ParticleType type) const
Definition: PFCandidate.cc:254
float dnn_e_sigIsolated_
DNN for electron PFid: isolated signal.
Definition: PFCandidate.h:521
std::atomic< ElementsInBlocks * > elementsInBlocks_
Definition: PFCandidate.h:451
PFVertexType vertexType_
Definition: PFCandidate.h:497
float time_
timing information (valid if timeError_ >= 0)
Definition: PFCandidate.h:557
float mva_nothing_gamma_
mva for gamma detection
Definition: PFCandidate.h:512
static constexpr float bigMva_
Definition: PFCandidate.h:411
float ps2Energy_
corrected PS2 energy
Definition: PFCandidate.h:488
float dnn_e_bkgNonIsolated_
DNN for electron PFid: non-isolated bkg.
Definition: PFCandidate.h:527
void setPdgId(int pdgId) final
std::array< float, 7 > hcalDepthEnergyFractions_
Definition: PFCandidate.h:561

◆ PFCandidate() [2/4]

PFCandidate::PFCandidate ( const PFCandidatePtr sourcePtr)

constructor from a reference (keeps track of source relationship)

Definition at line 62 of file PFCandidate.cc.

References hcalDepthEnergyFractions_, and sourcePtr_.

62  : PFCandidate(*sourcePtr) {
63  sourcePtr_ = sourcePtr;
64  hcalDepthEnergyFractions_ = sourcePtr->hcalDepthEnergyFractions_; // GP not sure it's needed
65 }
PFCandidate()
default constructor
Definition: PFCandidate.cc:23
PFCandidatePtr sourcePtr_
reference to the source PFCandidate, if any
Definition: PFCandidate.h:460
std::array< float, 7 > hcalDepthEnergyFractions_
Definition: PFCandidate.h:561

◆ PFCandidate() [3/4]

PFCandidate::PFCandidate ( Charge  q,
const LorentzVector p4,
ParticleType  particleId 
)

Definition at line 67 of file PFCandidate.cc.

References blocksStorage_, reco::LeafCandidate::charge(), e, elementsStorage_, submitPVResolutionJobs::err, Exception, ntuplemaker::fill, h, hcalDepthEnergyFractions_, mu, muonTrackType_, reco::Muon::None, refsInfo_, edm::RefVector< C, T, F >::reserve(), reco::LeafCandidate::setPdgId(), and translateTypeToPdgId().

69  elementsInBlocks_(nullptr),
70  ecalERatio_(1.),
71  hcalERatio_(1.),
72  hoERatio_(1.),
73  rawEcalEnergy_(0.),
74  rawHcalEnergy_(0.),
75  rawHoEnergy_(0.),
76  ps1Energy_(0.),
77  ps2Energy_(0.),
78  flags_(0),
79  deltaP_(0.),
94  getter_(nullptr),
96  time_(0.f),
97  timeError_(-1.f) {
98  refsInfo_.reserve(3);
100  elementsStorage_.reserve(10);
102 
104 
105  // proceed with various consistency checks
106 
107  // charged candidate: track ref and charge must be non null
108  if (partId == h || partId == e || partId == mu) {
109  if (charge == 0) {
110  string err;
111  err += "Attempt to construct a charged PFCandidate with a zero charge";
112  throw cms::Exception("InconsistentValue", err.c_str());
113  }
114  } else {
115  if (charge) {
116  string err;
117  err += "Attempt to construct a neutral PFCandidate ";
118  err += "with a non-zero charge";
119  throw cms::Exception("InconsistentValue", err.c_str());
120  }
121  }
123 }
float deltaP_
uncertainty on 3-momentum
Definition: PFCandidate.h:494
reco::Muon::MuonTrackType muonTrackType_
Definition: PFCandidate.h:464
const edm::EDProductGetter * getter_
Definition: PFCandidate.h:551
float timeError_
timing information uncertainty (<0 if timing not available)
Definition: PFCandidate.h:559
float hcalERatio_
corrected HCAL energy ratio (corrected/raw)
Definition: PFCandidate.h:470
float rawHcalEnergy_
raw HCAL energy
Definition: PFCandidate.h:479
unsigned flags_
all flags, packed (ecal regional, hcal regional, tracking)
Definition: PFCandidate.h:491
float dnn_e_bkgTau_
DNN for electron PFid: tau bkg.
Definition: PFCandidate.h:530
float dnn_e_sigNonIsolated_
DNN for electron PFid: non-isolated signal.
Definition: PFCandidate.h:524
float mva_e_mu_
mva for electron-muon discrimination
Definition: PFCandidate.h:506
float mva_nothing_nh_
mva for neutral hadron detection
Definition: PFCandidate.h:515
float hoERatio_
corrected HO energy ratio (corrected/raw)
Definition: PFCandidate.h:473
float mva_gamma_nh_
mva for neutral hadron - gamma discrimination
Definition: PFCandidate.h:518
float ecalERatio_
corrected ECAL energy ratio (corrected/raw)
Definition: PFCandidate.h:467
float mva_pi_mu_
mva for pi-muon discrimination
Definition: PFCandidate.h:509
const LorentzVector & p4() const final
four-momentum Lorentz vector
float dnn_e_bkgPhoton_
DNN for electron PFid: photon bkg.
Definition: PFCandidate.h:533
float rawEcalEnergy_
raw ECAL energy
Definition: PFCandidate.h:476
float mva_e_pi_
mva for electron-pion discrimination
Definition: PFCandidate.h:503
std::vector< unsigned long long > refsInfo_
Definition: PFCandidate.h:553
float ps1Energy_
corrected PS1 energy
Definition: PFCandidate.h:485
unsigned short storedRefsBitPattern_
Definition: PFCandidate.h:552
CompositeCandidate(std::string name="")
default constructor
double f[11][100]
float rawHoEnergy_
raw HO energy
Definition: PFCandidate.h:482
void reserve(size_type n)
Reserve space for RefVector.
Definition: RefVector.h:108
int translateTypeToPdgId(ParticleType type) const
Definition: PFCandidate.cc:254
float dnn_e_sigIsolated_
DNN for electron PFid: isolated signal.
Definition: PFCandidate.h:521
std::atomic< ElementsInBlocks * > elementsInBlocks_
Definition: PFCandidate.h:451
PFVertexType vertexType_
Definition: PFCandidate.h:497
float time_
timing information (valid if timeError_ >= 0)
Definition: PFCandidate.h:557
float mva_nothing_gamma_
mva for gamma detection
Definition: PFCandidate.h:512
static constexpr float bigMva_
Definition: PFCandidate.h:411
float ps2Energy_
corrected PS2 energy
Definition: PFCandidate.h:488
float dnn_e_bkgNonIsolated_
DNN for electron PFid: non-isolated bkg.
Definition: PFCandidate.h:527
void setPdgId(int pdgId) final
Elements elementsStorage_
Definition: PFCandidate.h:456
int charge() const final
electric charge
std::array< float, 7 > hcalDepthEnergyFractions_
Definition: PFCandidate.h:561

◆ PFCandidate() [4/4]

PFCandidate::PFCandidate ( const PFCandidate iOther)

copy constructor

Definition at line 125 of file PFCandidate.cc.

References elementsInBlocks_, and createJobs::tmp.

126  : CompositeCandidate(iOther),
127  elementsInBlocks_(nullptr),
130  sourcePtr_(iOther.sourcePtr_),
132  ecalERatio_(iOther.ecalERatio_),
133  hcalERatio_(iOther.hcalERatio_),
134  hoERatio_(iOther.hoERatio_),
137  rawHoEnergy_(iOther.rawHoEnergy_),
138  ps1Energy_(iOther.ps1Energy_),
139  ps2Energy_(iOther.ps2Energy_),
140  flags_(iOther.flags_),
141  deltaP_(iOther.deltaP_),
142  vertexType_(iOther.vertexType_),
144  mva_e_pi_(iOther.mva_e_pi_),
145  mva_e_mu_(iOther.mva_e_mu_),
146  mva_pi_mu_(iOther.mva_pi_mu_),
155  dnn_gamma_(iOther.dnn_gamma_),
157  getter_(iOther.getter_),
159  refsInfo_(iOther.refsInfo_),
161  time_(iOther.time_),
162  timeError_(iOther.timeError_),
164  auto tmp = iOther.elementsInBlocks_.load(std::memory_order_acquire);
165  if (nullptr != tmp) {
166  elementsInBlocks_.store(new ElementsInBlocks{*tmp}, std::memory_order_release);
167  }
168 }
float deltaP_
uncertainty on 3-momentum
Definition: PFCandidate.h:494
reco::Muon::MuonTrackType muonTrackType_
Definition: PFCandidate.h:464
const edm::EDProductGetter * getter_
Definition: PFCandidate.h:551
float timeError_
timing information uncertainty (<0 if timing not available)
Definition: PFCandidate.h:559
float hcalERatio_
corrected HCAL energy ratio (corrected/raw)
Definition: PFCandidate.h:470
float rawHcalEnergy_
raw HCAL energy
Definition: PFCandidate.h:479
unsigned flags_
all flags, packed (ecal regional, hcal regional, tracking)
Definition: PFCandidate.h:491
float dnn_e_bkgTau_
DNN for electron PFid: tau bkg.
Definition: PFCandidate.h:530
float dnn_e_sigNonIsolated_
DNN for electron PFid: non-isolated signal.
Definition: PFCandidate.h:524
float mva_e_mu_
mva for electron-muon discrimination
Definition: PFCandidate.h:506
float mva_nothing_nh_
mva for neutral hadron detection
Definition: PFCandidate.h:515
std::vector< const void * > refsCollectionCache_
Definition: PFCandidate.h:554
float hoERatio_
corrected HO energy ratio (corrected/raw)
Definition: PFCandidate.h:473
float mva_gamma_nh_
mva for neutral hadron - gamma discrimination
Definition: PFCandidate.h:518
float ecalERatio_
corrected ECAL energy ratio (corrected/raw)
Definition: PFCandidate.h:467
float mva_pi_mu_
mva for pi-muon discrimination
Definition: PFCandidate.h:509
float dnn_e_bkgPhoton_
DNN for electron PFid: photon bkg.
Definition: PFCandidate.h:533
float rawEcalEnergy_
raw ECAL energy
Definition: PFCandidate.h:476
float mva_e_pi_
mva for electron-pion discrimination
Definition: PFCandidate.h:503
std::vector< unsigned long long > refsInfo_
Definition: PFCandidate.h:553
float ps1Energy_
corrected PS1 energy
Definition: PFCandidate.h:485
std::vector< ElementInBlock > ElementsInBlocks
unsigned short storedRefsBitPattern_
Definition: PFCandidate.h:552
CompositeCandidate(std::string name="")
default constructor
float rawHoEnergy_
raw HO energy
Definition: PFCandidate.h:482
float dnn_e_sigIsolated_
DNN for electron PFid: isolated signal.
Definition: PFCandidate.h:521
std::atomic< ElementsInBlocks * > elementsInBlocks_
Definition: PFCandidate.h:451
PFVertexType vertexType_
Definition: PFCandidate.h:497
PFCandidatePtr sourcePtr_
reference to the source PFCandidate, if any
Definition: PFCandidate.h:460
float time_
timing information (valid if timeError_ >= 0)
Definition: PFCandidate.h:557
math::XYZPointF positionAtECALEntrance_
position at ECAL entrance, from the PFRecTrack
Definition: PFCandidate.h:539
float mva_nothing_gamma_
mva for gamma detection
Definition: PFCandidate.h:512
float ps2Energy_
corrected PS2 energy
Definition: PFCandidate.h:488
tmp
align.sh
Definition: createJobs.py:716
float dnn_e_bkgNonIsolated_
DNN for electron PFid: non-isolated bkg.
Definition: PFCandidate.h:527
Elements elementsStorage_
Definition: PFCandidate.h:456
std::array< float, 7 > hcalDepthEnergyFractions_
Definition: PFCandidate.h:561

◆ ~PFCandidate()

PFCandidate::~PFCandidate ( )
override

destructor

Definition at line 217 of file PFCandidate.cc.

References elementsInBlocks_.

217 { delete elementsInBlocks_.load(std::memory_order_acquire); }
std::atomic< ElementsInBlocks * > elementsInBlocks_
Definition: PFCandidate.h:451

Member Function Documentation

◆ addElementInBlock()

void PFCandidate::addElementInBlock ( const reco::PFBlockRef blockref,
unsigned  elementIndex 
)

add an element to the current PFCandidate

add element in block

Definition at line 221 of file PFCandidate.cc.

References blocksStorage_, elementsInBlocks_, elementsStorage_, edm::RefVector< C, T, F >::empty(), edm::Ref< C, T, F >::id(), and edm::RefVector< C, T, F >::push_back().

221  {
222  //elementsInBlocks_.push_back( make_pair(blockref.key(), elementIndex) );
223  if (blocksStorage_.empty())
224  blocksStorage_ = Blocks(blockref.id());
225  blocksStorage_.push_back(blockref);
226  elementsStorage_.push_back(elementIndex);
227  auto ptr = elementsInBlocks_.exchange(nullptr);
228  delete ptr;
229 }
bool empty() const
Is the RefVector empty.
Definition: RefVector.h:99
ProductID id() const
Accessor for product ID.
Definition: Ref.h:244
edm::RefVector< reco::PFBlockCollection > Blocks
Definition: PFCandidate.h:406
std::atomic< ElementsInBlocks * > elementsInBlocks_
Definition: PFCandidate.h:451
void push_back(value_type const &ref)
Add a Ref<C, T> to the RefVector.
Definition: RefVector.h:67
Elements elementsStorage_
Definition: PFCandidate.h:456

◆ bestMuonTrackType()

const reco::Muon::MuonTrackType reco::PFCandidate::bestMuonTrackType ( ) const
inline

get the Best Muon Track Ref

Definition at line 385 of file PFCandidate.h.

References muonTrackType_.

385 { return muonTrackType_; }
reco::Muon::MuonTrackType muonTrackType_
Definition: PFCandidate.h:464

◆ bestTrack()

const reco::Track* reco::PFCandidate::bestTrack ( ) const
inlineoverridevirtual

return a pointer to the best track, if available. otherwise, return a null pointer

Reimplemented from reco::Candidate.

Definition at line 150 of file PFCandidate.h.

References funct::abs(), gsfTrackRef(), edm::Ref< C, T, F >::isAvailable(), edm::Ref< C, T, F >::isNonnull(), reco::LeafCandidate::pdgId(), and trackRef().

Referenced by btagbtvdeep::TrackInfoBuilder::buildTrackInfo(), dxyError(), dzError(), Muon.Muon::ptErr(), btagbtvdeep::recoCandidateToFeatures(), and DeepBoostedJetTagInfoProducer::useTrackProperties().

150  {
151  if ((abs(pdgId()) == 11 || pdgId() == 22) && gsfTrackRef().isNonnull() && gsfTrackRef().isAvailable())
152  return &(*gsfTrackRef());
153  else if (trackRef().isNonnull() && trackRef().isAvailable())
154  return &(*trackRef());
155  else
156  return nullptr;
157  }
reco::GsfTrackRef gsfTrackRef() const
Definition: PFCandidate.cc:469
bool isNonnull() const
Checks for non-null.
Definition: Ref.h:238
int pdgId() const final
PDG identifier.
bool isAvailable() const
Definition: Ref.h:541
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
reco::TrackRef trackRef() const
Definition: PFCandidate.cc:437

◆ clone()

PFCandidate * PFCandidate::clone ( void  ) const
overridevirtual

return a clone

Reimplemented from reco::CompositeCandidate.

Reimplemented in pat::PFParticle, and reco::PileUpPFCandidate.

Definition at line 219 of file PFCandidate.cc.

References PFCandidate().

219 { return new PFCandidate(*this); }
PFCandidate()
default constructor
Definition: PFCandidate.cc:23

◆ conversionRef()

reco::ConversionRef PFCandidate::conversionRef ( ) const

return a reference to the original conversion

Definition at line 540 of file PFCandidate.cc.

References GETREF, kRefConversionBit, and kRefConversionMask.

540  {
542 }
#define GETREF(_class_, _mask_, _bit_)
Definition: CountBits.h:4656

◆ deltaP()

double reco::PFCandidate::deltaP ( ) const
inline

uncertainty on 3-momentum

Definition at line 301 of file PFCandidate.h.

References deltaP_.

Referenced by PFElectronTranslator::createGsfElectrons().

301 { return deltaP_; }
float deltaP_
uncertainty on 3-momentum
Definition: PFCandidate.h:494

◆ displacedVertexRef()

reco::PFDisplacedVertexRef PFCandidate::displacedVertexRef ( Flags  type) const

return a reference to the corresponding displaced vertex, otherwise, return a null reference

Definition at line 510 of file PFCandidate.cc.

References GETREF, kRefDisplacedVertexDauBit, kRefDisplacedVertexDauMask, kRefDisplacedVertexMotBit, kRefDisplacedVertexMotMask, T_FROM_DISP, and T_TO_DISP.

Referenced by PFCandConnector::analyseNuclearWPrim().

◆ dnn_e_bkgNonIsolated()

float reco::PFCandidate::dnn_e_bkgNonIsolated ( ) const
inline

Definition at line 356 of file PFCandidate.h.

References dnn_e_bkgNonIsolated_.

356 { return dnn_e_bkgNonIsolated_; }
float dnn_e_bkgNonIsolated_
DNN for electron PFid: non-isolated bkg.
Definition: PFCandidate.h:527

◆ dnn_e_bkgPhoton()

float reco::PFCandidate::dnn_e_bkgPhoton ( ) const
inline

Definition at line 364 of file PFCandidate.h.

References dnn_e_bkgPhoton_.

364 { return dnn_e_bkgPhoton_; }
float dnn_e_bkgPhoton_
DNN for electron PFid: photon bkg.
Definition: PFCandidate.h:533

◆ dnn_e_bkgTau()

float reco::PFCandidate::dnn_e_bkgTau ( ) const
inline

Definition at line 360 of file PFCandidate.h.

References dnn_e_bkgTau_.

360 { return dnn_e_bkgTau_; }
float dnn_e_bkgTau_
DNN for electron PFid: tau bkg.
Definition: PFCandidate.h:530

◆ dnn_e_sigIsolated()

float reco::PFCandidate::dnn_e_sigIsolated ( ) const
inline

Definition at line 348 of file PFCandidate.h.

References dnn_e_sigIsolated_.

348 { return dnn_e_sigIsolated_; }
float dnn_e_sigIsolated_
DNN for electron PFid: isolated signal.
Definition: PFCandidate.h:521

◆ dnn_e_sigNonIsolated()

float reco::PFCandidate::dnn_e_sigNonIsolated ( ) const
inline

Definition at line 352 of file PFCandidate.h.

References dnn_e_sigNonIsolated_.

352 { return dnn_e_sigNonIsolated_; }
float dnn_e_sigNonIsolated_
DNN for electron PFid: non-isolated signal.
Definition: PFCandidate.h:524

◆ dnn_gamma()

float reco::PFCandidate::dnn_gamma ( ) const
inline

Definition at line 368 of file PFCandidate.h.

References dnn_gamma_.

368 { return dnn_gamma_; }

◆ dxyError()

float reco::PFCandidate::dxyError ( ) const
inlineoverridevirtual

uncertainty on dxy

Reimplemented from reco::Candidate.

Definition at line 167 of file PFCandidate.h.

References bestTrack(), and reco::TrackBase::dxyError().

167  {
168  const Track* tr = bestTrack();
169  if (tr != nullptr)
170  return tr->dxyError();
171  else
172  return 0;
173  }
const reco::Track * bestTrack() const override
Definition: PFCandidate.h:150

◆ dzError()

float reco::PFCandidate::dzError ( ) const
inlineoverridevirtual

uncertainty on dz

Reimplemented from reco::Candidate.

Definition at line 159 of file PFCandidate.h.

References bestTrack(), and reco::TrackBase::dzError().

159  {
160  const Track* tr = bestTrack();
161  if (tr != nullptr)
162  return tr->dzError();
163  else
164  return 0;
165  }
const reco::Track * bestTrack() const override
Definition: PFCandidate.h:150

◆ ecalEnergy()

double reco::PFCandidate::ecalEnergy ( ) const
inline

◆ egammaExtraRef()

reco::PFCandidateEGammaExtraRef PFCandidate::egammaExtraRef ( ) const

return a reference to the EGamma extra

Definition at line 583 of file PFCandidate.cc.

References GETREF, kRefPFEGammaExtraBit, and kRefPFEGammaExtraMask.

Referenced by PFAlgo::egammaFilters().

◆ electronExtraRef()

reco::PFCandidateElectronExtraRef PFCandidate::electronExtraRef ( ) const

◆ elementsInBlocks()

const PFCandidate::ElementsInBlocks & PFCandidate::elementsInBlocks ( ) const

Definition at line 665 of file PFCandidate.cc.

References blocksStorage_, elementsInBlocks_, elementsStorage_, edm::RefVector< C, T, F >::size(), and groupFilesInBlocks::temp.

Referenced by PFMuonAlgo::cleanPunchThroughAndFakes(), PFPhotonTranslator::correspondingDaughterCandidate(), PFElectronTranslator::correspondingDaughterCandidate(), PFCandidateBenchmark::fillOne(), PFBlockBasedIsolation::getHighestEtECALCluster(), reco::modules::HICaloCompatibleTrackSelector::matchPFCandToTrack(), and PFAlgo::recoTracksNotHCAL().

665  {
666  if (nullptr == elementsInBlocks_.load(std::memory_order_acquire)) {
667  std::unique_ptr<ElementsInBlocks> temp(new ElementsInBlocks(blocksStorage_.size()));
668  for (unsigned int icopy = 0; icopy != blocksStorage_.size(); ++icopy)
669  (*temp)[icopy] = std::make_pair(blocksStorage_[icopy], elementsStorage_[icopy]);
670  ElementsInBlocks* expected = nullptr;
671  if (elementsInBlocks_.compare_exchange_strong(expected, temp.get(), std::memory_order_acq_rel)) {
672  temp.release();
673  }
674  }
675  return *(elementsInBlocks_.load(std::memory_order_acquire));
676 }
std::vector< ElementInBlock > ElementsInBlocks
Definition: PFCandidate.h:404
std::vector< ElementInBlock > ElementsInBlocks
size_type size() const
Size of the RefVector.
Definition: RefVector.h:102
std::atomic< ElementsInBlocks * > elementsInBlocks_
Definition: PFCandidate.h:451
Elements elementsStorage_
Definition: PFCandidate.h:456

◆ flag() [1/2]

bool PFCandidate::flag ( Flags  theFlag) const

return a given flag

Definition at line 313 of file PFCandidate.cc.

References flags_.

Referenced by setConversionRef(), and setDisplacedVertexRef().

313 { return (flags_ >> theFlag) & 1; }
unsigned flags_
all flags, packed (ecal regional, hcal regional, tracking)
Definition: PFCandidate.h:491

◆ flag() [2/2]

bool reco::PFCandidate::flag ( unsigned  shift,
unsigned  flag 
) const
private

◆ getRefInfo()

bool PFCandidate::getRefInfo ( unsigned int  iMask,
unsigned int  iBit,
edm::ProductID oProdID,
size_t &  oIndex,
size_t &  aIndex 
) const
private

Definition at line 408 of file PFCandidate.cc.

References refsInfo_, s_refsBefore, and storedRefsBitPattern_.

409  {
410  if (0 == (iBit & storedRefsBitPattern_)) {
411  return false;
412  }
413  aIndex = s_refsBefore[storedRefsBitPattern_ & iMask];
414  unsigned long long bitPacked = refsInfo_[aIndex];
415  oIndex = bitPacked & 0xFFFFFFFFULL; //low 32 bits are the index
416  unsigned short productIndex = (bitPacked & 0x0000FFFF00000000ULL) >> 32;
417  unsigned short processIndex = (bitPacked & 0xFFFF000000000000ULL) >> 48;
418  oProductID = edm::ProductID(processIndex, productIndex);
419  return true;
420 }
std::vector< unsigned long long > refsInfo_
Definition: PFCandidate.h:553
unsigned short storedRefsBitPattern_
Definition: PFCandidate.h:552
static const unsigned int s_refsBefore[]
Definition: CountBits.h:14

◆ gsfElectronRef()

reco::GsfElectronRef PFCandidate::gsfElectronRef ( ) const

return a reference to the corresponding GsfElectron if any

Definition at line 559 of file PFCandidate.cc.

References GETREF, kRefGsfElectronBit, and kRefGsfElectronMask.

Referenced by SelectionStep< Object >::select().

◆ gsfTrackRef()

reco::GsfTrackRef PFCandidate::gsfTrackRef ( ) const

◆ hcalDepthEnergyFraction()

float reco::PFCandidate::hcalDepthEnergyFraction ( unsigned int  depth) const
inline

fraction of hcal energy at a given depth (depth = 1 .. 7)

Definition at line 433 of file PFCandidate.h.

References hcalRecHitTable_cff::depth, and hcalDepthEnergyFractions_.

433 { return hcalDepthEnergyFractions_[depth - 1]; }
std::array< float, 7 > hcalDepthEnergyFractions_
Definition: PFCandidate.h:561

◆ hcalDepthEnergyFractions()

const std::array<float, 7>& reco::PFCandidate::hcalDepthEnergyFractions ( ) const
inline

fraction of hcal energy at a given depth (index 0..6 for depth 1..7)

Definition at line 435 of file PFCandidate.h.

References hcalDepthEnergyFractions_.

435 { return hcalDepthEnergyFractions_; }
std::array< float, 7 > hcalDepthEnergyFractions_
Definition: PFCandidate.h:561

◆ hcalEnergy()

double reco::PFCandidate::hcalEnergy ( ) const
inline

◆ hoEnergy()

double reco::PFCandidate::hoEnergy ( ) const
inline

return corrected Hcal energy

Definition at line 245 of file PFCandidate.h.

References hoERatio_, and rawHoEnergy_.

Referenced by Jet.Jet::hoEnergyFraction(), reco::makeSpecific(), and reco::tau::PFRecoTauEnergyAlgorithmPlugin::operator()().

245 { return hoERatio_ * rawHoEnergy_; }
float hoERatio_
corrected HO energy ratio (corrected/raw)
Definition: PFCandidate.h:473
float rawHoEnergy_
raw HO energy
Definition: PFCandidate.h:482

◆ isTimeValid()

bool reco::PFCandidate::isTimeValid ( ) const
inline

do we have a valid time information

Definition at line 421 of file PFCandidate.h.

References timeError_.

Referenced by TransientTrackBuilder::build().

421 { return timeError_ >= 0.f; }
float timeError_
timing information uncertainty (<0 if timing not available)
Definition: PFCandidate.h:559

◆ muonRef()

reco::MuonRef PFCandidate::muonRef ( ) const

◆ mva_e_mu()

float reco::PFCandidate::mva_e_mu ( ) const
inline

mva for electron-muon discrimination

Definition at line 323 of file PFCandidate.h.

References mva_e_mu_.

323 { return mva_e_mu_; }
float mva_e_mu_
mva for electron-muon discrimination
Definition: PFCandidate.h:506

◆ mva_e_pi()

float reco::PFCandidate::mva_e_pi ( ) const
inline

mva for electron-pion discrimination

Definition at line 317 of file PFCandidate.h.

References mva_e_pi_.

Referenced by PFElectronTranslator::createGsfElectrons(), PFAlgo::egammaFilters(), and PFCandidateBenchmark::fillOne().

317 { return mva_e_pi_; }
float mva_e_pi_
mva for electron-pion discrimination
Definition: PFCandidate.h:503

◆ mva_gamma_nh()

float reco::PFCandidate::mva_gamma_nh ( ) const
inline

mva for neutral hadron - gamma discrimination

Definition at line 372 of file PFCandidate.h.

References mva_gamma_nh_.

372 { return mva_gamma_nh_; }
float mva_gamma_nh_
mva for neutral hadron - gamma discrimination
Definition: PFCandidate.h:518

◆ mva_Isolated()

float reco::PFCandidate::mva_Isolated ( ) const
inline

Definition at line 313 of file PFCandidate.h.

References mva_Isolated_.

313 { return mva_Isolated_; }

◆ mva_nothing_gamma()

float reco::PFCandidate::mva_nothing_gamma ( ) const
inline

mva for gamma detection

Definition at line 335 of file PFCandidate.h.

References mva_nothing_gamma_.

Referenced by PFIsolationEstimator::isPhotonParticleVetoed().

335 { return mva_nothing_gamma_; }
float mva_nothing_gamma_
mva for gamma detection
Definition: PFCandidate.h:512

◆ mva_nothing_nh()

float reco::PFCandidate::mva_nothing_nh ( ) const
inline

mva for neutral hadron detection

Definition at line 341 of file PFCandidate.h.

References mva_nothing_nh_.

341 { return mva_nothing_nh_; }
float mva_nothing_nh_
mva for neutral hadron detection
Definition: PFCandidate.h:515

◆ mva_pi_mu()

float reco::PFCandidate::mva_pi_mu ( ) const
inline

mva for pi-muon discrimination

Definition at line 329 of file PFCandidate.h.

References mva_pi_mu_.

329 { return mva_pi_mu_; }
float mva_pi_mu_
mva for pi-muon discrimination
Definition: PFCandidate.h:509

◆ numberOfSourceCandidatePtrs()

size_t reco::PFCandidate::numberOfSourceCandidatePtrs ( ) const
inlineoverridevirtual

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

Reimplemented from reco::LeafCandidate.

Definition at line 122 of file PFCandidate.h.

Referenced by reco::PFCandidateFwdPtrFactory::operator()().

122 { return 1; }

◆ operator=()

PFCandidate & PFCandidate::operator= ( PFCandidate const &  iOther)

Definition at line 170 of file PFCandidate.cc.

References blocksStorage_, deltaP_, dnn_e_bkgNonIsolated_, dnn_e_bkgPhoton_, dnn_e_bkgTau_, dnn_e_sigIsolated_, dnn_e_sigNonIsolated_, dnn_gamma_, ecalERatio_, elementsInBlocks_, elementsStorage_, flags_, getter_, hcalDepthEnergyFractions_, hcalERatio_, hoERatio_, muonTrackType_, mva_e_mu_, mva_e_pi_, mva_gamma_nh_, mva_Isolated_, mva_nothing_gamma_, mva_nothing_nh_, mva_pi_mu_, reco::LeafCandidate::operator=(), positionAtECALEntrance_, ps1Energy_, ps2Energy_, rawEcalEnergy_, rawHcalEnergy_, rawHoEnergy_, refsCollectionCache_, refsInfo_, sourcePtr_, storedRefsBitPattern_, time_, timeError_, createJobs::tmp, and vertexType_.

170  {
172  auto tmp = iOther.elementsInBlocks_.load(std::memory_order_acquire);
173  if (nullptr != tmp) {
174  delete elementsInBlocks_.exchange(new ElementsInBlocks{*tmp}, std::memory_order_acq_rel);
175  } else {
176  delete elementsInBlocks_.exchange(nullptr, std::memory_order_acq_rel);
177  }
178  blocksStorage_ = iOther.blocksStorage_;
179  elementsStorage_ = iOther.elementsStorage_;
180  sourcePtr_ = iOther.sourcePtr_;
181  muonTrackType_ = iOther.muonTrackType_;
182  ecalERatio_ = iOther.ecalERatio_;
183  hcalERatio_ = iOther.hcalERatio_;
184  hoERatio_ = iOther.hoERatio_;
185  rawEcalEnergy_ = iOther.rawEcalEnergy_;
186  rawHcalEnergy_ = iOther.rawHcalEnergy_;
187  rawHoEnergy_ = iOther.rawHoEnergy_;
188  ps1Energy_ = iOther.ps1Energy_;
189  ps2Energy_ = iOther.ps2Energy_;
190  flags_ = iOther.flags_;
191  deltaP_ = iOther.deltaP_;
192  vertexType_ = iOther.vertexType_;
193  mva_Isolated_ = iOther.mva_Isolated_;
194  mva_e_pi_ = iOther.mva_e_pi_;
195  mva_e_mu_ = iOther.mva_e_mu_;
196  mva_pi_mu_ = iOther.mva_pi_mu_;
197  mva_nothing_gamma_ = iOther.mva_nothing_gamma_;
198  mva_nothing_nh_ = iOther.mva_nothing_nh_;
199  mva_gamma_nh_ = iOther.mva_gamma_nh_;
200  dnn_e_sigIsolated_ = iOther.dnn_e_sigIsolated_;
201  dnn_e_sigNonIsolated_ = iOther.dnn_e_sigNonIsolated_;
202  dnn_e_bkgNonIsolated_ = iOther.dnn_e_bkgNonIsolated_;
203  dnn_e_bkgTau_ = iOther.dnn_e_bkgTau_;
204  dnn_e_bkgPhoton_ = iOther.dnn_e_bkgPhoton_;
205  dnn_gamma_ = iOther.dnn_gamma_;
206  positionAtECALEntrance_ = iOther.positionAtECALEntrance_;
207  getter_ = iOther.getter_;
208  storedRefsBitPattern_ = iOther.storedRefsBitPattern_;
209  refsInfo_ = iOther.refsInfo_;
210  refsCollectionCache_ = iOther.refsCollectionCache_;
211  time_ = iOther.time_;
212  timeError_ = iOther.timeError_;
213  hcalDepthEnergyFractions_ = iOther.hcalDepthEnergyFractions_;
214  return *this;
215 }
float deltaP_
uncertainty on 3-momentum
Definition: PFCandidate.h:494
reco::Muon::MuonTrackType muonTrackType_
Definition: PFCandidate.h:464
const edm::EDProductGetter * getter_
Definition: PFCandidate.h:551
float timeError_
timing information uncertainty (<0 if timing not available)
Definition: PFCandidate.h:559
float hcalERatio_
corrected HCAL energy ratio (corrected/raw)
Definition: PFCandidate.h:470
float rawHcalEnergy_
raw HCAL energy
Definition: PFCandidate.h:479
unsigned flags_
all flags, packed (ecal regional, hcal regional, tracking)
Definition: PFCandidate.h:491
float dnn_e_bkgTau_
DNN for electron PFid: tau bkg.
Definition: PFCandidate.h:530
float dnn_e_sigNonIsolated_
DNN for electron PFid: non-isolated signal.
Definition: PFCandidate.h:524
float mva_e_mu_
mva for electron-muon discrimination
Definition: PFCandidate.h:506
float mva_nothing_nh_
mva for neutral hadron detection
Definition: PFCandidate.h:515
std::vector< const void * > refsCollectionCache_
Definition: PFCandidate.h:554
float hoERatio_
corrected HO energy ratio (corrected/raw)
Definition: PFCandidate.h:473
float mva_gamma_nh_
mva for neutral hadron - gamma discrimination
Definition: PFCandidate.h:518
float ecalERatio_
corrected ECAL energy ratio (corrected/raw)
Definition: PFCandidate.h:467
float mva_pi_mu_
mva for pi-muon discrimination
Definition: PFCandidate.h:509
float dnn_e_bkgPhoton_
DNN for electron PFid: photon bkg.
Definition: PFCandidate.h:533
float rawEcalEnergy_
raw ECAL energy
Definition: PFCandidate.h:476
float mva_e_pi_
mva for electron-pion discrimination
Definition: PFCandidate.h:503
std::vector< unsigned long long > refsInfo_
Definition: PFCandidate.h:553
float ps1Energy_
corrected PS1 energy
Definition: PFCandidate.h:485
std::vector< ElementInBlock > ElementsInBlocks
unsigned short storedRefsBitPattern_
Definition: PFCandidate.h:552
float rawHoEnergy_
raw HO energy
Definition: PFCandidate.h:482
float dnn_e_sigIsolated_
DNN for electron PFid: isolated signal.
Definition: PFCandidate.h:521
std::atomic< ElementsInBlocks * > elementsInBlocks_
Definition: PFCandidate.h:451
PFVertexType vertexType_
Definition: PFCandidate.h:497
PFCandidatePtr sourcePtr_
reference to the source PFCandidate, if any
Definition: PFCandidate.h:460
float time_
timing information (valid if timeError_ >= 0)
Definition: PFCandidate.h:557
math::XYZPointF positionAtECALEntrance_
position at ECAL entrance, from the PFRecTrack
Definition: PFCandidate.h:539
float mva_nothing_gamma_
mva for gamma detection
Definition: PFCandidate.h:512
float ps2Energy_
corrected PS2 energy
Definition: PFCandidate.h:488
LeafCandidate & operator=(LeafCandidate &&)=default
tmp
align.sh
Definition: createJobs.py:716
float dnn_e_bkgNonIsolated_
DNN for electron PFid: non-isolated bkg.
Definition: PFCandidate.h:527
Elements elementsStorage_
Definition: PFCandidate.h:456
std::array< float, 7 > hcalDepthEnergyFractions_
Definition: PFCandidate.h:561

◆ overlap()

bool PFCandidate::overlap ( const Candidate other) const
overrideprivatevirtual

Polymorphic overlap.

Reimplemented from reco::CompositeCandidate.

Definition at line 280 of file PFCandidate.cc.

References mps_fire::i, edm::Ptr< T >::isNonnull(), edm::Ptr< T >::isNull(), dqmiodumpmetadata::n, trackingPlots::other, overlap(), sourceCandidatePtr(), and sourcePtr_.

Referenced by overlap().

280  {
281  CandidatePtr myPtr = sourceCandidatePtr(0);
282  if (myPtr.isNull())
283  return false;
284  for (size_t i = 0, n = other.numberOfSourceCandidatePtrs(); i < n; ++i) {
285  CandidatePtr otherPtr = other.sourceCandidatePtr(i);
286  if ((otherPtr == myPtr) || (sourcePtr_.isNonnull() && otherPtr.isNonnull() && sourcePtr_->overlap(*otherPtr))) {
287  return true;
288  }
289  }
290  return false;
291 }
bool overlap(const Candidate &) const override
Polymorphic overlap.
Definition: PFCandidate.cc:280
bool isNull() const
Checks for null.
Definition: Ptr.h:142
bool isNonnull() const
Checks for non-null.
Definition: Ptr.h:146
PFCandidatePtr sourcePtr_
reference to the source PFCandidate, if any
Definition: PFCandidate.h:460
CandidatePtr sourceCandidatePtr(size_type i) const override
Definition: PFCandidate.h:124

◆ particleId()

virtual ParticleType reco::PFCandidate::particleId ( ) const
inlinevirtual

◆ photonExtraRef()

reco::PFCandidatePhotonExtraRef PFCandidate::photonExtraRef ( ) const

return a reference to the photon extra

Definition at line 579 of file PFCandidate.cc.

References GETREF, kRefPFPhotonExtraBit, and kRefPFPhotonExtraMask.

◆ photonRef()

reco::PhotonRef PFCandidate::photonRef ( ) const

return a reference to the corresponding Photon if any

Definition at line 577 of file PFCandidate.cc.

References GETREF, kRefPhotonBit, and kRefPhotonMask.

#define GETREF(_class_, _mask_, _bit_)
Definition: CountBits.h:4656

◆ positionAtECALEntrance()

const math::XYZPointF& reco::PFCandidate::positionAtECALEntrance ( ) const
inline

◆ pS1Energy()

double reco::PFCandidate::pS1Energy ( ) const
inline

return corrected PS1 energy

Definition at line 280 of file PFCandidate.h.

References ps1Energy_.

280 { return ps1Energy_; }
float ps1Energy_
corrected PS1 energy
Definition: PFCandidate.h:485

◆ pS2Energy()

double reco::PFCandidate::pS2Energy ( ) const
inline

return corrected PS2 energy

Definition at line 286 of file PFCandidate.h.

References ps2Energy_.

286 { return ps2Energy_; }
float ps2Energy_
corrected PS2 energy
Definition: PFCandidate.h:488

◆ rawEcalEnergy()

double reco::PFCandidate::rawEcalEnergy ( ) const
inline

return corrected Ecal energy

Definition at line 224 of file PFCandidate.h.

References rawEcalEnergy_.

Referenced by PFMuonAlgo::cleanPunchThroughAndFakes(), and PFElectronTranslator::createBasicCluster().

224 { return rawEcalEnergy_; }
float rawEcalEnergy_
raw ECAL energy
Definition: PFCandidate.h:476

◆ rawHcalEnergy()

double reco::PFCandidate::rawHcalEnergy ( ) const
inline

return raw Hcal energy

Definition at line 236 of file PFCandidate.h.

References rawHcalEnergy_.

Referenced by PFMuonAlgo::cleanPunchThroughAndFakes().

236 { return rawHcalEnergy_; }
float rawHcalEnergy_
raw HCAL energy
Definition: PFCandidate.h:479

◆ rawHoEnergy()

double reco::PFCandidate::rawHoEnergy ( ) const
inline

return raw Hcal energy

Definition at line 248 of file PFCandidate.h.

References rawHoEnergy_.

248 { return rawHoEnergy_; }
float rawHoEnergy_
raw HO energy
Definition: PFCandidate.h:482

◆ rescaleMomentum()

void PFCandidate::rescaleMomentum ( double  rescaleFactor)

particle momentum *= rescaleFactor

Definition at line 294 of file PFCandidate.cc.

References e, Exception, reco::LeafCandidate::mass(), reco::LeafCandidate::p(), reco::LeafCandidate::px(), reco::LeafCandidate::py(), reco::LeafCandidate::pz(), reco::LeafCandidate::setP4(), mathSSE::sqrt(), and to_string().

294  {
295  if (rescaleFactor < 0)
296  throw cms::Exception(
297  "NegativeScaling",
298  "Scale factor " + std::to_string(rescaleFactor) + " is < 0. Cannot rescale momentum by this value");
299 
300  float e = std::sqrt(p() * p() * rescaleFactor * rescaleFactor + mass() * mass());
301 
302  LorentzVector rescaledp4(rescaleFactor * px(), rescaleFactor * py(), rescaleFactor * pz(), e);
303  setP4(rescaledp4);
304 }
double pz() const final
z coordinate of momentum vector
static std::string to_string(const XMLCh *ch)
double px() const final
x coordinate of momentum vector
double p() const final
magnitude of momentum vector
T sqrt(T t)
Definition: SSEVec.h:19
math::XYZTLorentzVector LorentzVector
double py() const final
y coordinate of momentum vector
double mass() const final
mass
void setP4(const LorentzVector &p4) final
set 4-momentum

◆ set_dnn_e_bkgNonIsolated()

void reco::PFCandidate::set_dnn_e_bkgNonIsolated ( float  mva)
inline

Definition at line 357 of file PFCandidate.h.

References dnn_e_bkgNonIsolated_, and beam_dqm_sourceclient-live_cfg::mva.

Referenced by PFAlgo::egammaFilters().

float dnn_e_bkgNonIsolated_
DNN for electron PFid: non-isolated bkg.
Definition: PFCandidate.h:527

◆ set_dnn_e_bkgPhoton()

void reco::PFCandidate::set_dnn_e_bkgPhoton ( float  mva)
inline

Definition at line 365 of file PFCandidate.h.

References dnn_e_bkgPhoton_, and beam_dqm_sourceclient-live_cfg::mva.

Referenced by PFAlgo::egammaFilters().

365 { dnn_e_bkgPhoton_ = mva; }
float dnn_e_bkgPhoton_
DNN for electron PFid: photon bkg.
Definition: PFCandidate.h:533

◆ set_dnn_e_bkgTau()

void reco::PFCandidate::set_dnn_e_bkgTau ( float  mva)
inline

Definition at line 361 of file PFCandidate.h.

References dnn_e_bkgTau_, and beam_dqm_sourceclient-live_cfg::mva.

Referenced by PFAlgo::egammaFilters().

361 { dnn_e_bkgTau_ = mva; }
float dnn_e_bkgTau_
DNN for electron PFid: tau bkg.
Definition: PFCandidate.h:530

◆ set_dnn_e_sigIsolated()

void reco::PFCandidate::set_dnn_e_sigIsolated ( float  mva)
inline

Definition at line 349 of file PFCandidate.h.

References dnn_e_sigIsolated_, and beam_dqm_sourceclient-live_cfg::mva.

Referenced by PFAlgo::egammaFilters().

349 { dnn_e_sigIsolated_ = mva; }
float dnn_e_sigIsolated_
DNN for electron PFid: isolated signal.
Definition: PFCandidate.h:521

◆ set_dnn_e_sigNonIsolated()

void reco::PFCandidate::set_dnn_e_sigNonIsolated ( float  mva)
inline

Definition at line 353 of file PFCandidate.h.

References dnn_e_sigNonIsolated_, and beam_dqm_sourceclient-live_cfg::mva.

Referenced by PFAlgo::egammaFilters().

float dnn_e_sigNonIsolated_
DNN for electron PFid: non-isolated signal.
Definition: PFCandidate.h:524

◆ set_dnn_gamma()

void reco::PFCandidate::set_dnn_gamma ( float  mva)
inline

◆ set_mva_e_mu()

void reco::PFCandidate::set_mva_e_mu ( float  mva)
inline

set mva for electron-muon discrimination

Definition at line 320 of file PFCandidate.h.

References beam_dqm_sourceclient-live_cfg::mva, and mva_e_mu_.

320 { mva_e_mu_ = mva; }
float mva_e_mu_
mva for electron-muon discrimination
Definition: PFCandidate.h:506

◆ set_mva_e_pi()

void reco::PFCandidate::set_mva_e_pi ( float  mvaNI)
inline

Definition at line 315 of file PFCandidate.h.

References mva_e_pi_.

Referenced by PFAlgo::egammaFilters().

315 { mva_e_pi_ = mvaNI; }
float mva_e_pi_
mva for electron-pion discrimination
Definition: PFCandidate.h:503

◆ set_mva_gamma_nh()

void reco::PFCandidate::set_mva_gamma_nh ( float  mva)
inline

set mva for neutral hadron - gamma discrimination

Definition at line 344 of file PFCandidate.h.

References beam_dqm_sourceclient-live_cfg::mva, and mva_gamma_nh_.

344 { mva_gamma_nh_ = mva; }
float mva_gamma_nh_
mva for neutral hadron - gamma discrimination
Definition: PFCandidate.h:518

◆ set_mva_Isolated()

void reco::PFCandidate::set_mva_Isolated ( float  mvaI)
inline

set mva for electron-pion discrimination. For charged particles, this variable is set to 0 for particles that are not preided to 1 otherwise For neutral particles, it is set to the default value

Definition at line 311 of file PFCandidate.h.

References mva_Isolated_.

Referenced by PFAlgo::egammaFilters().

311 { mva_Isolated_ = mvaI; }

◆ set_mva_nothing_gamma()

void reco::PFCandidate::set_mva_nothing_gamma ( float  mva)
inline

set mva for gamma detection

Definition at line 332 of file PFCandidate.h.

References beam_dqm_sourceclient-live_cfg::mva, and mva_nothing_gamma_.

Referenced by PFAlgo::egammaFilters().

◆ set_mva_nothing_nh()

void reco::PFCandidate::set_mva_nothing_nh ( float  mva)
inline

set mva for neutral hadron detection

Definition at line 338 of file PFCandidate.h.

References beam_dqm_sourceclient-live_cfg::mva, and mva_nothing_nh_.

338 { mva_nothing_nh_ = mva; }
float mva_nothing_nh_
mva for neutral hadron detection
Definition: PFCandidate.h:515

◆ set_mva_pi_mu()

void reco::PFCandidate::set_mva_pi_mu ( float  mva)
inline

set mva for pi-muon discrimination

Definition at line 326 of file PFCandidate.h.

References beam_dqm_sourceclient-live_cfg::mva, and mva_pi_mu_.

326 { mva_pi_mu_ = mva; }
float mva_pi_mu_
mva for pi-muon discrimination
Definition: PFCandidate.h:509

◆ setConversionRef()

void PFCandidate::setConversionRef ( const reco::ConversionRef ref)

set ref to original reco conversion

Definition at line 520 of file PFCandidate.cc.

References submitPVResolutionJobs::err, Exception, flag(), gamma, GAMMA_TO_GAMMACONV, edm::Ref< C, T, F >::isNonnull(), edm::Ref< C, T, F >::key(), kRefConversionBit, kRefConversionMask, EgammaValidation_cff::num, particleId(), edm::Ref< C, T, F >::productGetter(), edm::Ref< C, T, F >::refCore(), and storeRefInfo().

520  {
521  if (particleId() != gamma) {
522  string err;
523  err += "PFCandidate::setConversionRef: this is not a (converted) photon ! particleId_=";
524  char num[4];
525  sprintf(num, "%d", particleId());
526  err += num;
527 
528  throw cms::Exception("InconsistentReference", err.c_str());
529  } else if (!flag(GAMMA_TO_GAMMACONV)) {
530  string err;
531  err += "PFCandidate::setConversionRef: particule flag is not GAMMA_TO_GAMMACONV";
532 
533  throw cms::Exception("InconsistentReference", err.c_str());
534  }
535 
536  storeRefInfo(
537  kRefConversionMask, kRefConversionBit, iRef.isNonnull(), iRef.refCore(), iRef.key(), iRef.productGetter());
538 }
bool flag(Flags theFlag) const
return a given flag
Definition: PFCandidate.cc:313
void storeRefInfo(unsigned int iMask, unsigned int iBit, bool iIsValid, const edm::RefCore &iCore, size_t iKey, const edm::EDProductGetter *)
Definition: PFCandidate.cc:372
virtual ParticleType particleId() const
Definition: PFCandidate.h:392

◆ setDeltaP()

void reco::PFCandidate::setDeltaP ( double  dp)
inline

set uncertainty on momentum

Definition at line 298 of file PFCandidate.h.

References deltaP_, and Calorimetry_cff::dp.

298 { deltaP_ = dp; }
float deltaP_
uncertainty on 3-momentum
Definition: PFCandidate.h:494

◆ setDisplacedVertexRef()

void PFCandidate::setDisplacedVertexRef ( const reco::PFDisplacedVertexRef ref,
Flags  flag 
)

set displaced vertex reference

Definition at line 472 of file PFCandidate.cc.

References submitPVResolutionJobs::err, Exception, flag(), h, edm::Ref< C, T, F >::isNonnull(), edm::Ref< C, T, F >::key(), kRefDisplacedVertexDauBit, kRefDisplacedVertexDauMask, kRefDisplacedVertexMotBit, kRefDisplacedVertexMotMask, EgammaValidation_cff::num, particleId(), edm::Ref< C, T, F >::productGetter(), edm::Ref< C, T, F >::refCore(), storeRefInfo(), T_FROM_DISP, and T_TO_DISP.

472  {
473  if (particleId() != h) {
474  string err;
475  err += "PFCandidate::setDisplacedVertexRef: this is not a hadron! particleId_=";
476  char num[4];
477  sprintf(num, "%d", particleId());
478  err += num;
479 
480  throw cms::Exception("InconsistentReference", err.c_str());
481  } else if (!flag(T_FROM_DISP) && !flag(T_TO_DISP)) {
482  string err;
483  err += "PFCandidate::setDisplacedVertexRef: particule flag is neither T_FROM_DISP nor T_TO_DISP";
484 
485  throw cms::Exception("InconsistentReference", err.c_str());
486  }
487 
488  if (type == T_TO_DISP && flag(T_TO_DISP))
491  iRef.isNonnull(),
492  iRef.refCore(),
493  iRef.key(),
494  iRef.productGetter());
495  else if (type == T_FROM_DISP && flag(T_FROM_DISP))
498  iRef.isNonnull(),
499  iRef.refCore(),
500  iRef.key(),
501  iRef.productGetter());
502  else if ((type == T_FROM_DISP && !flag(T_FROM_DISP)) || (type == T_TO_DISP && !flag(T_TO_DISP))) {
503  string err;
504  err += "PFCandidate::setDisplacedVertexRef: particule flag is not switched on";
505 
506  throw cms::Exception("InconsistentReference", err.c_str());
507  }
508 }
bool flag(Flags theFlag) const
return a given flag
Definition: PFCandidate.cc:313
void storeRefInfo(unsigned int iMask, unsigned int iBit, bool iIsValid, const edm::RefCore &iCore, size_t iKey, const edm::EDProductGetter *)
Definition: PFCandidate.cc:372
virtual ParticleType particleId() const
Definition: PFCandidate.h:392

◆ setEcalEnergy()

void reco::PFCandidate::setEcalEnergy ( float  eeRaw,
float  eeCorr 
)
inline

set corrected Ecal energy

Definition at line 215 of file PFCandidate.h.

References funct::abs(), ecalERatio_, and rawEcalEnergy_.

215  {
216  rawEcalEnergy_ = eeRaw;
217  ecalERatio_ = std::abs(eeRaw) < 1.e-6 ? 1.0 : eeCorr / eeRaw;
218  }
float ecalERatio_
corrected ECAL energy ratio (corrected/raw)
Definition: PFCandidate.h:467
float rawEcalEnergy_
raw ECAL energy
Definition: PFCandidate.h:476
Abs< T >::type abs(const T &t)
Definition: Abs.h:22

◆ setFlag() [1/2]

void PFCandidate::setFlag ( Flags  theFlag,
bool  value 
)

set a given flag

Definition at line 306 of file PFCandidate.cc.

References flags_.

306  {
307  if (value)
308  flags_ = flags_ | (1 << theFlag);
309  else
310  flags_ = flags_ ^ (1 << theFlag);
311 }
unsigned flags_
all flags, packed (ecal regional, hcal regional, tracking)
Definition: PFCandidate.h:491
Definition: value.py:1

◆ setFlag() [2/2]

void reco::PFCandidate::setFlag ( unsigned  shift,
unsigned  flag,
bool  value 
)
private

◆ setGsfElectronRef()

void PFCandidate::setGsfElectronRef ( const reco::GsfElectronRef ref)

set GsfElectronRef

Definition at line 554 of file PFCandidate.cc.

References edm::Ref< C, T, F >::isNonnull(), edm::Ref< C, T, F >::key(), kRefGsfElectronBit, kRefGsfElectronMask, edm::Ref< C, T, F >::productGetter(), edm::Ref< C, T, F >::refCore(), and storeRefInfo().

554  {
555  storeRefInfo(
556  kRefGsfElectronMask, kRefGsfElectronBit, iRef.isNonnull(), iRef.refCore(), iRef.key(), iRef.productGetter());
557 }
void storeRefInfo(unsigned int iMask, unsigned int iBit, bool iIsValid, const edm::RefCore &iCore, size_t iKey, const edm::EDProductGetter *)
Definition: PFCandidate.cc:372

◆ setGsfTrackRef()

void PFCandidate::setGsfTrackRef ( const reco::GsfTrackRef ref)

set gsftrack reference

Definition at line 453 of file PFCandidate.cc.

References edm::Ref< C, T, F >::isNonnull(), edm::Ref< C, T, F >::key(), kRefGsfTrackBit, kRefGsfTrackMask, edm::Ref< C, T, F >::productGetter(), edm::Ref< C, T, F >::refCore(), and storeRefInfo().

453  {
454  // Removed by F. Beaudette. Would like to be able to save the GsfTrackRef even for charged pions
455  // if( particleId() != e ) {
456  // string err;
457  // err += "PFCandidate::setGsfTrackRef: this is not an electron ! particleId_=";
458  // char num[4];
459  // sprintf( num, "%d", particleId());
460  // err += num;
461  //
462  // throw cms::Exception("InconsistentReference",
463  // err.c_str() );
464  // }
465 
466  storeRefInfo(kRefGsfTrackMask, kRefGsfTrackBit, iRef.isNonnull(), iRef.refCore(), iRef.key(), iRef.productGetter());
467 }
void storeRefInfo(unsigned int iMask, unsigned int iBit, bool iIsValid, const edm::RefCore &iCore, size_t iKey, const edm::EDProductGetter *)
Definition: PFCandidate.cc:372

◆ setHcalDepthEnergyFractions()

void reco::PFCandidate::setHcalDepthEnergyFractions ( const std::array< float, 7 > &  fracs)
inline

set the fraction of hcal energy as function of depth (index 0..6 for depth 1..7)

Definition at line 437 of file PFCandidate.h.

References hcalDepthEnergyFractions_.

437 { hcalDepthEnergyFractions_ = fracs; }
std::array< float, 7 > hcalDepthEnergyFractions_
Definition: PFCandidate.h:561

◆ setHcalEnergy()

void reco::PFCandidate::setHcalEnergy ( float  ehRaw,
float  ehCorr 
)
inline

set corrected Hcal energy

Definition at line 227 of file PFCandidate.h.

References funct::abs(), hcalERatio_, and rawHcalEnergy_.

227  {
228  rawHcalEnergy_ = ehRaw;
229  hcalERatio_ = std::abs(ehRaw) < 1.e-6 ? 1.0 : ehCorr / ehRaw;
230  }
float hcalERatio_
corrected HCAL energy ratio (corrected/raw)
Definition: PFCandidate.h:470
float rawHcalEnergy_
raw HCAL energy
Definition: PFCandidate.h:479
Abs< T >::type abs(const T &t)
Definition: Abs.h:22

◆ setHoEnergy()

void reco::PFCandidate::setHoEnergy ( float  eoRaw,
float  eoCorr 
)
inline

set corrected Hcal energy

Definition at line 239 of file PFCandidate.h.

References funct::abs(), hoERatio_, and rawHoEnergy_.

239  {
240  rawHoEnergy_ = eoRaw;
241  hoERatio_ = std::abs(eoRaw) < 1.e-6 ? 1.0 : eoCorr / eoRaw;
242  }
float hoERatio_
corrected HO energy ratio (corrected/raw)
Definition: PFCandidate.h:473
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
float rawHoEnergy_
raw HO energy
Definition: PFCandidate.h:482

◆ setMuonRef()

void PFCandidate::setMuonRef ( const reco::MuonRef ref)

set muon reference

Definition at line 439 of file PFCandidate.cc.

References submitPVResolutionJobs::err, Exception, edm::Ref< C, T, F >::isNonnull(), edm::Ref< C, T, F >::key(), kRefMuonBit, kRefMuonMask, edm::Ref< C, T, F >::productGetter(), edm::Ref< C, T, F >::refCore(), storeRefInfo(), and trackRef().

Referenced by PFMuonAlgo::reconstructMuon().

439  {
440  if (trackRef() != iRef->track()) {
441  string err;
442  err += "PFCandidate::setMuonRef: inconsistent track references!";
443 
444  throw cms::Exception("InconsistentReference", err.c_str());
445  }
446 
447  storeRefInfo(kRefMuonMask, kRefMuonBit, iRef.isNonnull(), iRef.refCore(), iRef.key(), iRef.productGetter());
448 }
reco::TrackRef trackRef() const
Definition: PFCandidate.cc:437
void storeRefInfo(unsigned int iMask, unsigned int iBit, bool iIsValid, const edm::RefCore &iCore, size_t iKey, const edm::EDProductGetter *)
Definition: PFCandidate.cc:372

◆ setMuonTrackType()

void reco::PFCandidate::setMuonTrackType ( const reco::Muon::MuonTrackType type)
inline

set the Best Muon Track Ref

Definition at line 381 of file PFCandidate.h.

References muonTrackType_.

Referenced by PFMuonAlgo::changeTrack().

◆ setParticleType()

void PFCandidate::setParticleType ( ParticleType  type)

set Particle Type

Definition at line 278 of file PFCandidate.cc.

References reco::LeafCandidate::setPdgId(), and translateTypeToPdgId().

Referenced by PFMuonAlgo::changeTrack(), PFAlgo::egammaFilters(), and DeltaBetaWeights::produce().

int translateTypeToPdgId(ParticleType type) const
Definition: PFCandidate.cc:254
void setPdgId(int pdgId) final

◆ setPFEGammaExtraRef()

void PFCandidate::setPFEGammaExtraRef ( const reco::PFCandidateEGammaExtraRef ref)

set the PF EGamma Extra Ref

Definition at line 625 of file PFCandidate.cc.

References edm::Ref< C, T, F >::isNonnull(), edm::Ref< C, T, F >::key(), kRefPFEGammaExtraBit, kRefPFEGammaExtraMask, edm::Ref< C, T, F >::productGetter(), edm::Ref< C, T, F >::refCore(), and storeRefInfo().

625  {
626  storeRefInfo(
627  kRefPFEGammaExtraMask, kRefPFEGammaExtraBit, iRef.isNonnull(), iRef.refCore(), iRef.key(), iRef.productGetter());
628 }
void storeRefInfo(unsigned int iMask, unsigned int iBit, bool iIsValid, const edm::RefCore &iCore, size_t iKey, const edm::EDProductGetter *)
Definition: PFCandidate.cc:372

◆ setPFElectronExtraRef()

void PFCandidate::setPFElectronExtraRef ( const reco::PFCandidateElectronExtraRef ref)

set the PF Electron Extra Ref

Definition at line 564 of file PFCandidate.cc.

References edm::Ref< C, T, F >::isNonnull(), edm::Ref< C, T, F >::key(), kRefPFElectronExtraBit, kRefPFElectronExtraMask, edm::Ref< C, T, F >::productGetter(), edm::Ref< C, T, F >::refCore(), and storeRefInfo().

564  {
567  iRef.isNonnull(),
568  iRef.refCore(),
569  iRef.key(),
570  iRef.productGetter());
571 }
void storeRefInfo(unsigned int iMask, unsigned int iBit, bool iIsValid, const edm::RefCore &iCore, size_t iKey, const edm::EDProductGetter *)
Definition: PFCandidate.cc:372

◆ setPFPhotonExtraRef()

void PFCandidate::setPFPhotonExtraRef ( const reco::PFCandidatePhotonExtraRef ref)

set the PF Photon Extra Ref

Definition at line 620 of file PFCandidate.cc.

References edm::Ref< C, T, F >::isNonnull(), edm::Ref< C, T, F >::key(), kRefPFPhotonExtraBit, kRefPFPhotonExtraMask, edm::Ref< C, T, F >::productGetter(), edm::Ref< C, T, F >::refCore(), and storeRefInfo().

620  {
621  storeRefInfo(
622  kRefPFPhotonExtraMask, kRefPFPhotonExtraBit, iRef.isNonnull(), iRef.refCore(), iRef.key(), iRef.productGetter());
623 }
void storeRefInfo(unsigned int iMask, unsigned int iBit, bool iIsValid, const edm::RefCore &iCore, size_t iKey, const edm::EDProductGetter *)
Definition: PFCandidate.cc:372

◆ setPhotonRef()

void PFCandidate::setPhotonRef ( const reco::PhotonRef phRef)

set ref to the corresponding reco::Photon if any

Definition at line 591 of file PFCandidate.cc.

References e, submitPVResolutionJobs::err, Exception, gamma, edm::Ref< C, T, F >::isNonnull(), edm::Ref< C, T, F >::key(), kRefPhotonBit, kRefPhotonMask, EgammaValidation_cff::num, particleId(), edm::Ref< C, T, F >::productGetter(), edm::Ref< C, T, F >::refCore(), and storeRefInfo().

591  {
592  if (particleId() != gamma && particleId() != e) {
593  string err;
594  err += "PFCandidate::setSuperClusterRef: this is not an electron neither a photon ! particleId_=";
595  char num[4];
596  sprintf(num, "%d", particleId());
597  err += num;
598 
599  throw cms::Exception("InconsistentReference", err.c_str());
600  }
601 
602  storeRefInfo(kRefPhotonMask, kRefPhotonBit, iRef.isNonnull(), iRef.refCore(), iRef.key(), iRef.productGetter());
603 }
void storeRefInfo(unsigned int iMask, unsigned int iBit, bool iIsValid, const edm::RefCore &iCore, size_t iKey, const edm::EDProductGetter *)
Definition: PFCandidate.cc:372
virtual ParticleType particleId() const
Definition: PFCandidate.h:392

◆ setPositionAtECALEntrance()

void reco::PFCandidate::setPositionAtECALEntrance ( const math::XYZPointF pos)
inline

set position at ECAL entrance

Definition at line 375 of file PFCandidate.h.

References positionAtECALEntrance_.

math::XYZPointF positionAtECALEntrance_
position at ECAL entrance, from the PFRecTrack
Definition: PFCandidate.h:539

◆ setPs1Energy()

void reco::PFCandidate::setPs1Energy ( float  e1)
inline

set corrected PS1 energy

Definition at line 277 of file PFCandidate.h.

References StorageManager_cfg::e1, and ps1Energy_.

277 { ps1Energy_ = e1; }
float ps1Energy_
corrected PS1 energy
Definition: PFCandidate.h:485

◆ setPs2Energy()

void reco::PFCandidate::setPs2Energy ( float  e2)
inline

set corrected PS2 energy

Definition at line 283 of file PFCandidate.h.

References ps2Energy_.

283 { ps2Energy_ = e2; }
float ps2Energy_
corrected PS2 energy
Definition: PFCandidate.h:488

◆ setSourceCandidatePtr()

void reco::PFCandidate::setSourceCandidatePtr ( const PFCandidatePtr ptr)
inline

Definition at line 120 of file PFCandidate.h.

References sourcePtr_.

Referenced by PuppiPhoton::produce(), and VirtualJetProducer::writeJetsWithConstituents().

120 { sourcePtr_ = ptr; }
PFCandidatePtr sourcePtr_
reference to the source PFCandidate, if any
Definition: PFCandidate.h:460

◆ setSuperClusterRef()

void PFCandidate::setSuperClusterRef ( const reco::SuperClusterRef scRef)

Definition at line 605 of file PFCandidate.cc.

References e, submitPVResolutionJobs::err, Exception, gamma, edm::Ref< C, T, F >::isNonnull(), edm::Ref< C, T, F >::key(), kRefSuperClusterBit, kRefSuperClusterMask, EgammaValidation_cff::num, particleId(), edm::Ref< C, T, F >::productGetter(), edm::Ref< C, T, F >::refCore(), and storeRefInfo().

605  {
606  if (particleId() != gamma && particleId() != e) {
607  string err;
608  err += "PFCandidate::setSuperClusterRef: this is not an electron neither a photon ! particleId_=";
609  char num[4];
610  sprintf(num, "%d", particleId());
611  err += num;
612 
613  throw cms::Exception("InconsistentReference", err.c_str());
614  }
615 
616  storeRefInfo(
617  kRefSuperClusterMask, kRefSuperClusterBit, iRef.isNonnull(), iRef.refCore(), iRef.key(), iRef.productGetter());
618 }
void storeRefInfo(unsigned int iMask, unsigned int iBit, bool iIsValid, const edm::RefCore &iCore, size_t iKey, const edm::EDProductGetter *)
Definition: PFCandidate.cc:372
virtual ParticleType particleId() const
Definition: PFCandidate.h:392

◆ setTime()

void reco::PFCandidate::setTime ( float  time,
float  timeError = 0.f 
)
inline

the timing information

Definition at line 427 of file PFCandidate.h.

References time(), time_, timeError(), and timeError_.

427  {
428  time_ = time;
430  }
float timeError_
timing information uncertainty (<0 if timing not available)
Definition: PFCandidate.h:559
float time() const
Definition: PFCandidate.h:423
float timeError() const
Definition: PFCandidate.h:425
float time_
timing information (valid if timeError_ >= 0)
Definition: PFCandidate.h:557

◆ setTrackRef()

void PFCandidate::setTrackRef ( const reco::TrackRef ref)

set track reference

Definition at line 422 of file PFCandidate.cc.

References reco::LeafCandidate::charge(), submitPVResolutionJobs::err, Exception, edm::Ref< C, T, F >::isNonnull(), edm::Ref< C, T, F >::key(), kRefTrackBit, kRefTrackMask, EgammaValidation_cff::num, particleId(), edm::Ref< C, T, F >::productGetter(), edm::Ref< C, T, F >::refCore(), and storeRefInfo().

422  {
423  if (!charge()) {
424  string err;
425  err += "PFCandidate::setTrackRef: this is a neutral candidate! ";
426  err += "particleId_=";
427  char num[4];
428  sprintf(num, "%d", particleId());
429  err += num;
430 
431  throw cms::Exception("InconsistentReference", err.c_str());
432  }
433 
434  storeRefInfo(kRefTrackMask, kRefTrackBit, iRef.isNonnull(), iRef.refCore(), iRef.key(), iRef.productGetter());
435 }
int charge() const final
electric charge
void storeRefInfo(unsigned int iMask, unsigned int iBit, bool iIsValid, const edm::RefCore &iCore, size_t iKey, const edm::EDProductGetter *)
Definition: PFCandidate.cc:372
virtual ParticleType particleId() const
Definition: PFCandidate.h:392

◆ setV0Ref()

void PFCandidate::setV0Ref ( const reco::VertexCompositeCandidateRef ref)

set ref to original reco conversion

Definition at line 545 of file PFCandidate.cc.

References edm::Ref< C, T, F >::isNonnull(), edm::Ref< C, T, F >::key(), kRefV0Bit, kRefV0Mask, edm::Ref< C, T, F >::productGetter(), edm::Ref< C, T, F >::refCore(), and storeRefInfo().

545  {
546  storeRefInfo(kRefV0Mask, kRefV0Bit, iRef.isNonnull(), iRef.refCore(), iRef.key(), iRef.productGetter());
547 }
void storeRefInfo(unsigned int iMask, unsigned int iBit, bool iIsValid, const edm::RefCore &iCore, size_t iKey, const edm::EDProductGetter *)
Definition: PFCandidate.cc:372

◆ sourceCandidatePtr()

CandidatePtr reco::PFCandidate::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::LeafCandidate.

Definition at line 124 of file PFCandidate.h.

References sourcePtr_.

Referenced by reco::PFCandidateFwdPtrFactory::operator()(), and overlap().

124 { return sourcePtr_; }
PFCandidatePtr sourcePtr_
reference to the source PFCandidate, if any
Definition: PFCandidate.h:460

◆ storeRefInfo()

void PFCandidate::storeRefInfo ( unsigned int  iMask,
unsigned int  iBit,
bool  iIsValid,
const edm::RefCore iCore,
size_t  iKey,
const edm::EDProductGetter iGetter 
)
private

Definition at line 372 of file PFCandidate.cc.

References cms::cuda::assert(), bitPackRefInfo(), runTheMatrix::const, getter_, edm::RefCore::productPtr(), refsCollectionCache_, refsInfo_, s_refsBefore, and storedRefsBitPattern_.

Referenced by setConversionRef(), setDisplacedVertexRef(), setGsfElectronRef(), setGsfTrackRef(), setMuonRef(), setPFEGammaExtraRef(), setPFElectronExtraRef(), setPFPhotonExtraRef(), setPhotonRef(), setSuperClusterRef(), setTrackRef(), and setV0Ref().

377  {
378  size_t index = s_refsBefore[storedRefsBitPattern_ & iMask];
379  if (nullptr == getter_) {
380  getter_ = iGetter;
381  }
382 
383  if (iIsValid) {
384  if (0 == (storedRefsBitPattern_ & iBit)) {
385  refsInfo_.insert(refsInfo_.begin() + index, bitPackRefInfo(iCore, iKey));
386  if (iGetter == nullptr)
387  refsCollectionCache_.insert(refsCollectionCache_.begin() + index, static_cast<void const*>(iCore.productPtr()));
388  else
389  refsCollectionCache_.insert(refsCollectionCache_.begin() + index, nullptr);
390  } else {
391  assert(refsInfo_.size() > index);
392  *(refsInfo_.begin() + index) = bitPackRefInfo(iCore, iKey);
393  if (iGetter == nullptr)
394  *(refsCollectionCache_.begin() + index) = static_cast<void const*>(iCore.productPtr());
395  else
396  *(refsCollectionCache_.begin() + index) = nullptr;
397  }
398  storedRefsBitPattern_ |= iBit;
399  } else {
400  if (storedRefsBitPattern_ & iBit) {
401  refsInfo_.erase(refsInfo_.begin() + index);
403  storedRefsBitPattern_ ^= iBit;
404  }
405  }
406 }
const edm::EDProductGetter * getter_
Definition: PFCandidate.h:551
std::vector< const void * > refsCollectionCache_
Definition: PFCandidate.h:554
assert(be >=bs)
void const * productPtr() const
Definition: RefCore.h:51
std::vector< unsigned long long > refsInfo_
Definition: PFCandidate.h:553
unsigned short storedRefsBitPattern_
Definition: PFCandidate.h:552
unsigned int index
Definition: LeafCandidate.h:31
static const unsigned int s_refsBefore[]
Definition: CountBits.h:14
static unsigned long long bitPackRefInfo(const edm::RefCore &iCore, size_t iIndex)
Definition: PFCandidate.cc:365

◆ superClusterRef()

reco::SuperClusterRef PFCandidate::superClusterRef ( ) const

◆ time()

float reco::PFCandidate::time ( ) const
inline
Returns
the timing

Definition at line 423 of file PFCandidate.h.

References time_.

Referenced by TransientTrackBuilder::build(), and setTime().

423 { return time_; }
float time_
timing information (valid if timeError_ >= 0)
Definition: PFCandidate.h:557

◆ timeError()

float reco::PFCandidate::timeError ( ) const
inline
Returns
the timing uncertainty

Definition at line 425 of file PFCandidate.h.

References timeError_.

Referenced by TransientTrackBuilder::build(), and setTime().

425 { return timeError_; }
float timeError_
timing information uncertainty (<0 if timing not available)
Definition: PFCandidate.h:559

◆ trackRef()

reco::TrackRef PFCandidate::trackRef ( ) const

◆ translatePdgIdToType()

PFCandidate::ParticleType PFCandidate::translatePdgIdToType ( int  pdgid) const

Definition at line 231 of file PFCandidate.cc.

References funct::abs(), e, egamma_HF, gamma, h, h0, h_HF, mu, EgammaValidation_cff::pdgid, and X.

Referenced by particleId(), DeltaBetaWeights::produce(), PuppiPhoton::produce(), PuppiProducer::produce(), SoftKillerProducer::produce(), HiFJRhoFlowModulationProducer::produce(), and VirtualJetProducer::writeJetsWithConstituents().

231  {
232  switch (std::abs(pdgid)) {
233  case 211:
234  return h;
235  case 11:
236  return e;
237  case 13:
238  return mu;
239  case 22:
240  return gamma;
241  case 130:
242  return h0;
243  case 1:
244  return h_HF;
245  case 2:
246  return egamma_HF;
247  case 0:
248  return X;
249  default:
250  return X;
251  }
252 }
Abs< T >::type abs(const T &t)
Definition: Abs.h:22

◆ translateTypeToPdgId()

int PFCandidate::translateTypeToPdgId ( ParticleType  type) const

returns the pdg id corresponding to the particle type. the particle type could be removed at some point to gain some space. low priority

Definition at line 254 of file PFCandidate.cc.

References reco::LeafCandidate::charge(), e, egamma_HF, gamma, h, h0, h_HF, mu, and X.

Referenced by PFCandidate(), and setParticleType().

254  {
255  int thecharge = charge();
256 
257  switch (type) {
258  case h:
259  return thecharge * 211; // pi+
260  case e:
261  return thecharge * (-11);
262  case mu:
263  return thecharge * (-13);
264  case gamma:
265  return 22;
266  case h0:
267  return 130; // K_L0
268  case h_HF:
269  return 1; // dummy pdg code
270  case egamma_HF:
271  return 2; // dummy pdg code
272  case X:
273  default:
274  return 0;
275  }
276 }
int charge() const final
electric charge

◆ v0Ref()

reco::VertexCompositeCandidateRef PFCandidate::v0Ref ( ) const

return a reference to the original conversion

Definition at line 549 of file PFCandidate.cc.

References GETREF, kRefV0Bit, and kRefV0Mask.

◆ vertex()

const math::XYZPoint & PFCandidate::vertex ( ) const
overridevirtual

vertex position (overwritten by PF...)

Reimplemented from reco::LeafCandidate.

Definition at line 60 of file PFCandidate.cc.

References vertexLegacy(), and vertexType_.

Referenced by FWPFCandidate3DProxyBuilder::build(), Tau.Tau::dxy(), vx(), vy(), and vz().

60 { return vertexLegacy(vertexType_); }
PFVertexType vertexType_
Definition: PFCandidate.h:497
const math::XYZPoint & vertexLegacy(PFCandidate::PFVertexType vertexType) const
Definition: PFCandidate.cc:630

◆ vertexLegacy()

const math::XYZPoint & PFCandidate::vertexLegacy ( PFCandidate::PFVertexType  vertexType) const
private

Definition at line 630 of file PFCandidate.cc.

References gsfTrackRef(), kCandVertex, kComMuonVertex, kDYTMuonVertex, kGSFVertex, kPickyMuonVertex, kSAMuonVertex, kTPFMSMuonVertex, kTrkMuonVertex, kTrkVertex, muonRef(), trackRef(), and reco::LeafCandidate::vertex().

Referenced by vertex().

630  {
631  switch (vertexType) {
632  case kCandVertex:
633  return LeafCandidate::vertex();
634  break;
635  //the following cases will only be called for legacy AOD which does not have an embedded vertex
636  case kTrkVertex:
637  return trackRef()->vertex();
638  break;
639  case kComMuonVertex:
640  return muonRef()->combinedMuon()->vertex();
641  break;
642  case kSAMuonVertex:
643  return muonRef()->standAloneMuon()->vertex();
644  break;
645  case kTrkMuonVertex:
646  return muonRef()->track()->vertex();
647  break;
648  case kTPFMSMuonVertex:
649  return muonRef()->tpfmsTrack()->vertex();
650  break;
651  case kPickyMuonVertex:
652  return muonRef()->pickyTrack()->vertex();
653  break;
654  case kDYTMuonVertex:
655  return muonRef()->dytTrack()->vertex();
656  break;
657 
658  case kGSFVertex:
659  return gsfTrackRef()->vertex();
660  break;
661  }
662  return LeafCandidate::vertex();
663 }
reco::GsfTrackRef gsfTrackRef() const
Definition: PFCandidate.cc:469
const Point & vertex() const override
vertex position (overwritten by PF...)
reco::MuonRef muonRef() const
Definition: PFCandidate.cc:450
reco::TrackRef trackRef() const
Definition: PFCandidate.cc:437

◆ vx()

double reco::PFCandidate::vx ( ) const
inlineoverridevirtual

x coordinate of vertex position

Reimplemented from reco::LeafCandidate.

Definition at line 416 of file PFCandidate.h.

References vertex().

Referenced by PFIsolationEstimator::fGetIsolationInRings().

416 { return vertex().x(); }
const Point & vertex() const override
vertex position (overwritten by PF...)
Definition: PFCandidate.cc:60

◆ vy()

double reco::PFCandidate::vy ( ) const
inlineoverridevirtual

y coordinate of vertex position

Reimplemented from reco::LeafCandidate.

Definition at line 417 of file PFCandidate.h.

References vertex().

Referenced by PFIsolationEstimator::fGetIsolationInRings().

417 { return vertex().y(); }
const Point & vertex() const override
vertex position (overwritten by PF...)
Definition: PFCandidate.cc:60

◆ vz()

double reco::PFCandidate::vz ( ) const
inlineoverridevirtual

z coordinate of vertex position

Reimplemented from reco::LeafCandidate.

Definition at line 418 of file PFCandidate.h.

References vertex().

Referenced by PFIsolationEstimator::fGetIsolationInRings().

418 { return vertex().z(); }
const Point & vertex() const override
vertex position (overwritten by PF...)
Definition: PFCandidate.cc:60

Friends And Related Function Documentation

◆ operator<<

std::ostream& operator<< ( std::ostream &  out,
const PFCandidate c 
)
friend

Member Data Documentation

◆ bigMva_

constexpr float reco::PFCandidate::bigMva_ = -999.
static

Definition at line 411 of file PFCandidate.h.

◆ blocksStorage_

Blocks reco::PFCandidate::blocksStorage_
private

Definition at line 455 of file PFCandidate.h.

Referenced by addElementInBlock(), elementsInBlocks(), operator=(), and PFCandidate().

◆ deltaP_

float reco::PFCandidate::deltaP_
private

uncertainty on 3-momentum

Definition at line 494 of file PFCandidate.h.

Referenced by deltaP(), operator=(), and setDeltaP().

◆ dnn_e_bkgNonIsolated_

float reco::PFCandidate::dnn_e_bkgNonIsolated_
private

DNN for electron PFid: non-isolated bkg.

Definition at line 527 of file PFCandidate.h.

Referenced by dnn_e_bkgNonIsolated(), operator=(), and set_dnn_e_bkgNonIsolated().

◆ dnn_e_bkgPhoton_

float reco::PFCandidate::dnn_e_bkgPhoton_
private

DNN for electron PFid: photon bkg.

Definition at line 533 of file PFCandidate.h.

Referenced by dnn_e_bkgPhoton(), operator=(), and set_dnn_e_bkgPhoton().

◆ dnn_e_bkgTau_

float reco::PFCandidate::dnn_e_bkgTau_
private

DNN for electron PFid: tau bkg.

Definition at line 530 of file PFCandidate.h.

Referenced by dnn_e_bkgTau(), operator=(), and set_dnn_e_bkgTau().

◆ dnn_e_sigIsolated_

float reco::PFCandidate::dnn_e_sigIsolated_
private

DNN for electron PFid: isolated signal.

Definition at line 521 of file PFCandidate.h.

Referenced by dnn_e_sigIsolated(), operator=(), and set_dnn_e_sigIsolated().

◆ dnn_e_sigNonIsolated_

float reco::PFCandidate::dnn_e_sigNonIsolated_
private

DNN for electron PFid: non-isolated signal.

Definition at line 524 of file PFCandidate.h.

Referenced by dnn_e_sigNonIsolated(), operator=(), and set_dnn_e_sigNonIsolated().

◆ dnn_gamma_

float reco::PFCandidate::dnn_gamma_
private

Definition at line 536 of file PFCandidate.h.

Referenced by dnn_gamma(), operator=(), and set_dnn_gamma().

◆ ecalERatio_

float reco::PFCandidate::ecalERatio_
private

corrected ECAL energy ratio (corrected/raw)

Definition at line 467 of file PFCandidate.h.

Referenced by ecalEnergy(), operator=(), and setEcalEnergy().

◆ elementsInBlocks_

std::atomic<ElementsInBlocks*> reco::PFCandidate::elementsInBlocks_
mutableprivate

◆ elementsStorage_

Elements reco::PFCandidate::elementsStorage_
private

Definition at line 456 of file PFCandidate.h.

Referenced by addElementInBlock(), elementsInBlocks(), operator=(), and PFCandidate().

◆ flags_

unsigned reco::PFCandidate::flags_
private

all flags, packed (ecal regional, hcal regional, tracking)

Definition at line 491 of file PFCandidate.h.

Referenced by flag(), operator=(), and setFlag().

◆ getter_

const edm::EDProductGetter* reco::PFCandidate::getter_
private

Definition at line 551 of file PFCandidate.h.

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

◆ hcalDepthEnergyFractions_

std::array<float, 7> reco::PFCandidate::hcalDepthEnergyFractions_
private

◆ hcalERatio_

float reco::PFCandidate::hcalERatio_
private

corrected HCAL energy ratio (corrected/raw)

Definition at line 470 of file PFCandidate.h.

Referenced by hcalEnergy(), operator=(), and setHcalEnergy().

◆ hoERatio_

float reco::PFCandidate::hoERatio_
private

corrected HO energy ratio (corrected/raw)

Definition at line 473 of file PFCandidate.h.

Referenced by hoEnergy(), operator=(), and setHoEnergy().

◆ muonTrackType_

reco::Muon::MuonTrackType reco::PFCandidate::muonTrackType_
private

Reference to the best track if it is a muon pF is allowed to switch the default muon track

Definition at line 464 of file PFCandidate.h.

Referenced by bestMuonTrackType(), operator=(), PFCandidate(), and setMuonTrackType().

◆ mva_e_mu_

float reco::PFCandidate::mva_e_mu_
private

mva for electron-muon discrimination

Definition at line 506 of file PFCandidate.h.

Referenced by mva_e_mu(), operator=(), and set_mva_e_mu().

◆ mva_e_pi_

float reco::PFCandidate::mva_e_pi_
private

mva for electron-pion discrimination

Definition at line 503 of file PFCandidate.h.

Referenced by mva_e_pi(), operator=(), and set_mva_e_pi().

◆ mva_gamma_nh_

float reco::PFCandidate::mva_gamma_nh_
private

mva for neutral hadron - gamma discrimination

Definition at line 518 of file PFCandidate.h.

Referenced by mva_gamma_nh(), operator=(), and set_mva_gamma_nh().

◆ mva_Isolated_

float reco::PFCandidate::mva_Isolated_
private

Definition at line 500 of file PFCandidate.h.

Referenced by mva_Isolated(), operator=(), and set_mva_Isolated().

◆ mva_nothing_gamma_

float reco::PFCandidate::mva_nothing_gamma_
private

mva for gamma detection

Definition at line 512 of file PFCandidate.h.

Referenced by mva_nothing_gamma(), operator=(), and set_mva_nothing_gamma().

◆ mva_nothing_nh_

float reco::PFCandidate::mva_nothing_nh_
private

mva for neutral hadron detection

Definition at line 515 of file PFCandidate.h.

Referenced by mva_nothing_nh(), operator=(), and set_mva_nothing_nh().

◆ mva_pi_mu_

float reco::PFCandidate::mva_pi_mu_
private

mva for pi-muon discrimination

Definition at line 509 of file PFCandidate.h.

Referenced by mva_pi_mu(), operator=(), and set_mva_pi_mu().

◆ positionAtECALEntrance_

math::XYZPointF reco::PFCandidate::positionAtECALEntrance_
private

position at ECAL entrance, from the PFRecTrack

Definition at line 539 of file PFCandidate.h.

Referenced by operator=(), positionAtECALEntrance(), and setPositionAtECALEntrance().

◆ ps1Energy_

float reco::PFCandidate::ps1Energy_
private

corrected PS1 energy

Definition at line 485 of file PFCandidate.h.

Referenced by operator=(), pS1Energy(), and setPs1Energy().

◆ ps2Energy_

float reco::PFCandidate::ps2Energy_
private

corrected PS2 energy

Definition at line 488 of file PFCandidate.h.

Referenced by operator=(), pS2Energy(), and setPs2Energy().

◆ rawEcalEnergy_

float reco::PFCandidate::rawEcalEnergy_
private

raw ECAL energy

Definition at line 476 of file PFCandidate.h.

Referenced by ecalEnergy(), operator=(), rawEcalEnergy(), and setEcalEnergy().

◆ rawHcalEnergy_

float reco::PFCandidate::rawHcalEnergy_
private

raw HCAL energy

Definition at line 479 of file PFCandidate.h.

Referenced by hcalEnergy(), operator=(), rawHcalEnergy(), and setHcalEnergy().

◆ rawHoEnergy_

float reco::PFCandidate::rawHoEnergy_
private

raw HO energy

Definition at line 482 of file PFCandidate.h.

Referenced by hoEnergy(), operator=(), rawHoEnergy(), and setHoEnergy().

◆ refsCollectionCache_

std::vector<const void*> reco::PFCandidate::refsCollectionCache_
private

Definition at line 554 of file PFCandidate.h.

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

◆ refsInfo_

std::vector<unsigned long long> reco::PFCandidate::refsInfo_
private

Definition at line 553 of file PFCandidate.h.

Referenced by getRefInfo(), operator=(), PFCandidate(), and storeRefInfo().

◆ sourcePtr_

PFCandidatePtr reco::PFCandidate::sourcePtr_
private

reference to the source PFCandidate, if any

Definition at line 460 of file PFCandidate.h.

Referenced by operator=(), overlap(), PFCandidate(), setSourceCandidatePtr(), and sourceCandidatePtr().

◆ storedRefsBitPattern_

unsigned short reco::PFCandidate::storedRefsBitPattern_
private

Definition at line 552 of file PFCandidate.h.

Referenced by getRefInfo(), operator=(), and storeRefInfo().

◆ time_

float reco::PFCandidate::time_
private

timing information (valid if timeError_ >= 0)

Definition at line 557 of file PFCandidate.h.

Referenced by operator=(), setTime(), and time().

◆ timeError_

float reco::PFCandidate::timeError_
private

timing information uncertainty (<0 if timing not available)

Definition at line 559 of file PFCandidate.h.

Referenced by isTimeValid(), operator=(), setTime(), and timeError().

◆ vertexType_

PFVertexType reco::PFCandidate::vertexType_
private

Definition at line 497 of file PFCandidate.h.

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