test
CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Types | Public 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)
 
void addUserDataFromPtr (const std::string &label, const edm::Ptr< pat::UserData > &data)
 
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)
 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 ObjectType &obj)
 constructor from a base object (leaves invalid reference to original object!) More...
 
 PATObject (const edm::RefToBase< ObjectType > &ref)
 constructor from reference More...
 
 PATObject (const edm::Ptr< ObjectType > &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
TriggerObjectStandAloneCollection
triggerObjectMatches () 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...
 
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 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...
 
virtual ~PATObject ()
 destructor More...
 

Protected Attributes

std::vector< std::string > efficiencyNames_
 vector of the efficiencies (names) More...
 
std::vector
< pat::LookupTableRecord
efficiencyValues_
 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::CandKinResolution
kinResolutions_
 Kinematic resolutions. More...
 
std::vector
< reco::CandidatePtrVector
overlapItems_
 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 49 of file PATObject.h.

Member Typedef Documentation

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

Definition at line 52 of file PATObject.h.

Constructor & Destructor Documentation

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

default constructor

Definition at line 465 of file PATObject.h.

465  {
466  }
template<class ObjectType>
pat::PATObject< ObjectType >::PATObject ( const ObjectType &  obj)

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

Definition at line 468 of file PATObject.h.

468  :
469  ObjectType(obj),
470  refToOrig_() {
471  }
edm::Ptr< reco::Candidate > refToOrig_
Definition: PATObject.h:421
template<class ObjectType>
pat::PATObject< ObjectType >::PATObject ( const edm::RefToBase< ObjectType > &  ref)

constructor from reference

Definition at line 473 of file PATObject.h.

473  :
474  ObjectType(*ref),
475  refToOrig_(ref.id(), ref.get(), ref.key()) // correct way to convert RefToBase=>Ptr, if ref is guaranteed to be available
476  // which happens to be true, otherwise the line before this throws ex. already
477  {
478  }
value_type const * get() const
Definition: RefToBase.h:225
ProductID id() const
Definition: RefToBase.h:233
size_t key() const
Definition: RefToBase.h:241
edm::Ptr< reco::Candidate > refToOrig_
Definition: PATObject.h:421
template<class ObjectType>
pat::PATObject< ObjectType >::PATObject ( const edm::Ptr< ObjectType > &  ref)

constructor from reference

Definition at line 480 of file PATObject.h.

480  :
481  ObjectType(*ref),
482  refToOrig_(ref) {
483  }
edm::Ptr< reco::Candidate > refToOrig_
Definition: PATObject.h:421
template<class ObjectType>
virtual pat::PATObject< ObjectType >::~PATObject ( )
inlinevirtual

destructor

Definition at line 63 of file PATObject.h.

63 {}

Member Function Documentation

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 676 of file PATObject.h.

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

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

676  {
677  if (!genParticleEmbedded_.empty()) { // we're embedding
678  if (ref.isNonnull()) genParticleEmbedded_.push_back(*ref);
679  } else {
680  genParticleRef_.push_back(ref);
681  }
682  }
bool isNonnull() const
Checks for non-null.
Definition: Ref.h:252
std::vector< reco::GenParticleRef > genParticleRef_
Reference to a generator level particle.
Definition: PATObject.h:432
std::vector< reco::GenParticle > genParticleEmbedded_
vector to hold an embedded generator level particle
Definition: PATObject.h:434
template<class ObjectType>
void pat::PATObject< ObjectType >::addTriggerObjectMatch ( const TriggerObjectStandAlone trigObj)
inline

add a trigger match

Definition at line 204 of file PATObject.h.

204 { triggerObjectMatchesEmbedded_.push_back( trigObj ); };
TriggerObjectStandAloneCollection triggerObjectMatchesEmbedded_
vector of trigger matches
Definition: PATObject.h:424
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 857 of file PATObject.h.

References data, HLT_25ns14e33_v1_cff::distance, and diffTwoXMLs::label.

860  {
861  auto it = std::lower_bound(userCandLabels_.begin(),userCandLabels_.end(),label);
862  const auto dist = std::distance(userCandLabels_.begin(),it);
863  if( it == userCandLabels_.end() || *it != label ) {
864  userCandLabels_.insert(it,label);
865  userCands_.insert(userCands_.begin()+dist,data);
866  } else if( overwrite && *it == label ) {
867  userCands_[dist] = data;
868  } else {
869  edm::LogWarning("addUserCand")
870  << "Attempting to add userCand " << label << " failed, Ptr exists already!";
871  }
872  }
std::vector< reco::CandidatePtr > userCands_
Definition: PATObject.h:452
std::vector< std::string > userCandLabels_
Definition: PATObject.h:451
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:82
template<class ObjectType>
template<typename T >
void pat::PATObject< ObjectType >::addUserData ( const std::string &  label,
const T data,
bool  transientOnly = 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 309 of file PATObject.h.

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

309  {
310  userDataLabels_.push_back(label);
311  userDataObjects_.push_back(pat::UserData::make<T>(data, transientOnly));
312  }
std::vector< std::string > userDataLabels_
User data object.
Definition: PATObject.h:442
void push_back(D *&d)
Definition: OwnVector.h:280
pat::UserDataCollection userDataObjects_
Definition: PATObject.h:443
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:82
template<class ObjectType>
void pat::PATObject< ObjectType >::addUserDataFromPtr ( const std::string &  label,
const edm::Ptr< pat::UserData > &  data 
)
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 316 of file PATObject.h.

316  {
317  userDataLabels_.push_back(label);
318  userDataObjects_.push_back(data->clone());
319  }
std::vector< std::string > userDataLabels_
User data object.
Definition: PATObject.h:442
void push_back(D *&d)
Definition: OwnVector.h:280
pat::UserDataCollection userDataObjects_
Definition: PATObject.h:443
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 793 of file PATObject.h.

References data, HLT_25ns14e33_v1_cff::distance, and diffTwoXMLs::label.

Referenced by EGExtraInfoModifierFromFloatValueMaps::modifyObject(), ZMuMuTrackUserData::produce(), ZMuMuMuonUserData::produce(), pat::PATPhotonSlimmer::produce(), ZMuMuUserData::produce(), ZMuMuUserDataOneTrack::produce(), Onia2MuMuPAT::produce(), and PatJPsiProducer::produce().

796  {
797  auto it = std::lower_bound(userFloatLabels_.begin(),userFloatLabels_.end(),label);
798  const auto dist = std::distance(userFloatLabels_.begin(),it);
799  if( it == userFloatLabels_.end() || *it != label ) {
800  userFloatLabels_.insert(it,label);
801  userFloats_.insert(userFloats_.begin()+dist,data);
802  } else if( *it == label ) {
803  //create a range by adding behind the first entry
804  userFloats_.insert(userFloats_.begin()+dist+1, data);
805  }
806  }
std::vector< float > userFloats_
Definition: PATObject.h:446
std::vector< std::string > userFloatLabels_
Definition: PATObject.h:445
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:82
template<class ObjectType>
void pat::PATObject< ObjectType >::addUserInt ( const std::string &  label,
int32_t  data 
)

Set user-defined int.

Definition at line 832 of file PATObject.h.

References data, HLT_25ns14e33_v1_cff::distance, and diffTwoXMLs::label.

Referenced by EGExtraInfoModifierFromIntValueMaps::modifyObject(), OniaPhotonConversionProducer::produce(), and Onia2MuMuPAT::produce().

834  {
835  auto it = std::lower_bound(userIntLabels_.begin(),userIntLabels_.end(),label);
836  const auto dist = std::distance(userIntLabels_.begin(),it);
837  if( it == userIntLabels_.end() || *it != label ) {
838  userIntLabels_.insert(it,label);
839  userInts_.insert(userInts_.begin()+dist,data);
840  } else if( *it == label ) {
841  //create a range by adding behind the first entry
842  userInts_.insert(userInts_.begin()+dist+1,data);
843  }
844  }
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:82
std::vector< int32_t > userInts_
Definition: PATObject.h:449
std::vector< std::string > userIntLabels_
Definition: PATObject.h:448
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 642 of file PATObject.h.

References run_regression::ret.

642  {
643  std::vector<std::pair<std::string,pat::LookupTableRecord> > ret;
644  std::vector<std::string>::const_iterator itn = efficiencyNames_.begin(), edn = efficiencyNames_.end();
645  std::vector<pat::LookupTableRecord>::const_iterator itv = efficiencyValues_.begin();
646  for ( ; itn != edn; ++itn, ++itv) {
647  ret.emplace_back( *itn, *itv);
648  }
649  return ret;
650  }
std::vector< std::string > efficiencyNames_
vector of the efficiencies (names)
Definition: PATObject.h:429
std::vector< pat::LookupTableRecord > efficiencyValues_
vector of the efficiencies (values)
Definition: PATObject.h:427
template<class ObjectType >
const pat::LookupTableRecord & pat::PATObject< ObjectType >::efficiency ( const std::string &  name) const

Returns an efficiency given its name.

Definition at line 631 of file PATObject.h.

References HLT_25ns14e33_v1_cff::distance, Exception, and mergeVDriftHistosByStation::name.

631  {
632  // find the name in the (sorted) list of names
633  auto it = std::lower_bound(efficiencyNames_.cbegin(), efficiencyNames_.cend(), name);
634  if ((it == efficiencyNames_.end()) || (*it != name)) {
635  throw cms::Exception("Invalid Label") << "There is no efficiency with name '" << name << "' in this PAT Object\n";
636  }
637  return efficiencyValues_[std::distance(efficiencyNames_.cbegin(),it)];
638  }
std::vector< std::string > efficiencyNames_
vector of the efficiencies (names)
Definition: PATObject.h:429
std::vector< pat::LookupTableRecord > efficiencyValues_
vector of the efficiencies (values)
Definition: PATObject.h:427
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 215 of file PATObject.h.

215 { return efficiencyNames_; }
std::vector< std::string > efficiencyNames_
vector of the efficiencies (names)
Definition: PATObject.h:429
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 217 of file PATObject.h.

217 { return efficiencyValues_; }
std::vector< pat::LookupTableRecord > efficiencyValues_
vector of the efficiencies (values)
Definition: PATObject.h:427
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 692 of file PATObject.h.

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

692  {
693  genParticleEmbedded_.clear();
694  for (std::vector<reco::GenParticleRef>::const_iterator it = genParticleRef_.begin(); it != genParticleRef_.end(); ++it) {
695  if (it->isNonnull()) genParticleEmbedded_.push_back(**it);
696  }
697  genParticleRef_.clear();
698  }
std::vector< reco::GenParticleRef > genParticleRef_
Reference to a generator level particle.
Definition: PATObject.h:432
std::vector< reco::GenParticle > genParticleEmbedded_
vector to hold an embedded generator level particle
Definition: PATObject.h:434
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 244 of file PATObject.h.

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

244  {
246  return ref.isNonnull() ? ref.get() : 0;
247  }
bool isNonnull() const
Checks for non-null.
Definition: Ref.h:252
reco::GenParticleRef genParticleRef(size_t idx=0) const
Definition: PATObject.h:225
T const * get() const
Returns C++ pointer to the item.
Definition: Ref.h:244
tuple idx
DEBUGGING if hasattr(process,&quot;trackMonIterativeTracking2012&quot;): print &quot;trackMonIterativeTracking2012 D...
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 711 of file PATObject.h.

References funct::abs(), RecoTauCleanerPlugins::charge, reco::LeafCandidate::charge(), end, g, reco::LeafCandidate::pdgId(), reco::LeafCandidate::status(), and ntuplemaker::status.

711  {
712  // get a vector, avoiding an unneeded copy if there is no embedding
713  const std::vector<reco::GenParticleRef> & vec = (genParticleEmbedded_.empty() ? genParticleRef_ : genParticleRefs());
714  for (std::vector<reco::GenParticleRef>::const_iterator ref = vec.begin(), end = vec.end(); ref != end; ++ref) {
715  if (ref->isNonnull()) {
716  const reco::GenParticle & g = **ref;
717  if ((status != 0) && (g.status() != status)) continue;
718  if (pdgId == 0) {
719  return *ref;
720  } else if (!autoCharge) {
721  if (pdgId == g.pdgId()) return *ref;
722  } else if (abs(pdgId) == abs(g.pdgId())) {
723  // I want pdgId > 0 to match "correct charge" (for charged particles)
724  if (g.charge() == 0) return *ref;
725  else if ((this->charge() == 0) && (pdgId == g.pdgId())) return *ref;
726  else if (g.charge()*this->charge()*pdgId > 0) return *ref;
727  }
728  }
729  }
730  return reco::GenParticleRef();
731  }
virtual int pdgId() const
PDG identifier.
std::vector< reco::GenParticleRef > genParticleRef_
Reference to a generator level particle.
Definition: PATObject.h:432
virtual int status() const
status word
edm::Ref< GenParticleCollection > GenParticleRef
persistent reference to a GenParticle
std::vector< reco::GenParticleRef > genParticleRefs() const
Definition: PATObject.h:701
std::vector< reco::GenParticle > genParticleEmbedded_
vector to hold an embedded generator level particle
Definition: PATObject.h:434
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
virtual int charge() const
electric charge
Definition: LeafCandidate.h:91
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
#define end
Definition: vmac.h:37
tuple status
Definition: ntuplemaker.py:245
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 225 of file PATObject.h.

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

225  {
226  if (idx >= genParticlesSize()) return reco::GenParticleRef();
228  }
std::vector< reco::GenParticleRef > genParticleRef_
Reference to a generator level particle.
Definition: PATObject.h:432
size_t genParticlesSize() const
Number of generator level particles stored as ref or embedded.
Definition: PATObject.h:249
edm::Ref< GenParticleCollection > GenParticleRef
persistent reference to a GenParticle
std::vector< reco::GenParticle > genParticleEmbedded_
vector to hold an embedded generator level particle
Definition: PATObject.h:434
tuple idx
DEBUGGING if hasattr(process,&quot;trackMonIterativeTracking2012&quot;): print &quot;trackMonIterativeTracking2012 D...
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 701 of file PATObject.h.

References i, gen::n, and run_regression::ret.

Referenced by getGenTau().

701  {
702  if (genParticleEmbedded_.empty()) return genParticleRef_;
703  std::vector<reco::GenParticleRef> ret(genParticleEmbedded_.size());
704  for (size_t i = 0, n = ret.size(); i < n; ++i) {
706  }
707  return ret;
708  }
int i
Definition: DBlmapReader.cc:9
std::vector< reco::GenParticleRef > genParticleRef_
Reference to a generator level particle.
Definition: PATObject.h:432
edm::Ref< GenParticleCollection > GenParticleRef
persistent reference to a GenParticle
std::vector< reco::GenParticle > genParticleEmbedded_
vector to hold an embedded generator level particle
Definition: PATObject.h:434
template<class ObjectType>
size_t pat::PATObject< ObjectType >::genParticlesSize ( ) const
inline

Number of generator level particles stored as ref or embedded.

Definition at line 249 of file PATObject.h.

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

249  {
250  return genParticleEmbedded_.empty() ? genParticleRef_.size() : genParticleEmbedded_.size();
251  }
std::vector< reco::GenParticleRef > genParticleRef_
Reference to a generator level particle.
Definition: PATObject.h:432
std::vector< reco::GenParticle > genParticleEmbedded_
vector to hold an embedded generator level particle
Definition: PATObject.h:434
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 876 of file PATObject.h.

References HLT_25ns14e33_v1_cff::distance, Exception, diffTwoXMLs::label, and match().

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().

876  {
877  const bool has_unlabelled = (kinResolutionLabels_.size()+1 == kinResolutions_.size());
878  if (label.empty()) {
879  if ( has_unlabelled ) {
880  return kinResolutions_[0];
881  } else {
882  throw cms::Exception("Missing Data", "This object does not contain an un-labelled kinematic resolution");
883  }
884  } else {
885  auto match = std::lower_bound(kinResolutionLabels_.cbegin(), kinResolutionLabels_.cend(), label);
886  const auto dist = std::distance(kinResolutionLabels_.begin(),match);
887  const size_t increment = ( has_unlabelled ? 1 : 0 );
888  if ( match == kinResolutionLabels_.end() || *match != label ) {
889  cms::Exception ex("Missing Data");
890  ex << "This object does not contain a kinematic resolution with name '" << label << "'.\n";
891  ex << "The known labels are: " ;
892  for (std::vector<std::string>::const_iterator it = kinResolutionLabels_.cbegin(); it != kinResolutionLabels_.cend(); ++it) {
893  ex << "'" << *it << "' ";
894  }
895  ex << "\n";
896  throw ex;
897  } else {
898  return kinResolutions_[dist+increment];
899  }
900  }
901  }
std::vector< pat::CandKinResolution > kinResolutions_
Kinematic resolutions.
Definition: PATObject.h:455
std::vector< std::string > kinResolutionLabels_
Definition: PATObject.h:458
std::pair< typename Association::data_type::first_type, double > match(Reference key, Association association, bool bestMatchByMaxValue)
Generic matching function.
Definition: Utils.h:10
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 904 of file PATObject.h.

References diffTwoXMLs::label, and match().

904  {
905  if (label.empty()) {
906  return (kinResolutionLabels_.size()+1 == kinResolutions_.size());
907  } else {
908  auto match = std::lower_bound(kinResolutionLabels_.cbegin(), kinResolutionLabels_.cend(), label);
909  return ( match != kinResolutionLabels_.cend() && *match == label );
910  }
911  }
std::vector< pat::CandKinResolution > kinResolutions_
Kinematic resolutions.
Definition: PATObject.h:455
std::vector< std::string > kinResolutionLabels_
Definition: PATObject.h:458
std::pair< typename Association::data_type::first_type, double > match(Reference key, Association association, bool bestMatchByMaxValue)
Generic matching function.
Definition: Utils.h:10
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 734 of file PATObject.h.

References diffTwoXMLs::label, and match().

734  {
735  auto match = std::lower_bound(overlapLabels_.cbegin(), overlapLabels_.cend(), label);
736  return ( match != overlapLabels_.end() && *match == label );
737  }
std::pair< typename Association::data_type::first_type, double > match(Reference key, Association association, bool bestMatchByMaxValue)
Generic matching function.
Definition: Utils.h:10
std::vector< std::string > overlapLabels_
Overlapping test labels (only if there are any overlaps)
Definition: PATObject.h:437
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 364 of file PATObject.h.

364  {
365  auto it = std::lower_bound(userCandLabels_.cbegin(), userCandLabels_.cend(), key);
366  return ( it != userCandLabels_.cend() && *it == key );
367  }
std::vector< std::string > userCandLabels_
Definition: PATObject.h:451
string key
FastSim: produces sample of signal events, overlayed with premixed minbias events.
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 286 of file PATObject.h.

286  {
287  return (userDataObject_(key) != nullptr);
288  }
string key
FastSim: produces sample of signal events, overlayed with premixed minbias events.
const pat::UserData * userDataObject_(const std::string &key) const
Definition: PATObject.h:761
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 334 of file PATObject.h.

Referenced by EGExtraInfoModifierFromFloatValueMaps::modifyObject().

334  {
335  auto it = std::lower_bound(userFloatLabels_.cbegin(), userFloatLabels_.cend(), key);
336  return ( it != userFloatLabels_.cend() && *it == key );
337  }
std::vector< std::string > userFloatLabels_
Definition: PATObject.h:445
string key
FastSim: produces sample of signal events, overlayed with premixed minbias events.
template<class ObjectType>
bool pat::PATObject< ObjectType >::hasUserFloat ( const char *  key) const
inline

a CINT-friendly interface

Definition at line 339 of file PATObject.h.

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

339 {return hasUserFloat( std::string(key) );}
bool hasUserFloat(const std::string &key) const
Return true if there is a user-defined float with a given name.
Definition: PATObject.h:334
string key
FastSim: produces sample of signal events, overlayed with premixed minbias events.
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 351 of file PATObject.h.

Referenced by EGExtraInfoModifierFromIntValueMaps::modifyObject(), WenuPlots::PassPreselectionCriteria(), ZeePlots::PassPreselectionCriteria1(), and ZeePlots::PassPreselectionCriteria2().

351  {
352  auto it = std::lower_bound(userIntLabels_.cbegin(), userIntLabels_.cend(), key);
353  return ( it != userIntLabels_.cend() && *it == key );
354  }
string key
FastSim: produces sample of signal events, overlayed with premixed minbias events.
std::vector< std::string > userIntLabels_
Definition: PATObject.h:448
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 485 of file PATObject.h.

References Exception, and edm::errors::ProductNotFound.

Referenced by hitfit::JetTranslatorBase< AJet >::CheckEta(), and hitfit::JetTranslatorBase< AJet >::operator()().

485  {
486  if (refToOrig_.isNull()) {
487  // this object was not produced from a reference, so no link to the
488  // original object exists -> return a 0-pointer
489  return 0;
490  } else if (!refToOrig_.isAvailable()) {
491  throw edm::Exception(edm::errors::ProductNotFound) << "The original collection from which this PAT object was made is not present any more in the event, hence you cannot access the originating object anymore.";
492  } else {
493  return refToOrig_.get();
494  }
495  }
T const * get() const
Returns C++ pointer to the item.
Definition: Ptr.h:160
bool isAvailable() const
Definition: Ptr.h:259
bool isNull() const
Checks for null.
Definition: Ptr.h:165
edm::Ptr< reco::Candidate > refToOrig_
Definition: PATObject.h:421
template<class ObjectType >
const edm::Ptr< reco::Candidate > & pat::PATObject< ObjectType >::originalObjectRef ( ) const
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 273 of file PATObject.h.

273 { return overlapLabels_; }
std::vector< std::string > overlapLabels_
Overlapping test labels (only if there are any overlaps)
Definition: PATObject.h:437
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 740 of file PATObject.h.

References HLT_25ns14e33_v1_cff::distance, pat::pat_statics::EMPTY_CPV, diffTwoXMLs::label, and match().

740  {
741 
742  auto match = std::lower_bound(overlapLabels_.cbegin(), overlapLabels_.cend(), label);
743  if( match == overlapLabels_.cend() || *match != label ) return pat_statics::EMPTY_CPV;
745  }
std::vector< reco::CandidatePtrVector > overlapItems_
Overlapping items (sorted by distance)
Definition: PATObject.h:439
std::pair< typename Association::data_type::first_type, double > match(Reference key, Association association, bool bestMatchByMaxValue)
Generic matching function.
Definition: Utils.h:10
std::vector< std::string > overlapLabels_
Overlapping test labels (only if there are any overlaps)
Definition: PATObject.h:437
static const reco::CandidatePtrVector EMPTY_CPV
Definition: PATObject.h:44
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 390 of file PATObject.h.

390 { return getKinResolution(label).resolE(this->p4()); }
double p4[4]
Definition: TauolaWrapper.h:92
double resolE(const LorentzVector &p4) const
Resolution on energy, given the 4-momentum of the associated Candidate.
const pat::CandKinResolution & getKinResolution(const std::string &label="") const
Definition: PATObject.h:876
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 393 of file PATObject.h.

393 { return getKinResolution(label).resolEt(this->p4()); }
double p4[4]
Definition: TauolaWrapper.h:92
const pat::CandKinResolution & getKinResolution(const std::string &label="") const
Definition: PATObject.h:876
double resolEt(const LorentzVector &p4) const
Resolution on et, given the 4-momentum of the associated Candidate.
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 381 of file PATObject.h.

381 { return getKinResolution(label).resolEta(this->p4()); }
double p4[4]
Definition: TauolaWrapper.h:92
double resolEta(const LorentzVector &p4) const
Resolution on eta, given the 4-momentum of the associated Candidate.
const pat::CandKinResolution & getKinResolution(const std::string &label="") const
Definition: PATObject.h:876
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 415 of file PATObject.h.

415 { return getKinResolution(label).resolM(this->p4()); }
double p4[4]
Definition: TauolaWrapper.h:92
double resolM(const LorentzVector &p4) const
const pat::CandKinResolution & getKinResolution(const std::string &label="") const
Definition: PATObject.h:876
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 396 of file PATObject.h.

396 { return getKinResolution(label).resolP(this->p4()); }
double resolP(const LorentzVector &p4) const
Resolution on p, given the 4-momentum of the associated Candidate.
double p4[4]
Definition: TauolaWrapper.h:92
const pat::CandKinResolution & getKinResolution(const std::string &label="") const
Definition: PATObject.h:876
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 387 of file PATObject.h.

387 { return getKinResolution(label).resolPhi(this->p4()); }
double resolPhi(const LorentzVector &p4) const
Resolution on phi, given the 4-momentum of the associated Candidate.
double p4[4]
Definition: TauolaWrapper.h:92
const pat::CandKinResolution & getKinResolution(const std::string &label="") const
Definition: PATObject.h:876
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 402 of file PATObject.h.

402 { return getKinResolution(label).resolPInv(this->p4()); }
double p4[4]
Definition: TauolaWrapper.h:92
double resolPInv(const LorentzVector &p4) const
Resolution on 1/p, given the 4-momentum of the associated Candidate.
const pat::CandKinResolution & getKinResolution(const std::string &label="") const
Definition: PATObject.h:876
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 399 of file PATObject.h.

399 { return getKinResolution(label).resolPt(this->p4()); }
double p4[4]
Definition: TauolaWrapper.h:92
const pat::CandKinResolution & getKinResolution(const std::string &label="") const
Definition: PATObject.h:876
double resolPt(const LorentzVector &p4) const
Resolution on pt, given the 4-momentum of the associated Candidate.
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 405 of file PATObject.h.

405 { return getKinResolution(label).resolPx(this->p4()); }
double p4[4]
Definition: TauolaWrapper.h:92
double resolPx(const LorentzVector &p4) const
Resolution on px, given the 4-momentum of the associated Candidate.
const pat::CandKinResolution & getKinResolution(const std::string &label="") const
Definition: PATObject.h:876
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 408 of file PATObject.h.

408 { return getKinResolution(label).resolPy(this->p4()); }
double resolPy(const LorentzVector &p4) const
Resolution on py, given the 4-momentum of the associated Candidate.
double p4[4]
Definition: TauolaWrapper.h:92
const pat::CandKinResolution & getKinResolution(const std::string &label="") const
Definition: PATObject.h:876
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 411 of file PATObject.h.

411 { return getKinResolution(label).resolPz(this->p4()); }
double resolPz(const LorentzVector &p4) const
Resolution on pz, given the 4-momentum of the associated Candidate.
double p4[4]
Definition: TauolaWrapper.h:92
const pat::CandKinResolution & getKinResolution(const std::string &label="") const
Definition: PATObject.h:876
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 384 of file PATObject.h.

384 { return getKinResolution(label).resolTheta(this->p4()); }
double p4[4]
Definition: TauolaWrapper.h:92
const pat::CandKinResolution & getKinResolution(const std::string &label="") const
Definition: PATObject.h:876
double resolTheta(const LorentzVector &p4) const
Resolution on theta, given the 4-momentum of the associated Candidate.
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 653 of file PATObject.h.

References HLT_25ns14e33_v1_cff::distance, edm::eventsetup::heterocontainer::insert(), mergeVDriftHistosByStation::name, and relativeConstraints::value.

Referenced by pat::helper::EfficiencyLoader::setEfficiencies().

653  {
654  // look for the name, or to the place where we can insert it without violating the alphabetic order
655  auto it = std::lower_bound(efficiencyNames_.begin(), efficiencyNames_.end(), name);
656  const auto dist = std::distance(efficiencyNames_.begin(),it);
657  if (it == efficiencyNames_.end()) { // insert at the end
658  efficiencyNames_.push_back(name);
659  efficiencyValues_.push_back(value);
660  } else if (*it == name) { // replace existing
661  efficiencyValues_[dist] = value;
662  } else { // insert in the middle :-(
664  efficiencyValues_.insert( efficiencyValues_.begin() + dist, value );
665  }
666  }
std::vector< std::string > efficiencyNames_
vector of the efficiencies (names)
Definition: PATObject.h:429
std::vector< pat::LookupTableRecord > efficiencyValues_
vector of the efficiencies (values)
Definition: PATObject.h:427
bool insert(Storage &iStorage, ItemType *iItem, const IdTag &iIdTag)
Definition: HCMethods.h:49
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 685 of file PATObject.h.

685  {
686  genParticleEmbedded_.clear();
687  genParticleEmbedded_.push_back(particle);
688  genParticleRef_.clear();
689  }
std::vector< reco::GenParticleRef > genParticleRef_
Reference to a generator level particle.
Definition: PATObject.h:432
std::vector< reco::GenParticle > genParticleEmbedded_
vector to hold an embedded generator level particle
Definition: PATObject.h:434
template<class ObjectType >
void pat::PATObject< ObjectType >::setGenParticleRef ( const reco::GenParticleRef ref,
bool  embed = false 
)

Set the generator level particle reference.

Definition at line 669 of file PATObject.h.

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

669  {
670  genParticleRef_ = std::vector<reco::GenParticleRef>(1,ref);
671  genParticleEmbedded_.clear();
672  if (embed) embedGenParticle();
673  }
std::vector< reco::GenParticleRef > genParticleRef_
Reference to a generator level particle.
Definition: PATObject.h:432
std::vector< reco::GenParticle > genParticleEmbedded_
vector to hold an embedded generator level particle
Definition: PATObject.h:434
#define embed
Definition: AMPTWrapper.h:178
void embedGenParticle()
Definition: PATObject.h:692
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 914 of file PATObject.h.

References HLT_25ns14e33_v1_cff::distance, diffTwoXMLs::label, and match().

Referenced by pat::helper::KinResolutionsLoader::setResolutions().

914  {
915  const bool has_unlabelled = (kinResolutionLabels_.size()+1 == kinResolutions_.size());
916  if (label.empty()) {
917  if (has_unlabelled) {
918  // There is already an un-labelled object. Replace it
919  kinResolutions_[0] = resol;
920  } else {
921  // Insert. Note that the un-labelled is always the first, so we need to insert before begin()
922  // (for an empty vector, this should not cost more than push_back)
923  kinResolutions_.insert(kinResolutions_.begin(), resol);
924  }
925  } else {
926  auto match = std::lower_bound(kinResolutionLabels_.begin(), kinResolutionLabels_.end(), label);
927  const auto dist = std::distance(kinResolutionLabels_.begin(),match);
928  const size_t increment = ( has_unlabelled ? 1 : 0 );
929  if ( match != kinResolutionLabels_.end() && *match == label ) {
930  // Existing object: replace
931  kinResolutions_[dist+increment] = resol;
932  } else {
934  kinResolutions_.insert(kinResolutions_.begin()+dist+increment,resol);
935  }
936  }
937  }
std::vector< pat::CandKinResolution > kinResolutions_
Kinematic resolutions.
Definition: PATObject.h:455
std::vector< std::string > kinResolutionLabels_
Definition: PATObject.h:458
std::pair< typename Association::data_type::first_type, double > match(Reference key, Association association, bool bestMatchByMaxValue)
Generic matching function.
Definition: Utils.h:10
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 748 of file PATObject.h.

References HLT_25ns14e33_v1_cff::distance, diffTwoXMLs::label, match(), and analyzePatCleaning_cfg::overlaps.

748  {
749 
750  auto match = std::lower_bound(overlapLabels_.begin(), overlapLabels_.end(), label);
751  const auto dist = std::distance(overlapLabels_.begin(),match);
752  if ( match == overlapLabels_.end() || *match != label ) {
753  overlapLabels_.insert(match,label);
754  overlapItems_.insert(overlapItems_.begin()+dist,overlaps);
755  } else {
756  overlapItems_[dist] = overlaps;
757  }
758  }
const reco::CandidatePtrVector & overlaps(const std::string &label) const
Definition: PATObject.h:740
std::vector< reco::CandidatePtrVector > overlapItems_
Overlapping items (sorted by distance)
Definition: PATObject.h:439
std::pair< typename Association::data_type::first_type, double > match(Reference key, Association association, bool bestMatchByMaxValue)
Generic matching function.
Definition: Utils.h:10
std::vector< std::string > overlapLabels_
Overlapping test labels (only if there are any overlaps)
Definition: PATObject.h:437
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 501 of file PATObject.h.

References edm::Ref< C, T, F >::get(), edm::Ref< C, T, F >::isNonnull(), and findQualityFiles::size.

501  {
502  if ( idx >= triggerObjectMatches().size() ) return 0;
504  return ref.isNonnull() ? ref.get() : 0;
505  }
TriggerObjectStandAloneCollection triggerObjectMatchesEmbedded_
vector of trigger matches
Definition: PATObject.h:424
tuple idx
DEBUGGING if hasattr(process,&quot;trackMonIterativeTracking2012&quot;): print &quot;trackMonIterativeTracking2012 D...
const TriggerObjectStandAloneCollection & triggerObjectMatches() const
get all matched trigger objects
Definition: PATObject.h:77
tuple size
Write out results.
edm::Ref< TriggerObjectStandAloneCollection > TriggerObjectStandAloneRef
Persistent reference to an item in a TriggerObjectStandAloneCollection.
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 579 of file PATObject.h.

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

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

579  {
580  std::vector< size_t > refs;
581  for ( size_t i = 0; i < triggerObjectMatches().size(); ++i ) {
582  if ( triggerObjectMatch( i ) != 0 && triggerObjectMatch( i )->hasAlgorithmName( nameAlgorithm, algoCondAccepted ) ) refs.push_back( i );
583  }
584  if ( idx >= refs.size() ) return 0;
586  return ref.isNonnull() ? ref.get() : 0;
587  }
int i
Definition: DBlmapReader.cc:9
bool isNonnull() const
Checks for non-null.
Definition: Ref.h:252
TriggerObjectStandAloneCollection triggerObjectMatchesEmbedded_
vector of trigger matches
Definition: PATObject.h:424
bool hasAlgorithmName(const std::string &algorithmName, bool algoCondAccepted=true) const
Checks, if a certain L1 algorithm name is assigned.
const TriggerObjectStandAlone * triggerObjectMatch(const size_t idx=0) const
get one matched trigger object by index
Definition: PATObject.h:501
tuple idx
DEBUGGING if hasattr(process,&quot;trackMonIterativeTracking2012&quot;): print &quot;trackMonIterativeTracking2012 D...
const TriggerObjectStandAloneCollection & triggerObjectMatches() const
get all matched trigger objects
Definition: PATObject.h:77
edm::Ref< TriggerObjectStandAloneCollection > TriggerObjectStandAloneRef
Persistent reference to an item in a TriggerObjectStandAloneCollection.
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 144 of file PATObject.h.

144  {
145  return triggerObjectMatchByAlgorithm( std::string( nameAlgorithm ), algoCondAccepted, idx );
146  };
const TriggerObjectStandAlone * triggerObjectMatchByAlgorithm(const std::string &nameAlgorithm, const bool algoCondAccepted=true, const size_t idx=0) const
Definition: PATObject.h:579
tuple idx
DEBUGGING if hasattr(process,&quot;trackMonIterativeTracking2012&quot;): print &quot;trackMonIterativeTracking2012 D...
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 148 of file PATObject.h.

148  {
149  return triggerObjectMatchByAlgorithm( nameAlgorithm, bool( algoCondAccepted ), idx );
150  };
const TriggerObjectStandAlone * triggerObjectMatchByAlgorithm(const std::string &nameAlgorithm, const bool algoCondAccepted=true, const size_t idx=0) const
Definition: PATObject.h:579
tuple idx
DEBUGGING if hasattr(process,&quot;trackMonIterativeTracking2012&quot;): print &quot;trackMonIterativeTracking2012 D...
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 152 of file PATObject.h.

152  {
153  return triggerObjectMatchByAlgorithm( std::string( nameAlgorithm ), bool( algoCondAccepted ), idx );
154  };
const TriggerObjectStandAlone * triggerObjectMatchByAlgorithm(const std::string &nameAlgorithm, const bool algoCondAccepted=true, const size_t idx=0) const
Definition: PATObject.h:579
tuple idx
DEBUGGING if hasattr(process,&quot;trackMonIterativeTracking2012&quot;): print &quot;trackMonIterativeTracking2012 D...
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 537 of file PATObject.h.

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

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

537  {
538  std::vector< size_t > refs;
539  for ( size_t i = 0; i < triggerObjectMatches().size(); ++i ) {
540  if ( triggerObjectMatch( i ) != 0 && triggerObjectMatch( i )->hasCollection( coll ) ) {
541  refs.push_back( i );
542  }
543  }
544  if ( idx >= refs.size() ) return 0;
546  return ref.isNonnull() ? ref.get() : 0;
547  }
int i
Definition: DBlmapReader.cc:9
bool isNonnull() const
Checks for non-null.
Definition: Ref.h:252
virtual bool hasCollection(const std::string &collName) const
Checks, if a certain label of original collection is assigned (method overrides)
TriggerObjectStandAloneCollection triggerObjectMatchesEmbedded_
vector of trigger matches
Definition: PATObject.h:424
const TriggerObjectStandAlone * triggerObjectMatch(const size_t idx=0) const
get one matched trigger object by index
Definition: PATObject.h:501
JetCorrectorParametersCollection coll
Definition: classes.h:10
tuple idx
DEBUGGING if hasattr(process,&quot;trackMonIterativeTracking2012&quot;): print &quot;trackMonIterativeTracking2012 D...
const TriggerObjectStandAloneCollection & triggerObjectMatches() const
get all matched trigger objects
Definition: PATObject.h:77
edm::Ref< TriggerObjectStandAloneCollection > TriggerObjectStandAloneRef
Persistent reference to an item in a TriggerObjectStandAloneCollection.
template<class ObjectType>
const TriggerObjectStandAlone* pat::PATObject< ObjectType >::triggerObjectMatchByCollection ( const char *  coll,
const size_t  idx = 0 
) const
inline

Definition at line 108 of file PATObject.h.

108  {
110  };
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:537
JetCorrectorParametersCollection coll
Definition: classes.h:10
tuple idx
DEBUGGING if hasattr(process,&quot;trackMonIterativeTracking2012&quot;): print &quot;trackMonIterativeTracking2012 D...
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 559 of file PATObject.h.

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

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

559  {
560  std::vector< size_t > refs;
561  for ( size_t i = 0; i < triggerObjectMatches().size(); ++i ) {
562  if ( triggerObjectMatch( i ) != 0 && triggerObjectMatch( i )->hasConditionName( nameCondition ) ) refs.push_back( i );
563  }
564  if ( idx >= refs.size() ) return 0;
566  return ref.isNonnull() ? ref.get() : 0;
567  }
int i
Definition: DBlmapReader.cc:9
bool isNonnull() const
Checks for non-null.
Definition: Ref.h:252
TriggerObjectStandAloneCollection triggerObjectMatchesEmbedded_
vector of trigger matches
Definition: PATObject.h:424
const TriggerObjectStandAlone * triggerObjectMatch(const size_t idx=0) const
get one matched trigger object by index
Definition: PATObject.h:501
bool hasConditionName(const std::string &conditionName) const
Checks, if a certain L1 condition name is assigned.
tuple idx
DEBUGGING if hasattr(process,&quot;trackMonIterativeTracking2012&quot;): print &quot;trackMonIterativeTracking2012 D...
const TriggerObjectStandAloneCollection & triggerObjectMatches() const
get all matched trigger objects
Definition: PATObject.h:77
edm::Ref< TriggerObjectStandAloneCollection > TriggerObjectStandAloneRef
Persistent reference to an item in a TriggerObjectStandAloneCollection.
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.

120  {
121  return triggerObjectMatchByCondition( std::string( nameCondition ), idx );
122  };
tuple idx
DEBUGGING if hasattr(process,&quot;trackMonIterativeTracking2012&quot;): print &quot;trackMonIterativeTracking2012 D...
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:559
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 599 of file PATObject.h.

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

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

599  {
600  std::vector< size_t > refs;
601  for ( size_t i = 0; i < triggerObjectMatches().size(); ++i ) {
602  if ( triggerObjectMatch( i ) != 0 && triggerObjectMatch( i )->hasFilterLabel( labelFilter ) ) refs.push_back( i );
603  }
604  if ( idx >= refs.size() ) return 0;
606  return ref.isNonnull() ? ref.get() : 0;
607  }
int i
Definition: DBlmapReader.cc:9
bool isNonnull() const
Checks for non-null.
Definition: Ref.h:252
TriggerObjectStandAloneCollection triggerObjectMatchesEmbedded_
vector of trigger matches
Definition: PATObject.h:424
const TriggerObjectStandAlone * triggerObjectMatch(const size_t idx=0) const
get one matched trigger object by index
Definition: PATObject.h:501
bool hasFilterLabel(const std::string &filterLabel) const
Checks, if a certain HLT filter label is assigned.
tuple idx
DEBUGGING if hasattr(process,&quot;trackMonIterativeTracking2012&quot;): print &quot;trackMonIterativeTracking2012 D...
const TriggerObjectStandAloneCollection & triggerObjectMatches() const
get all matched trigger objects
Definition: PATObject.h:77
edm::Ref< TriggerObjectStandAloneCollection > TriggerObjectStandAloneRef
Persistent reference to an item in a TriggerObjectStandAloneCollection.
template<class ObjectType>
const TriggerObjectStandAlone* pat::PATObject< ObjectType >::triggerObjectMatchByFilter ( const char *  labelFilter,
const size_t  idx = 0 
) const
inline

Definition at line 164 of file PATObject.h.

164  {
165  return triggerObjectMatchByFilter( std::string( labelFilter ), idx );
166  };
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:599
tuple idx
DEBUGGING if hasattr(process,&quot;trackMonIterativeTracking2012&quot;): print &quot;trackMonIterativeTracking2012 D...
template<class ObjectType>
const TriggerObjectStandAlone* pat::PATObject< ObjectType >::triggerObjectMatchByFilterID ( const unsigned  triggerObjectType,
const size_t  idx = 0 
) const
inline

Definition at line 96 of file PATObject.h.

96  {
97  return triggerObjectMatchByType( trigger::TriggerObjectType( triggerObjectType ), idx );
98  };
tuple idx
DEBUGGING if hasattr(process,&quot;trackMonIterativeTracking2012&quot;): print &quot;trackMonIterativeTracking2012 D...
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:517
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 619 of file PATObject.h.

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

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

619  {
620  std::vector< size_t > refs;
621  for ( size_t i = 0; i < triggerObjectMatches().size(); ++i ) {
622  if ( triggerObjectMatch( i ) != 0 && triggerObjectMatch( i )->hasPathName( namePath, pathLastFilterAccepted, pathL3FilterAccepted ) ) refs.push_back( i );
623  }
624  if ( idx >= refs.size() ) return 0;
626  return ref.isNonnull() ? ref.get() : 0;
627  }
int i
Definition: DBlmapReader.cc:9
bool isNonnull() const
Checks for non-null.
Definition: Ref.h:252
bool hasPathName(const std::string &pathName, bool pathLastFilterAccepted=false, bool pathL3FilterAccepted=true) const
Checks, if a certain HLT path name is assigned.
TriggerObjectStandAloneCollection triggerObjectMatchesEmbedded_
vector of trigger matches
Definition: PATObject.h:424
const TriggerObjectStandAlone * triggerObjectMatch(const size_t idx=0) const
get one matched trigger object by index
Definition: PATObject.h:501
tuple idx
DEBUGGING if hasattr(process,&quot;trackMonIterativeTracking2012&quot;): print &quot;trackMonIterativeTracking2012 D...
const TriggerObjectStandAloneCollection & triggerObjectMatches() const
get all matched trigger objects
Definition: PATObject.h:77
edm::Ref< TriggerObjectStandAloneCollection > TriggerObjectStandAloneRef
Persistent reference to an item in a TriggerObjectStandAloneCollection.
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 192 of file PATObject.h.

192  {
193  return triggerObjectMatchByPath( std::string( namePath ), pathLastFilterAccepted, pathL3FilterAccepted, idx );
194  };
const TriggerObjectStandAlone * triggerObjectMatchByPath(const std::string &namePath, const bool pathLastFilterAccepted=false, const bool pathL3FilterAccepted=true, const size_t idx=0) const
Definition: PATObject.h:619
tuple idx
DEBUGGING if hasattr(process,&quot;trackMonIterativeTracking2012&quot;): print &quot;trackMonIterativeTracking2012 D...
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 196 of file PATObject.h.

196  {
197  return triggerObjectMatchByPath( namePath, bool( pathLastFilterAccepted ), bool( pathL3FilterAccepted ), idx );
198  };
const TriggerObjectStandAlone * triggerObjectMatchByPath(const std::string &namePath, const bool pathLastFilterAccepted=false, const bool pathL3FilterAccepted=true, const size_t idx=0) const
Definition: PATObject.h:619
tuple idx
DEBUGGING if hasattr(process,&quot;trackMonIterativeTracking2012&quot;): print &quot;trackMonIterativeTracking2012 D...
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 200 of file PATObject.h.

200  {
201  return triggerObjectMatchByPath( std::string( namePath ), bool( pathLastFilterAccepted ), bool( pathL3FilterAccepted ), idx );
202  };
const TriggerObjectStandAlone * triggerObjectMatchByPath(const std::string &namePath, const bool pathLastFilterAccepted=false, const bool pathL3FilterAccepted=true, const size_t idx=0) const
Definition: PATObject.h:619
tuple idx
DEBUGGING if hasattr(process,&quot;trackMonIterativeTracking2012&quot;): print &quot;trackMonIterativeTracking2012 D...
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 517 of file PATObject.h.

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

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

517  {
518  std::vector< size_t > refs;
519  for ( size_t i = 0; i < triggerObjectMatches().size(); ++i ) {
520  if ( triggerObjectMatch( i ) != 0 && triggerObjectMatch( i )->hasTriggerObjectType( triggerObjectType ) ) refs.push_back( i );
521  }
522  if ( idx >= refs.size() ) return 0;
524  return ref.isNonnull() ? ref.get() : 0;
525  }
int i
Definition: DBlmapReader.cc:9
bool isNonnull() const
Checks for non-null.
Definition: Ref.h:252
TriggerObjectStandAloneCollection triggerObjectMatchesEmbedded_
vector of trigger matches
Definition: PATObject.h:424
const TriggerObjectStandAlone * triggerObjectMatch(const size_t idx=0) const
get one matched trigger object by index
Definition: PATObject.h:501
bool hasTriggerObjectType(trigger::TriggerObjectType triggerObjectType) const
Checks, if a certain trigger object type identifier is assigned.
tuple idx
DEBUGGING if hasattr(process,&quot;trackMonIterativeTracking2012&quot;): print &quot;trackMonIterativeTracking2012 D...
const TriggerObjectStandAloneCollection & triggerObjectMatches() const
get all matched trigger objects
Definition: PATObject.h:77
edm::Ref< TriggerObjectStandAloneCollection > TriggerObjectStandAloneRef
Persistent reference to an item in a TriggerObjectStandAloneCollection.
template<class ObjectType>
const TriggerObjectStandAlone* pat::PATObject< ObjectType >::triggerObjectMatchByType ( const unsigned  triggerObjectType,
const size_t  idx = 0 
) const
inline

Definition at line 92 of file PATObject.h.

92  {
93  return triggerObjectMatchByType( trigger::TriggerObjectType( triggerObjectType ), idx );
94  };
tuple idx
DEBUGGING if hasattr(process,&quot;trackMonIterativeTracking2012&quot;): print &quot;trackMonIterativeTracking2012 D...
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:517
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 77 of file PATObject.h.

TriggerObjectStandAloneCollection triggerObjectMatchesEmbedded_
vector of trigger matches
Definition: PATObject.h:424
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 570 of file PATObject.h.

References i, and matches.

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

570  {
572  for ( size_t i = 0; i < triggerObjectMatches().size(); ++i ) {
573  if ( triggerObjectMatch( i ) != 0 && triggerObjectMatch( i )->hasAlgorithmName( nameAlgorithm, algoCondAccepted ) ) matches.push_back( *( triggerObjectMatch( i ) ) );
574  }
575  return matches;
576  }
int i
Definition: DBlmapReader.cc:9
std::vector< TriggerObjectStandAlone > TriggerObjectStandAloneCollection
Collection of TriggerObjectStandAlone.
bool hasAlgorithmName(const std::string &algorithmName, bool algoCondAccepted=true) const
Checks, if a certain L1 algorithm name is assigned.
const TriggerObjectStandAlone * triggerObjectMatch(const size_t idx=0) const
get one matched trigger object by index
Definition: PATObject.h:501
const TriggerObjectStandAloneCollection & triggerObjectMatches() const
get all matched trigger objects
Definition: PATObject.h:77
template<class ObjectType>
const TriggerObjectStandAloneCollection pat::PATObject< ObjectType >::triggerObjectMatchesByAlgorithm ( const char *  nameAlgorithm,
const bool  algoCondAccepted = true 
) const
inline

Definition at line 128 of file PATObject.h.

128  {
129  return triggerObjectMatchesByAlgorithm( std::string( nameAlgorithm ), algoCondAccepted );
130  };
const TriggerObjectStandAloneCollection triggerObjectMatchesByAlgorithm(const std::string &nameAlgorithm, const bool algoCondAccepted=true) const
Definition: PATObject.h:570
template<class ObjectType>
const TriggerObjectStandAloneCollection pat::PATObject< ObjectType >::triggerObjectMatchesByAlgorithm ( const std::string &  nameAlgorithm,
const unsigned  algoCondAccepted 
) const
inline

Definition at line 132 of file PATObject.h.

132  {
133  return triggerObjectMatchesByAlgorithm( nameAlgorithm, bool( algoCondAccepted ) );
134  };
const TriggerObjectStandAloneCollection triggerObjectMatchesByAlgorithm(const std::string &nameAlgorithm, const bool algoCondAccepted=true) const
Definition: PATObject.h:570
template<class ObjectType>
const TriggerObjectStandAloneCollection pat::PATObject< ObjectType >::triggerObjectMatchesByAlgorithm ( const char *  nameAlgorithm,
const unsigned  algoCondAccepted 
) const
inline

Definition at line 136 of file PATObject.h.

136  {
137  return triggerObjectMatchesByAlgorithm( std::string( nameAlgorithm ), bool( algoCondAccepted ) );
138  };
const TriggerObjectStandAloneCollection triggerObjectMatchesByAlgorithm(const std::string &nameAlgorithm, const bool algoCondAccepted=true) const
Definition: PATObject.h:570
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 528 of file PATObject.h.

References i, and matches.

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

528  {
530  for ( size_t i = 0; i < triggerObjectMatches().size(); ++i ) {
531  if ( triggerObjectMatch( i ) != 0 && triggerObjectMatch( i )->hasCollection( coll ) ) matches.push_back( *( triggerObjectMatch( i ) ) );
532  }
533  return matches;
534  }
int i
Definition: DBlmapReader.cc:9
virtual bool hasCollection(const std::string &collName) const
Checks, if a certain label of original collection is assigned (method overrides)
std::vector< TriggerObjectStandAlone > TriggerObjectStandAloneCollection
Collection of TriggerObjectStandAlone.
const TriggerObjectStandAlone * triggerObjectMatch(const size_t idx=0) const
get one matched trigger object by index
Definition: PATObject.h:501
JetCorrectorParametersCollection coll
Definition: classes.h:10
const TriggerObjectStandAloneCollection & triggerObjectMatches() const
get all matched trigger objects
Definition: PATObject.h:77
template<class ObjectType>
const TriggerObjectStandAloneCollection pat::PATObject< ObjectType >::triggerObjectMatchesByCollection ( const char *  coll) const
inline

Definition at line 102 of file PATObject.h.

102  {
104  };
const TriggerObjectStandAloneCollection triggerObjectMatchesByCollection(const std::string &coll) const
get all matched trigger objects from a certain collection
Definition: PATObject.h:528
JetCorrectorParametersCollection coll
Definition: classes.h:10
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 550 of file PATObject.h.

References i, and matches.

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

550  {
552  for ( size_t i = 0; i < triggerObjectMatches().size(); ++i ) {
553  if ( triggerObjectMatch( i ) != 0 && triggerObjectMatch( i )->hasConditionName( nameCondition ) ) matches.push_back( *( triggerObjectMatch( i ) ) );
554  }
555  return matches;
556  }
int i
Definition: DBlmapReader.cc:9
std::vector< TriggerObjectStandAlone > TriggerObjectStandAloneCollection
Collection of TriggerObjectStandAlone.
const TriggerObjectStandAlone * triggerObjectMatch(const size_t idx=0) const
get one matched trigger object by index
Definition: PATObject.h:501
bool hasConditionName(const std::string &conditionName) const
Checks, if a certain L1 condition name is assigned.
const TriggerObjectStandAloneCollection & triggerObjectMatches() const
get all matched trigger objects
Definition: PATObject.h:77
template<class ObjectType>
const TriggerObjectStandAloneCollection pat::PATObject< ObjectType >::triggerObjectMatchesByCondition ( const char *  nameCondition) const
inline

Definition at line 114 of file PATObject.h.

114  {
115  return triggerObjectMatchesByCondition( std::string( nameCondition ) );
116  };
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:550
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 590 of file PATObject.h.

References i, and matches.

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

590  {
592  for ( size_t i = 0; i < triggerObjectMatches().size(); ++i ) {
593  if ( triggerObjectMatch( i ) != 0 && triggerObjectMatch( i )->hasFilterLabel( labelFilter ) ) matches.push_back( *( triggerObjectMatch( i ) ) );
594  }
595  return matches;
596  }
int i
Definition: DBlmapReader.cc:9
std::vector< TriggerObjectStandAlone > TriggerObjectStandAloneCollection
Collection of TriggerObjectStandAlone.
const TriggerObjectStandAlone * triggerObjectMatch(const size_t idx=0) const
get one matched trigger object by index
Definition: PATObject.h:501
bool hasFilterLabel(const std::string &filterLabel) const
Checks, if a certain HLT filter label is assigned.
const TriggerObjectStandAloneCollection & triggerObjectMatches() const
get all matched trigger objects
Definition: PATObject.h:77
template<class ObjectType>
const TriggerObjectStandAloneCollection pat::PATObject< ObjectType >::triggerObjectMatchesByFilter ( const char *  labelFilter) const
inline

Definition at line 158 of file PATObject.h.

158  {
159  return triggerObjectMatchesByFilter( std::string( labelFilter ) );
160  };
const TriggerObjectStandAloneCollection triggerObjectMatchesByFilter(const std::string &labelFilter) const
get all matched HLT objects used in a certain HLT filter
Definition: PATObject.h:590
template<class ObjectType>
const TriggerObjectStandAloneCollection pat::PATObject< ObjectType >::triggerObjectMatchesByFilterID ( const unsigned  triggerObjectType) const
inline

Definition at line 87 of file PATObject.h.

87  {
88  return triggerObjectMatchesByType( trigger::TriggerObjectType( triggerObjectType ) );
89  };
const TriggerObjectStandAloneCollection triggerObjectMatchesByType(const trigger::TriggerObjectType triggerObjectType) const
Definition: PATObject.h:508
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 610 of file PATObject.h.

References i, and matches.

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

610  {
612  for ( size_t i = 0; i < triggerObjectMatches().size(); ++i ) {
613  if ( triggerObjectMatch( i ) != 0 && triggerObjectMatch( i )->hasPathName( namePath, pathLastFilterAccepted, pathL3FilterAccepted ) ) matches.push_back( *( triggerObjectMatch( i ) ) );
614  }
615  return matches;
616  }
int i
Definition: DBlmapReader.cc:9
bool hasPathName(const std::string &pathName, bool pathLastFilterAccepted=false, bool pathL3FilterAccepted=true) const
Checks, if a certain HLT path name is assigned.
std::vector< TriggerObjectStandAlone > TriggerObjectStandAloneCollection
Collection of TriggerObjectStandAlone.
const TriggerObjectStandAlone * triggerObjectMatch(const size_t idx=0) const
get one matched trigger object by index
Definition: PATObject.h:501
const TriggerObjectStandAloneCollection & triggerObjectMatches() const
get all matched trigger objects
Definition: PATObject.h:77
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 174 of file PATObject.h.

174  {
175  return triggerObjectMatchesByPath( std::string( namePath ), pathLastFilterAccepted, pathL3FilterAccepted );
176  };
const TriggerObjectStandAloneCollection triggerObjectMatchesByPath(const std::string &namePath, const bool pathLastFilterAccepted=false, const bool pathL3FilterAccepted=true) const
Definition: PATObject.h:610
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 178 of file PATObject.h.

178  {
179  return triggerObjectMatchesByPath( namePath, bool( pathLastFilterAccepted ), bool( pathL3FilterAccepted ) );
180  };
const TriggerObjectStandAloneCollection triggerObjectMatchesByPath(const std::string &namePath, const bool pathLastFilterAccepted=false, const bool pathL3FilterAccepted=true) const
Definition: PATObject.h:610
template<class ObjectType>
const TriggerObjectStandAloneCollection pat::PATObject< ObjectType >::triggerObjectMatchesByPath ( const char *  namePath,
const unsigned  pathLastFilterAccepted,
const unsigned  pathL3FilterAccepted = 1 
) const
inline

Definition at line 182 of file PATObject.h.

182  {
183  return triggerObjectMatchesByPath( std::string( namePath ), bool( pathLastFilterAccepted ), bool( pathL3FilterAccepted ) );
184  };
const TriggerObjectStandAloneCollection triggerObjectMatchesByPath(const std::string &namePath, const bool pathLastFilterAccepted=false, const bool pathL3FilterAccepted=true) const
Definition: PATObject.h:610
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 508 of file PATObject.h.

References i, and matches.

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

508  {
510  for ( size_t i = 0; i < triggerObjectMatches().size(); ++i ) {
511  if ( triggerObjectMatch( i ) != 0 && triggerObjectMatch( i )->hasTriggerObjectType( triggerObjectType ) ) matches.push_back( *( triggerObjectMatch( i ) ) );
512  }
513  return matches;
514  }
int i
Definition: DBlmapReader.cc:9
std::vector< TriggerObjectStandAlone > TriggerObjectStandAloneCollection
Collection of TriggerObjectStandAlone.
const TriggerObjectStandAlone * triggerObjectMatch(const size_t idx=0) const
get one matched trigger object by index
Definition: PATObject.h:501
bool hasTriggerObjectType(trigger::TriggerObjectType triggerObjectType) const
Checks, if a certain trigger object type identifier is assigned.
const TriggerObjectStandAloneCollection & triggerObjectMatches() const
get all matched trigger objects
Definition: PATObject.h:77
template<class ObjectType>
const TriggerObjectStandAloneCollection pat::PATObject< ObjectType >::triggerObjectMatchesByType ( const unsigned  triggerObjectType) const
inline

Definition at line 83 of file PATObject.h.

83  {
84  return triggerObjectMatchesByType( trigger::TriggerObjectType( triggerObjectType ) );
85  };
const TriggerObjectStandAloneCollection triggerObjectMatchesByType(const trigger::TriggerObjectType triggerObjectType) const
Definition: PATObject.h:508
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 206 of file PATObject.h.

206  {
207  for (std::vector<TriggerObjectStandAlone>::iterator it = triggerObjectMatchesEmbedded_.begin(), ed = triggerObjectMatchesEmbedded_.end(); it != ed; ++it) it->unpackPathNames(names);
208  }
TriggerObjectStandAloneCollection triggerObjectMatchesEmbedded_
vector of trigger matches
Definition: PATObject.h:424
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 847 of file PATObject.h.

References HLT_25ns14e33_v1_cff::distance, and relval_steps::key.

848  {
849  auto it = std::lower_bound(userCandLabels_.cbegin(), userCandLabels_.cend(), key);
850  if (it != userCandLabels_.cend()) {
851  return userCands_[std::distance(userCandLabels_.begin(),it)];
852  }
853  return reco::CandidatePtr();
854  }
std::vector< reco::CandidatePtr > userCands_
Definition: PATObject.h:452
std::vector< std::string > userCandLabels_
Definition: PATObject.h:451
string key
FastSim: produces sample of signal events, overlayed with premixed minbias events.
edm::Ptr< Candidate > CandidatePtr
persistent reference to an object in a collection of Candidate objects
Definition: CandidateFwd.h:25
template<class ObjectType>
const std::vector<std::string>& pat::PATObject< ObjectType >::userCandNames ( ) const
inline

Get list of user-defined cand names.

Definition at line 362 of file PATObject.h.

362 { return userCandLabels_; }
std::vector< std::string > userCandLabels_
Definition: PATObject.h:451
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 280 of file PATObject.h.

280  {
282  return (data != nullptr ? data->template get<T>() : nullptr);
283 
284  }
string key
FastSim: produces sample of signal events, overlayed with premixed minbias events.
const pat::UserData * userDataObject_(const std::string &key) const
Definition: PATObject.h:761
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:82
Base class for data that users can add to pat objects.
Definition: UserData.h:24
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 299 of file PATObject.h.

299  {
301  return (data != nullptr ? data->bareData() : nullptr);
302  }
string key
FastSim: produces sample of signal events, overlayed with premixed minbias events.
const pat::UserData * userDataObject_(const std::string &key) const
Definition: PATObject.h:761
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:82
Base class for data that users can add to pat objects.
Definition: UserData.h:24
const void * bareData() const
Definition: UserData.h:49
template<class ObjectType>
const std::vector<std::string>& pat::PATObject< ObjectType >::userDataNames ( ) const
inline

Get list of user data object names.

Definition at line 295 of file PATObject.h.

295 { return userDataLabels_; }
std::vector< std::string > userDataLabels_
User data object.
Definition: PATObject.h:442
template<class ObjectType >
const pat::UserData * pat::PATObject< ObjectType >::userDataObject_ ( const std::string &  key) const
private

Definition at line 761 of file PATObject.h.

References HLT_25ns14e33_v1_cff::distance, and relval_steps::key.

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

762  {
763  auto it = std::lower_bound(userDataLabels_.cbegin(),userDataLabels_.cend(),key);
764  if ( it != userDataLabels_.cend() && *it == key) {
765  return &userDataObjects_[std::distance(userDataLabels_.cbegin(),it)];
766  }
767  return nullptr;
768  }
std::vector< std::string > userDataLabels_
User data object.
Definition: PATObject.h:442
string key
FastSim: produces sample of signal events, overlayed with premixed minbias events.
pat::UserDataCollection userDataObjects_
Definition: PATObject.h:443
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 290 of file PATObject.h.

290  {
292  return (data != nullptr ? data->typeName() : pat_statics::EMPTY_STR);
293  };
static const std::string EMPTY_STR("")
string key
FastSim: produces sample of signal events, overlayed with premixed minbias events.
const pat::UserData * userDataObject_(const std::string &key) const
Definition: PATObject.h:761
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:82
virtual const std::string & typeName() const =0
Human readable name of the concrete type of stored data.
Base class for data that users can add to pat objects.
Definition: UserData.h:24
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 771 of file PATObject.h.

References HLT_25ns14e33_v1_cff::distance, relval_steps::key, and pat::throwMissingLabel().

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

772  {
773  auto it = std::lower_bound(userFloatLabels_.cbegin(),userFloatLabels_.cend(),key);
774  if( it != userFloatLabels_.cend() && *it == key ) {
775  return userFloats_[std::distance(userFloatLabels_.cbegin(),it)];
776  }
778  return std::numeric_limits<float>::quiet_NaN();
779  }
std::vector< float > userFloats_
Definition: PATObject.h:446
std::vector< std::string > userFloatLabels_
Definition: PATObject.h:445
void throwMissingLabel(const std::string &what, const std::string &bad_label, const std::vector< std::string > &available)
string key
FastSim: produces sample of signal events, overlayed with premixed minbias events.
template<class ObjectType>
float pat::PATObject< ObjectType >::userFloat ( const char *  key) const
inline

a CINT-friendly interface

Definition at line 327 of file PATObject.h.

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

327 { return userFloat( std::string(key) ); }
float userFloat(const std::string &key) const
Definition: PATObject.h:771
string key
FastSim: produces sample of signal events, overlayed with premixed minbias events.
template<class ObjectType>
const std::vector<std::string>& pat::PATObject< ObjectType >::userFloatNames ( ) const
inline

Get list of user-defined float names.

Definition at line 332 of file PATObject.h.

332 { return userFloatLabels_; }
std::vector< std::string > userFloatLabels_
Definition: PATObject.h:445
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 782 of file PATObject.h.

References HLT_25ns14e33_v1_cff::distance, relval_steps::key, and query::result.

782  {
783  auto range = std::equal_range(userFloatLabels_.cbegin(),userFloatLabels_.cend(),key);
784  std::vector<float> result;
785  result.reserve(std::distance(range.first,range.second));
786  for( auto it = range.first; it != range.second; ++it ) {
787  result.push_back(userFloats_[std::distance(userFloatLabels_.cbegin(),it)]);
788  }
789  return result;
790  }
std::vector< float > userFloats_
Definition: PATObject.h:446
tuple result
Definition: query.py:137
std::vector< std::string > userFloatLabels_
Definition: PATObject.h:445
string key
FastSim: produces sample of signal events, overlayed with premixed minbias events.
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 810 of file PATObject.h.

References HLT_25ns14e33_v1_cff::distance, relval_steps::key, bookConverter::max, and pat::throwMissingLabel().

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

811  {
812  auto it = std::lower_bound(userIntLabels_.cbegin(), userIntLabels_.cend(), key);
813  if ( it != userIntLabels_.cend() && *it == key ) {
814  return userInts_[std::distance(userIntLabels_.cbegin(),it)];
815  }
818  }
void throwMissingLabel(const std::string &what, const std::string &bad_label, const std::vector< std::string > &available)
string key
FastSim: produces sample of signal events, overlayed with premixed minbias events.
std::vector< int32_t > userInts_
Definition: PATObject.h:449
std::vector< std::string > userIntLabels_
Definition: PATObject.h:448
template<class ObjectType>
const std::vector<std::string>& pat::PATObject< ObjectType >::userIntNames ( ) const
inline

Get list of user-defined int names.

Definition at line 349 of file PATObject.h.

349 { return userIntLabels_; }
std::vector< std::string > userIntLabels_
Definition: PATObject.h:448
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 821 of file PATObject.h.

References HLT_25ns14e33_v1_cff::distance, relval_steps::key, and query::result.

821  {
822  auto range = std::equal_range(userIntLabels_.cbegin(),userIntLabels_.cend(),key);
823  std::vector<int> result;
824  result.reserve(std::distance(range.first,range.second));
825  for( auto it = range.first; it != range.second; ++it ) {
826  result.push_back(userInts_[std::distance(userIntLabels_.cbegin(),it)]);
827  }
828  return result;
829  }
tuple result
Definition: query.py:137
string key
FastSim: produces sample of signal events, overlayed with premixed minbias events.
std::vector< int32_t > userInts_
Definition: PATObject.h:449
std::vector< std::string > userIntLabels_
Definition: PATObject.h:448

Member Data Documentation

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

vector of the efficiencies (names)

Definition at line 429 of file PATObject.h.

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

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

vector of the efficiencies (values)

Definition at line 427 of file PATObject.h.

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

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

vector to hold an embedded generator level particle

Definition at line 434 of file PATObject.h.

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

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

Reference to a generator level particle.

Definition at line 432 of file PATObject.h.

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

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 458 of file PATObject.h.

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

Kinematic resolutions.

Definition at line 455 of file PATObject.h.

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

Overlapping items (sorted by distance)

Definition at line 439 of file PATObject.h.

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

Overlapping test labels (only if there are any overlaps)

Definition at line 437 of file PATObject.h.

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

template<class ObjectType>
edm::Ptr<reco::Candidate> pat::PATObject< ObjectType >::refToOrig_
protected
template<class ObjectType>
TriggerObjectStandAloneCollection pat::PATObject< ObjectType >::triggerObjectMatchesEmbedded_
protected
template<class ObjectType>
std::vector<std::string> pat::PATObject< ObjectType >::userCandLabels_
protected
template<class ObjectType>
std::vector<reco::CandidatePtr> pat::PATObject< ObjectType >::userCands_
protected

Definition at line 452 of file PATObject.h.

template<class ObjectType>
std::vector<std::string> pat::PATObject< ObjectType >::userDataLabels_
protected
template<class ObjectType>
pat::UserDataCollection pat::PATObject< ObjectType >::userDataObjects_
protected
template<class ObjectType>
std::vector<std::string> pat::PATObject< ObjectType >::userFloatLabels_
protected
template<class ObjectType>
std::vector<float> pat::PATObject< ObjectType >::userFloats_
protected

Definition at line 446 of file PATObject.h.

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

Definition at line 449 of file PATObject.h.