43 vertexType_(kCandVertex),
44 mva_Isolated_(bigMva_),
48 mva_nothing_gamma_(bigMva_),
49 mva_nothing_nh_(bigMva_),
50 mva_gamma_nh_(bigMva_),
51 getter_(
nullptr),storedRefsBitPattern_(0),
52 time_(0.
f),timeError_(-1.
f)
114 err+=
"Attempt to construct a charged PFCandidate with a zero charge";
122 err +=
"Attempt to construct a neutral PFCandidate ";
123 err +=
"with a non-zero charge";
221 unsigned elementIndex ) {
238 case 22:
return gamma;
252 case h:
return thecharge*211;
253 case e:
return thecharge*(-11);
254 case mu:
return thecharge*(-13);
255 case gamma:
return 22;
272 if (myPtr.
isNull())
return false;
275 if ((otherPtr == myPtr) ||
289 rescaledp4 *= rescaleFactor;
306 return (
flags_>>theFlag) & 1;
318 out<<setiosflags(ios::right);
320 out<<setprecision(3);
321 out<<
" E/pT/eta/phi " 331 out<<
", blocks/iele: ";
334 for(
unsigned i=0;
i<eleInBlocks.size();
i++) {
336 unsigned indexInBlock = eleInBlocks[
i].second;
338 out<<
"("<<blockRef.
key()<<
"|"<<indexInBlock<<
"), ";
364 unsigned long long bitPack = iIndex;
365 bitPack |=
static_cast<unsigned long long>(iCore.
id().
productIndex())<<32;
366 bitPack |=
static_cast<unsigned long long>(iCore.
id().
processIndex())<<48;
385 if (iGetter==
nullptr)
387 static_cast<void const*
>(iCore.
productPtr()));
393 if (iGetter==
nullptr)
411 edm::ProductID& oProductID,
size_t& oIndex,
size_t& aIndex)
const {
417 unsigned long long bitPacked =
refsInfo_[aIndex];
418 oIndex = bitPacked & 0xFFFFFFFFULL;
419 unsigned short productIndex = (bitPacked & 0x0000FFFF00000000ULL)>>32;
420 unsigned short processIndex = (bitPacked & 0xFFFF000000000000ULL)>>48;
428 err +=
"PFCandidate::setTrackRef: this is a neutral candidate! ";
429 err +=
"particleId_=";
449 err +=
"PFCandidate::setMuonRef: inconsistent track references!";
488 err +=
"PFCandidate::setDisplacedVertexRef: this is not a hadron! particleId_=";
498 err +=
"PFCandidate::setDisplacedVertexRef: particule flag is neither T_FROM_DISP nor T_TO_DISP";
517 err +=
"PFCandidate::setDisplacedVertexRef: particule flag is not switched on";
542 err +=
"PFCandidate::setConversionRef: this is not a (converted) photon ! particleId_=";
552 err +=
"PFCandidate::setConversionRef: particule flag is not GAMMA_TO_GAMMACONV";
616 err +=
"PFCandidate::setSuperClusterRef: this is not an electron neither a photon ! particleId_=";
632 err +=
"PFCandidate::setSuperClusterRef: this is not an electron neither a photon ! particleId_=";
665 return muonRef()->combinedMuon()->vertex();
668 return muonRef()->standAloneMuon()->vertex();
671 return muonRef()->track()->vertex();
674 return muonRef()->tpfmsTrack()->vertex();
677 return muonRef()->pickyTrack()->vertex();
680 return muonRef()->dytTrack()->vertex();
699 if(
elementsInBlocks_.compare_exchange_strong(expected,temp.get(),std::memory_order_acq_rel)) {
~PFCandidate() override
destructor
float deltaP_
uncertainty on 3-momentum
int Charge
electric charge type
ParticleType
particle types
reco::Muon::MuonTrackType muonTrackType_
bool isNonnull() const
Checks for non-null.
double eta() const final
momentum pseudorapidity
const edm::EDProductGetter * getter_
void setPFPhotonExtraRef(const reco::PFCandidatePhotonExtraRef &ref)
set the PF Photon Extra Ref
void setGsfElectronRef(const reco::GsfElectronRef &ref)
set GsfElectronRef
void setFlag(Flags theFlag, bool value)
set a given flag
bool getRefInfo(unsigned int iMask, unsigned int iBit, edm::ProductID &oProdID, size_t &oIndex, size_t &aIndex) const
float timeError_
timing information uncertainty (<0 if timing not available)
float hcalERatio_
corrected HCAL energy ratio (corrected/raw)
float rawHcalEnergy_
raw HCAL energy
unsigned flags_
all flags, packed (ecal regional, hcal regional, tracking)
virtual CandidatePtr sourceCandidatePtr(size_type i) const
float mva_e_mu_
mva for electron-muon discrimination
static const float bigMva_
std::array< float, 7 > hcalDepthEnergyFractions_
bool overlap(const Candidate &) const override
Polymorphic overlap.
float mva_nothing_nh_
mva for neutral hadron detection
RefCore const & refCore() const
ProcessIndex productIndex() const
double pt() const final
transverse momentum
int charge() const final
electric charge
float hoERatio_
corrected HO energy ratio (corrected/raw)
edm::RefVector< reco::PFBlockCollection > Blocks
key_type key() const
Accessor for product key.
reco::PFCandidatePhotonExtraRef photonExtraRef() const
return a reference to the photon extra
float mva_gamma_nh_
mva for neutral hadron - gamma discrimination
float ecalERatio_
corrected ECAL energy ratio (corrected/raw)
virtual size_t numberOfSourceCandidatePtrs() const =0
float mva_pi_mu_
mva for pi-muon discrimination
bool empty() const
Is the RefVector empty.
std::vector< ElementInBlock > ElementsInBlocks
ProductID id() const
Accessor for product ID.
float rawEcalEnergy_
raw ECAL energy
reco::TrackRef trackRef() const
float mva_e_pi_
mva for electron-pion discrimination
reco::PFDisplacedVertexRef displacedVertexRef(Flags type) const
const Point & vertex() const override
vertex position (overwritten by PF...)
std::vector< unsigned long long > refsInfo_
static unsigned long long bitPackRefInfo(const edm::RefCore &iCore, size_t iIndex)
void setDisplacedVertexRef(const reco::PFDisplacedVertexRef &ref, Flags flag)
set displaced vertex reference
std::ostream & operator<<(std::ostream &, BeamSpot beam)
float ps1Energy_
corrected PS1 energy
CandidatePtr sourceCandidatePtr(size_type i) const override
void addElementInBlock(const reco::PFBlockRef &blockref, unsigned elementIndex)
add an element to the current PFCandidate
void setPFElectronExtraRef(const reco::PFCandidateElectronExtraRef &ref)
set the PF Electron Extra Ref
void setParticleType(ParticleType type)
set Particle Type
reco::PhotonRef photonRef() const
return a reference to the corresponding Photon if any
bool flag(Flags theFlag) const
return a given flag
const Point & vertex() const override
vertex position (overwritten by PF...)
void const * productPtr() const
unsigned short storedRefsBitPattern_
double energy() const final
energy
bool isNull() const
Checks for null.
int translateTypeToPdgId(ParticleType type) const
CompositeCandidate(std::string name="")
default constructor
Abs< T >::type abs(const T &t)
reco::GsfElectronRef gsfElectronRef() const
return a reference to the corresponding GsfElectron if any
const LorentzVector & p4() const final
four-momentum Lorentz vector
float rawHoEnergy_
raw HO energy
void reserve(size_type n)
Reserve space for RefVector.
void rescaleMomentum(double rescaleFactor)
particle momentum *= rescaleFactor
reco::MuonRef muonRef() const
bool isNonnull() const
Checks for non-null.
PFCandidate * clone() const override
return a clone
static const unsigned int s_refsBefore[]
unsigned int index
index type
reco::PFCandidateElectronExtraRef electronExtraRef() const
return a reference to the electron extra
void setGsfTrackRef(const reco::GsfTrackRef &ref)
set gsftrack reference
PFCandidate()
default constructor
XYZPointD XYZPoint
point in space with cartesian internal representation
void setPhotonRef(const reco::PhotonRef &phRef)
set ref to the corresponding reco::Photon if any
void setConversionRef(const reco::ConversionRef &ref)
set ref to original reco conversion
edm::Ref< PFDisplacedVertexCollection > PFDisplacedVertexRef
persistent reference to a PFDisplacedVertex objects
ProductID id() const
Accessor for product ID.
ParticleType translatePdgIdToType(int pdgid) const
math::XYZTLorentzVector LorentzVector
Lorentz vector.
PFCandidate & operator=(PFCandidate const &)
std::atomic< ElementsInBlocks * > elementsInBlocks_
std::vector< std::vector< double > > tmp
PFCandidatePtr sourcePtr_
reference to the source PFCandidate, if any
Particle reconstructed by the particle flow algorithm.
float time_
timing information (valid if timeError_ >= 0)
reco::VertexCompositeCandidateRef v0Ref() const
return a reference to the original conversion
void setMuonRef(const reco::MuonRef &ref)
set muon reference
math::XYZPointF positionAtECALEntrance_
position at ECAL entrance, from the PFRecTrack
float mva_nothing_gamma_
mva for gamma detection
reco::PFCandidateEGammaExtraRef egammaExtraRef() const
return a reference to the EGamma extra
reco::GsfTrackRef gsfTrackRef() const
void setPFEGammaExtraRef(const reco::PFCandidateEGammaExtraRef &ref)
set the PF EGamma Extra Ref
EDProductGetter const * productGetter() const
Accessor for product getter.
float ps2Energy_
corrected PS2 energy
void push_back(value_type const &ref)
Add a Ref<C, T> to the RefVector.
size_type size() const
Size of the RefVector.
void setSuperClusterRef(const reco::SuperClusterRef &scRef)
void setV0Ref(const reco::VertexCompositeCandidateRef &ref)
set ref to original reco conversion
virtual ParticleType particleId() const
LeafCandidate & operator=(LeafCandidate &&)=default
void setTrackRef(const reco::TrackRef &ref)
set track reference
const ElementsInBlocks & elementsInBlocks() const
ProcessIndex processIndex() const
double phi() const final
momentum azimuthal angle
Elements elementsStorage_
void setPdgId(int pdgId) final
reco::ConversionRef conversionRef() const
return a reference to the original conversion
void setP4(const LorentzVector &p4) final
set 4-momentum
std::vector< const void * > refsCollectionCache_
reco::SuperClusterRef superClusterRef() const
return a reference to the corresponding SuperCluster if any
void storeRefInfo(unsigned int iMask, unsigned int iBit, bool iIsValid, const edm::RefCore &iCore, size_t iKey, const edm::EDProductGetter *)
#define GETREF(_class_, _mask_, _bit_)