41 vertexType_(kCandVertex),
45 mva_nothing_gamma_(bigMva_),
46 mva_nothing_nh_(bigMva_),
47 mva_gamma_nh_(bigMva_),
48 getter_(0),storedRefsBitPattern_(0)
77 vertexType_(kCandVertex),
81 mva_nothing_gamma_(bigMva_),
82 mva_nothing_nh_(bigMva_),
83 mva_gamma_nh_(bigMva_),
84 getter_(0),storedRefsBitPattern_(0)
99 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";
124 unsigned elementIndex ) {
139 case 22:
return gamma;
153 case h:
return thecharge*211;
154 case e:
return thecharge*(-11);
155 case mu:
return thecharge*(-13);
156 case gamma:
return 22;
173 if (myPtr.
isNull())
return false;
176 if ((otherPtr == myPtr) ||
190 rescaledp4 *= rescaleFactor;
207 return (
flags_>>theFlag) & 1;
219 out<<setiosflags(ios::right);
220 out<<setiosflags(ios::fixed);
221 out<<setprecision(3);
222 out<<
" E/pT/eta/phi "
232 out<<
", blocks/iele: ";
235 for(
unsigned i=0;
i<eleInBlocks.size();
i++) {
237 unsigned indexInBlock = eleInBlocks[
i].second;
239 out<<
"("<<blockRef.
key()<<
"|"<<indexInBlock<<
"), ";
260 out<<resetiosflags(ios::right|ios::fixed);
265 unsigned long long bitPack = iIndex;
266 bitPack |=
static_cast<unsigned long long>(iCore.
id().
productIndex())<<32;
267 bitPack |=
static_cast<unsigned long long>(iCore.
id().
processIndex())<<48;
308 edm::ProductID& oProductID,
size_t& oIndex,
size_t& aIndex)
const {
314 unsigned long long bitPacked =
refsInfo_[aIndex];
315 oIndex = bitPacked & 0xFFFFFFFFULL;
316 unsigned short productIndex = (bitPacked & 0x0000FFFF00000000ULL)>>32;
317 unsigned short processIndex = (bitPacked & 0xFFFF000000000000ULL)>>48;
325 err +=
"PFCandidate::setTrackRef: this is a neutral candidate! ";
326 err +=
"particleId_=";
345 err +=
"PFCandidate::setMuonRef: inconsistent track references!";
384 err +=
"PFCandidate::setDisplacedVertexRef: this is not a hadron! particleId_=";
394 err +=
"PFCandidate::setDisplacedVertexRef: particule flag is neither T_FROM_DISP nor T_TO_DISP";
413 err +=
"PFCandidate::setDisplacedVertexRef: particule flag is not switched on";
438 err +=
"PFCandidate::setConversionRef: this is not a (converted) photon ! particleId_=";
448 err +=
"PFCandidate::setConversionRef: particule flag is not GAMMA_TO_GAMMACONV";
509 err +=
"PFCandidate::setSuperClusterRef: this is not an electron neither a photon ! particleId_=";
525 err +=
"PFCandidate::setSuperClusterRef: this is not an electron neither a photon ! particleId_=";
555 return muonRef()->combinedMuon()->vertex();
558 return muonRef()->standAloneMuon()->vertex();
561 return muonRef()->track()->vertex();
int Charge
electric charge type
ParticleType
particle types
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 bool overlap(const Candidate &) const
Polymorphic overlap.
virtual PFCandidate * clone() const
return a clone
unsigned flags_
all flags, packed (ecal regional, hcal regional, tracking)
virtual CandidatePtr sourceCandidatePtr(size_type i) const
static const float bigMva_
ProcessIndex productIndex() const
virtual void setP4(const LorentzVector &p4)
set 4-momentum
edm::RefVector< reco::PFBlockCollection > Blocks
reco::PFCandidatePhotonExtraRef photonExtraRef() const
return a reference to the photon extra
Point vertex_
vertex position
virtual double eta() const
momentum pseudorapidity
std::vector< ElementInBlock > ElementsInBlocks
const ElementsInBlocks & elementsInBlocks() const
reco::TrackRef trackRef() const
reco::PFDisplacedVertexRef displacedVertexRef(Flags type) const
CandidatePtr sourceCandidatePtr(size_type i) const
bool isNonnull() const
Checks for non-null.
std::vector< unsigned long long > refsInfo_
virtual double energy() const
energy
bool isNonnull() const
Checks for non-null.
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)
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
ProductID id() const
Accessor for product ID.
bool flag(Flags theFlag) const
return a given flag
void const * productPtr() const
virtual int charge() const
electric charge
unsigned short storedRefsBitPattern_
int translateTypeToPdgId(ParticleType type) const
reco::GsfElectronRef gsfElectronRef() const
return a reference to the corresponding GsfElectron if any
virtual const Point & vertex() const
vertex position
RefCore const & refCore() const
void reserve(size_type n)
Reserve space for RefVector.
void rescaleMomentum(double rescaleFactor)
particle momentum *= rescaleFactor
virtual ~PFCandidate()
destructor
reco::MuonRef muonRef() const
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
virtual double pt() const
transverse momentum
XYZPointD XYZPoint
point in space with cartesian internal representation
void setPhotonRef(const reco::PhotonRef &phRef)
set ref to the corresponding reco::Photon if any
key_type key() const
Accessor for product key.
void setConversionRef(const reco::ConversionRef &ref)
set ref to original reco conversion
edm::Ref< PFDisplacedVertexCollection > PFDisplacedVertexRef
persistent reference to a PFDisplacedVertex objects
ParticleType translatePdgIdToType(int pdgid) const
math::XYZTLorentzVector LorentzVector
Lorentz vector.
PFCandidatePtr sourcePtr_
reference to the source PFCandidate, if any
bool isNull() const
Checks for null.
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
reco::GsfTrackRef gsfTrackRef() const
virtual void setPdgId(int pdgId)
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)
ProductID id() const
Accessor for product ID.
EDProductGetter const * productGetter() const
Accessor for product getter.
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
ProcessIndex processIndex() const
virtual size_t numberOfSourceCandidatePtrs() const =0
virtual double phi() const
momentum azimuthal angle
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_)