43 vertexType_(kCandVertex),
44 mva_Isolated_(bigMva_),
48 mva_nothing_gamma_(bigMva_),
49 mva_nothing_nh_(bigMva_),
50 mva_gamma_nh_(bigMva_),
51 getter_(0),storedRefsBitPattern_(0)
84 vertexType_(kCandVertex),
85 mva_Isolated_(bigMva_),
89 mva_nothing_gamma_(bigMva_),
90 mva_nothing_nh_(bigMva_),
91 mva_gamma_nh_(bigMva_),
92 getter_(0),storedRefsBitPattern_(0)
109 err+=
"Attempt to construct a charged PFCandidate with a zero charge";
117 err +=
"Attempt to construct a neutral PFCandidate ";
118 err +=
"with a non-zero charge";
129 blocksStorage_(iOther.blocksStorage_),
130 elementsStorage_(iOther.elementsStorage_),
131 sourcePtr_(iOther.sourcePtr_),
132 muonTrackType_(iOther.muonTrackType_),
133 ecalERatio_(iOther.ecalERatio_),
134 hcalERatio_(iOther.hcalERatio_),
135 hoERatio_(iOther.hoERatio_),
136 rawEcalEnergy_(iOther.rawEcalEnergy_),
137 rawHcalEnergy_(iOther.rawHcalEnergy_),
138 rawHoEnergy_(iOther.rawHoEnergy_),
139 ps1Energy_(iOther.ps1Energy_),
140 ps2Energy_(iOther.ps2Energy_),
141 flags_(iOther.flags_),
142 deltaP_(iOther.deltaP_),
143 vertexType_(iOther.vertexType_),
144 mva_Isolated_(iOther.mva_Isolated_),
145 mva_e_pi_(iOther.mva_e_pi_),
146 mva_e_mu_(iOther.mva_e_mu_),
147 mva_pi_mu_(iOther.mva_pi_mu_),
148 mva_nothing_gamma_(iOther.mva_nothing_gamma_),
149 mva_nothing_nh_(iOther.mva_nothing_nh_),
150 mva_gamma_nh_(iOther.mva_gamma_nh_),
151 positionAtECALEntrance_(iOther.positionAtECALEntrance_),
152 getter_(iOther.getter_),
153 storedRefsBitPattern_(iOther.storedRefsBitPattern_),
154 refsInfo_(iOther.refsInfo_),
155 refsCollectionCache_(iOther.refsCollectionCache_)
164 CompositeCandidate::operator=(iOther);
212 unsigned elementIndex ) {
229 case 22:
return gamma;
243 case h:
return thecharge*211;
244 case e:
return thecharge*(-11);
245 case mu:
return thecharge*(-13);
246 case gamma:
return 22;
263 if (myPtr.
isNull())
return false;
266 if ((otherPtr == myPtr) ||
280 rescaledp4 *= rescaleFactor;
297 return (
flags_>>theFlag) & 1;
309 out<<setiosflags(ios::right);
310 out<<setiosflags(ios::fixed);
311 out<<setprecision(3);
312 out<<
" E/pT/eta/phi "
322 out<<
", blocks/iele: ";
325 for(
unsigned i=0;
i<eleInBlocks.size();
i++) {
327 unsigned indexInBlock = eleInBlocks[
i].second;
329 out<<
"("<<blockRef.
key()<<
"|"<<indexInBlock<<
"), ";
350 out<<resetiosflags(ios::right|ios::fixed);
355 unsigned long long bitPack = iIndex;
356 bitPack |=
static_cast<unsigned long long>(iCore.
id().
productIndex())<<32;
357 bitPack |=
static_cast<unsigned long long>(iCore.
id().
processIndex())<<48;
402 edm::ProductID& oProductID,
size_t& oIndex,
size_t& aIndex)
const {
408 unsigned long long bitPacked =
refsInfo_[aIndex];
409 oIndex = bitPacked & 0xFFFFFFFFULL;
410 unsigned short productIndex = (bitPacked & 0x0000FFFF00000000ULL)>>32;
411 unsigned short processIndex = (bitPacked & 0xFFFF000000000000ULL)>>48;
419 err +=
"PFCandidate::setTrackRef: this is a neutral candidate! ";
420 err +=
"particleId_=";
440 err +=
"PFCandidate::setMuonRef: inconsistent track references!";
479 err +=
"PFCandidate::setDisplacedVertexRef: this is not a hadron! particleId_=";
489 err +=
"PFCandidate::setDisplacedVertexRef: particule flag is neither T_FROM_DISP nor T_TO_DISP";
508 err +=
"PFCandidate::setDisplacedVertexRef: particule flag is not switched on";
533 err +=
"PFCandidate::setConversionRef: this is not a (converted) photon ! particleId_=";
543 err +=
"PFCandidate::setConversionRef: particule flag is not GAMMA_TO_GAMMACONV";
607 err +=
"PFCandidate::setSuperClusterRef: this is not an electron neither a photon ! particleId_=";
623 err +=
"PFCandidate::setSuperClusterRef: this is not an electron neither a photon ! particleId_=";
656 return muonRef()->combinedMuon()->vertex();
659 return muonRef()->standAloneMuon()->vertex();
662 return muonRef()->track()->vertex();
665 return muonRef()->tpfmsTrack()->vertex();
668 return muonRef()->pickyTrack()->vertex();
687 if(
elementsInBlocks_.compare_exchange_strong(expected,temp.get(),std::memory_order_acq_rel)) {
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.
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
virtual float pt() const
transverse momentum
virtual bool overlap(const Candidate &) const
Polymorphic overlap.
float hcalERatio_
corrected HCAL energy ratio (corrected/raw)
float rawHcalEnergy_
raw HCAL energy
virtual PFCandidate * clone() const
return a clone
virtual float phi() const
momentum azimuthal angle
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_
float mva_nothing_nh_
mva for neutral hadron detection
RefCore const & refCore() const
ProcessIndex productIndex() const
virtual void setP4(const LorentzVector &p4)
set 4-momentum
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)
Point vertex_
vertex position
float mva_pi_mu_
mva for pi-muon discrimination
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
CandidatePtr sourceCandidatePtr(size_type i) const
std::vector< unsigned long long > refsInfo_
virtual double energy() const
energy
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
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
virtual float eta() const
momentum pseudorapidity
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
void const * productPtr() const
virtual int charge() const
electric charge
unsigned short storedRefsBitPattern_
bool isNull() const
Checks for null.
int translateTypeToPdgId(ParticleType type) const
Abs< T >::type abs(const T &t)
reco::GsfElectronRef gsfElectronRef() const
return a reference to the corresponding GsfElectron if any
virtual const Point & vertex() const
vertex position (overwritten by PF...)
float rawHoEnergy_
raw HO energy
void reserve(size_type n)
Reserve space for RefVector.
void rescaleMomentum(double rescaleFactor)
particle momentum *= rescaleFactor
virtual ~PFCandidate()
destructor
reco::MuonRef muonRef() const
bool isNonnull() const
Checks for non-null.
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.
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
virtual void setPdgId(int pdgId)
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
void setTrackRef(const reco::TrackRef &ref)
set track reference
const ElementsInBlocks & elementsInBlocks() const
ProcessIndex processIndex() const
virtual size_t numberOfSourceCandidatePtrs() const =0
virtual const LorentzVector & p4() const
four-momentum Lorentz vector
Elements elementsStorage_
reco::ConversionRef conversionRef() const
return a reference to the original conversion
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_)