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:467
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:435

◆ 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 538 of file PFCandidate.cc.

References GETREF, kRefConversionBit, and kRefConversionMask.

538  {
540 }
#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 508 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 581 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 663 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().

663  {
664  if (nullptr == elementsInBlocks_.load(std::memory_order_acquire)) {
665  std::unique_ptr<ElementsInBlocks> temp(new ElementsInBlocks(blocksStorage_.size()));
666  for (unsigned int icopy = 0; icopy != blocksStorage_.size(); ++icopy)
667  (*temp)[icopy] = std::make_pair(blocksStorage_[icopy], elementsStorage_[icopy]);
668  ElementsInBlocks* expected = nullptr;
669  if (elementsInBlocks_.compare_exchange_strong(expected, temp.get(), std::memory_order_acq_rel)) {
670  temp.release();
671  }
672  }
673  return *(elementsInBlocks_.load(std::memory_order_acquire));
674 }
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 311 of file PFCandidate.cc.

References flags_.

Referenced by setConversionRef(), and setDisplacedVertexRef().

311 { 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 406 of file PFCandidate.cc.

References refsInfo_, s_refsBefore, and storedRefsBitPattern_.

407  {
408  if (0 == (iBit & storedRefsBitPattern_)) {
409  return false;
410  }
411  aIndex = s_refsBefore[storedRefsBitPattern_ & iMask];
412  unsigned long long bitPacked = refsInfo_[aIndex];
413  oIndex = bitPacked & 0xFFFFFFFFULL; //low 32 bits are the index
414  unsigned short productIndex = (bitPacked & 0x0000FFFF00000000ULL) >> 32;
415  unsigned short processIndex = (bitPacked & 0xFFFF000000000000ULL) >> 48;
416  oProductID = edm::ProductID(processIndex, productIndex);
417  return true;
418 }
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 557 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 LEDCalibrationChannels::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 577 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 575 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 reco::LeafCandidate::energy(), Exception, reco::LeafCandidate::p(), reco::LeafCandidate::px(), reco::LeafCandidate::py(), reco::LeafCandidate::pz(), reco::LeafCandidate::setP4(), mathSSE::sqrt(), and cond::impl::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  float rescaleE = std::sqrt(p() * p() * (rescaleFactor * rescaleFactor - 1) / (energy() * energy()) + 1);
300  LorentzVector rescaledp4(rescaleFactor * px(), rescaleFactor * py(), rescaleFactor * pz(), rescaleE * energy());
301  setP4(rescaledp4);
302 }
double pz() const final
z coordinate of momentum vector
std::string to_string(const V &value)
Definition: OMSAccess.h:77
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
void setP4(const LorentzVector &p4) final
set 4-momentum
double energy() const final
energy

◆ 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 518 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().

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

470  {
471  if (particleId() != h) {
472  string err;
473  err += "PFCandidate::setDisplacedVertexRef: this is not a hadron! particleId_=";
474  char num[4];
475  sprintf(num, "%d", particleId());
476  err += num;
477 
478  throw cms::Exception("InconsistentReference", err.c_str());
479  } else if (!flag(T_FROM_DISP) && !flag(T_TO_DISP)) {
480  string err;
481  err += "PFCandidate::setDisplacedVertexRef: particule flag is neither T_FROM_DISP nor T_TO_DISP";
482 
483  throw cms::Exception("InconsistentReference", err.c_str());
484  }
485 
486  if (type == T_TO_DISP && flag(T_TO_DISP))
489  iRef.isNonnull(),
490  iRef.refCore(),
491  iRef.key(),
492  iRef.productGetter());
493  else if (type == T_FROM_DISP && flag(T_FROM_DISP))
496  iRef.isNonnull(),
497  iRef.refCore(),
498  iRef.key(),
499  iRef.productGetter());
500  else if ((type == T_FROM_DISP && !flag(T_FROM_DISP)) || (type == T_TO_DISP && !flag(T_TO_DISP))) {
501  string err;
502  err += "PFCandidate::setDisplacedVertexRef: particule flag is not switched on";
503 
504  throw cms::Exception("InconsistentReference", err.c_str());
505  }
506 }
bool flag(Flags theFlag) const
return a given flag
Definition: PFCandidate.cc:311
void storeRefInfo(unsigned int iMask, unsigned int iBit, bool iIsValid, const edm::RefCore &iCore, size_t iKey, const edm::EDProductGetter *)
Definition: PFCandidate.cc:370
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 304 of file PFCandidate.cc.

References flags_.

304  {
305  if (value)
306  flags_ = flags_ | (1 << theFlag);
307  else
308  flags_ = flags_ ^ (1 << theFlag);
309 }
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 552 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().

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

◆ setGsfTrackRef()

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

set gsftrack reference

Definition at line 451 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().

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

◆ 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 437 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().

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

◆ 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 623 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().

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

◆ setPFElectronExtraRef()

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

set the PF Electron Extra Ref

Definition at line 562 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().

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

◆ setPFPhotonExtraRef()

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

set the PF Photon Extra Ref

Definition at line 618 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().

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

◆ setPhotonRef()

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

set ref to the corresponding reco::Photon if any

Definition at line 589 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().

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

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

420  {
421  if (!charge()) {
422  string err;
423  err += "PFCandidate::setTrackRef: this is a neutral candidate! ";
424  err += "particleId_=";
425  char num[4];
426  sprintf(num, "%d", particleId());
427  err += num;
428 
429  throw cms::Exception("InconsistentReference", err.c_str());
430  }
431 
432  storeRefInfo(kRefTrackMask, kRefTrackBit, iRef.isNonnull(), iRef.refCore(), iRef.key(), iRef.productGetter());
433 }
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:370
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 543 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().

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

◆ 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 370 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().

375  {
376  size_t index = s_refsBefore[storedRefsBitPattern_ & iMask];
377  if (nullptr == getter_) {
378  getter_ = iGetter;
379  }
380 
381  if (iIsValid) {
382  if (0 == (storedRefsBitPattern_ & iBit)) {
383  refsInfo_.insert(refsInfo_.begin() + index, bitPackRefInfo(iCore, iKey));
384  if (iGetter == nullptr)
385  refsCollectionCache_.insert(refsCollectionCache_.begin() + index, static_cast<void const*>(iCore.productPtr()));
386  else
387  refsCollectionCache_.insert(refsCollectionCache_.begin() + index, nullptr);
388  } else {
389  assert(refsInfo_.size() > index);
390  *(refsInfo_.begin() + index) = bitPackRefInfo(iCore, iKey);
391  if (iGetter == nullptr)
392  *(refsCollectionCache_.begin() + index) = static_cast<void const*>(iCore.productPtr());
393  else
394  *(refsCollectionCache_.begin() + index) = nullptr;
395  }
396  storedRefsBitPattern_ |= iBit;
397  } else {
398  if (storedRefsBitPattern_ & iBit) {
399  refsInfo_.erase(refsInfo_.begin() + index);
401  storedRefsBitPattern_ ^= iBit;
402  }
403  }
404 }
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:363

◆ 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(), 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 547 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:628

◆ vertexLegacy()

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

Definition at line 628 of file PFCandidate.cc.

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

Referenced by vertex().

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

◆ 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().