CMS 3D CMS Logo

List of all members | Public Types | Public Member Functions | Protected Member Functions | Protected Attributes | Private Member Functions
pat::PATObject< ObjectType > Class Template Reference

Templated PAT object container. More...

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

Inheritance diagram for pat::PATObject< ObjectType >:

Public Types

typedef ObjectType base_type
 

Public Member Functions

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...
 
template<typename T >
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 char *key) const
 a CINT-friendly interface More...
 
bool hasUserFloat (const std::string &key) const
 Return true if there is a user-defined float with a given name. 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 edm::Ptr< ObjectType > &ref)
 constructor from reference More...
 
 PATObject (const edm::RefToBase< ObjectType > &ref)
 constructor from reference More...
 
 PATObject (const ObjectType &obj)
 constructor from a base object (leaves invalid reference to original object!) 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 char *nameAlgorithm, const bool algoCondAccepted=true, const size_t idx=0) const
 
const TriggerObjectStandAlonetriggerObjectMatchByAlgorithm (const char *nameAlgorithm, const unsigned algoCondAccepted, const size_t idx=0) const
 
const TriggerObjectStandAlonetriggerObjectMatchByAlgorithm (const std::string &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 TriggerObjectStandAlonetriggerObjectMatchByCollection (const char *coll, 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 TriggerObjectStandAlonetriggerObjectMatchByCondition (const char *nameCondition, 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 TriggerObjectStandAlonetriggerObjectMatchByFilter (const char *labelFilter, 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 TriggerObjectStandAlonetriggerObjectMatchByFilterID (const unsigned triggerObjectType, 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 char *namePath, const unsigned pathLastFilterAccepted, const unsigned pathL3FilterAccepted=1, 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 std::string &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 char *nameAlgorithm, const bool algoCondAccepted=true) const
 
const TriggerObjectStandAloneCollection triggerObjectMatchesByAlgorithm (const char *nameAlgorithm, const unsigned algoCondAccepted) const
 
const TriggerObjectStandAloneCollection triggerObjectMatchesByAlgorithm (const std::string &nameAlgorithm, const bool algoCondAccepted=true) const
 
const TriggerObjectStandAloneCollection triggerObjectMatchesByAlgorithm (const std::string &nameAlgorithm, const unsigned algoCondAccepted) const
 
const TriggerObjectStandAloneCollection triggerObjectMatchesByCollection (const char *coll) const
 
const TriggerObjectStandAloneCollection triggerObjectMatchesByCollection (const std::string &coll) const
 get all matched trigger objects from a certain collection More...
 
const TriggerObjectStandAloneCollection triggerObjectMatchesByCondition (const char *nameCondition) 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 triggerObjectMatchesByFilter (const char *labelFilter) const
 
const TriggerObjectStandAloneCollection triggerObjectMatchesByFilter (const std::string &labelFilter) const
 get all matched HLT objects used in a certain HLT filter More...
 
const TriggerObjectStandAloneCollection triggerObjectMatchesByFilterID (const unsigned triggerObjectType) const
 
const TriggerObjectStandAloneCollection triggerObjectMatchesByPath (const char *namePath, const bool pathLastFilterAccepted=false, const bool pathL3FilterAccepted=true) const
 
const TriggerObjectStandAloneCollection triggerObjectMatchesByPath (const char *namePath, const unsigned pathLastFilterAccepted, const unsigned pathL3FilterAccepted=1) const
 
const TriggerObjectStandAloneCollection triggerObjectMatchesByPath (const std::string &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 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...
 
template<typename T >
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 char *key) const
 a CINT-friendly interface More...
 
float userFloat (const std::string &key) const
 
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...
 

Protected Member Functions

void addUserDataObject_ (const std::string &label, std::unique_ptr< pat::UserData > value, bool overwrite=false)
 

Protected Attributes

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_
 

Private Member Functions

const pat::UserDatauserDataObject_ (const std::string &key) const
 

Detailed Description

template<class ObjectType>
class pat::PATObject< ObjectType >

Templated PAT object container.

PATObject is the templated base PAT object that wraps around reco objects.

Please post comments and questions to the Physics Tools hypernews: https://hypernews.cern.ch/HyperNews/CMS/get/physTools.html

Author
Steven Lowette, Giovanni Petrucciani, Frederic Ronga, Volker Adler, Sal Rappoccio

Definition at line 45 of file PATObject.h.

Member Typedef Documentation

◆ base_type

template<class ObjectType>
typedef ObjectType pat::PATObject< ObjectType >::base_type

Definition at line 47 of file PATObject.h.

Constructor & Destructor Documentation

◆ PATObject() [1/4]

template<class ObjectType >
pat::PATObject< ObjectType >::PATObject ( )

default constructor

Definition at line 506 of file PATObject.h.

506 {}

◆ PATObject() [2/4]

template<class ObjectType>
pat::PATObject< ObjectType >::PATObject ( const ObjectType &  obj)

constructor from a base object (leaves invalid reference to original object!)

Definition at line 509 of file PATObject.h.

509 : ObjectType(obj), refToOrig_() {}

◆ PATObject() [3/4]

template<class ObjectType>
pat::PATObject< ObjectType >::PATObject ( const edm::RefToBase< ObjectType > &  ref)

constructor from reference

Definition at line 512 of file PATObject.h.

513  : ObjectType(*ref),
514  refToOrig_(ref.id(),
515  ref.get(),
516  ref.key()) // correct way to convert RefToBase=>Ptr, if ref is guaranteed to be available
517  // which happens to be true, otherwise the line before this throws ex. already
518  {}

◆ PATObject() [4/4]

template<class ObjectType>
pat::PATObject< ObjectType >::PATObject ( const edm::Ptr< ObjectType > &  ref)

constructor from reference

Definition at line 521 of file PATObject.h.

521 : ObjectType(*ref), refToOrig_(ref) {}

◆ ~PATObject()

template<class ObjectType>
pat::PATObject< ObjectType >::~PATObject ( )
inlineoverride

destructor

Definition at line 58 of file PATObject.h.

58 {}

Member Function Documentation

◆ addGenParticleRef()

template<class ObjectType >
void pat::PATObject< ObjectType >::addGenParticleRef ( const reco::GenParticleRef ref)

Add a generator level particle reference If there is already an embedded particle, this ref will be embedded too

Definition at line 753 of file PATObject.h.

753  {
754  if (!genParticleEmbedded_.empty()) { // we're embedding
755  if (ref.isNonnull())
756  genParticleEmbedded_.push_back(*ref);
757  } else {
758  genParticleRef_.push_back(ref);
759  }
760  }

Referenced by pat::PATElectronProducer::fillElectron(), pat::PATElectronProducer::fillElectron2(), pat::PATMuonProducer::fillMuon(), pat::PATPFParticleProducer::produce(), pat::PATGenericParticleProducer::produce(), pat::PATTauProducer::produce(), and pat::PATPhotonProducer::produce().

◆ addTriggerObjectMatch()

template<class ObjectType>
void pat::PATObject< ObjectType >::addTriggerObjectMatch ( const TriggerObjectStandAlone trigObj)
inline

add a trigger match

Definition at line 240 of file PATObject.h.

240  {
241  triggerObjectMatchesEmbedded_.push_back(trigObj);
242  };

Referenced by pat::PATMuonProducer::fillL1TriggerInfo().

◆ addUserCand()

template<class ObjectType >
void pat::PATObject< ObjectType >::addUserCand ( const std::string &  label,
const reco::CandidatePtr data,
const bool  overwrite = false 
)

Set user-defined int.

Definition at line 956 of file PATObject.h.

958  {
959  auto it = std::lower_bound(userCandLabels_.begin(), userCandLabels_.end(), label);
960  const auto dist = std::distance(userCandLabels_.begin(), it);
961  if (it == userCandLabels_.end() || *it != label) {
962  userCandLabels_.insert(it, label);
963  userCands_.insert(userCands_.begin() + dist, data);
964  } else if (overwrite) {
965  userCands_[dist] = data;
966  } else {
967  userCandLabels_.insert(it + 1, label);
968  userCands_.insert(userCands_.begin() + dist + 1, data);
969  }
970  }

◆ addUserData()

template<class ObjectType>
template<typename T >
void pat::PATObject< ObjectType >::addUserData ( const std::string &  label,
const T data,
bool  transientOnly = false,
bool  overwrite = false 
)
inline

Set user-defined data Needs dictionaries for T and for pat::UserHolder<T>, and it will throw exception if they're missing, unless transientOnly is set to true

Definition at line 350 of file PATObject.h.

350  {
351  std::unique_ptr<pat::UserData> made(pat::UserData::make<T>(data, transientOnly));
352  addUserDataObject_(label, std::move(made), overwrite);
353  }

Referenced by OniaPhotonConversionProducer::makePhotonCandidate(), and Onia2MuMuPAT::produce().

◆ addUserDataFromPtr()

template<class ObjectType>
void pat::PATObject< ObjectType >::addUserDataFromPtr ( const std::string &  label,
const edm::Ptr< pat::UserData > &  data,
bool  overwrite = false 
)
inline

Set user-defined data. To be used only to fill from ValueMap<Ptr<UserData>> Do not use unless you know what you are doing.

Definition at line 357 of file PATObject.h.

357  {
358  std::unique_ptr<pat::UserData> cloned(data->clone());
360  }

◆ addUserDataObject_()

template<class ObjectType >
void pat::PATObject< ObjectType >::addUserDataObject_ ( const std::string &  label,
std::unique_ptr< pat::UserData value,
bool  overwrite = false 
)
protected

Definition at line 855 of file PATObject.h.

857  {
858  auto it = std::lower_bound(userDataLabels_.begin(), userDataLabels_.end(), label);
859  const auto dist = std::distance(userDataLabels_.begin(), it);
860  if (it == userDataLabels_.end() || *it != label) {
861  userDataLabels_.insert(it, label);
863  } else if (overwrite) {
865  } else {
866  //create a range by adding behind the first entry
867  userDataLabels_.insert(it + 1, label);
869  }
870  }

Referenced by pat::PATObject< reco::Muon >::addUserData(), and pat::PATObject< reco::Muon >::addUserDataFromPtr().

◆ addUserFloat()

template<class ObjectType >
void pat::PATObject< ObjectType >::addUserFloat ( const std::string &  label,
float  data,
const bool  overwrite = false 
)

Set user-defined float.

Definition at line 894 of file PATObject.h.

894  {
895  auto it = std::lower_bound(userFloatLabels_.begin(), userFloatLabels_.end(), label);
896  const auto dist = std::distance(userFloatLabels_.begin(), it);
897  if (it == userFloatLabels_.end() || *it != label) {
898  userFloatLabels_.insert(it, label);
899  userFloats_.insert(userFloats_.begin() + dist, data);
900  } else if (overwrite) {
901  userFloats_[dist] = data;
902  } else {
903  //create a range by adding behind the first entry
904  userFloatLabels_.insert(it + 1, label);
905  userFloats_.insert(userFloats_.begin() + dist + 1, data);
906  }
907  }

Referenced by ZeeCandidateFilter::filter(), EGEtScaleSysModifier::modifyObject(), ZMuMuTrackUserData::produce(), ZMuMuUserDataOneTrack::produce(), ZMuMuUserData::produce(), and Onia2MuMuPAT::produce().

◆ addUserInt()

template<class ObjectType>
void pat::PATObject< ObjectType >::addUserInt ( const std::string &  label,
int32_t  data,
const bool  overwrite = false 
)

Set user-defined int.

Definition at line 931 of file PATObject.h.

931  {
932  auto it = std::lower_bound(userIntLabels_.begin(), userIntLabels_.end(), label);
933  const auto dist = std::distance(userIntLabels_.begin(), it);
934  if (it == userIntLabels_.end() || *it != label) {
935  userIntLabels_.insert(it, label);
936  userInts_.insert(userInts_.begin() + dist, data);
937  } else if (overwrite) {
938  userInts_[dist] = data;
939  } else {
940  //create a range by adding behind the first entry
941  userIntLabels_.insert(it + 1, label);
942  userInts_.insert(userInts_.begin() + dist + 1, data);
943  }
944  }

Referenced by ZeeCandidateFilter::filter(), and Onia2MuMuPAT::produce().

◆ efficiencies()

template<class ObjectType >
std::vector< std::pair< std::string, pat::LookupTableRecord > > pat::PATObject< ObjectType >::efficiencies ( ) const

Returns the efficiencies as <name,value> pairs (by value)

Definition at line 718 of file PATObject.h.

718  {
719  std::vector<std::pair<std::string, pat::LookupTableRecord> > ret;
720  std::vector<std::string>::const_iterator itn = efficiencyNames_.begin(), edn = efficiencyNames_.end();
721  std::vector<pat::LookupTableRecord>::const_iterator itv = efficiencyValues_.begin();
722  for (; itn != edn; ++itn, ++itv) {
723  ret.emplace_back(*itn, *itv);
724  }
725  return ret;
726  }

◆ efficiency()

template<class ObjectType >
const pat::LookupTableRecord & pat::PATObject< ObjectType >::efficiency ( const std::string &  name) const

Returns an efficiency given its name.

Definition at line 708 of file PATObject.h.

708  {
709  // find the name in the (sorted) list of names
710  auto it = std::lower_bound(efficiencyNames_.cbegin(), efficiencyNames_.cend(), name);
711  if ((it == efficiencyNames_.end()) || (*it != name)) {
712  throw cms::Exception("Invalid Label") << "There is no efficiency with name '" << name << "' in this PAT Object\n";
713  }
714  return efficiencyValues_[std::distance(efficiencyNames_.cbegin(), it)];
715  }

Referenced by objects.LeptonAnalyzer.LeptonAnalyzer::makeLeptons().

◆ efficiencyNames()

template<class ObjectType>
const std::vector<std::string>& pat::PATObject< ObjectType >::efficiencyNames ( ) const
inline

Returns the list of the names of the stored efficiencies.

Definition at line 257 of file PATObject.h.

257 { return efficiencyNames_; }

◆ efficiencyValues()

template<class ObjectType>
const std::vector<pat::LookupTableRecord>& pat::PATObject< ObjectType >::efficiencyValues ( ) const
inline

Returns the list of the values of the stored efficiencies (the ordering is the same as in efficiencyNames())

Definition at line 259 of file PATObject.h.

259 { return efficiencyValues_; }

◆ embedGenParticle()

template<class ObjectType >
void pat::PATObject< ObjectType >::embedGenParticle ( )

Embed the generator level particle(s) in this PATObject Note that generator level particles can only be all embedded or all not embedded.

Definition at line 770 of file PATObject.h.

770  {
771  genParticleEmbedded_.clear();
772  for (std::vector<reco::GenParticleRef>::const_iterator it = genParticleRef_.begin(); it != genParticleRef_.end();
773  ++it) {
774  if (it->isNonnull())
775  genParticleEmbedded_.push_back(**it);
776  }
777  genParticleRef_.clear();
778  }

Referenced by pat::PATElectronProducer::fillElectron(), pat::PATElectronProducer::fillElectron2(), pat::PATMuonProducer::fillMuon(), pat::PATGenericParticleProducer::produce(), Onia2MuMuPAT::produce(), pat::PATPFParticleProducer::produce(), pat::PATTauProducer::produce(), and pat::PATPhotonProducer::produce().

◆ genParticle()

template<class ObjectType>
const reco::GenParticle* pat::PATObject< ObjectType >::genParticle ( size_t  idx = 0) const
inline

Get generator level particle, as C++ pointer (might be 0 if the ref was null) If you stored multiple GenParticles, you can specify which one you want.

Definition at line 287 of file PATObject.h.

287  {
289  return ref.isNonnull() ? ref.get() : nullptr;
290  }

Referenced by ZMuMu_Radiative_analyzer::analyze(), gamma_radiative_analyzer::analyze(), and pat::Lepton< reco::Muon >::genLepton().

◆ genParticleById()

template<class ObjectType >
reco::GenParticleRef pat::PATObject< ObjectType >::genParticleById ( int  pdgId,
int  status,
uint8_t  autoCharge = 0 
) const

Get a generator level particle reference with a given pdg id and status If there is no MC match with that pdgId and status, it will return a null ref Note: this might be a transient ref if the genParticle was embedded If status == 0, only the pdgId will be checked; likewise, if pdgId == 0, only the status will be checked. When autoCharge is set to true, and a charged reco particle is matched to a charged gen particle, positive pdgId means 'same charge', negative pdgId means 'opposite charge'; for example, electron.genParticleById(11,0,true) will get an e^+ matched to e^+ or e^- matched to e^-, while genParticleById(-15,0,true) will get e^+ matched to e^- or vice versa. If a neutral reco particle is matched to a charged gen particle, the sign of the pdgId passed to getParticleById must match that of the gen particle; for example photon.getParticleById(11) will match gamma to e^-, while genParticleById(-11) will match gamma to e^+ (pdgId=-11)

Definition at line 792 of file PATObject.h.

792  {
793  // get a vector, avoiding an unneeded copy if there is no embedding
794  const std::vector<reco::GenParticleRef> &vec = (genParticleEmbedded_.empty() ? genParticleRef_ : genParticleRefs());
795  for (std::vector<reco::GenParticleRef>::const_iterator ref = vec.begin(), end = vec.end(); ref != end; ++ref) {
796  if (ref->isNonnull()) {
797  const reco::GenParticle &g = **ref;
798  if ((status != 0) && (g.status() != status))
799  continue;
800  if (pdgId == 0) {
801  return *ref;
802  } else if (!autoCharge) {
803  if (pdgId == g.pdgId())
804  return *ref;
805  } else if (abs(pdgId) == abs(g.pdgId())) {
806  // I want pdgId > 0 to match "correct charge" (for charged particles)
807  if (g.charge() == 0)
808  return *ref;
809  else if ((this->charge() == 0) && (pdgId == g.pdgId()))
810  return *ref;
811  else if (g.charge() * this->charge() * pdgId > 0)
812  return *ref;
813  }
814  }
815  }
816  return reco::GenParticleRef();
817  }

◆ genParticleRef()

template<class ObjectType>
reco::GenParticleRef pat::PATObject< ObjectType >::genParticleRef ( size_t  idx = 0) const
inline

Get generator level particle reference (might be a transient ref if the genParticle was embedded) If you stored multiple GenParticles, you can specify which one you want.

Definition at line 267 of file PATObject.h.

267  {
268  if (idx >= genParticlesSize())
269  return reco::GenParticleRef();
271  }

Referenced by DimuonStatistics::analyze(), pat::PATObject< reco::Muon >::genParticle(), and DimuonMCMatcher::produce().

◆ genParticleRefs()

template<class ObjectType >
std::vector< reco::GenParticleRef > pat::PATObject< ObjectType >::genParticleRefs ( ) const

Return the list of generator level particles. Note that the refs can be transient refs to embedded GenParticles

Definition at line 781 of file PATObject.h.

781  {
782  if (genParticleEmbedded_.empty())
783  return genParticleRef_;
784  std::vector<reco::GenParticleRef> ret(genParticleEmbedded_.size());
785  for (size_t i = 0, n = ret.size(); i < n; ++i) {
787  }
788  return ret;
789  }

Referenced by getGenTau().

◆ genParticlesSize()

template<class ObjectType>
size_t pat::PATObject< ObjectType >::genParticlesSize ( ) const
inline

Number of generator level particles stored as ref or embedded.

Definition at line 292 of file PATObject.h.

292  {
293  return genParticleEmbedded_.empty() ? genParticleRef_.size() : genParticleEmbedded_.size();
294  }

Referenced by pat::PATObject< reco::Muon >::genParticleRef().

◆ getKinResolution()

template<class ObjectType >
const pat::CandKinResolution & pat::PATObject< ObjectType >::getKinResolution ( const std::string &  label = "") const

Return the kinematic resolutions associated to this object, possibly specifying a label for it. If not present, it will throw an exception.

Definition at line 973 of file PATObject.h.

973  {
974  const bool has_unlabelled = (kinResolutionLabels_.size() + 1 == kinResolutions_.size());
975  if (label.empty()) {
976  if (has_unlabelled) {
977  return kinResolutions_[0];
978  } else {
979  throw cms::Exception("Missing Data", "This object does not contain an un-labelled kinematic resolution");
980  }
981  } else {
983  const auto dist = std::distance(kinResolutionLabels_.begin(), match);
984  const size_t increment = (has_unlabelled ? 1 : 0);
985  if (match == kinResolutionLabels_.end() || *match != label) {
986  cms::Exception ex("Missing Data");
987  ex << "This object does not contain a kinematic resolution with name '" << label << "'.\n";
988  ex << "The known labels are: ";
989  for (std::vector<std::string>::const_iterator it = kinResolutionLabels_.cbegin();
990  it != kinResolutionLabels_.cend();
991  ++it) {
992  ex << "'" << *it << "' ";
993  }
994  ex << "\n";
995  throw ex;
996  } else {
997  return kinResolutions_[dist + increment];
998  }
999  }
1000  }

Referenced by pat::PATObject< reco::Muon >::resolE(), pat::PATObject< reco::Muon >::resolEt(), pat::PATObject< reco::Muon >::resolEta(), pat::PATObject< reco::Muon >::resolM(), pat::PATObject< reco::Muon >::resolP(), pat::PATObject< reco::Muon >::resolPhi(), pat::PATObject< reco::Muon >::resolPInv(), pat::PATObject< reco::Muon >::resolPt(), pat::PATObject< reco::Muon >::resolPx(), pat::PATObject< reco::Muon >::resolPy(), pat::PATObject< reco::Muon >::resolPz(), and pat::PATObject< reco::Muon >::resolTheta().

◆ hasKinResolution()

template<class ObjectType >
bool pat::PATObject< ObjectType >::hasKinResolution ( const std::string &  label = "") const

Check if the kinematic resolutions are stored into this object (possibly specifying a label for them)

Definition at line 1003 of file PATObject.h.

1003  {
1004  if (label.empty()) {
1005  return (kinResolutionLabels_.size() + 1 == kinResolutions_.size());
1006  } else {
1008  return (match != kinResolutionLabels_.cend() && *match == label);
1009  }
1010  }

◆ hasOverlaps()

template<class ObjectType >
bool pat::PATObject< ObjectType >::hasOverlaps ( const std::string &  label) const

Returns true if there was at least one overlap for this test label.

Definition at line 820 of file PATObject.h.

820  {
821  auto match = std::lower_bound(overlapLabels_.cbegin(), overlapLabels_.cend(), label);
822  return (match != overlapLabels_.end() && *match == label);
823  }

◆ hasUserCand()

template<class ObjectType>
bool pat::PATObject< ObjectType >::hasUserCand ( const std::string &  key) const
inline

Return true if there is a user-defined int with a given name.

Definition at line 405 of file PATObject.h.

405  {
406  auto it = std::lower_bound(userCandLabels_.cbegin(), userCandLabels_.cend(), key);
407  return (it != userCandLabels_.cend() && *it == key);
408  }

◆ hasUserData()

template<class ObjectType>
bool pat::PATObject< ObjectType >::hasUserData ( const std::string &  key) const
inline

Check if user data with a specific type is present.

Definition at line 329 of file PATObject.h.

329 { return (userDataObject_(key) != nullptr); }

◆ hasUserFloat() [1/2]

template<class ObjectType>
bool pat::PATObject< ObjectType >::hasUserFloat ( const char *  key) const
inline

a CINT-friendly interface

Definition at line 380 of file PATObject.h.

380 { return hasUserFloat(std::string(key)); }

Referenced by pat::PATObject< reco::Muon >::hasUserFloat(), and Jet.Jet::puMva().

◆ hasUserFloat() [2/2]

template<class ObjectType>
bool pat::PATObject< ObjectType >::hasUserFloat ( const std::string &  key) const
inline

Return true if there is a user-defined float with a given name.

Definition at line 375 of file PATObject.h.

375  {
376  auto it = std::lower_bound(userFloatLabels_.cbegin(), userFloatLabels_.cend(), key);
377  return (it != userFloatLabels_.cend() && *it == key);
378  }

Referenced by WenuPlots::analyze(), and Jet.Jet::puMva().

◆ hasUserInt()

template<class ObjectType>
bool pat::PATObject< ObjectType >::hasUserInt ( const std::string &  key) const
inline

Return true if there is a user-defined int with a given name.

Definition at line 392 of file PATObject.h.

392  {
393  auto it = std::lower_bound(userIntLabels_.cbegin(), userIntLabels_.cend(), key);
394  return (it != userIntLabels_.cend() && *it == key);
395  }

Referenced by WenuPlots::analyze(), ZeePlots::PassPreselectionCriteria1(), and ZeePlots::PassPreselectionCriteria2().

◆ originalObject()

template<class ObjectType >
const reco::Candidate * pat::PATObject< ObjectType >::originalObject ( ) const

access to the original object; returns zero for null Ref and throws for unavailable collection

Definition at line 524 of file PATObject.h.

524  {
525  if (refToOrig_.isNull()) {
526  // this object was not produced from a reference, so no link to the
527  // original object exists -> return a 0-pointer
528  return nullptr;
529  } else if (!refToOrig_.isAvailable()) {
531  << "The original collection from which this PAT object was made is not present any more in the event, hence "
532  "you cannot access the originating object anymore.";
533  } else {
534  return refToOrig_.get();
535  }
536  }

◆ originalObjectRef()

template<class ObjectType >
const edm::Ptr< reco::Candidate > & pat::PATObject< ObjectType >::originalObjectRef ( ) const

◆ overlapLabels()

template<class ObjectType>
const std::vector<std::string>& pat::PATObject< ObjectType >::overlapLabels ( ) const
inline

Returns the labels of the overlap tests that found at least one overlap.

Definition at line 316 of file PATObject.h.

316 { return overlapLabels_; }

◆ overlaps()

template<class ObjectType >
const reco::CandidatePtrVector & pat::PATObject< ObjectType >::overlaps ( const std::string &  label) const

Return the list of overlaps for one label (can be empty) The original ordering of items is kept (usually it's by increasing deltaR from this item)

Definition at line 826 of file PATObject.h.

826  {
827  auto match = std::lower_bound(overlapLabels_.cbegin(), overlapLabels_.cend(), label);
828  if (match == overlapLabels_.cend() || *match != label)
829  return get_empty_cpv();
831  }

◆ resolE()

template<class ObjectType>
double pat::PATObject< ObjectType >::resolE ( const std::string &  label = "") const
inline

Resolution on energy, possibly with a label to specify which resolution to use.

Definition at line 431 of file PATObject.h.

431 { return getKinResolution(label).resolE(this->p4()); }

◆ resolEt()

template<class ObjectType>
double pat::PATObject< ObjectType >::resolEt ( const std::string &  label = "") const
inline

Resolution on et, possibly with a label to specify which resolution to use.

Definition at line 434 of file PATObject.h.

434 { return getKinResolution(label).resolEt(this->p4()); }

◆ resolEta()

template<class ObjectType>
double pat::PATObject< ObjectType >::resolEta ( const std::string &  label = "") const
inline

Resolution on eta, possibly with a label to specify which resolution to use.

Definition at line 422 of file PATObject.h.

422 { return getKinResolution(label).resolEta(this->p4()); }

◆ resolM()

template<class ObjectType>
double pat::PATObject< ObjectType >::resolM ( const std::string &  label = "") const
inline

Resolution on mass, possibly with a label to specify which resolution to use Note: this will be zero if a mass-constrained parametrization is used for this object

Definition at line 456 of file PATObject.h.

456 { return getKinResolution(label).resolM(this->p4()); }

◆ resolP()

template<class ObjectType>
double pat::PATObject< ObjectType >::resolP ( const std::string &  label = "") const
inline

Resolution on p, possibly with a label to specify which resolution to use.

Definition at line 437 of file PATObject.h.

437 { return getKinResolution(label).resolP(this->p4()); }

◆ resolPhi()

template<class ObjectType>
double pat::PATObject< ObjectType >::resolPhi ( const std::string &  label = "") const
inline

Resolution on phi, possibly with a label to specify which resolution to use.

Definition at line 428 of file PATObject.h.

428 { return getKinResolution(label).resolPhi(this->p4()); }

◆ resolPInv()

template<class ObjectType>
double pat::PATObject< ObjectType >::resolPInv ( const std::string &  label = "") const
inline

Resolution on 1/p, possibly with a label to specify which resolution to use.

Definition at line 443 of file PATObject.h.

443 { return getKinResolution(label).resolPInv(this->p4()); }

◆ resolPt()

template<class ObjectType>
double pat::PATObject< ObjectType >::resolPt ( const std::string &  label = "") const
inline

Resolution on pt, possibly with a label to specify which resolution to use.

Definition at line 440 of file PATObject.h.

440 { return getKinResolution(label).resolPt(this->p4()); }

◆ resolPx()

template<class ObjectType>
double pat::PATObject< ObjectType >::resolPx ( const std::string &  label = "") const
inline

Resolution on px, possibly with a label to specify which resolution to use.

Definition at line 446 of file PATObject.h.

446 { return getKinResolution(label).resolPx(this->p4()); }

◆ resolPy()

template<class ObjectType>
double pat::PATObject< ObjectType >::resolPy ( const std::string &  label = "") const
inline

Resolution on py, possibly with a label to specify which resolution to use.

Definition at line 449 of file PATObject.h.

449 { return getKinResolution(label).resolPy(this->p4()); }

◆ resolPz()

template<class ObjectType>
double pat::PATObject< ObjectType >::resolPz ( const std::string &  label = "") const
inline

Resolution on pz, possibly with a label to specify which resolution to use.

Definition at line 452 of file PATObject.h.

452 { return getKinResolution(label).resolPz(this->p4()); }

◆ resolTheta()

template<class ObjectType>
double pat::PATObject< ObjectType >::resolTheta ( const std::string &  label = "") const
inline

Resolution on theta, possibly with a label to specify which resolution to use.

Definition at line 425 of file PATObject.h.

425 { return getKinResolution(label).resolTheta(this->p4()); }

◆ setEfficiency()

template<class ObjectType >
void pat::PATObject< ObjectType >::setEfficiency ( const std::string &  name,
const pat::LookupTableRecord value 
)

Store one efficiency in this item, in addition to the existing ones If an efficiency with the same name exists, the old value is replaced by this one Calling this method many times with names not sorted alphabetically will be slow

Definition at line 729 of file PATObject.h.

729  {
730  // look for the name, or to the place where we can insert it without violating the alphabetic order
731  auto it = std::lower_bound(efficiencyNames_.begin(), efficiencyNames_.end(), name);
732  const auto dist = std::distance(efficiencyNames_.begin(), it);
733  if (it == efficiencyNames_.end()) { // insert at the end
734  efficiencyNames_.push_back(name);
735  efficiencyValues_.push_back(value);
736  } else if (*it == name) { // replace existing
737  efficiencyValues_[dist] = value;
738  } else { // insert in the middle :-(
739  efficiencyNames_.insert(it, name);
740  efficiencyValues_.insert(efficiencyValues_.begin() + dist, value);
741  }
742  }

◆ setGenParticle()

template<class ObjectType >
void pat::PATObject< ObjectType >::setGenParticle ( const reco::GenParticle particle)

Set the generator level particle from a particle not in the Event (embedding it, of course)

Definition at line 763 of file PATObject.h.

763  {
764  genParticleEmbedded_.clear();
765  genParticleEmbedded_.push_back(particle);
766  genParticleRef_.clear();
767  }

◆ setGenParticleRef()

template<class ObjectType >
void pat::PATObject< ObjectType >::setGenParticleRef ( const reco::GenParticleRef ref,
bool  embed = false 
)

Set the generator level particle reference.

Definition at line 745 of file PATObject.h.

745  {
746  genParticleRef_ = std::vector<reco::GenParticleRef>(1, ref);
747  genParticleEmbedded_.clear();
748  if (embed)
750  }

Referenced by Onia2MuMuPAT::produce(), and pat::Lepton< reco::Muon >::setGenLepton().

◆ setKinResolution()

template<class ObjectType >
void pat::PATObject< ObjectType >::setKinResolution ( const pat::CandKinResolution resol,
const std::string &  label = "" 
)

Add a kinematic resolution to this object (possibly with a label)

Definition at line 1013 of file PATObject.h.

1013  {
1014  const bool has_unlabelled = (kinResolutionLabels_.size() + 1 == kinResolutions_.size());
1015  if (label.empty()) {
1016  if (has_unlabelled) {
1017  // There is already an un-labelled object. Replace it
1018  kinResolutions_[0] = resol;
1019  } else {
1020  // Insert. Note that the un-labelled is always the first, so we need to insert before begin()
1021  // (for an empty vector, this should not cost more than push_back)
1022  kinResolutions_.insert(kinResolutions_.begin(), resol);
1023  }
1024  } else {
1026  const auto dist = std::distance(kinResolutionLabels_.begin(), match);
1027  const size_t increment = (has_unlabelled ? 1 : 0);
1028  if (match != kinResolutionLabels_.end() && *match == label) {
1029  // Existing object: replace
1030  kinResolutions_[dist + increment] = resol;
1031  } else {
1032  kinResolutionLabels_.insert(match, label);
1033  kinResolutions_.insert(kinResolutions_.begin() + dist + increment, resol);
1034  }
1035  }
1036  }

◆ setOverlaps()

template<class ObjectType >
void pat::PATObject< ObjectType >::setOverlaps ( const std::string &  label,
const reco::CandidatePtrVector overlaps 
)

Sets the list of overlapping items for one label Note that adding an empty PtrVector has no effect at all Items within the list should already be sorted appropriately (this method won't sort them)

Definition at line 834 of file PATObject.h.

834  {
835  auto match = std::lower_bound(overlapLabels_.begin(), overlapLabels_.end(), label);
836  const auto dist = std::distance(overlapLabels_.begin(), match);
837  if (match == overlapLabels_.end() || *match != label) {
838  overlapLabels_.insert(match, label);
839  overlapItems_.insert(overlapItems_.begin() + dist, overlaps);
840  } else {
841  overlapItems_[dist] = overlaps;
842  }
843  }

◆ triggerObjectMatch()

template<class ObjectType >
const TriggerObjectStandAlone * pat::PATObject< ObjectType >::triggerObjectMatch ( const size_t  idx = 0) const

get one matched trigger object by index

Definition at line 544 of file PATObject.h.

544  {
545  if (idx >= triggerObjectMatches().size())
546  return nullptr;
548  return ref.isNonnull() ? ref.get() : nullptr;
549  }

◆ triggerObjectMatchByAlgorithm() [1/4]

template<class ObjectType>
const TriggerObjectStandAlone* pat::PATObject< ObjectType >::triggerObjectMatchByAlgorithm ( const char *  nameAlgorithm,
const bool  algoCondAccepted = true,
const size_t  idx = 0 
) const
inline

Definition at line 151 of file PATObject.h.

153  {
154  return triggerObjectMatchByAlgorithm(std::string(nameAlgorithm), algoCondAccepted, idx);
155  };

◆ triggerObjectMatchByAlgorithm() [2/4]

template<class ObjectType>
const TriggerObjectStandAlone* pat::PATObject< ObjectType >::triggerObjectMatchByAlgorithm ( const char *  nameAlgorithm,
const unsigned  algoCondAccepted,
const size_t  idx = 0 
) const
inline

Definition at line 163 of file PATObject.h.

165  {
166  return triggerObjectMatchByAlgorithm(std::string(nameAlgorithm), bool(algoCondAccepted), idx);
167  };

◆ triggerObjectMatchByAlgorithm() [3/4]

template<class ObjectType >
const TriggerObjectStandAlone * pat::PATObject< ObjectType >::triggerObjectMatchByAlgorithm ( const std::string &  nameAlgorithm,
const bool  algoCondAccepted = true,
const size_t  idx = 0 
) const

get one matched L1 object used in a succeeding object combination of a condition in a certain L1 (physics) algorithm by index; if 'algoCondAccepted' is set to 'true' (default), only objects used in succeeding conditions of succeeding algorithms are considered ("firing" objects)

Definition at line 639 of file PATObject.h.

641  {
642  std::vector<size_t> refs;
643  for (size_t i = 0; i < triggerObjectMatches().size(); ++i) {
644  if (triggerObjectMatch(i) != 0 && triggerObjectMatch(i)->hasAlgorithmName(nameAlgorithm, algoCondAccepted))
645  refs.push_back(i);
646  }
647  if (idx >= refs.size())
648  return nullptr;
650  return ref.isNonnull() ? ref.get() : nullptr;
651  }

Referenced by pat::PATObject< reco::Muon >::triggerObjectMatchByAlgorithm().

◆ triggerObjectMatchByAlgorithm() [4/4]

template<class ObjectType>
const TriggerObjectStandAlone* pat::PATObject< ObjectType >::triggerObjectMatchByAlgorithm ( const std::string &  nameAlgorithm,
const unsigned  algoCondAccepted,
const size_t  idx = 0 
) const
inline

Definition at line 157 of file PATObject.h.

159  {
160  return triggerObjectMatchByAlgorithm(nameAlgorithm, bool(algoCondAccepted), idx);
161  };

◆ triggerObjectMatchByCollection() [1/2]

template<class ObjectType>
const TriggerObjectStandAlone* pat::PATObject< ObjectType >::triggerObjectMatchByCollection ( const char *  coll,
const size_t  idx = 0 
) const
inline

Definition at line 107 of file PATObject.h.

107  {
109  };

◆ triggerObjectMatchByCollection() [2/2]

template<class ObjectType >
const TriggerObjectStandAlone * pat::PATObject< ObjectType >::triggerObjectMatchByCollection ( const std::string &  coll,
const size_t  idx = 0 
) const

get one matched trigger object from a certain collection by index

Definition at line 588 of file PATObject.h.

589  {
590  std::vector<size_t> refs;
591  for (size_t i = 0; i < triggerObjectMatches().size(); ++i) {
592  if (triggerObjectMatch(i) != 0 && triggerObjectMatch(i)->hasCollection(coll)) {
593  refs.push_back(i);
594  }
595  }
596  if (idx >= refs.size())
597  return nullptr;
599  return ref.isNonnull() ? ref.get() : nullptr;
600  }

Referenced by pat::PATObject< reco::Muon >::triggerObjectMatchByCollection().

◆ triggerObjectMatchByCondition() [1/2]

template<class ObjectType>
const TriggerObjectStandAlone* pat::PATObject< ObjectType >::triggerObjectMatchByCondition ( const char *  nameCondition,
const size_t  idx = 0 
) const
inline

Definition at line 120 of file PATObject.h.

121  {
122  return triggerObjectMatchByCondition(std::string(nameCondition), idx);
123  };

◆ triggerObjectMatchByCondition() [2/2]

template<class ObjectType >
const TriggerObjectStandAlone * pat::PATObject< ObjectType >::triggerObjectMatchByCondition ( 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

Definition at line 614 of file PATObject.h.

615  {
616  std::vector<size_t> refs;
617  for (size_t i = 0; i < triggerObjectMatches().size(); ++i) {
618  if (triggerObjectMatch(i) != 0 && triggerObjectMatch(i)->hasConditionName(nameCondition))
619  refs.push_back(i);
620  }
621  if (idx >= refs.size())
622  return nullptr;
624  return ref.isNonnull() ? ref.get() : nullptr;
625  }

Referenced by pat::PATObject< reco::Muon >::triggerObjectMatchByCondition().

◆ triggerObjectMatchByFilter() [1/2]

template<class ObjectType>
const TriggerObjectStandAlone* pat::PATObject< ObjectType >::triggerObjectMatchByFilter ( const char *  labelFilter,
const size_t  idx = 0 
) const
inline

Definition at line 178 of file PATObject.h.

178  {
179  return triggerObjectMatchByFilter(std::string(labelFilter), idx);
180  };

◆ triggerObjectMatchByFilter() [2/2]

template<class ObjectType >
const TriggerObjectStandAlone * pat::PATObject< ObjectType >::triggerObjectMatchByFilter ( const std::string &  labelFilter,
const size_t  idx = 0 
) const

get one matched HLT object used in a certain HLT filter by index

Definition at line 665 of file PATObject.h.

666  {
667  std::vector<size_t> refs;
668  for (size_t i = 0; i < triggerObjectMatches().size(); ++i) {
669  if (triggerObjectMatch(i) != 0 && triggerObjectMatch(i)->hasFilterLabel(labelFilter))
670  refs.push_back(i);
671  }
672  if (idx >= refs.size())
673  return nullptr;
675  return ref.isNonnull() ? ref.get() : nullptr;
676  }

Referenced by pat::PATObject< reco::Muon >::triggerObjectMatchByFilter().

◆ triggerObjectMatchByFilterID()

template<class ObjectType>
const TriggerObjectStandAlone* pat::PATObject< ObjectType >::triggerObjectMatchByFilterID ( const unsigned  triggerObjectType,
const size_t  idx = 0 
) const
inline

Definition at line 94 of file PATObject.h.

95  {
96  return triggerObjectMatchByType(trigger::TriggerObjectType(triggerObjectType), idx);
97  };

◆ triggerObjectMatchByPath() [1/4]

template<class ObjectType>
const TriggerObjectStandAlone* pat::PATObject< ObjectType >::triggerObjectMatchByPath ( const char *  namePath,
const bool  pathLastFilterAccepted = false,
const bool  pathL3FilterAccepted = true,
const size_t  idx = 0 
) const
inline

Definition at line 218 of file PATObject.h.

221  {
222  return triggerObjectMatchByPath(std::string(namePath), pathLastFilterAccepted, pathL3FilterAccepted, idx);
223  };

◆ triggerObjectMatchByPath() [2/4]

template<class ObjectType>
const TriggerObjectStandAlone* pat::PATObject< ObjectType >::triggerObjectMatchByPath ( const char *  namePath,
const unsigned  pathLastFilterAccepted,
const unsigned  pathL3FilterAccepted = 1,
const size_t  idx = 0 
) const
inline

Definition at line 232 of file PATObject.h.

235  {
237  std::string(namePath), bool(pathLastFilterAccepted), bool(pathL3FilterAccepted), idx);
238  };

◆ triggerObjectMatchByPath() [3/4]

template<class ObjectType >
const TriggerObjectStandAlone * pat::PATObject< ObjectType >::triggerObjectMatchByPath ( const std::string &  namePath,
const bool  pathLastFilterAccepted = false,
const bool  pathL3FilterAccepted = true,
const size_t  idx = 0 
) const

get one matched HLT object used in a certain HLT path by index; if 'pathLastFilterAccepted' is set to 'true' (default), only objects used in the final filter of a succeeding path are considered ("firing" objects, old style only valid for single object triggers); if 'pathL3FilterAccepted' is set to 'true' (default), only objects used in L3 filters (identified by the "saveTags" parameter being 'true') of a succeeding path are considered ("firing" objects also valid for x-triggers)

Definition at line 691 of file PATObject.h.

694  {
695  std::vector<size_t> refs;
696  for (size_t i = 0; i < triggerObjectMatches().size(); ++i) {
697  if (triggerObjectMatch(i) != nullptr &&
698  triggerObjectMatch(i)->hasPathName(namePath, pathLastFilterAccepted, pathL3FilterAccepted))
699  refs.push_back(i);
700  }
701  if (idx >= refs.size())
702  return nullptr;
704  return ref.isNonnull() ? ref.get() : nullptr;
705  }

Referenced by pat::PATObject< reco::Muon >::triggerObjectMatchByPath().

◆ triggerObjectMatchByPath() [4/4]

template<class ObjectType>
const TriggerObjectStandAlone* pat::PATObject< ObjectType >::triggerObjectMatchByPath ( const std::string &  namePath,
const unsigned  pathLastFilterAccepted,
const unsigned  pathL3FilterAccepted = 1,
const size_t  idx = 0 
) const
inline

Definition at line 225 of file PATObject.h.

228  {
229  return triggerObjectMatchByPath(namePath, bool(pathLastFilterAccepted), bool(pathL3FilterAccepted), idx);
230  };

◆ triggerObjectMatchByType() [1/2]

template<class ObjectType >
const TriggerObjectStandAlone * pat::PATObject< ObjectType >::triggerObjectMatchByType ( const trigger::TriggerObjectType  triggerObjectType,
const size_t  idx = 0 
) const

get one matched trigger object of a certain type by index

Definition at line 563 of file PATObject.h.

564  {
565  std::vector<size_t> refs;
566  for (size_t i = 0; i < triggerObjectMatches().size(); ++i) {
567  if (triggerObjectMatch(i) != nullptr && triggerObjectMatch(i)->hasTriggerObjectType(triggerObjectType))
568  refs.push_back(i);
569  }
570  if (idx >= refs.size())
571  return nullptr;
573  return ref.isNonnull() ? ref.get() : nullptr;
574  }

Referenced by pat::PATObject< reco::Muon >::triggerObjectMatchByFilterID(), and pat::PATObject< reco::Muon >::triggerObjectMatchByType().

◆ triggerObjectMatchByType() [2/2]

template<class ObjectType>
const TriggerObjectStandAlone* pat::PATObject< ObjectType >::triggerObjectMatchByType ( const unsigned  triggerObjectType,
const size_t  idx = 0 
) const
inline

Definition at line 89 of file PATObject.h.

90  {
91  return triggerObjectMatchByType(trigger::TriggerObjectType(triggerObjectType), idx);
92  };

◆ triggerObjectMatches()

template<class ObjectType>
const TriggerObjectStandAloneCollection& pat::PATObject< ObjectType >::triggerObjectMatches ( ) const
inline

get all matched trigger objects

access to embedded trigger matches: duplicated functions using 'char*' instead of 'std::string' are needed in order to work properly in CINT command lines; duplicated functions using 'unsigned' instead of 'bool' are needed in order to work properly in the cut string parser;

Definition at line 72 of file PATObject.h.

◆ triggerObjectMatchesByAlgorithm() [1/4]

template<class ObjectType>
const TriggerObjectStandAloneCollection pat::PATObject< ObjectType >::triggerObjectMatchesByAlgorithm ( const char *  nameAlgorithm,
const bool  algoCondAccepted = true 
) const
inline

Definition at line 130 of file PATObject.h.

131  {
132  return triggerObjectMatchesByAlgorithm(std::string(nameAlgorithm), algoCondAccepted);
133  };

◆ triggerObjectMatchesByAlgorithm() [2/4]

template<class ObjectType>
const TriggerObjectStandAloneCollection pat::PATObject< ObjectType >::triggerObjectMatchesByAlgorithm ( const char *  nameAlgorithm,
const unsigned  algoCondAccepted 
) const
inline

Definition at line 140 of file PATObject.h.

141  {
142  return triggerObjectMatchesByAlgorithm(std::string(nameAlgorithm), bool(algoCondAccepted));
143  };

◆ triggerObjectMatchesByAlgorithm() [3/4]

template<class ObjectType >
const TriggerObjectStandAloneCollection pat::PATObject< ObjectType >::triggerObjectMatchesByAlgorithm ( const std::string &  nameAlgorithm,
const bool  algoCondAccepted = true 
) const

get all matched L1 objects used in a succeeding object combination of a condition in a certain L1 (physics) algorithm; if 'algoCondAccepted' is set to 'true' (default), only objects used in succeeding conditions of succeeding algorithms are considered ("firing" objects)

Definition at line 628 of file PATObject.h.

629  {
631  for (size_t i = 0; i < triggerObjectMatches().size(); ++i) {
632  if (triggerObjectMatch(i) != 0 && triggerObjectMatch(i)->hasAlgorithmName(nameAlgorithm, algoCondAccepted))
633  matches.push_back(*(triggerObjectMatch(i)));
634  }
635  return matches;
636  }

Referenced by pat::PATObject< reco::Muon >::triggerObjectMatchesByAlgorithm().

◆ triggerObjectMatchesByAlgorithm() [4/4]

template<class ObjectType>
const TriggerObjectStandAloneCollection pat::PATObject< ObjectType >::triggerObjectMatchesByAlgorithm ( const std::string &  nameAlgorithm,
const unsigned  algoCondAccepted 
) const
inline

Definition at line 135 of file PATObject.h.

136  {
137  return triggerObjectMatchesByAlgorithm(nameAlgorithm, bool(algoCondAccepted));
138  };

◆ triggerObjectMatchesByCollection() [1/2]

template<class ObjectType>
const TriggerObjectStandAloneCollection pat::PATObject< ObjectType >::triggerObjectMatchesByCollection ( const char *  coll) const
inline

Definition at line 101 of file PATObject.h.

101  {
103  };

◆ triggerObjectMatchesByCollection() [2/2]

template<class ObjectType >
const TriggerObjectStandAloneCollection pat::PATObject< ObjectType >::triggerObjectMatchesByCollection ( const std::string &  coll) const

get all matched trigger objects from a certain collection

Definition at line 577 of file PATObject.h.

578  {
580  for (size_t i = 0; i < triggerObjectMatches().size(); ++i) {
582  matches.push_back(*(triggerObjectMatch(i)));
583  }
584  return matches;
585  }

Referenced by pat::PATObject< reco::Muon >::triggerObjectMatchesByCollection().

◆ triggerObjectMatchesByCondition() [1/2]

template<class ObjectType>
const TriggerObjectStandAloneCollection pat::PATObject< ObjectType >::triggerObjectMatchesByCondition ( const char *  nameCondition) const
inline

Definition at line 113 of file PATObject.h.

113  {
114  return triggerObjectMatchesByCondition(std::string(nameCondition));
115  };

◆ triggerObjectMatchesByCondition() [2/2]

template<class ObjectType >
const TriggerObjectStandAloneCollection pat::PATObject< ObjectType >::triggerObjectMatchesByCondition ( const std::string &  nameCondition) const

get all matched L1 objects used in a succeeding object combination of a certain L1 condition

Definition at line 603 of file PATObject.h.

604  {
606  for (size_t i = 0; i < triggerObjectMatches().size(); ++i) {
607  if (triggerObjectMatch(i) != 0 && triggerObjectMatch(i)->hasConditionName(nameCondition))
608  matches.push_back(*(triggerObjectMatch(i)));
609  }
610  return matches;
611  }

Referenced by pat::PATObject< reco::Muon >::triggerObjectMatchesByCondition().

◆ triggerObjectMatchesByFilter() [1/2]

template<class ObjectType>
const TriggerObjectStandAloneCollection pat::PATObject< ObjectType >::triggerObjectMatchesByFilter ( const char *  labelFilter) const
inline

Definition at line 171 of file PATObject.h.

171  {
172  return triggerObjectMatchesByFilter(std::string(labelFilter));
173  };

◆ triggerObjectMatchesByFilter() [2/2]

template<class ObjectType >
const TriggerObjectStandAloneCollection pat::PATObject< ObjectType >::triggerObjectMatchesByFilter ( const std::string &  labelFilter) const

get all matched HLT objects used in a certain HLT filter

Definition at line 654 of file PATObject.h.

655  {
657  for (size_t i = 0; i < triggerObjectMatches().size(); ++i) {
658  if (triggerObjectMatch(i) != 0 && triggerObjectMatch(i)->hasFilterLabel(labelFilter))
659  matches.push_back(*(triggerObjectMatch(i)));
660  }
661  return matches;
662  }

Referenced by pat::PATObject< reco::Muon >::triggerObjectMatchesByFilter().

◆ triggerObjectMatchesByFilterID()

template<class ObjectType>
const TriggerObjectStandAloneCollection pat::PATObject< ObjectType >::triggerObjectMatchesByFilterID ( const unsigned  triggerObjectType) const
inline

Definition at line 83 of file PATObject.h.

83  {
84  return triggerObjectMatchesByType(trigger::TriggerObjectType(triggerObjectType));
85  };

◆ triggerObjectMatchesByPath() [1/4]

template<class ObjectType>
const TriggerObjectStandAloneCollection pat::PATObject< ObjectType >::triggerObjectMatchesByPath ( const char *  namePath,
const bool  pathLastFilterAccepted = false,
const bool  pathL3FilterAccepted = true 
) const
inline

Definition at line 190 of file PATObject.h.

192  {
193  return triggerObjectMatchesByPath(std::string(namePath), pathLastFilterAccepted, pathL3FilterAccepted);
194  };

◆ triggerObjectMatchesByPath() [2/4]

template<class ObjectType>
const TriggerObjectStandAloneCollection pat::PATObject< ObjectType >::triggerObjectMatchesByPath ( const char *  namePath,
const unsigned  pathLastFilterAccepted,
const unsigned  pathL3FilterAccepted = 1 
) const
inline

Definition at line 202 of file PATObject.h.

204  {
206  std::string(namePath), bool(pathLastFilterAccepted), bool(pathL3FilterAccepted));
207  };

◆ triggerObjectMatchesByPath() [3/4]

template<class ObjectType >
const TriggerObjectStandAloneCollection pat::PATObject< ObjectType >::triggerObjectMatchesByPath ( const std::string &  namePath,
const bool  pathLastFilterAccepted = false,
const bool  pathL3FilterAccepted = true 
) const

get all matched HLT objects used in a certain HLT path; if 'pathLastFilterAccepted' is set to 'true' (default), only objects used in the final filter of a succeeding path are considered ("firing" objects old style only valid for single object triggers); if 'pathL3FilterAccepted' is set to 'true' (default), only objects used in L3 filters (identified by the "saveTags" parameter being 'true') of a succeeding path are considered ("firing" objects old style only valid for single object triggers)

Definition at line 679 of file PATObject.h.

680  {
682  for (size_t i = 0; i < triggerObjectMatches().size(); ++i) {
683  if (triggerObjectMatch(i) != nullptr &&
684  triggerObjectMatch(i)->hasPathName(namePath, pathLastFilterAccepted, pathL3FilterAccepted))
685  matches.push_back(*(triggerObjectMatch(i)));
686  }
687  return matches;
688  }

Referenced by testAnalyzer::analyze(), ZMuMu_vtxAnalyzer::analyze(), ZMuMu_efficiencyAnalyzer::analyze(), ZMuMu_MCanalyzer::analyze(), ZMuMu_Radiative_analyzer::analyze(), modules::ZHLTMatchFilter::operator()(), ZToLLEdmNtupleDumper::produce(), and pat::PATObject< reco::Muon >::triggerObjectMatchesByPath().

◆ triggerObjectMatchesByPath() [4/4]

template<class ObjectType>
const TriggerObjectStandAloneCollection pat::PATObject< ObjectType >::triggerObjectMatchesByPath ( const std::string &  namePath,
const unsigned  pathLastFilterAccepted,
const unsigned  pathL3FilterAccepted = 1 
) const
inline

Definition at line 196 of file PATObject.h.

198  {
199  return triggerObjectMatchesByPath(namePath, bool(pathLastFilterAccepted), bool(pathL3FilterAccepted));
200  };

◆ triggerObjectMatchesByType() [1/2]

template<class ObjectType >
const TriggerObjectStandAloneCollection pat::PATObject< ObjectType >::triggerObjectMatchesByType ( const trigger::TriggerObjectType  triggerObjectType) const

get all matched trigger objects of a certain type; trigger object types are defined in 'enum trigger::TriggerObjectType' (DataFormats/HLTReco/interface/TriggerTypeDefs.h)

Definition at line 552 of file PATObject.h.

553  {
555  for (size_t i = 0; i < triggerObjectMatches().size(); ++i) {
556  if (triggerObjectMatch(i) != 0 && triggerObjectMatch(i)->hasTriggerObjectType(triggerObjectType))
557  matches.push_back(*(triggerObjectMatch(i)));
558  }
559  return matches;
560  }

Referenced by pat::PATObject< reco::Muon >::triggerObjectMatchesByFilterID(), and pat::PATObject< reco::Muon >::triggerObjectMatchesByType().

◆ triggerObjectMatchesByType() [2/2]

template<class ObjectType>
const TriggerObjectStandAloneCollection pat::PATObject< ObjectType >::triggerObjectMatchesByType ( const unsigned  triggerObjectType) const
inline

Definition at line 79 of file PATObject.h.

79  {
80  return triggerObjectMatchesByType(trigger::TriggerObjectType(triggerObjectType));
81  };

◆ unpackTriggerObjectPathNames()

template<class ObjectType>
void pat::PATObject< ObjectType >::unpackTriggerObjectPathNames ( const edm::TriggerNames names)
inline

unpack path names of matched trigger objects (if they were packed before embedding, which is not normally the case)

Definition at line 244 of file PATObject.h.

244  {
245  for (std::vector<TriggerObjectStandAlone>::iterator it = triggerObjectMatchesEmbedded_.begin(),
247  it != ed;
248  ++it)
249  it->unpackPathNames(names);
250  }

◆ userCand()

template<class ObjectType >
reco::CandidatePtr pat::PATObject< ObjectType >::userCand ( const std::string &  key) const

Get user-defined candidate ptr Note: it will a null pointer if the key is not found; you can check if the key exists with 'hasUserInt' method.

Definition at line 947 of file PATObject.h.

947  {
948  auto it = std::lower_bound(userCandLabels_.cbegin(), userCandLabels_.cend(), key);
949  if (it != userCandLabels_.cend()) {
950  return userCands_[std::distance(userCandLabels_.begin(), it)];
951  }
952  return reco::CandidatePtr();
953  }

◆ userCandNames()

template<class ObjectType>
const std::vector<std::string>& pat::PATObject< ObjectType >::userCandNames ( ) const
inline

Get list of user-defined cand names.

Definition at line 403 of file PATObject.h.

403 { return userCandLabels_; }

◆ userData()

template<class ObjectType>
template<typename T >
const T* pat::PATObject< ObjectType >::userData ( const std::string &  key) const
inline

Returns user-defined data. Returns NULL if the data is not present, or not of type T.

Definition at line 324 of file PATObject.h.

324  {
326  return (data != nullptr ? data->template get<T>() : nullptr);
327  }

Referenced by BPHWriteSpecificDecay::fill().

◆ userDataBare()

template<class ObjectType>
const void* pat::PATObject< ObjectType >::userDataBare ( const std::string &  key) const
inline

Get the data as a void *, for CINT usage. COMPLETELY UNSUPPORTED, USE ONLY FOR DEBUGGING

Definition at line 340 of file PATObject.h.

340  {
342  return (data != nullptr ? data->bareData() : nullptr);
343  }

◆ userDataNames()

template<class ObjectType>
const std::vector<std::string>& pat::PATObject< ObjectType >::userDataNames ( ) const
inline

Get list of user data object names.

Definition at line 336 of file PATObject.h.

336 { return userDataLabels_; }

◆ userDataObject_()

template<class ObjectType >
const pat::UserData * pat::PATObject< ObjectType >::userDataObject_ ( const std::string &  key) const
private

Definition at line 846 of file PATObject.h.

846  {
847  auto it = std::lower_bound(userDataLabels_.cbegin(), userDataLabels_.cend(), key);
848  if (it != userDataLabels_.cend() && *it == key) {
849  return &userDataObjects_[std::distance(userDataLabels_.cbegin(), it)];
850  }
851  return nullptr;
852  }

Referenced by pat::PATObject< reco::Muon >::hasUserData(), pat::PATObject< reco::Muon >::userData(), pat::PATObject< reco::Muon >::userDataBare(), and pat::PATObject< reco::Muon >::userDataObjectType().

◆ userDataObjectType()

template<class ObjectType>
const std::string& pat::PATObject< ObjectType >::userDataObjectType ( const std::string &  key) const
inline

Get human-readable type of user data object, for debugging.

Definition at line 331 of file PATObject.h.

331  {
333  return (data != nullptr ? data->typeName() : get_empty_str());
334  };

◆ userFloat() [1/2]

template<class ObjectType>
float pat::PATObject< ObjectType >::userFloat ( const char *  key) const
inline

a CINT-friendly interface

Definition at line 368 of file PATObject.h.

368 { return userFloat(std::string(key)); }

Referenced by Jet.Jet::puMva(), and pat::PATObject< reco::Muon >::userFloat().

◆ userFloat() [2/2]

template<class ObjectType >
float pat::PATObject< ObjectType >::userFloat ( const std::string &  key) const

Get user-defined float Note: throws if the key is not found; you can check if the key exists with 'hasUserFloat' method.

Definition at line 873 of file PATObject.h.

873  {
874  auto it = std::lower_bound(userFloatLabels_.cbegin(), userFloatLabels_.cend(), key);
875  if (it != userFloatLabels_.cend() && *it == key) {
876  return userFloats_[std::distance(userFloatLabels_.cbegin(), it)];
877  }
878  throwMissingLabel("UserFloat", key, userFloatLabels_);
879  return std::numeric_limits<float>::quiet_NaN();
880  }

Referenced by ZeePlots::analyze(), WenuPlots::analyze(), EGEtScaleSysModifier::modifyObject(), and Jet.Jet::puMva().

◆ userFloatNames()

template<class ObjectType>
const std::vector<std::string>& pat::PATObject< ObjectType >::userFloatNames ( ) const
inline

Get list of user-defined float names.

Definition at line 373 of file PATObject.h.

373 { return userFloatLabels_; }

◆ userFloatRange()

template<class ObjectType >
std::vector< float > pat::PATObject< ObjectType >::userFloatRange ( const std::string &  key) const

return a range of values corresponding to key

Definition at line 883 of file PATObject.h.

883  {
884  auto range = std::equal_range(userFloatLabels_.cbegin(), userFloatLabels_.cend(), key);
885  std::vector<float> result;
886  result.reserve(std::distance(range.first, range.second));
887  for (auto it = range.first; it != range.second; ++it) {
888  result.push_back(userFloats_[std::distance(userFloatLabels_.cbegin(), it)]);
889  }
890  return result;
891  }

◆ userInt()

template<class ObjectType >
int pat::PATObject< ObjectType >::userInt ( const std::string &  key) const

Get user-defined int Note: throws if the key is not found; you can check if the key exists with 'hasUserInt' method.

Definition at line 910 of file PATObject.h.

910  {
911  auto it = std::lower_bound(userIntLabels_.cbegin(), userIntLabels_.cend(), key);
912  if (it != userIntLabels_.cend() && *it == key) {
913  return userInts_[std::distance(userIntLabels_.cbegin(), it)];
914  }
915  throwMissingLabel("UserInt", key, userIntLabels_);
917  }

Referenced by WenuPlots::analyze(), ZeePlots::PassPreselectionCriteria1(), and ZeePlots::PassPreselectionCriteria2().

◆ userIntNames()

template<class ObjectType>
const std::vector<std::string>& pat::PATObject< ObjectType >::userIntNames ( ) const
inline

Get list of user-defined int names.

Definition at line 390 of file PATObject.h.

390 { return userIntLabels_; }

◆ userIntRange()

template<class ObjectType >
std::vector< int > pat::PATObject< ObjectType >::userIntRange ( const std::string &  key) const

returns a range of values corresponding to key

Definition at line 920 of file PATObject.h.

920  {
921  auto range = std::equal_range(userIntLabels_.cbegin(), userIntLabels_.cend(), key);
922  std::vector<int> result;
923  result.reserve(std::distance(range.first, range.second));
924  for (auto it = range.first; it != range.second; ++it) {
925  result.push_back(userInts_[std::distance(userIntLabels_.cbegin(), it)]);
926  }
927  return result;
928  }

Member Data Documentation

◆ efficiencyNames_

template<class ObjectType>
std::vector<std::string> pat::PATObject< ObjectType >::efficiencyNames_
protected

vector of the efficiencies (names)

Definition at line 468 of file PATObject.h.

Referenced by pat::PATObject< reco::Muon >::efficiencyNames().

◆ efficiencyValues_

template<class ObjectType>
std::vector<pat::LookupTableRecord> pat::PATObject< ObjectType >::efficiencyValues_
protected

vector of the efficiencies (values)

Definition at line 466 of file PATObject.h.

Referenced by pat::PATObject< reco::Muon >::efficiencyValues().

◆ genParticleEmbedded_

template<class ObjectType>
std::vector<reco::GenParticle> pat::PATObject< ObjectType >::genParticleEmbedded_
protected

vector to hold an embedded generator level particle

Definition at line 473 of file PATObject.h.

Referenced by pat::PATObject< reco::Muon >::genParticleRef(), and pat::PATObject< reco::Muon >::genParticlesSize().

◆ genParticleRef_

template<class ObjectType>
std::vector<reco::GenParticleRef> pat::PATObject< ObjectType >::genParticleRef_
protected

Reference to a generator level particle.

Definition at line 471 of file PATObject.h.

Referenced by pat::PATObject< reco::Muon >::genParticleRef(), and pat::PATObject< reco::Muon >::genParticlesSize().

◆ kinResolutionLabels_

template<class ObjectType>
std::vector<std::string> pat::PATObject< ObjectType >::kinResolutionLabels_
protected

Labels for the kinematic resolutions. if (kinResolutions_.size() == kinResolutionLabels_.size()+1), then the first resolution has no label.

Definition at line 497 of file PATObject.h.

◆ kinResolutions_

template<class ObjectType>
std::vector<pat::CandKinResolution> pat::PATObject< ObjectType >::kinResolutions_
protected

Kinematic resolutions.

Definition at line 494 of file PATObject.h.

◆ overlapItems_

template<class ObjectType>
std::vector<reco::CandidatePtrVector> pat::PATObject< ObjectType >::overlapItems_
protected

Overlapping items (sorted by distance)

Definition at line 478 of file PATObject.h.

◆ overlapLabels_

template<class ObjectType>
std::vector<std::string> pat::PATObject< ObjectType >::overlapLabels_
protected

Overlapping test labels (only if there are any overlaps)

Definition at line 476 of file PATObject.h.

Referenced by pat::PATObject< reco::Muon >::overlapLabels().

◆ refToOrig_

template<class ObjectType>
edm::Ptr<reco::Candidate> pat::PATObject< ObjectType >::refToOrig_
protected

Definition at line 460 of file PATObject.h.

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

◆ triggerObjectMatchesEmbedded_

template<class ObjectType>
TriggerObjectStandAloneCollection pat::PATObject< ObjectType >::triggerObjectMatchesEmbedded_
protected

◆ userCandLabels_

template<class ObjectType>
std::vector<std::string> pat::PATObject< ObjectType >::userCandLabels_
protected

◆ userCands_

template<class ObjectType>
std::vector<reco::CandidatePtr> pat::PATObject< ObjectType >::userCands_
protected

Definition at line 491 of file PATObject.h.

◆ userDataLabels_

template<class ObjectType>
std::vector<std::string> pat::PATObject< ObjectType >::userDataLabels_
protected

User data object.

Definition at line 481 of file PATObject.h.

Referenced by pat::PATObject< reco::Muon >::userDataNames().

◆ userDataObjects_

template<class ObjectType>
pat::UserDataCollection pat::PATObject< ObjectType >::userDataObjects_
protected

Definition at line 482 of file PATObject.h.

◆ userFloatLabels_

template<class ObjectType>
std::vector<std::string> pat::PATObject< ObjectType >::userFloatLabels_
protected

◆ userFloats_

template<class ObjectType>
std::vector<float> pat::PATObject< ObjectType >::userFloats_
protected

Definition at line 485 of file PATObject.h.

◆ userIntLabels_

template<class ObjectType>
std::vector<std::string> pat::PATObject< ObjectType >::userIntLabels_
protected

◆ userInts_

template<class ObjectType>
std::vector<int32_t> pat::PATObject< ObjectType >::userInts_
protected

Definition at line 488 of file PATObject.h.

trigger::TriggerObjectType
TriggerObjectType
Definition: TriggerTypeDefs.h:23
runTheMatrix.ret
ret
prodAgent to be discontinued
Definition: runTheMatrix.py:367
pat::UserData
Base class for data that users can add to pat objects.
Definition: UserData.h:23
pat::CandKinResolution::resolP
double resolP(const LorentzVector &p4) const
Resolution on p, given the 4-momentum of the associated Candidate.
Definition: CandKinResolution.cc:44
embed
#define embed
Definition: AMPTWrapper.h:188
FastTimerService_cff.range
range
Definition: FastTimerService_cff.py:34
pat::TriggerObjectStandAlone::hasAlgorithmName
bool hasAlgorithmName(const std::string &algorithmName, bool algoCondAccepted=true) const
Checks, if a certain L1 algorithm name is assigned.
Definition: TriggerObjectStandAlone.h:159
reco::GenParticleRef
edm::Ref< GenParticleCollection > GenParticleRef
persistent reference to a GenParticle
Definition: GenParticleFwd.h:17
pat::TriggerObjectStandAlone::hasPathName
bool hasPathName(const std::string &pathName, bool pathLastFilterAccepted=false, bool pathL3FilterAccepted=true) const
Checks, if a certain HLT path name is assigned.
Definition: TriggerObjectStandAlone.h:153
pat::throwMissingLabel
void throwMissingLabel(const std::string &what, const std::string &bad_label, const std::vector< std::string > &available)
Definition: throwMissingLabel.cc:7
pat::PATObject::efficiencyValues_
std::vector< pat::LookupTableRecord > efficiencyValues_
vector of the efficiencies (values)
Definition: PATObject.h:466
mps_fire.i
i
Definition: mps_fire.py:428
pat::PATObject::triggerObjectMatchByPath
const TriggerObjectStandAlone * triggerObjectMatchByPath(const std::string &namePath, const bool pathLastFilterAccepted=false, const bool pathL3FilterAccepted=true, const size_t idx=0) const
Definition: PATObject.h:691
l1ParticleFlow_cff.resol
resol
Definition: l1ParticleFlow_cff.py:17
pat::PATObject::triggerObjectMatches
const TriggerObjectStandAloneCollection & triggerObjectMatches() const
get all matched trigger objects
Definition: PATObject.h:72
dqmiodumpmetadata.n
n
Definition: dqmiodumpmetadata.py:28
pat::PATObject::triggerObjectMatchesByType
const TriggerObjectStandAloneCollection triggerObjectMatchesByType(const trigger::TriggerObjectType triggerObjectType) const
Definition: PATObject.h:552
cropTnPTrees.cloned
cloned
Definition: cropTnPTrees.py:37
edm::RefToBase::key
size_t key() const
Definition: RefToBase.h:219
pat::PATObject::kinResolutionLabels_
std::vector< std::string > kinResolutionLabels_
Definition: PATObject.h:497
reco::GenParticle
Definition: GenParticle.h:21
mps_update.status
status
Definition: mps_update.py:69
pat::CandKinResolution::resolPx
double resolPx(const LorentzVector &p4) const
Resolution on px, given the 4-momentum of the associated Candidate.
Definition: CandKinResolution.cc:53
pat::PATObject::triggerObjectMatchByFilter
const TriggerObjectStandAlone * triggerObjectMatchByFilter(const std::string &labelFilter, const size_t idx=0) const
get one matched HLT object used in a certain HLT filter by index
Definition: PATObject.h:665
pat::CandKinResolution::resolPhi
double resolPhi(const LorentzVector &p4) const
Resolution on phi, given the 4-momentum of the associated Candidate.
Definition: CandKinResolution.cc:32
pat::PATObject::triggerObjectMatchesByAlgorithm
const TriggerObjectStandAloneCollection triggerObjectMatchesByAlgorithm(const std::string &nameAlgorithm, const bool algoCondAccepted=true) const
Definition: PATObject.h:628
edm::Ref::get
T const * get() const
Returns C++ pointer to the item.
Definition: Ref.h:232
pat::CandKinResolution::resolPInv
double resolPInv(const LorentzVector &p4) const
Resolution on 1/p, given the 4-momentum of the associated Candidate.
Definition: CandKinResolution.cc:50
pat::PATObject::genParticlesSize
size_t genParticlesSize() const
Number of generator level particles stored as ref or embedded.
Definition: PATObject.h:292
pat::PATObject::triggerObjectMatchByAlgorithm
const TriggerObjectStandAlone * triggerObjectMatchByAlgorithm(const std::string &nameAlgorithm, const bool algoCondAccepted=true, const size_t idx=0) const
Definition: PATObject.h:639
edm::Ptr::get
T const * get() const
Returns C++ pointer to the item.
Definition: Ptr.h:139
pat::TriggerObjectStandAlone::hasFilterLabel
bool hasFilterLabel(const std::string &filterLabel) const
Checks, if a certain HLT filter label is assigned.
Definition: TriggerObjectStandAlone.h:149
pat::PATObject::userFloat
float userFloat(const std::string &key) const
Definition: PATObject.h:873
pat::PATObject::triggerObjectMatchByCondition
const TriggerObjectStandAlone * triggerObjectMatchByCondition(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
Definition: PATObject.h:614
pat::PATObject::triggerObjectMatchesByCondition
const TriggerObjectStandAloneCollection triggerObjectMatchesByCondition(const std::string &nameCondition) const
get all matched L1 objects used in a succeeding object combination of a certain L1 condition
Definition: PATObject.h:603
edm::Ref< GenParticleCollection >
heavyIonCSV_trainingSettings.idx
idx
Definition: heavyIonCSV_trainingSettings.py:5
pat::PATObject::userDataObjects_
pat::UserDataCollection userDataObjects_
Definition: PATObject.h:482
pat::TriggerObject::hasTriggerObjectType
bool hasTriggerObjectType(trigger::TriggerObjectType triggerObjectType) const
Checks, if a certain trigger object type identifier is assigned.
pat::PATObject::overlapLabels_
std::vector< std::string > overlapLabels_
Overlapping test labels (only if there are any overlaps)
Definition: PATObject.h:476
edm::errors::ProductNotFound
Definition: EDMException.h:33
pat::PATObject::userInts_
std::vector< int32_t > userInts_
Definition: PATObject.h:488
pat::PATObject::triggerObjectMatchByCollection
const TriggerObjectStandAlone * triggerObjectMatchByCollection(const std::string &coll, const size_t idx=0) const
get one matched trigger object from a certain collection by index
Definition: PATObject.h:588
pat::TriggerObjectStandAloneRef
edm::Ref< TriggerObjectStandAloneCollection > TriggerObjectStandAloneRef
Persistent reference to an item in a TriggerObjectStandAloneCollection.
Definition: TriggerObjectStandAlone.h:221
pat::PATObject::refToOrig_
edm::Ptr< reco::Candidate > refToOrig_
Definition: PATObject.h:460
names
const std::string names[nVars_]
Definition: PhotonIDValueMapProducer.cc:124
pat::CandKinResolution::resolPy
double resolPy(const LorentzVector &p4) const
Resolution on py, given the 4-momentum of the associated Candidate.
Definition: CandKinResolution.cc:56
pat::PATObject::triggerObjectMatchesByFilter
const TriggerObjectStandAloneCollection triggerObjectMatchesByFilter(const std::string &labelFilter) const
get all matched HLT objects used in a certain HLT filter
Definition: PATObject.h:654
pat::PATObject::genParticleRefs
std::vector< reco::GenParticleRef > genParticleRefs() const
Definition: PATObject.h:781
pat::PATObject::overlaps
const reco::CandidatePtrVector & overlaps(const std::string &label) const
Definition: PATObject.h:826
pat::PATObject::hasUserFloat
bool hasUserFloat(const std::string &key) const
Return true if there is a user-defined float with a given name.
Definition: PATObject.h:375
mps_fire.end
end
Definition: mps_fire.py:242
pat::get_empty_cpv
const reco::CandidatePtrVector & get_empty_cpv()
Definition: PATObject.cc:4
pat::CandKinResolution::resolM
double resolM(const LorentzVector &p4) const
Definition: CandKinResolution.cc:41
edm::RefToBase::get
value_type const * get() const
Definition: RefToBase.h:209
pat::PATObject::addUserDataObject_
void addUserDataObject_(const std::string &label, std::unique_ptr< pat::UserData > value, bool overwrite=false)
Definition: PATObject.h:855
pat::TriggerObjectStandAlone::hasConditionName
bool hasConditionName(const std::string &conditionName) const
Checks, if a certain L1 condition name is assigned.
Definition: TriggerObjectStandAlone.h:151
edm::OwnVector::insert
void insert(const_iterator i, D *&d)
Definition: OwnVector.h:395
pat::get_empty_str
const std::string & get_empty_str()
Definition: PATObject.cc:9
getGTfromDQMFile.obj
obj
Definition: getGTfromDQMFile.py:32
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
ALCARECOTkAlJpsiMuMu_cff.charge
charge
Definition: ALCARECOTkAlJpsiMuMu_cff.py:47
pat::PATObject::userCands_
std::vector< reco::CandidatePtr > userCands_
Definition: PATObject.h:491
pfDeepBoostedJetPreprocessParams_cfi.lower_bound
lower_bound
Definition: pfDeepBoostedJetPreprocessParams_cfi.py:15
pat::PATObject::userIntLabels_
std::vector< std::string > userIntLabels_
Definition: PATObject.h:487
ecaldqm::binning::ObjectType
ObjectType
Definition: MESetBinningUtils.h:17
pat::PATObject::triggerObjectMatch
const TriggerObjectStandAlone * triggerObjectMatch(const size_t idx=0) const
get one matched trigger object by index
Definition: PATObject.h:544
SiStripPI::max
Definition: SiStripPayloadInspectorHelper.h:169
pat::PATObject::genParticleRef_
std::vector< reco::GenParticleRef > genParticleRef_
Reference to a generator level particle.
Definition: PATObject.h:471
pat::CandKinResolution::resolPt
double resolPt(const LorentzVector &p4) const
Resolution on pt, given the 4-momentum of the associated Candidate.
Definition: CandKinResolution.cc:47
pat::PATObject::triggerObjectMatchesByCollection
const TriggerObjectStandAloneCollection triggerObjectMatchesByCollection(const std::string &coll) const
get all matched trigger objects from a certain collection
Definition: PATObject.h:577
reco::LeafCandidate::pdgId
int pdgId() const final
PDG identifier.
Definition: LeafCandidate.h:176
edm::Ref::isNonnull
bool isNonnull() const
Checks for non-null.
Definition: Ref.h:238
pat::PATObject::userDataObject_
const pat::UserData * userDataObject_(const std::string &key) const
Definition: PATObject.h:846
match
std::pair< typename Association::data_type::first_type, double > match(Reference key, Association association, bool bestMatchByMaxValue)
Generic matching function.
Definition: Utils.h:10
pat::TriggerObjectStandAloneCollection
std::vector< TriggerObjectStandAlone > TriggerObjectStandAloneCollection
Collection of TriggerObjectStandAlone.
Definition: TriggerObjectStandAlone.h:219
p4
double p4[4]
Definition: TauolaWrapper.h:92
value
Definition: value.py:1
pat::PATObject::efficiencyNames_
std::vector< std::string > efficiencyNames_
vector of the efficiencies (names)
Definition: PATObject.h:468
pat::PATObject::triggerObjectMatchesByPath
const TriggerObjectStandAloneCollection triggerObjectMatchesByPath(const std::string &namePath, const bool pathLastFilterAccepted=false, const bool pathL3FilterAccepted=true) const
Definition: PATObject.h:679
EgammaValidation_cff.pdgId
pdgId
Definition: EgammaValidation_cff.py:118
pat::CandKinResolution::resolE
double resolE(const LorentzVector &p4) const
Resolution on energy, given the 4-momentum of the associated Candidate.
Definition: CandKinResolution.cc:35
pat::PATObject::genParticleEmbedded_
std::vector< reco::GenParticle > genParticleEmbedded_
vector to hold an embedded generator level particle
Definition: PATObject.h:473
pat::PATObject::triggerObjectMatchByType
const TriggerObjectStandAlone * triggerObjectMatchByType(const trigger::TriggerObjectType triggerObjectType, const size_t idx=0) const
get one matched trigger object of a certain type by index
Definition: PATObject.h:563
pat::PATObject::kinResolutions_
std::vector< pat::CandKinResolution > kinResolutions_
Kinematic resolutions.
Definition: PATObject.h:494
edm::RefToBase::id
ProductID id() const
Definition: RefToBase.h:214
pat::PATObject::userCandLabels_
std::vector< std::string > userCandLabels_
Definition: PATObject.h:490
pat::CandKinResolution::resolTheta
double resolTheta(const LorentzVector &p4) const
Resolution on theta, given the 4-momentum of the associated Candidate.
Definition: CandKinResolution.cc:29
eostools.move
def move(src, dest)
Definition: eostools.py:511
pat::CandKinResolution::resolPz
double resolPz(const LorentzVector &p4) const
Resolution on pz, given the 4-momentum of the associated Candidate.
Definition: CandKinResolution.cc:59
relativeConstraints.value
value
Definition: relativeConstraints.py:53
Exception
Definition: hltDiff.cc:246
pat::TriggerObjectStandAlone::hasCollection
bool hasCollection(const std::string &collName) const override
Checks, if a certain label of original collection is assigned (method overrides)
Definition: TriggerObjectStandAlone.cc:235
Skims_PA_cff.name
name
Definition: Skims_PA_cff.py:17
data
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:79
patCandidatesForDimuonsSequences_cff.matches
matches
Definition: patCandidatesForDimuonsSequences_cff.py:131
pat::PATObject::triggerObjectMatchesEmbedded_
TriggerObjectStandAloneCollection triggerObjectMatchesEmbedded_
vector of trigger matches
Definition: PATObject.h:463
pat::PATObject::userDataLabels_
std::vector< std::string > userDataLabels_
User data object.
Definition: PATObject.h:481
edm::Ptr::isAvailable
bool isAvailable() const
Definition: Ptr.h:230
mps_fire.result
result
Definition: mps_fire.py:311
cms::Exception
Definition: Exception.h:70
reco::CandidatePtr
edm::Ptr< Candidate > CandidatePtr
persistent reference to an object in a collection of Candidate objects
Definition: CandidateFwd.h:25
funct::abs
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
edm::OwnVector::begin
iterator begin()
Definition: OwnVector.h:280
pat::PATObject::embedGenParticle
void embedGenParticle()
Definition: PATObject.h:770
HLT_FULL_cff.distance
distance
Definition: HLT_FULL_cff.py:7799
crabWrapper.key
key
Definition: crabWrapper.py:19
pat::CandKinResolution::resolEta
double resolEta(const LorentzVector &p4) const
Resolution on eta, given the 4-momentum of the associated Candidate.
Definition: CandKinResolution.cc:26
edm::Ptr::isNull
bool isNull() const
Checks for null.
Definition: Ptr.h:142
label
const char * label
Definition: PFTauDecayModeTools.cc:11
pat::PATObject::genParticleRef
reco::GenParticleRef genParticleRef(size_t idx=0) const
Definition: PATObject.h:267
pat::CandKinResolution::resolEt
double resolEt(const LorentzVector &p4) const
Resolution on et, given the 4-momentum of the associated Candidate.
Definition: CandKinResolution.cc:38
pat::PATObject::userFloatLabels_
std::vector< std::string > userFloatLabels_
Definition: PATObject.h:484
g
The Signals That Services Can Subscribe To This is based on ActivityRegistry and is current per Services can connect to the signals distributed by the ActivityRegistry in order to monitor the activity of the application Each possible callback has some defined which we here list in angle e g
Definition: Activities.doc:4
pat::PATObject::userFloats_
std::vector< float > userFloats_
Definition: PATObject.h:485
pat::PATObject::getKinResolution
const pat::CandKinResolution & getKinResolution(const std::string &label="") const
Definition: PATObject.h:973
findQualityFiles.size
size
Write out results.
Definition: findQualityFiles.py:443
edm::OwnVector::set
void set(size_t i, D *&d)
Definition: OwnVector.h:357
pat::PATObject::overlapItems_
std::vector< reco::CandidatePtrVector > overlapItems_
Overlapping items (sorted by distance)
Definition: PATObject.h:478