|
|
Go to the documentation of this file.
26 : elementsInBlocks_(nullptr),
37 vertexType_(kCandVertex),
38 mva_Isolated_(bigMva_),
42 mva_nothing_gamma_(bigMva_),
43 mva_nothing_nh_(bigMva_),
44 mva_gamma_nh_(bigMva_),
46 storedRefsBitPattern_(0),
65 elementsInBlocks_(nullptr),
76 vertexType_(kCandVertex),
77 mva_Isolated_(bigMva_),
81 mva_nothing_gamma_(bigMva_),
82 mva_nothing_nh_(bigMva_),
83 mva_gamma_nh_(bigMva_),
85 storedRefsBitPattern_(0),
98 if (partId ==
h || partId ==
e || partId ==
mu) {
101 err +=
"Attempt to construct a charged PFCandidate with a zero charge";
107 err +=
"Attempt to construct a neutral PFCandidate ";
108 err +=
"with a non-zero charge";
117 elementsInBlocks_(nullptr),
118 blocksStorage_(iOther.blocksStorage_),
119 elementsStorage_(iOther.elementsStorage_),
120 sourcePtr_(iOther.sourcePtr_),
121 muonTrackType_(iOther.muonTrackType_),
122 ecalERatio_(iOther.ecalERatio_),
123 hcalERatio_(iOther.hcalERatio_),
124 hoERatio_(iOther.hoERatio_),
125 rawEcalEnergy_(iOther.rawEcalEnergy_),
126 rawHcalEnergy_(iOther.rawHcalEnergy_),
127 rawHoEnergy_(iOther.rawHoEnergy_),
128 ps1Energy_(iOther.ps1Energy_),
129 ps2Energy_(iOther.ps2Energy_),
130 flags_(iOther.flags_),
131 deltaP_(iOther.deltaP_),
132 vertexType_(iOther.vertexType_),
133 mva_Isolated_(iOther.mva_Isolated_),
134 mva_e_pi_(iOther.mva_e_pi_),
135 mva_e_mu_(iOther.mva_e_mu_),
136 mva_pi_mu_(iOther.mva_pi_mu_),
137 mva_nothing_gamma_(iOther.mva_nothing_gamma_),
138 mva_nothing_nh_(iOther.mva_nothing_nh_),
139 mva_gamma_nh_(iOther.mva_gamma_nh_),
140 positionAtECALEntrance_(iOther.positionAtECALEntrance_),
141 getter_(iOther.getter_),
142 storedRefsBitPattern_(iOther.storedRefsBitPattern_),
143 refsInfo_(iOther.refsInfo_),
144 refsCollectionCache_(iOther.refsCollectionCache_),
146 timeError_(iOther.timeError_),
147 hcalDepthEnergyFractions_(iOther.hcalDepthEnergyFractions_) {
149 if (
nullptr !=
tmp) {
157 if (
nullptr !=
tmp) {
237 return thecharge * 211;
239 return thecharge * (-11);
241 return thecharge * (-13);
262 for (
size_t i = 0,
n =
other.numberOfSourceCandidatePtrs();
i <
n; ++
i) {
273 rescaledp4 *= rescaleFactor;
290 out <<
"\tPFCandidate type: " <<
c.particleId();
291 out << setiosflags(ios::right);
293 out << setprecision(3);
294 out <<
" E/pT/eta/phi " <<
c.energy() <<
"/" <<
c.pt() <<
"/" <<
c.eta() <<
"/" <<
c.phi();
296 out <<
", T_FROM_DISP" << endl;
298 out <<
", T_TO_DISP" << endl;
300 out <<
", T_FROM_GAMMACONV" << endl;
302 out <<
", GAMMA_TO_GAMMACONV" << endl;
304 out <<
", blocks/iele: ";
307 for (
unsigned i = 0;
i < eleInBlocks.size();
i++) {
309 unsigned indexInBlock = eleInBlocks[
i].second;
311 out <<
"(" << blockRef.
key() <<
"|" << indexInBlock <<
"), ";
314 out <<
" source:" <<
c.sourcePtr_.id() <<
"/" <<
c.sourcePtr_.key();
329 if (
c.particleId() ==
PFCandidate::e &&
c.electronExtraRef().isNonnull() &&
c.electronExtraRef().isAvailable()) {
330 out << std::endl << *(
c.electronExtraRef());
337 unsigned long long bitPack = iIndex;
338 bitPack |= static_cast<unsigned long long>(iCore.
id().
productIndex()) << 32;
339 bitPack |= static_cast<unsigned long long>(iCore.
id().
processIndex()) << 48;
357 if (iGetter ==
nullptr)
364 if (iGetter ==
nullptr)
380 unsigned int iMask,
unsigned int iBit,
edm::ProductID& oProductID,
size_t& oIndex,
size_t& aIndex)
const {
385 unsigned long long bitPacked =
refsInfo_[aIndex];
386 oIndex = bitPacked & 0xFFFFFFFFULL;
387 unsigned short productIndex = (bitPacked & 0x0000FFFF00000000ULL) >> 32;
388 unsigned short processIndex = (bitPacked & 0xFFFF000000000000ULL) >> 48;
396 err +=
"PFCandidate::setTrackRef: this is a neutral candidate! ";
397 err +=
"particleId_=";
413 err +=
"PFCandidate::setMuonRef: inconsistent track references!";
446 err +=
"PFCandidate::setDisplacedVertexRef: this is not a hadron! particleId_=";
454 err +=
"PFCandidate::setDisplacedVertexRef: particule flag is neither T_FROM_DISP nor T_TO_DISP";
475 err +=
"PFCandidate::setDisplacedVertexRef: particule flag is not switched on";
494 err +=
"PFCandidate::setConversionRef: this is not a (converted) photon ! particleId_=";
502 err +=
"PFCandidate::setConversionRef: particule flag is not GAMMA_TO_GAMMACONV";
565 err +=
"PFCandidate::setSuperClusterRef: this is not an electron neither a photon ! particleId_=";
579 err +=
"PFCandidate::setSuperClusterRef: this is not an electron neither a photon ! particleId_=";
611 return muonRef()->combinedMuon()->vertex();
614 return muonRef()->standAloneMuon()->vertex();
617 return muonRef()->track()->vertex();
620 return muonRef()->tpfmsTrack()->vertex();
623 return muonRef()->pickyTrack()->vertex();
626 return muonRef()->dytTrack()->vertex();
reco::TrackRef trackRef() const
PFCandidatePtr sourcePtr_
reference to the source PFCandidate, if any
void setPdgId(int pdgId) final
std::array< float, 7 > hcalDepthEnergyFractions_
void reserve(size_type n)
Reserve space for RefVector.
void addElementInBlock(const reco::PFBlockRef &blockref, unsigned elementIndex)
add an element to the current PFCandidate
const edm::EDProductGetter * getter_
void setPhotonRef(const reco::PhotonRef &phRef)
set ref to the corresponding reco::Photon if any
float timeError_
timing information uncertainty (<0 if timing not available)
PFCandidate & operator=(PFCandidate const &)
void setDisplacedVertexRef(const reco::PFDisplacedVertexRef &ref, Flags flag)
set displaced vertex reference
reco::PhotonRef photonRef() const
return a reference to the corresponding Photon if any
float ps1Energy_
corrected PS1 energy
float rawHcalEnergy_
raw HCAL energy
void setPFEGammaExtraRef(const reco::PFCandidateEGammaExtraRef &ref)
set the PF EGamma Extra Ref
bool flag(Flags theFlag) const
return a given flag
int Charge
electric charge type
float hcalERatio_
corrected HCAL energy ratio (corrected/raw)
const Point & vertex() const override
vertex position (overwritten by PF...)
LeafCandidate & operator=(LeafCandidate &&)=default
ProcessIndex processIndex() const
void setGsfElectronRef(const reco::GsfElectronRef &ref)
set GsfElectronRef
std::vector< unsigned long long > refsInfo_
float mva_pi_mu_
mva for pi-muon discrimination
CandidatePtr sourceCandidatePtr(size_type i) const override
const ElementsInBlocks & elementsInBlocks() const
void setSuperClusterRef(const reco::SuperClusterRef &scRef)
math::XYZPointF positionAtECALEntrance_
position at ECAL entrance, from the PFRecTrack
float mva_e_pi_
mva for electron-pion discrimination
float hoERatio_
corrected HO energy ratio (corrected/raw)
reco::PFCandidateEGammaExtraRef egammaExtraRef() const
return a reference to the EGamma extra
reco::PFDisplacedVertexRef displacedVertexRef(Flags type) const
float ecalERatio_
corrected ECAL energy ratio (corrected/raw)
reco::MuonRef muonRef() const
float mva_nothing_nh_
mva for neutral hadron detection
float time_
timing information (valid if timeError_ >= 0)
bool empty() const
Is the RefVector empty.
ProcessIndex productIndex() const
void setFlag(Flags theFlag, bool value)
set a given flag
static const unsigned int s_refsBefore[]
void setTrackRef(const reco::TrackRef &ref)
set track reference
bool overlap(const Candidate &) const override
Polymorphic overlap.
float rawHoEnergy_
raw HO energy
Elements elementsStorage_
float mva_e_mu_
mva for electron-muon discrimination
std::atomic< ElementsInBlocks * > elementsInBlocks_
std::vector< const void * > refsCollectionCache_
void setConversionRef(const reco::ConversionRef &ref)
set ref to original reco conversion
void rescaleMomentum(double rescaleFactor)
particle momentum *= rescaleFactor
std::vector< ElementInBlock > ElementsInBlocks
edm::RefVector< reco::PFBlockCollection > Blocks
~PFCandidate() override
destructor
bool getRefInfo(unsigned int iMask, unsigned int iBit, edm::ProductID &oProdID, size_t &oIndex, size_t &aIndex) const
PFCandidate()
default constructor
void setV0Ref(const reco::VertexCompositeCandidateRef &ref)
set ref to original reco conversion
XYZPointD XYZPoint
point in space with cartesian internal representation
reco::GsfTrackRef gsfTrackRef() const
reco::PFCandidatePhotonExtraRef photonExtraRef() const
return a reference to the photon extra
reco::VertexCompositeCandidateRef v0Ref() const
return a reference to the original conversion
virtual ParticleType particleId() const
reco::Muon::MuonTrackType muonTrackType_
bool isNonnull() const
Checks for non-null.
reco::PFCandidateElectronExtraRef electronExtraRef() const
return a reference to the electron extra
const LorentzVector & p4() const final
four-momentum Lorentz vector
std::ostream & operator<<(std::ostream &, BeamSpot beam)
reco::SuperClusterRef superClusterRef() const
return a reference to the corresponding SuperCluster if any
PFCandidate * clone() const override
return a clone
int charge() const final
electric charge
int translateTypeToPdgId(ParticleType type) const
float rawEcalEnergy_
raw ECAL energy
RefCore const & refCore() const
void push_back(value_type const &ref)
Add a Ref<C, T> to the RefVector.
void storeRefInfo(unsigned int iMask, unsigned int iBit, bool iIsValid, const edm::RefCore &iCore, size_t iKey, const edm::EDProductGetter *)
const Point & vertex() const override
vertex position (overwritten by PF...)
void const * productPtr() const
void setGsfTrackRef(const reco::GsfTrackRef &ref)
set gsftrack reference
ProductID id() const
Accessor for product ID.
void setP4(const LorentzVector &p4) final
set 4-momentum
#define GETREF(_class_, _mask_, _bit_)
static const float bigMva_
static unsigned long long bitPackRefInfo(const edm::RefCore &iCore, size_t iIndex)
unsigned int index
index type
unsigned short storedRefsBitPattern_
ParticleType translatePdgIdToType(int pdgid) const
bool isNonnull() const
Checks for non-null.
unsigned flags_
all flags, packed (ecal regional, hcal regional, tracking)
EDProductGetter const * productGetter() const
Accessor for product getter.
Particle reconstructed by the particle flow algorithm.
key_type key() const
Accessor for product key.
reco::ConversionRef conversionRef() const
return a reference to the original conversion
Abs< T >::type abs(const T &t)
math::XYZTLorentzVector LorentzVector
Lorentz vector.
float ps2Energy_
corrected PS2 energy
ParticleType
particle types
void setMuonRef(const reco::MuonRef &ref)
set muon reference
size_type size() const
Size of the RefVector.
reco::GsfElectronRef gsfElectronRef() const
return a reference to the corresponding GsfElectron if any
void setPFElectronExtraRef(const reco::PFCandidateElectronExtraRef &ref)
set the PF Electron Extra Ref
bool isNull() const
Checks for null.
void setPFPhotonExtraRef(const reco::PFCandidatePhotonExtraRef &ref)
set the PF Photon Extra Ref
float deltaP_
uncertainty on 3-momentum
void setParticleType(ParticleType type)
set Particle Type
float mva_nothing_gamma_
mva for gamma detection
float mva_gamma_nh_
mva for neutral hadron - gamma discrimination
edm::Ref< PFDisplacedVertexCollection > PFDisplacedVertexRef
persistent reference to a PFDisplacedVertex objects