CMS 3D CMS Logo

List of all members | Public Member Functions | Protected Types | Protected Member Functions | Protected Attributes
pat::GenericParticle Class Reference

Analysis-level Generic Particle class (e.g. for hadron or muon not fully reconstructed) More...

#include "DataFormats/PatCandidates/interface/GenericParticle.h"

Inheritance diagram for pat::GenericParticle:
pat::PATObject< reco::RecoCandidate > reco::RecoCandidate reco::LeafCandidate reco::Candidate

Public Member Functions

float caloIso () const
 
CaloTowerRef caloTower () const override
 
GenericParticleclone () const override
 required reimplementation of the Candidate's clone method More...
 
reco::TrackRef combinedMuon () const override
 
float ecalIso () const
 
const IsoDepositecalIsoDeposit () const
 
void ecalIsoDeposit (const IsoDeposit &dep)
 
void embedCaloTower ()
 embeds the calotower instead of keeping a reference to it More...
 
void embedCombined ()
 embeds the combined track instead of keeping a reference to it More...
 
void embedGsfTrack ()
 embeds the gsf track instead of keeping a reference to it More...
 
void embedStandalone ()
 embeds the stand-alone track instead of keeping a reference to it More...
 
void embedSuperCluster ()
 embeds the supercluster instead of keeping a reference to it More...
 
void embedTrack ()
 embeds the master track instead of keeping a reference to it More...
 
void embedTracks ()
 embeds the other tracks instead of keeping references More...
 
 GenericParticle ()
 default constructor More...
 
 GenericParticle (const reco::Candidate &aGenericParticle)
 constructor from Candidate More...
 
 GenericParticle (const edm::RefToBase< reco::Candidate > &aGenericParticleRef)
 constructor from ref to Candidate More...
 
 GenericParticle (const edm::Ptr< reco::Candidate > &aGenericParticleRef)
 constructor from ref to Candidate More...
 
reco::GsfTrackRef gsfTrack () const override
 
float hcalIso () const
 
const IsoDeposithcalIsoDeposit () const
 
void hcalIsoDeposit (const IsoDeposit &dep)
 
const IsoDepositisoDeposit (IsolationKeys key) const
 Returns the IsoDeposit associated with some key, or a null pointer if it is not available. More...
 
size_t numberOfTracks () const override
 number of multiple tracks (not including the master one) More...
 
bool overlap (const Candidate &) const override
 
float quality ()
 returns a user defined quality value, if set by the user to some meaningful value More...
 
virtual void setCaloTower (const CaloTowerRef &ref, bool embed=false)
 sets calotower reference (or even embed it into the object) More...
 
virtual void setCombinedMuon (const reco::TrackRef &ref, bool embed=false)
 sets combined muon track reference (or even embed it into the object) More...
 
void setEcalIso (float caloIso)
 Sets ecal isolation variable. More...
 
virtual void setGsfTrack (const reco::GsfTrackRef &ref, bool embed=false)
 sets gsf track reference (or even embed it into the object) More...
 
void setHcalIso (float caloIso)
 Sets hcal isolation variable. More...
 
void setIsoDeposit (IsolationKeys key, const IsoDeposit &dep)
 Sets the IsoDeposit associated with some key; if it is already existent, it is overwritten. More...
 
void setIsolation (IsolationKeys key, float value)
 
void setQuality (float quality)
 sets a user defined quality value More...
 
virtual void setStandAloneMuon (const reco::TrackRef &ref, bool embed=false)
 sets stand-alone muon track reference (or even embed it into the object) More...
 
virtual void setSuperCluster (const reco::SuperClusterRef &ref, bool embed=false)
 sets supercluster reference (or even embed it into the object) More...
 
virtual void setTrack (const reco::TrackRef &ref, bool embed=false)
 sets master track reference (or even embed it into the object) More...
 
void setTrackIso (float trackIso)
 Sets tracker isolation variable. More...
 
virtual void setTracks (const reco::TrackRefVector &refs, bool embed=false)
 sets multiple track references (or even embed the tracks into the object - whatch out for disk size issues!) More...
 
void setUserIso (float value, uint8_t index=0)
 Sets user isolation variable index. More...
 
void setVertexAssociation (const pat::VertexAssociation &assoc)
 Set a single vertex association. More...
 
void setVertexAssociations (const std::vector< pat::VertexAssociation > &assocs)
 Set multiple vertex associations. More...
 
reco::TrackRef standAloneMuon () const override
 
reco::SuperClusterRef superCluster () const override
 
reco::TrackRef track () const override
 
reco::TrackRef track (size_t idx) const override
 
float trackIso () const
 
const IsoDeposittrackIsoDeposit () const
 
void trackIsoDeposit (const IsoDeposit &dep)
 
const IsoDeposituserIsoDeposit (uint8_t index=0) const
 
void userIsoDeposit (const IsoDeposit &dep, uint8_t index=0)
 
float userIsolation (IsolationKeys key) const
 
float userIsolation (const std::string &key) const
 
const pat::VertexAssociationvertexAssociation (size_t index=0) const
 Vertex association (or associations, if any). Return null pointer if none has been set. More...
 
const std::vector< pat::VertexAssociation > & vertexAssociations () const
 Vertex associations. Can be empty if it was not enabled in the config file. More...
 
 ~GenericParticle () override
 destructor More...
 
- Public Member Functions inherited from pat::PATObject< reco::RecoCandidate >
void addGenParticleRef (const reco::GenParticleRef &ref)
 
void addTriggerObjectMatch (const TriggerObjectStandAlone &trigObj)
 add a trigger match More...
 
void addUserCand (const std::string &label, const reco::CandidatePtr &data, const bool overwrite=false)
 Set user-defined int. More...
 
void addUserData (const std::string &label, const T &data, bool transientOnly=false, bool overwrite=false)
 
void addUserDataFromPtr (const std::string &label, const edm::Ptr< pat::UserData > &data, bool overwrite=false)
 
void addUserFloat (const std::string &label, float data, const bool overwrite=false)
 Set user-defined float. More...
 
void addUserInt (const std::string &label, int32_t data, const bool overwrite=false)
 Set user-defined int. More...
 
std::vector< std::pair< std::string, pat::LookupTableRecord > > efficiencies () const
 Returns the efficiencies as <name,value> pairs (by value) More...
 
const pat::LookupTableRecordefficiency (const std::string &name) const
 Returns an efficiency given its name. More...
 
const std::vector< std::string > & efficiencyNames () const
 Returns the list of the names of the stored efficiencies. More...
 
const std::vector< pat::LookupTableRecord > & efficiencyValues () const
 Returns the list of the values of the stored efficiencies (the ordering is the same as in efficiencyNames()) More...
 
void embedGenParticle ()
 
const reco::GenParticlegenParticle (size_t idx=0) const
 
reco::GenParticleRef genParticleById (int pdgId, int status, uint8_t autoCharge=0) const
 
reco::GenParticleRef genParticleRef (size_t idx=0) const
 
std::vector< reco::GenParticleRefgenParticleRefs () const
 
size_t genParticlesSize () const
 Number of generator level particles stored as ref or embedded. More...
 
const pat::CandKinResolutiongetKinResolution (const std::string &label="") const
 
bool hasKinResolution (const std::string &label="") const
 Check if the kinematic resolutions are stored into this object (possibly specifying a label for them) More...
 
bool hasOverlaps (const std::string &label) const
 Returns true if there was at least one overlap for this test label. More...
 
bool hasUserCand (const std::string &key) const
 Return true if there is a user-defined int with a given name. More...
 
bool hasUserData (const std::string &key) const
 Check if user data with a specific type is present. More...
 
bool hasUserFloat (const std::string &key) const
 Return true if there is a user-defined float with a given name. More...
 
bool hasUserFloat (const char *key) const
 a CINT-friendly interface More...
 
bool hasUserInt (const std::string &key) const
 Return true if there is a user-defined int with a given name. More...
 
const reco::CandidateoriginalObject () const
 access to the original object; returns zero for null Ref and throws for unavailable collection More...
 
const edm::Ptr< reco::Candidate > & originalObjectRef () const
 reference to original object. Returns a null reference if not available More...
 
const std::vector< std::string > & overlapLabels () const
 Returns the labels of the overlap tests that found at least one overlap. More...
 
const reco::CandidatePtrVectoroverlaps (const std::string &label) const
 
 PATObject ()
 default constructor More...
 
 PATObject (const reco::RecoCandidate &obj)
 constructor from a base object (leaves invalid reference to original object!) More...
 
 PATObject (const edm::RefToBase< reco::RecoCandidate > &ref)
 constructor from reference More...
 
 PATObject (const edm::Ptr< reco::RecoCandidate > &ref)
 constructor from reference More...
 
double resolE (const std::string &label="") const
 Resolution on energy, possibly with a label to specify which resolution to use. More...
 
double resolEt (const std::string &label="") const
 Resolution on et, possibly with a label to specify which resolution to use. More...
 
double resolEta (const std::string &label="") const
 Resolution on eta, possibly with a label to specify which resolution to use. More...
 
double resolM (const std::string &label="") const
 
double resolP (const std::string &label="") const
 Resolution on p, possibly with a label to specify which resolution to use. More...
 
double resolPhi (const std::string &label="") const
 Resolution on phi, possibly with a label to specify which resolution to use. More...
 
double resolPInv (const std::string &label="") const
 Resolution on 1/p, possibly with a label to specify which resolution to use. More...
 
double resolPt (const std::string &label="") const
 Resolution on pt, possibly with a label to specify which resolution to use. More...
 
double resolPx (const std::string &label="") const
 Resolution on px, possibly with a label to specify which resolution to use. More...
 
double resolPy (const std::string &label="") const
 Resolution on py, possibly with a label to specify which resolution to use. More...
 
double resolPz (const std::string &label="") const
 Resolution on pz, possibly with a label to specify which resolution to use. More...
 
double resolTheta (const std::string &label="") const
 Resolution on theta, possibly with a label to specify which resolution to use. More...
 
void setEfficiency (const std::string &name, const pat::LookupTableRecord &value)
 
void setGenParticle (const reco::GenParticle &particle)
 Set the generator level particle from a particle not in the Event (embedding it, of course) More...
 
void setGenParticleRef (const reco::GenParticleRef &ref, bool embed=false)
 Set the generator level particle reference. More...
 
void setKinResolution (const pat::CandKinResolution &resol, const std::string &label="")
 Add a kinematic resolution to this object (possibly with a label) More...
 
void setOverlaps (const std::string &label, const reco::CandidatePtrVector &overlaps)
 
const TriggerObjectStandAlonetriggerObjectMatch (const size_t idx=0) const
 get one matched trigger object by index More...
 
const TriggerObjectStandAlonetriggerObjectMatchByAlgorithm (const std::string &nameAlgorithm, const bool algoCondAccepted=true, const size_t idx=0) const
 
const TriggerObjectStandAlonetriggerObjectMatchByAlgorithm (const char *nameAlgorithm, const bool algoCondAccepted=true, const size_t idx=0) const
 
const TriggerObjectStandAlonetriggerObjectMatchByAlgorithm (const std::string &nameAlgorithm, const unsigned algoCondAccepted, const size_t idx=0) const
 
const TriggerObjectStandAlonetriggerObjectMatchByAlgorithm (const char *nameAlgorithm, const unsigned algoCondAccepted, const size_t idx=0) const
 
const TriggerObjectStandAlonetriggerObjectMatchByCollection (const std::string &coll, const size_t idx=0) const
 get one matched trigger object from a certain collection by index More...
 
const TriggerObjectStandAlonetriggerObjectMatchByCollection (const char *coll, const size_t idx=0) const
 
const TriggerObjectStandAlonetriggerObjectMatchByCondition (const std::string &nameCondition, const size_t idx=0) const
 get one matched L1 object used in a succeeding object combination of a certain L1 condition by index More...
 
const TriggerObjectStandAlonetriggerObjectMatchByCondition (const char *nameCondition, const size_t idx=0) const
 
const TriggerObjectStandAlonetriggerObjectMatchByFilter (const std::string &labelFilter, const size_t idx=0) const
 get one matched HLT object used in a certain HLT filter by index More...
 
const TriggerObjectStandAlonetriggerObjectMatchByFilter (const char *labelFilter, const size_t idx=0) const
 
const TriggerObjectStandAlonetriggerObjectMatchByFilterID (const unsigned triggerObjectType, const size_t idx=0) const
 
const TriggerObjectStandAlonetriggerObjectMatchByPath (const std::string &namePath, const bool pathLastFilterAccepted=false, const bool pathL3FilterAccepted=true, const size_t idx=0) const
 
const TriggerObjectStandAlonetriggerObjectMatchByPath (const char *namePath, const bool pathLastFilterAccepted=false, const bool pathL3FilterAccepted=true, const size_t idx=0) const
 
const TriggerObjectStandAlonetriggerObjectMatchByPath (const std::string &namePath, const unsigned pathLastFilterAccepted, const unsigned pathL3FilterAccepted=1, const size_t idx=0) const
 
const TriggerObjectStandAlonetriggerObjectMatchByPath (const char *namePath, const unsigned pathLastFilterAccepted, const unsigned pathL3FilterAccepted=1, const size_t idx=0) const
 
const TriggerObjectStandAlonetriggerObjectMatchByType (const trigger::TriggerObjectType triggerObjectType, const size_t idx=0) const
 get one matched trigger object of a certain type by index More...
 
const TriggerObjectStandAlonetriggerObjectMatchByType (const unsigned triggerObjectType, const size_t idx=0) const
 
const TriggerObjectStandAloneCollectiontriggerObjectMatches () const
 get all matched trigger objects More...
 
const TriggerObjectStandAloneCollection triggerObjectMatchesByAlgorithm (const std::string &nameAlgorithm, const bool algoCondAccepted=true) const
 
const TriggerObjectStandAloneCollection triggerObjectMatchesByAlgorithm (const char *nameAlgorithm, const bool algoCondAccepted=true) const
 
const TriggerObjectStandAloneCollection triggerObjectMatchesByAlgorithm (const std::string &nameAlgorithm, const unsigned algoCondAccepted) const
 
const TriggerObjectStandAloneCollection triggerObjectMatchesByAlgorithm (const char *nameAlgorithm, const unsigned algoCondAccepted) const
 
const TriggerObjectStandAloneCollection triggerObjectMatchesByCollection (const std::string &coll) const
 get all matched trigger objects from a certain collection More...
 
const TriggerObjectStandAloneCollection triggerObjectMatchesByCollection (const char *coll) const
 
const TriggerObjectStandAloneCollection triggerObjectMatchesByCondition (const std::string &nameCondition) const
 get all matched L1 objects used in a succeeding object combination of a certain L1 condition More...
 
const TriggerObjectStandAloneCollection triggerObjectMatchesByCondition (const char *nameCondition) const
 
const TriggerObjectStandAloneCollection triggerObjectMatchesByFilter (const std::string &labelFilter) const
 get all matched HLT objects used in a certain HLT filter More...
 
const TriggerObjectStandAloneCollection triggerObjectMatchesByFilter (const char *labelFilter) const
 
const TriggerObjectStandAloneCollection triggerObjectMatchesByFilterID (const unsigned triggerObjectType) const
 
const TriggerObjectStandAloneCollection triggerObjectMatchesByPath (const std::string &namePath, const bool pathLastFilterAccepted=false, const bool pathL3FilterAccepted=true) const
 
const TriggerObjectStandAloneCollection triggerObjectMatchesByPath (const char *namePath, const bool pathLastFilterAccepted=false, const bool pathL3FilterAccepted=true) const
 
const TriggerObjectStandAloneCollection triggerObjectMatchesByPath (const std::string &namePath, const unsigned pathLastFilterAccepted, const unsigned pathL3FilterAccepted=1) const
 
const TriggerObjectStandAloneCollection triggerObjectMatchesByPath (const char *namePath, const unsigned pathLastFilterAccepted, const unsigned pathL3FilterAccepted=1) const
 
const TriggerObjectStandAloneCollection triggerObjectMatchesByType (const trigger::TriggerObjectType triggerObjectType) const
 
const TriggerObjectStandAloneCollection triggerObjectMatchesByType (const unsigned triggerObjectType) const
 
void unpackTriggerObjectPathNames (const edm::TriggerNames &names)
 unpack path names of matched trigger objects (if they were packed before embedding, which is not normally the case) More...
 
reco::CandidatePtr userCand (const std::string &key) const
 
const std::vector< std::string > & userCandNames () const
 Get list of user-defined cand names. More...
 
const TuserData (const std::string &key) const
 Returns user-defined data. Returns NULL if the data is not present, or not of type T. More...
 
const void * userDataBare (const std::string &key) const
 
const std::vector< std::string > & userDataNames () const
 Get list of user data object names. More...
 
const std::string & userDataObjectType (const std::string &key) const
 Get human-readable type of user data object, for debugging. More...
 
float userFloat (const std::string &key) const
 
float userFloat (const char *key) const
 a CINT-friendly interface More...
 
const std::vector< std::string > & userFloatNames () const
 Get list of user-defined float names. More...
 
std::vector< float > userFloatRange (const std::string &key) const
 return a range of values corresponding to key More...
 
int32_t userInt (const std::string &key) const
 
const std::vector< std::string > & userIntNames () const
 Get list of user-defined int names. More...
 
std::vector< int > userIntRange (const std::string &key) const
 returns a range of values corresponding to key More...
 
 ~PATObject () override
 destructor More...
 
- Public Member Functions inherited from reco::RecoCandidate
const TrackbestTrack () const override
 best track pointer More...
 
virtual TrackBaseRef bestTrackRef () const
 best track RefToBase More...
 
virtual TrackType bestTrackType () const
 track type More...
 
RecoCandidateclone () const override
 returns a clone of the Candidate object More...
 
float dxyError () const override
 uncertainty on dxy More...
 
float dzError () const override
 uncertainty on dz More...
 
bool overlap (const Candidate &) const override=0
 check overlap with another candidate More...
 
 RecoCandidate ()
 default constructor More...
 
template<typename P4 >
 RecoCandidate (Charge q, const P4 &p4, const Point &vtx=Point(0, 0, 0), int pdgId=0, int status=0)
 constructor from values More...
 
 ~RecoCandidate () 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...
 
size_t numberOfSourceCandidatePtrs () const override
 
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...
 
CandidatePtr sourceCandidatePtr (size_type i) const override
 
int status () const final
 status word More...
 
double theta () const final
 momentum polar angle More...
 
int threeCharge () const final
 electric charge More...
 
const Pointvertex () const override
 vertex position (overwritten by PF...) 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 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...
 
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...
 

Protected Types

typedef std::vector< std::pair< IsolationKeys, pat::IsoDeposit > > IsoDepositPairs
 

Protected Member Functions

void fillInFrom (const reco::Candidate &cand)
 
- Protected Member Functions inherited from pat::PATObject< reco::RecoCandidate >
void addUserDataObject_ (const std::string &label, std::unique_ptr< pat::UserData > value, bool overwrite=false)
 
- Protected Member Functions inherited from reco::RecoCandidate
template<typename R >
bool checkOverlap (const R &r1, const R &r2) const
 check if two components overlap More...
 

Protected Attributes

CaloTowerCollection caloTower_
 
CaloTowerRef caloTowerRef_
 
reco::TrackCollection combinedTrack_
 
reco::TrackRef combinedTrackRef_
 
reco::GsfTrackCollection gsfTrack_
 
reco::GsfTrackRef gsfTrackRef_
 
IsoDepositPairs isoDeposits_
 
std::vector< float > isolations_
 
float quality_
 
reco::TrackCollection standaloneTrack_
 
reco::TrackRef standaloneTrackRef_
 
reco::SuperClusterCollection superCluster_
 
reco::SuperClusterRef superClusterRef_
 
reco::TrackCollection track_
 
reco::TrackRef trackRef_
 
reco::TrackRefVector trackRefs_
 
reco::TrackCollection tracks_
 
std::vector< pat::VertexAssociationvtxAss_
 
- Protected Attributes inherited from pat::PATObject< reco::RecoCandidate >
std::vector< std::string > efficiencyNames_
 vector of the efficiencies (names) More...
 
std::vector< pat::LookupTableRecordefficiencyValues_
 vector of the efficiencies (values) More...
 
std::vector< reco::GenParticlegenParticleEmbedded_
 vector to hold an embedded generator level particle More...
 
std::vector< reco::GenParticleRefgenParticleRef_
 Reference to a generator level particle. More...
 
std::vector< std::string > kinResolutionLabels_
 
std::vector< pat::CandKinResolutionkinResolutions_
 Kinematic resolutions. More...
 
std::vector< reco::CandidatePtrVectoroverlapItems_
 Overlapping items (sorted by distance) More...
 
std::vector< std::string > overlapLabels_
 Overlapping test labels (only if there are any overlaps) More...
 
edm::Ptr< reco::CandidaterefToOrig_
 
TriggerObjectStandAloneCollection triggerObjectMatchesEmbedded_
 vector of trigger matches More...
 
std::vector< std::string > userCandLabels_
 
std::vector< reco::CandidatePtruserCands_
 
std::vector< std::string > userDataLabels_
 User data object. More...
 
pat::UserDataCollection userDataObjects_
 
std::vector< std::string > userFloatLabels_
 
std::vector< float > userFloats_
 
std::vector< std::string > userIntLabels_
 
std::vector< int32_t > userInts_
 

Additional Inherited Members

- Public Types inherited from pat::PATObject< reco::RecoCandidate >
typedef reco::RecoCandidate base_type
 
- Public Types inherited from reco::RecoCandidate
enum  TrackType { noTrackType, recoTrackType, gsfTrackType }
 track type More...
 
- 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...
 

Detailed Description

Analysis-level Generic Particle class (e.g. for hadron or muon not fully reconstructed)

GenericParticle implements the analysis-level generic particle class within the 'pat' namespace.

Author
Giovanni Petrucciani

Definition at line 38 of file GenericParticle.h.

Member Typedef Documentation

◆ IsoDepositPairs

typedef std::vector<std::pair<IsolationKeys, pat::IsoDeposit> > pat::GenericParticle::IsoDepositPairs
protected

Definition at line 315 of file GenericParticle.h.

Constructor & Destructor Documentation

◆ GenericParticle() [1/4]

GenericParticle::GenericParticle ( )

default constructor

Definition at line 9 of file GenericParticle.cc.

Referenced by clone().

9 : PATObject<reco::RecoCandidate>() {}

◆ GenericParticle() [2/4]

pat::GenericParticle::GenericParticle ( const reco::Candidate aGenericParticle)

constructor from Candidate

◆ GenericParticle() [3/4]

pat::GenericParticle::GenericParticle ( const edm::RefToBase< reco::Candidate > &  aGenericParticleRef)

constructor from ref to Candidate

◆ GenericParticle() [4/4]

pat::GenericParticle::GenericParticle ( const edm::Ptr< reco::Candidate > &  aGenericParticleRef)

constructor from ref to Candidate

◆ ~GenericParticle()

GenericParticle::~GenericParticle ( )
override

destructor

Definition at line 27 of file GenericParticle.cc.

27 {}

Member Function Documentation

◆ caloIso()

float pat::GenericParticle::caloIso ( ) const
inline

Return the sum of ecal and hcal isolation variable that were stored in this object when produced, or -1.0 if at least one is missing

Definition at line 222 of file GenericParticle.h.

References pat::CaloIso, and userIsolation().

Referenced by setEcalIso(), and setHcalIso().

222 { return userIsolation(pat::CaloIso); }
float userIsolation(IsolationKeys key) const

◆ caloTower()

CaloTowerRef pat::GenericParticle::caloTower ( ) const
inlineoverridevirtual

reference to a CaloTower (might be transient ref if CaloTower is embedded) returns null ref if there is no calotower

Reimplemented from reco::RecoCandidate.

Definition at line 95 of file GenericParticle.h.

References caloTower_, caloTowerRef_, and edm::SortedCollection< T, SORT >::empty().

Referenced by overlap().

95  {
97  }
CaloTowerCollection caloTower_
CaloTowerRef caloTowerRef_
edm::Ref< CaloTowerCollection > CaloTowerRef
Definition: CaloTowerDefs.h:17

◆ clone()

GenericParticle* pat::GenericParticle::clone ( void  ) const
inlineoverridevirtual

required reimplementation of the Candidate's clone method

Reimplemented from reco::LeafCandidate.

Definition at line 52 of file GenericParticle.h.

References GenericParticle().

52 { return new GenericParticle(*this); }
GenericParticle()
default constructor

◆ combinedMuon()

reco::TrackRef pat::GenericParticle::combinedMuon ( ) const
inlineoverridevirtual

reference to a combined muon Track (might be transient ref if SuperCluster is embedded) returns null ref if there is no combined muon track

Reimplemented from reco::RecoCandidate.

Definition at line 85 of file GenericParticle.h.

References combinedTrack_, and combinedTrackRef_.

Referenced by overlap().

85  {
87  }
reco::TrackCollection combinedTrack_
edm::Ref< TrackCollection > TrackRef
persistent reference to a Track
Definition: TrackFwd.h:20
reco::TrackRef combinedTrackRef_

◆ ecalIso()

float pat::GenericParticle::ecalIso ( ) const
inline

Return the ecal isolation variable that was stored in this object when produced, or -1.0 if there is none

Definition at line 225 of file GenericParticle.h.

References pat::EcalIso, and userIsolation().

225 { return userIsolation(pat::EcalIso); }
float userIsolation(IsolationKeys key) const

◆ ecalIsoDeposit() [1/2]

const IsoDeposit* pat::GenericParticle::ecalIsoDeposit ( ) const
inline

Definition at line 264 of file GenericParticle.h.

References pat::EcalIso, and isoDeposit().

264 { return isoDeposit(pat::EcalIso); }
const IsoDeposit * isoDeposit(IsolationKeys key) const
Returns the IsoDeposit associated with some key, or a null pointer if it is not available.

◆ ecalIsoDeposit() [2/2]

void pat::GenericParticle::ecalIsoDeposit ( const IsoDeposit dep)
inline

Definition at line 270 of file GenericParticle.h.

References pat::EcalIso, and setIsoDeposit().

270 { setIsoDeposit(pat::EcalIso, dep); }
void setIsoDeposit(IsolationKeys key, const IsoDeposit &dep)
Sets the IsoDeposit associated with some key; if it is already existent, it is overwritten.

◆ embedCaloTower()

void GenericParticle::embedCaloTower ( )

embeds the calotower instead of keeping a reference to it

Definition at line 142 of file GenericParticle.cc.

References caloTower_, caloTowerRef_, edm::SortedCollection< T, SORT >::empty(), edm::Ref< C, T, F >::isNonnull(), edm::SortedCollection< T, SORT >::push_back(), and edm::SortedCollection< T, SORT >::swap().

Referenced by pat::PATGenericParticleProducer::produce(), and setCaloTower().

142  {
143  if (!caloTower_.empty())
145  if (caloTowerRef_.isNonnull())
146  caloTower_.push_back(*caloTowerRef_); // import
147  caloTowerRef_ = CaloTowerRef(); // clear, to save space (zeroes compress better)
148 }
CaloTowerCollection caloTower_
void swap(SortedCollection &other)
void push_back(T const &t)
bool isNonnull() const
Checks for non-null.
Definition: Ref.h:232
edm::SortedCollection< CaloTower > CaloTowerCollection
Definition: CaloTowerDefs.h:16
CaloTowerRef caloTowerRef_
edm::Ref< CaloTowerCollection > CaloTowerRef
Definition: CaloTowerDefs.h:17

◆ embedCombined()

void GenericParticle::embedCombined ( )

embeds the combined track instead of keeping a reference to it

Definition at line 120 of file GenericParticle.cc.

References combinedTrack_, combinedTrackRef_, and edm::Ref< C, T, F >::isNonnull().

Referenced by pat::PATGenericParticleProducer::produce(), and setCombinedMuon().

120  {
121  combinedTrack_.clear();
123  combinedTrack_.push_back(*combinedTrackRef_); // import
124  combinedTrackRef_ = reco::TrackRef(); // clear, to save space (zeroes compress better)
125 }
reco::TrackCollection combinedTrack_
bool isNonnull() const
Checks for non-null.
Definition: Ref.h:232
edm::Ref< TrackCollection > TrackRef
persistent reference to a Track
Definition: TrackFwd.h:20
reco::TrackRef combinedTrackRef_

◆ embedGsfTrack()

void GenericParticle::embedGsfTrack ( )

embeds the gsf track instead of keeping a reference to it

Definition at line 127 of file GenericParticle.cc.

References gsfTrack_, gsfTrackRef_, and edm::Ref< C, T, F >::isNonnull().

Referenced by pat::PATGenericParticleProducer::produce(), and setGsfTrack().

127  {
128  gsfTrack_.clear();
129  if (gsfTrackRef_.isNonnull())
130  gsfTrack_.push_back(*gsfTrackRef_); // import
131  gsfTrackRef_ = reco::GsfTrackRef(); // clear, to save space (zeroes compress better)
132 }
edm::Ref< GsfTrackCollection > GsfTrackRef
persistent reference to a GsfTrack
Definition: GsfTrackFwd.h:13
bool isNonnull() const
Checks for non-null.
Definition: Ref.h:232
reco::GsfTrackRef gsfTrackRef_
reco::GsfTrackCollection gsfTrack_

◆ embedStandalone()

void GenericParticle::embedStandalone ( )

embeds the stand-alone track instead of keeping a reference to it

Definition at line 113 of file GenericParticle.cc.

References edm::Ref< C, T, F >::isNonnull(), standaloneTrack_, and standaloneTrackRef_.

Referenced by pat::PATGenericParticleProducer::produce(), and setStandAloneMuon().

113  {
114  standaloneTrack_.clear();
116  standaloneTrack_.push_back(*standaloneTrackRef_); // import
117  standaloneTrackRef_ = reco::TrackRef(); // clear, to save space (zeroes compress better)
118 }
reco::TrackRef standaloneTrackRef_
bool isNonnull() const
Checks for non-null.
Definition: Ref.h:232
reco::TrackCollection standaloneTrack_
edm::Ref< TrackCollection > TrackRef
persistent reference to a Track
Definition: TrackFwd.h:20

◆ embedSuperCluster()

void GenericParticle::embedSuperCluster ( )

embeds the supercluster instead of keeping a reference to it

Definition at line 135 of file GenericParticle.cc.

References edm::Ref< C, T, F >::isNonnull(), superCluster_, and superClusterRef_.

Referenced by pat::PATGenericParticleProducer::produce(), and setSuperCluster().

135  {
136  superCluster_.clear();
138  superCluster_.push_back(*superClusterRef_); // import
139  superClusterRef_ = reco::SuperClusterRef(); // clear, to save space (zeroes compress better)
140 }
bool isNonnull() const
Checks for non-null.
Definition: Ref.h:232
edm::Ref< SuperClusterCollection > SuperClusterRef
reference to an object in a collection of SuperCluster objects
reco::SuperClusterCollection superCluster_
reco::SuperClusterRef superClusterRef_

◆ embedTrack()

void GenericParticle::embedTrack ( )

embeds the master track instead of keeping a reference to it

Definition at line 96 of file GenericParticle.cc.

References edm::Ref< C, T, F >::isNonnull(), track_, and trackRef_.

Referenced by pat::PATGenericParticleProducer::produce(), and setTrack().

96  {
97  track_.clear();
98  if (trackRef_.isNonnull())
99  track_.push_back(*trackRef_); // import
100  trackRef_ = reco::TrackRef(); // clear, to save space (zeroes compress better)
101 }
reco::TrackCollection track_
bool isNonnull() const
Checks for non-null.
Definition: Ref.h:232
reco::TrackRef trackRef_
edm::Ref< TrackCollection > TrackRef
persistent reference to a Track
Definition: TrackFwd.h:20

◆ embedTracks()

void GenericParticle::embedTracks ( )

embeds the other tracks instead of keeping references

Definition at line 103 of file GenericParticle.cc.

References edm::RefVector< C, T, F >::begin(), edm::RefVector< C, T, F >::end(), ALPAKA_ACCELERATOR_NAMESPACE::vertexFinder::it, edm::RefVector< C, T, F >::size(), trackRefs_, and tracks_.

Referenced by pat::PATGenericParticleProducer::produce(), and setTracks().

103  {
104  tracks_.clear();
105  tracks_.reserve(trackRefs_.size());
107  if (it->isNonnull())
108  tracks_.push_back(**it); // embed track
109  }
110  trackRefs_ = reco::TrackRefVector(); // clear, to save space
111 }
edm::RefVector< TrackCollection > TrackRefVector
vector of reference to Track in the same collection
Definition: TrackFwd.h:29
size_type size() const
Size of the RefVector.
Definition: RefVector.h:102
reco::TrackCollection tracks_
const_iterator end() const
Termination of iteration.
Definition: RefVector.h:228
reco::TrackRefVector trackRefs_
const_iterator begin() const
Initialize an iterator over the RefVector.
Definition: RefVector.h:223

◆ fillInFrom()

void GenericParticle::fillInFrom ( const reco::Candidate cand)
protected

Definition at line 150 of file GenericParticle.cc.

References mps_fire::i, vertices_cff::ntracks, setCaloTower(), reco::LeafCandidate::setCharge(), setCombinedMuon(), setGsfTrack(), reco::LeafCandidate::setP4(), reco::LeafCandidate::setPdgId(), setStandAloneMuon(), reco::LeafCandidate::setStatus(), setSuperCluster(), setTrack(), setTracks(), reco::LeafCandidate::setVertex(), and DiMuonV_cfg::tracks.

150  {
151  // first, kinematics & status
152  setCharge(cand.charge());
153  setP4(cand.polarP4());
154  setVertex(cand.vertex());
155  setPdgId(cand.pdgId());
156  setStatus(cand.status());
157  // then RECO part, if available
158  const reco::RecoCandidate *rc = dynamic_cast<const reco::RecoCandidate *>(&cand);
159  if (rc != nullptr) {
160  setTrack(rc->track());
161  setGsfTrack(rc->gsfTrack());
162  setStandAloneMuon(rc->standAloneMuon());
163  setCombinedMuon(rc->combinedMuon());
164  setSuperCluster(rc->superCluster());
165  setCaloTower(rc->caloTower());
166  size_t ntracks = rc->numberOfTracks();
167  if (ntracks > 0) {
169  for (size_t i = 0; i < ntracks; ++i) {
170  tracks.push_back(rc->track(i));
171  }
172  setTracks(tracks);
173  }
174  }
175 }
virtual void setCombinedMuon(const reco::TrackRef &ref, bool embed=false)
sets combined muon track reference (or even embed it into the object)
void setVertex(const Point &vertex) override
set vertex
void setCharge(Charge q) final
set electric charge
virtual void setGsfTrack(const reco::GsfTrackRef &ref, bool embed=false)
sets gsf track reference (or even embed it into the object)
virtual void setCaloTower(const CaloTowerRef &ref, bool embed=false)
sets calotower reference (or even embed it into the object)
virtual void setTracks(const reco::TrackRefVector &refs, bool embed=false)
sets multiple track references (or even embed the tracks into the object - whatch out for disk size i...
virtual void setStandAloneMuon(const reco::TrackRef &ref, bool embed=false)
sets stand-alone muon track reference (or even embed it into the object)
void setStatus(int status) final
set status word
void setPdgId(int pdgId) final
virtual void setTrack(const reco::TrackRef &ref, bool embed=false)
sets master track reference (or even embed it into the object)
void setP4(const LorentzVector &p4) final
set 4-momentum
virtual void setSuperCluster(const reco::SuperClusterRef &ref, bool embed=false)
sets supercluster reference (or even embed it into the object)

◆ gsfTrack()

reco::GsfTrackRef pat::GenericParticle::gsfTrack ( ) const
inlineoverridevirtual

reference to a GsfTrack (might be transient ref if SuperCluster is embedded) returns null ref if there is no gsf track

Reimplemented from reco::RecoCandidate.

Definition at line 75 of file GenericParticle.h.

References gsfTrack_, and gsfTrackRef_.

Referenced by Electron.Electron::dxy(), Electron.Electron::dz(), Electron.Electron::edxy(), Electron.Electron::edz(), Electron.Electron::lostInner(), and overlap().

75  {
76  return (gsfTrack_.empty() ? gsfTrackRef_ : reco::GsfTrackRef(&gsfTrack_, 0));
77  }
edm::Ref< GsfTrackCollection > GsfTrackRef
persistent reference to a GsfTrack
Definition: GsfTrackFwd.h:13
reco::GsfTrackRef gsfTrackRef_
reco::GsfTrackCollection gsfTrack_

◆ hcalIso()

float pat::GenericParticle::hcalIso ( ) const
inline

Return the hcal isolation variable that was stored in this object when produced, or -1.0 if there is none

Definition at line 228 of file GenericParticle.h.

References pat::HcalIso, and userIsolation().

228 { return userIsolation(pat::HcalIso); }
float userIsolation(IsolationKeys key) const

◆ hcalIsoDeposit() [1/2]

const IsoDeposit* pat::GenericParticle::hcalIsoDeposit ( ) const
inline

Definition at line 265 of file GenericParticle.h.

References pat::HcalIso, and isoDeposit().

265 { return isoDeposit(pat::HcalIso); }
const IsoDeposit * isoDeposit(IsolationKeys key) const
Returns the IsoDeposit associated with some key, or a null pointer if it is not available.

◆ hcalIsoDeposit() [2/2]

void pat::GenericParticle::hcalIsoDeposit ( const IsoDeposit dep)
inline

Definition at line 271 of file GenericParticle.h.

References pat::HcalIso, and setIsoDeposit().

271 { setIsoDeposit(pat::HcalIso, dep); }
void setIsoDeposit(IsolationKeys key, const IsoDeposit &dep)
Sets the IsoDeposit associated with some key; if it is already existent, it is overwritten.

◆ isoDeposit()

const IsoDeposit* pat::GenericParticle::isoDeposit ( IsolationKeys  key) const
inline

Returns the IsoDeposit associated with some key, or a null pointer if it is not available.

Definition at line 242 of file GenericParticle.h.

References isoDeposits_, ALPAKA_ACCELERATOR_NAMESPACE::vertexFinder::it, and submitPVResolutionJobs::key.

Referenced by ecalIsoDeposit(), hcalIsoDeposit(), trackIsoDeposit(), and userIsoDeposit().

242  {
243  for (IsoDepositPairs::const_iterator it = isoDeposits_.begin(), ed = isoDeposits_.end(); it != ed; ++it) {
244  if (it->first == key)
245  return &it->second;
246  }
247  return nullptr;
248  }
IsoDepositPairs isoDeposits_
key
prepare the HTCondor submission files and eventually submit them

◆ numberOfTracks()

size_t pat::GenericParticle::numberOfTracks ( ) const
inlineoverridevirtual

number of multiple tracks (not including the master one)

Reimplemented from reco::RecoCandidate.

Definition at line 72 of file GenericParticle.h.

References edm::RefVector< C, T, F >::size(), trackRefs_, and tracks_.

Referenced by track().

72 { return tracks_.empty() ? trackRefs_.size() : tracks_.size(); }
size_type size() const
Size of the RefVector.
Definition: RefVector.h:102
reco::TrackCollection tracks_
reco::TrackRefVector trackRefs_

◆ overlap()

bool GenericParticle::overlap ( const Candidate ) const
override

Checks for overlap with another candidate. It will return 'true' if the other candidate is a RecoCandidate, and if they reference to at least one same non null track, supercluster or calotower (except for the multiple tracks) NOTE: It won't work with embedded references

Definition at line 177 of file GenericParticle.cc.

References reco::RecoCandidate::caloTower(), caloTower(), reco::RecoCandidate::combinedMuon(), combinedMuon(), reco::RecoCandidate::gsfTrack(), gsfTrack(), edm::Ref< C, T, F >::isNonnull(), reco::RecoCandidate::standAloneMuon(), standAloneMuon(), reco::RecoCandidate::superCluster(), superCluster(), reco::RecoCandidate::track(), and track().

177  {
178  const reco::RecoCandidate *rc = dynamic_cast<const reco::RecoCandidate *>(&cand);
179  if (rc != nullptr) {
180  if (rc->track().isNonnull() && (track() == rc->track()))
181  return true;
182  if (rc->gsfTrack().isNonnull() && (gsfTrack() == rc->gsfTrack()))
183  return true;
184  if (rc->standAloneMuon().isNonnull() && (standAloneMuon() == rc->standAloneMuon()))
185  return true;
186  if (rc->combinedMuon().isNonnull() && (combinedMuon() == rc->combinedMuon()))
187  return true;
188  if (rc->superCluster().isNonnull() && (superCluster() == rc->superCluster()))
189  return true;
190  if (rc->caloTower().isNonnull() && (caloTower() == rc->caloTower()))
191  return true;
192  }
193  const GenericParticle *rc2 = dynamic_cast<const GenericParticle *>(&cand);
194  if (rc2 != nullptr) {
195  if (rc2->track().isNonnull() && (track() == rc2->track()))
196  return true;
197  if (rc2->gsfTrack().isNonnull() && (gsfTrack() == rc2->gsfTrack()))
198  return true;
199  if (rc2->standAloneMuon().isNonnull() && (standAloneMuon() == rc2->standAloneMuon()))
200  return true;
201  if (rc2->combinedMuon().isNonnull() && (combinedMuon() == rc2->combinedMuon()))
202  return true;
203  if (rc2->superCluster().isNonnull() && (superCluster() == rc2->superCluster()))
204  return true;
205  if (rc2->caloTower().isNonnull() && (caloTower() == rc2->caloTower()))
206  return true;
207  }
208  return false;
209 }
reco::TrackRef track() const override
virtual reco::GsfTrackRef gsfTrack() const
reference to a GsfTrack
bool isNonnull() const
Checks for non-null.
Definition: Ref.h:232
reco::TrackRef standAloneMuon() const override
Analysis-level Generic Particle class (e.g. for hadron or muon not fully reconstructed) ...
virtual CaloTowerRef caloTower() const
reference to a CaloTower
CaloTowerRef caloTower() const override
reco::TrackRef combinedMuon() const override
reco::GsfTrackRef gsfTrack() const override
virtual reco::SuperClusterRef superCluster() const
reference to a SuperCluster
reco::SuperClusterRef superCluster() const override
virtual reco::TrackRef track() const
reference to a Track
virtual reco::TrackRef combinedMuon() const
reference to a stand-alone muon Track
virtual reco::TrackRef standAloneMuon() const
reference to a stand-alone muon Track

◆ quality()

float pat::GenericParticle::quality ( )
inline

returns a user defined quality value, if set by the user to some meaningful value

Definition at line 130 of file GenericParticle.h.

References quality_.

Referenced by setQuality().

130 { return quality_; }

◆ setCaloTower()

void GenericParticle::setCaloTower ( const CaloTowerRef ref,
bool  embed = false 
)
virtual

sets calotower reference (or even embed it into the object)

Definition at line 85 of file GenericParticle.cc.

References caloTower_, caloTowerRef_, embed, embedCaloTower(), edm::SortedCollection< T, SORT >::empty(), and edm::SortedCollection< T, SORT >::swap().

Referenced by fillInFrom().

85  {
86  caloTowerRef_ = ref;
87  if (embed) {
89  } else if (!caloTower_.empty()) {
91  }
92 }
CaloTowerCollection caloTower_
void swap(SortedCollection &other)
#define embed
Definition: AMPTWrapper.h:188
edm::SortedCollection< CaloTower > CaloTowerCollection
Definition: CaloTowerDefs.h:16
CaloTowerRef caloTowerRef_
void embedCaloTower()
embeds the calotower instead of keeping a reference to it

◆ setCombinedMuon()

void GenericParticle::setCombinedMuon ( const reco::TrackRef ref,
bool  embed = false 
)
virtual

sets combined muon track reference (or even embed it into the object)

Definition at line 58 of file GenericParticle.cc.

References combinedTrack_, combinedTrackRef_, embed, and embedCombined().

Referenced by fillInFrom().

58  {
59  combinedTrackRef_ = ref;
60  if (embed)
61  embedCombined();
62  else
63  combinedTrack_.clear();
64 }
reco::TrackCollection combinedTrack_
#define embed
Definition: AMPTWrapper.h:188
reco::TrackRef combinedTrackRef_
void embedCombined()
embeds the combined track instead of keeping a reference to it

◆ setEcalIso()

void pat::GenericParticle::setEcalIso ( float  caloIso)
inline

Sets ecal isolation variable.

Definition at line 234 of file GenericParticle.h.

References caloIso(), pat::EcalIso, and setIsolation().

void setIsolation(IsolationKeys key, float value)

◆ setGsfTrack()

void GenericParticle::setGsfTrack ( const reco::GsfTrackRef ref,
bool  embed = false 
)
virtual

sets gsf track reference (or even embed it into the object)

Definition at line 67 of file GenericParticle.cc.

References embed, embedGsfTrack(), gsfTrack_, and gsfTrackRef_.

Referenced by fillInFrom().

67  {
68  gsfTrackRef_ = ref;
69  if (embed)
70  embedGsfTrack();
71  else
72  gsfTrack_.clear();
73 }
#define embed
Definition: AMPTWrapper.h:188
reco::GsfTrackRef gsfTrackRef_
void embedGsfTrack()
embeds the gsf track instead of keeping a reference to it
reco::GsfTrackCollection gsfTrack_

◆ setHcalIso()

void pat::GenericParticle::setHcalIso ( float  caloIso)
inline

Sets hcal isolation variable.

Definition at line 236 of file GenericParticle.h.

References caloIso(), pat::HcalIso, and setIsolation().

void setIsolation(IsolationKeys key, float value)

◆ setIsoDeposit()

void pat::GenericParticle::setIsoDeposit ( IsolationKeys  key,
const IsoDeposit dep 
)
inline

Sets the IsoDeposit associated with some key; if it is already existent, it is overwritten.

Definition at line 251 of file GenericParticle.h.

References isoDeposits_, ALPAKA_ACCELERATOR_NAMESPACE::vertexFinder::it, and submitPVResolutionJobs::key.

Referenced by ecalIsoDeposit(), hcalIsoDeposit(), pat::PATGenericParticleProducer::produce(), trackIsoDeposit(), and userIsoDeposit().

251  {
252  IsoDepositPairs::iterator it = isoDeposits_.begin(), ed = isoDeposits_.end();
253  for (; it != ed; ++it) {
254  if (it->first == key) {
255  it->second = dep;
256  return;
257  }
258  }
259  isoDeposits_.push_back(std::make_pair(key, dep));
260  }
IsoDepositPairs isoDeposits_
key
prepare the HTCondor submission files and eventually submit them

◆ setIsolation()

void pat::GenericParticle::setIsolation ( IsolationKeys  key,
float  value 
)
inline

Sets the isolation variable for a specifc key. Note that you can't set isolation for a pseudo-key like CaloIso

Definition at line 201 of file GenericParticle.h.

References Exception, isolations_, submitPVResolutionJobs::key, and relativeConstraints::value.

Referenced by pat::PATGenericParticleProducer::produce(), setEcalIso(), setHcalIso(), setTrackIso(), and setUserIso().

201  {
202  if (key >= 0) {
203  if (size_t(key) >= isolations_.size())
204  isolations_.resize(key + 1, -1.0);
205  isolations_[key] = value;
206  } else {
207  throw cms::Exception("Illegal Argument")
208  << "The key for which you're setting isolation does not correspond "
209  << "to an individual isolation but to the sum of more independent isolations "
210  << "(e.g. Calo = Ecal + Hcal), so you can't SET the value, just GET it.\n"
211  << "Please set up each component independly.\n";
212  }
213  }
std::vector< float > isolations_
key
prepare the HTCondor submission files and eventually submit them

◆ setQuality()

void pat::GenericParticle::setQuality ( float  quality)
inline

sets a user defined quality value

Definition at line 132 of file GenericParticle.h.

References quality(), and quality_.

Referenced by pat::PATGenericParticleProducer::produce().

132 { quality_ = quality; }
float quality()
returns a user defined quality value, if set by the user to some meaningful value ...

◆ setStandAloneMuon()

void GenericParticle::setStandAloneMuon ( const reco::TrackRef ref,
bool  embed = false 
)
virtual

sets stand-alone muon track reference (or even embed it into the object)

Definition at line 49 of file GenericParticle.cc.

References embed, embedStandalone(), standaloneTrack_, and standaloneTrackRef_.

Referenced by fillInFrom().

49  {
50  standaloneTrackRef_ = ref;
51  if (embed)
53  else
54  standaloneTrack_.clear();
55 }
reco::TrackRef standaloneTrackRef_
#define embed
Definition: AMPTWrapper.h:188
reco::TrackCollection standaloneTrack_
void embedStandalone()
embeds the stand-alone track instead of keeping a reference to it

◆ setSuperCluster()

void GenericParticle::setSuperCluster ( const reco::SuperClusterRef ref,
bool  embed = false 
)
virtual

sets supercluster reference (or even embed it into the object)

Definition at line 76 of file GenericParticle.cc.

References embed, embedSuperCluster(), superCluster_, and superClusterRef_.

Referenced by fillInFrom().

76  {
77  superClusterRef_ = ref;
78  if (embed)
80  else
81  superCluster_.clear();
82 }
#define embed
Definition: AMPTWrapper.h:188
reco::SuperClusterCollection superCluster_
reco::SuperClusterRef superClusterRef_
void embedSuperCluster()
embeds the supercluster instead of keeping a reference to it

◆ setTrack()

void GenericParticle::setTrack ( const reco::TrackRef ref,
bool  embed = false 
)
virtual

sets master track reference (or even embed it into the object)

Definition at line 31 of file GenericParticle.cc.

References embed, embedTrack(), track_, and trackRef_.

Referenced by fillInFrom().

31  {
32  trackRef_ = ref;
33  if (embed)
34  embedTrack();
35  else
36  track_.clear();
37 }
reco::TrackCollection track_
void embedTrack()
embeds the master track instead of keeping a reference to it
reco::TrackRef trackRef_
#define embed
Definition: AMPTWrapper.h:188

◆ setTrackIso()

void pat::GenericParticle::setTrackIso ( float  trackIso)
inline

Sets tracker isolation variable.

Definition at line 232 of file GenericParticle.h.

References setIsolation(), pat::TrackIso, and trackIso().

void setIsolation(IsolationKeys key, float value)
float trackIso() const

◆ setTracks()

void GenericParticle::setTracks ( const reco::TrackRefVector refs,
bool  embed = false 
)
virtual

sets multiple track references (or even embed the tracks into the object - whatch out for disk size issues!)

Definition at line 40 of file GenericParticle.cc.

References embed, embedTracks(), trackRefs_, and tracks_.

Referenced by fillInFrom().

40  {
41  trackRefs_ = refs;
42  if (embed)
43  embedTracks();
44  else
45  tracks_.clear();
46 }
#define embed
Definition: AMPTWrapper.h:188
reco::TrackCollection tracks_
void embedTracks()
embeds the other tracks instead of keeping references
reco::TrackRefVector trackRefs_

◆ setUserIso()

void pat::GenericParticle::setUserIso ( float  value,
uint8_t  index = 0 
)
inline

Sets user isolation variable index.

Definition at line 238 of file GenericParticle.h.

References setIsolation(), and pat::UserBaseIso.

void setIsolation(IsolationKeys key, float value)
IsolationKeys
Enum defining isolation keys.
Definition: Isolation.h:9
Definition: value.py:1
unsigned int index
Definition: LeafCandidate.h:31

◆ setVertexAssociation()

void pat::GenericParticle::setVertexAssociation ( const pat::VertexAssociation assoc)
inline

Set a single vertex association.

Definition at line 283 of file GenericParticle.h.

References trackingPlots::assoc, and vtxAss_.

Referenced by pat::PATGenericParticleProducer::produce().

283  {
284  vtxAss_ = std::vector<pat::VertexAssociation>(1, assoc);
285  }
std::vector< pat::VertexAssociation > vtxAss_

◆ setVertexAssociations()

void pat::GenericParticle::setVertexAssociations ( const std::vector< pat::VertexAssociation > &  assocs)
inline

Set multiple vertex associations.

Definition at line 287 of file GenericParticle.h.

References vtxAss_.

287 { vtxAss_ = assocs; }
std::vector< pat::VertexAssociation > vtxAss_

◆ standAloneMuon()

reco::TrackRef pat::GenericParticle::standAloneMuon ( ) const
inlineoverridevirtual

reference to a stand-alone muon Track (might be transient ref if SuperCluster is embedded) returns null ref if there is no stand-alone muon track

Reimplemented from reco::RecoCandidate.

Definition at line 80 of file GenericParticle.h.

References standaloneTrack_, and standaloneTrackRef_.

Referenced by overlap().

80  {
82  }
reco::TrackRef standaloneTrackRef_
reco::TrackCollection standaloneTrack_
edm::Ref< TrackCollection > TrackRef
persistent reference to a Track
Definition: TrackFwd.h:20

◆ superCluster()

reco::SuperClusterRef pat::GenericParticle::superCluster ( ) const
inlineoverridevirtual

reference to a SuperCluster (might be transient ref if SuperCluster is embedded) returns null ref if there is no supercluster

Reimplemented from reco::RecoCandidate.

Definition at line 90 of file GenericParticle.h.

References superCluster_, and superClusterRef_.

Referenced by Electron.Electron::mvaIDLoose(), Electron.Electron::mvaIDRun2(), Electron.Electron::mvaIDTight(), and overlap().

90  {
92  }
edm::Ref< SuperClusterCollection > SuperClusterRef
reference to an object in a collection of SuperCluster objects
reco::SuperClusterCollection superCluster_
reco::SuperClusterRef superClusterRef_

◆ track() [1/2]

reco::TrackRef pat::GenericParticle::track ( ) const
inlineoverridevirtual

reference to a master track (might be transient refs if Tracks are embedded) returns null ref if there is no master track

Reimplemented from reco::RecoCandidate.

Definition at line 62 of file GenericParticle.h.

References track_, and trackRef_.

Referenced by overlap().

62 { return track_.empty() ? trackRef_ : reco::TrackRef(&track_, 0); }
reco::TrackCollection track_
reco::TrackRef trackRef_
edm::Ref< TrackCollection > TrackRef
persistent reference to a Track
Definition: TrackFwd.h:20

◆ track() [2/2]

reco::TrackRef pat::GenericParticle::track ( size_t  idx) const
inlineoverridevirtual

reference to one of a set of multiple tracks (might be transient refs if Tracks are embedded) throws exception if idx >= numberOfTracks()

Reimplemented from reco::RecoCandidate.

Definition at line 65 of file GenericParticle.h.

References Exception, heavyIonCSV_trainingSettings::idx, numberOfTracks(), trackRefs_, and tracks_.

65  {
66  if (idx >= numberOfTracks())
67  throw cms::Exception("Index out of bounds")
68  << "Requested track " << idx << " out of " << numberOfTracks() << ".\n";
69  return (tracks_.empty() ? trackRefs_[idx] : reco::TrackRef(&tracks_, idx));
70  }
size_t numberOfTracks() const override
number of multiple tracks (not including the master one)
reco::TrackCollection tracks_
edm::Ref< TrackCollection > TrackRef
persistent reference to a Track
Definition: TrackFwd.h:20
reco::TrackRefVector trackRefs_

◆ trackIso()

float pat::GenericParticle::trackIso ( ) const
inline

Return the tracker isolation variable that was stored in this object when produced, or -1.0 if there is none

Definition at line 218 of file GenericParticle.h.

References pat::TrackIso, and userIsolation().

Referenced by setTrackIso().

218 { return userIsolation(pat::TrackIso); }
float userIsolation(IsolationKeys key) const

◆ trackIsoDeposit() [1/2]

const IsoDeposit* pat::GenericParticle::trackIsoDeposit ( ) const
inline

Definition at line 263 of file GenericParticle.h.

References isoDeposit(), and pat::TrackIso.

263 { return isoDeposit(pat::TrackIso); }
const IsoDeposit * isoDeposit(IsolationKeys key) const
Returns the IsoDeposit associated with some key, or a null pointer if it is not available.

◆ trackIsoDeposit() [2/2]

void pat::GenericParticle::trackIsoDeposit ( const IsoDeposit dep)
inline

Definition at line 269 of file GenericParticle.h.

References setIsoDeposit(), and pat::TrackIso.

269 { setIsoDeposit(pat::TrackIso, dep); }
void setIsoDeposit(IsolationKeys key, const IsoDeposit &dep)
Sets the IsoDeposit associated with some key; if it is already existent, it is overwritten.

◆ userIsoDeposit() [1/2]

const IsoDeposit* pat::GenericParticle::userIsoDeposit ( uint8_t  index = 0) const
inline

Definition at line 266 of file GenericParticle.h.

References isoDeposit(), and pat::UserBaseIso.

IsolationKeys
Enum defining isolation keys.
Definition: Isolation.h:9
unsigned int index
Definition: LeafCandidate.h:31
const IsoDeposit * isoDeposit(IsolationKeys key) const
Returns the IsoDeposit associated with some key, or a null pointer if it is not available.

◆ userIsoDeposit() [2/2]

void pat::GenericParticle::userIsoDeposit ( const IsoDeposit dep,
uint8_t  index = 0 
)
inline

Definition at line 272 of file GenericParticle.h.

References setIsoDeposit(), and pat::UserBaseIso.

272  {
274  }
IsolationKeys
Enum defining isolation keys.
Definition: Isolation.h:9
unsigned int index
Definition: LeafCandidate.h:31
void setIsoDeposit(IsolationKeys key, const IsoDeposit &dep)
Sets the IsoDeposit associated with some key; if it is already existent, it is overwritten.

◆ userIsolation() [1/2]

float pat::GenericParticle::userIsolation ( IsolationKeys  key) const
inline

Returns the isolation variable for a specifc key (or pseudo-key like CaloIso), or -1.0 if not available

Definition at line 137 of file GenericParticle.h.

References pat::CaloIso, pat::EcalIso, pat::HcalIso, isolations_, and submitPVResolutionJobs::key.

Referenced by caloIso(), ecalIso(), hcalIso(), trackIso(), and userIsolation().

137  {
138  if (key >= 0) {
139  //if (key >= isolations_.size()) throw cms::Excepton("Missing Data")
140  //<< "Isolation corresponding to key "
141  //<< key << " was not stored for this particle.";
142  if (size_t(key) >= isolations_.size())
143  return -1.0;
144  return isolations_[key];
145  } else
146  switch (key) {
147  case pat::CaloIso:
148  //if (isolations_.size() <= pat::HcalIso) throw cms::Excepton("Missing Data")
149  //<< "CalIsoo Isolation was not stored for this particle.";
150  if (isolations_.size() <= pat::HcalIso)
151  return -1.0;
153  default:
154  return -1.0;
155  //throw cms::Excepton("Missing Data") << "Isolation corresponding to key "
156  //<< key << " was not stored for this particle.";
157  }
158  }
std::vector< float > isolations_
key
prepare the HTCondor submission files and eventually submit them

◆ userIsolation() [2/2]

float pat::GenericParticle::userIsolation ( const std::string &  key) const
inline

Returns the isolation variable for string type function arguments (to be used with the cut-string parser); the possible values of the strings are the enums defined in DataFormats/PatCandidates/interface/Isolation.h

Definition at line 163 of file GenericParticle.h.

References pat::CaloIso, pat::EcalIso, pat::HcalIso, submitPVResolutionJobs::key, pat::PfAllParticleIso, pat::PfChargedHadronIso, pat::PfGammaIso, pat::PfNeutralHadronIso, AlCaHLTBitMon_QueryRunRegistry::string, pat::TrackIso, pat::User1Iso, pat::User2Iso, pat::User3Iso, pat::User4Iso, pat::User5Iso, pat::UserBaseIso, and userIsolation().

163  {
164  // remove leading namespace specifier
165  std::string prunedKey = (key.find("pat::") == 0) ? std::string(key, 5) : key;
166  if (prunedKey == "TrackIso")
168  if (prunedKey == "EcalIso")
169  return userIsolation(pat::EcalIso);
170  if (prunedKey == "HcalIso")
171  return userIsolation(pat::HcalIso);
172  if (prunedKey == "PfAllParticleIso")
174  if (prunedKey == "PfChargedHadronIso")
176  if (prunedKey == "PfNeutralHadronIso")
178  if (prunedKey == "PfGammaIso")
180  if (prunedKey == "User1Iso")
182  if (prunedKey == "User2Iso")
184  if (prunedKey == "User3Iso")
186  if (prunedKey == "User4Iso")
188  if (prunedKey == "User5Iso")
190  if (prunedKey == "UserBaseIso")
192  if (prunedKey == "CaloIso")
193  return userIsolation(pat::CaloIso);
194  //throw cms::Excepton("Missing Data")
195  //<< "Isolation corresponding to key "
196  //<< key << " was not stored for this particle.";
197  return -1.0;
198  }
float userIsolation(IsolationKeys key) const
key
prepare the HTCondor submission files and eventually submit them

◆ vertexAssociation()

const pat::VertexAssociation* pat::GenericParticle::vertexAssociation ( size_t  index = 0) const
inline

Vertex association (or associations, if any). Return null pointer if none has been set.

Definition at line 277 of file GenericParticle.h.

References vtxAss_.

277  {
278  return vtxAss_.size() > index ? &vtxAss_[index] : nullptr;
279  }
unsigned int index
Definition: LeafCandidate.h:31
std::vector< pat::VertexAssociation > vtxAss_

◆ vertexAssociations()

const std::vector<pat::VertexAssociation>& pat::GenericParticle::vertexAssociations ( ) const
inline

Vertex associations. Can be empty if it was not enabled in the config file.

Definition at line 281 of file GenericParticle.h.

References vtxAss_.

281 { return vtxAss_; }
std::vector< pat::VertexAssociation > vtxAss_

Member Data Documentation

◆ caloTower_

CaloTowerCollection pat::GenericParticle::caloTower_
protected

Definition at line 300 of file GenericParticle.h.

Referenced by caloTower(), embedCaloTower(), and setCaloTower().

◆ caloTowerRef_

CaloTowerRef pat::GenericParticle::caloTowerRef_
protected

Definition at line 299 of file GenericParticle.h.

Referenced by caloTower(), embedCaloTower(), and setCaloTower().

◆ combinedTrack_

reco::TrackCollection pat::GenericParticle::combinedTrack_
protected

Definition at line 292 of file GenericParticle.h.

Referenced by combinedMuon(), embedCombined(), and setCombinedMuon().

◆ combinedTrackRef_

reco::TrackRef pat::GenericParticle::combinedTrackRef_
protected

Definition at line 291 of file GenericParticle.h.

Referenced by combinedMuon(), embedCombined(), and setCombinedMuon().

◆ gsfTrack_

reco::GsfTrackCollection pat::GenericParticle::gsfTrack_
protected

Definition at line 296 of file GenericParticle.h.

Referenced by embedGsfTrack(), gsfTrack(), and setGsfTrack().

◆ gsfTrackRef_

reco::GsfTrackRef pat::GenericParticle::gsfTrackRef_
protected

Definition at line 295 of file GenericParticle.h.

Referenced by embedGsfTrack(), gsfTrack(), and setGsfTrack().

◆ isoDeposits_

IsoDepositPairs pat::GenericParticle::isoDeposits_
protected

Definition at line 316 of file GenericParticle.h.

Referenced by isoDeposit(), and setIsoDeposit().

◆ isolations_

std::vector<float> pat::GenericParticle::isolations_
protected

Definition at line 317 of file GenericParticle.h.

Referenced by setIsolation(), and userIsolation().

◆ quality_

float pat::GenericParticle::quality_
protected

Definition at line 312 of file GenericParticle.h.

Referenced by quality(), and setQuality().

◆ standaloneTrack_

reco::TrackCollection pat::GenericParticle::standaloneTrack_
protected

Definition at line 292 of file GenericParticle.h.

Referenced by embedStandalone(), setStandAloneMuon(), and standAloneMuon().

◆ standaloneTrackRef_

reco::TrackRef pat::GenericParticle::standaloneTrackRef_
protected

Definition at line 291 of file GenericParticle.h.

Referenced by embedStandalone(), setStandAloneMuon(), and standAloneMuon().

◆ superCluster_

reco::SuperClusterCollection pat::GenericParticle::superCluster_
protected

Definition at line 304 of file GenericParticle.h.

Referenced by embedSuperCluster(), setSuperCluster(), and superCluster().

◆ superClusterRef_

reco::SuperClusterRef pat::GenericParticle::superClusterRef_
protected

Definition at line 303 of file GenericParticle.h.

Referenced by embedSuperCluster(), setSuperCluster(), and superCluster().

◆ track_

reco::TrackCollection pat::GenericParticle::track_
protected

Definition at line 292 of file GenericParticle.h.

Referenced by embedTrack(), setTrack(), and track().

◆ trackRef_

reco::TrackRef pat::GenericParticle::trackRef_
protected

Definition at line 291 of file GenericParticle.h.

Referenced by embedTrack(), setTrack(), and track().

◆ trackRefs_

reco::TrackRefVector pat::GenericParticle::trackRefs_
protected

Definition at line 307 of file GenericParticle.h.

Referenced by embedTracks(), numberOfTracks(), setTracks(), and track().

◆ tracks_

reco::TrackCollection pat::GenericParticle::tracks_
protected

Definition at line 308 of file GenericParticle.h.

Referenced by embedTracks(), numberOfTracks(), setTracks(), and track().

◆ vtxAss_

std::vector<pat::VertexAssociation> pat::GenericParticle::vtxAss_
protected