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)
 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)
 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...
 
int32_t userInt (const std::string &key) const
 
const std::vector< std::string > & userIntNames () const
 Get list of user-defined int names. 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 41 of file PATObject.h.

Member Typedef Documentation

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

Definition at line 44 of file PATObject.h.

Constructor & Destructor Documentation

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

default constructor

Definition at line 451 of file PATObject.h.

451  {
452  }
template<class ObjectType>
pat::PATObject< ObjectType >::PATObject ( const ObjectType &  obj)

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

Definition at line 454 of file PATObject.h.

454  :
455  ObjectType(obj),
456  refToOrig_() {
457  }
edm::Ptr< reco::Candidate > refToOrig_
Definition: PATObject.h:407
template<class ObjectType>
pat::PATObject< ObjectType >::PATObject ( const edm::RefToBase< ObjectType > &  ref)

constructor from reference

Definition at line 459 of file PATObject.h.

459  :
460  ObjectType(*ref),
461  refToOrig_(ref.id(), ref.get(), ref.key()) // correct way to convert RefToBase=>Ptr, if ref is guaranteed to be available
462  // which happens to be true, otherwise the line before this throws ex. already
463  {
464  }
ProductID id() const
Definition: RefToBase.h:220
size_t key() const
Definition: RefToBase.h:228
edm::Ptr< reco::Candidate > refToOrig_
Definition: PATObject.h:407
value_type const * get() const
Definition: RefToBase.h:212
template<class ObjectType>
pat::PATObject< ObjectType >::PATObject ( const edm::Ptr< ObjectType > &  ref)

constructor from reference

Definition at line 466 of file PATObject.h.

466  :
467  ObjectType(*ref),
468  refToOrig_(ref) {
469  }
edm::Ptr< reco::Candidate > refToOrig_
Definition: PATObject.h:407
template<class ObjectType>
virtual pat::PATObject< ObjectType >::~PATObject ( )
inlinevirtual

destructor

Definition at line 55 of file PATObject.h.

55 {}

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

661  {
662  if (!genParticleEmbedded_.empty()) { // we're embedding
663  if (ref.isNonnull()) genParticleEmbedded_.push_back(*ref);
664  } else {
665  genParticleRef_.push_back(ref);
666  }
667  }
std::vector< reco::GenParticleRef > genParticleRef_
Reference to a generator level particle.
Definition: PATObject.h:418
std::vector< reco::GenParticle > genParticleEmbedded_
vector to hold an embedded generator level particle
Definition: PATObject.h:420
bool isNonnull() const
Checks for non-null.
Definition: Ref.h:250
template<class ObjectType>
void pat::PATObject< ObjectType >::addTriggerObjectMatch ( const TriggerObjectStandAlone trigObj)
inline

add a trigger match

Definition at line 196 of file PATObject.h.

196 { triggerObjectMatchesEmbedded_.push_back( trigObj ); };
TriggerObjectStandAloneCollection triggerObjectMatchesEmbedded_
vector of trigger matches
Definition: PATObject.h:410
template<class ObjectType >
void pat::PATObject< ObjectType >::addUserCand ( const std::string &  label,
const reco::CandidatePtr data 
)

Set user-defined int.

Definition at line 802 of file PATObject.h.

804  {
805  userCandLabels_.push_back(label);
806  userCands_.push_back( data );
807  }
std::vector< reco::CandidatePtr > userCands_
Definition: PATObject.h:438
std::vector< std::string > userCandLabels_
Definition: PATObject.h:437
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 302 of file PATObject.h.

302  {
303  userDataLabels_.push_back(label);
304  userDataObjects_.push_back(pat::UserData::make<T>(data, transientOnly));
305  }
std::vector< std::string > userDataLabels_
User data object.
Definition: PATObject.h:428
void push_back(D *&d)
Definition: OwnVector.h:274
pat::UserDataCollection userDataObjects_
Definition: PATObject.h:429
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 309 of file PATObject.h.

309  {
310  userDataLabels_.push_back(label);
311  userDataObjects_.push_back(data->clone());
312  }
std::vector< std::string > userDataLabels_
User data object.
Definition: PATObject.h:428
void push_back(D *&d)
Definition: OwnVector.h:274
pat::UserDataCollection userDataObjects_
Definition: PATObject.h:429
template<class ObjectType >
void pat::PATObject< ObjectType >::addUserFloat ( const std::string &  label,
float  data 
)

Set user-defined float.

Definition at line 765 of file PATObject.h.

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

767  {
768  userFloatLabels_.push_back(label);
769  userFloats_.push_back( data );
770  }
std::vector< float > userFloats_
Definition: PATObject.h:432
std::vector< std::string > userFloatLabels_
Definition: PATObject.h:431
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 784 of file PATObject.h.

786  {
787  userIntLabels_.push_back(label);
788  userInts_.push_back( data );
789  }
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:82
std::vector< int32_t > userInts_
Definition: PATObject.h:435
std::vector< std::string > userIntLabels_
Definition: PATObject.h:434
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 628 of file PATObject.h.

References run_regression::ret.

628  {
629  std::vector<std::pair<std::string,pat::LookupTableRecord> > ret;
630  std::vector<std::string>::const_iterator itn = efficiencyNames_.begin(), edn = efficiencyNames_.end();
631  std::vector<pat::LookupTableRecord>::const_iterator itv = efficiencyValues_.begin();
632  for ( ; itn != edn; ++itn, ++itv) {
633  ret.push_back( std::pair<std::string,pat::LookupTableRecord>(*itn, *itv) );
634  }
635  return ret;
636  }
std::vector< std::string > efficiencyNames_
vector of the efficiencies (names)
Definition: PATObject.h:415
std::vector< pat::LookupTableRecord > efficiencyValues_
vector of the efficiencies (values)
Definition: PATObject.h:413
template<class ObjectType >
const pat::LookupTableRecord & pat::PATObject< ObjectType >::efficiency ( const std::string &  name) const

Returns an efficiency given its name.

Definition at line 617 of file PATObject.h.

References edm::hlt::Exception, and mergeVDriftHistosByStation::name.

617  {
618  // find the name in the (sorted) list of names
619  std::vector<std::string>::const_iterator it = std::lower_bound(efficiencyNames_.begin(), efficiencyNames_.end(), name);
620  if ((it == efficiencyNames_.end()) || (*it != name)) {
621  throw cms::Exception("Invalid Label") << "There is no efficiency with name '" << name << "' in this PAT Object\n";
622  }
623  return efficiencyValues_[it - efficiencyNames_.begin()];
624  }
std::vector< std::string > efficiencyNames_
vector of the efficiencies (names)
Definition: PATObject.h:415
std::vector< pat::LookupTableRecord > efficiencyValues_
vector of the efficiencies (values)
Definition: PATObject.h:413
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 207 of file PATObject.h.

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

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

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

677  {
678  genParticleEmbedded_.clear();
679  for (std::vector<reco::GenParticleRef>::const_iterator it = genParticleRef_.begin(); it != genParticleRef_.end(); ++it) {
680  if (it->isNonnull()) genParticleEmbedded_.push_back(**it);
681  }
682  genParticleRef_.clear();
683  }
std::vector< reco::GenParticleRef > genParticleRef_
Reference to a generator level particle.
Definition: PATObject.h:418
std::vector< reco::GenParticle > genParticleEmbedded_
vector to hold an embedded generator level particle
Definition: PATObject.h:420
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 236 of file PATObject.h.

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

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

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

696  {
697  // get a vector, avoiding an unneeded copy if there is no embedding
698  const std::vector<reco::GenParticleRef> & vec = (genParticleEmbedded_.empty() ? genParticleRef_ : genParticleRefs());
699  for (std::vector<reco::GenParticleRef>::const_iterator ref = vec.begin(), end = vec.end(); ref != end; ++ref) {
700  if (ref->isNonnull()) {
701  const reco::GenParticle & g = **ref;
702  if ((status != 0) && (g.status() != status)) continue;
703  if (pdgId == 0) {
704  return *ref;
705  } else if (!autoCharge) {
706  if (pdgId == g.pdgId()) return *ref;
707  } else if (abs(pdgId) == abs(g.pdgId())) {
708  // I want pdgId > 0 to match "correct charge" (for charged particles)
709  if (g.charge() == 0) return *ref;
710  else if ((this->charge() == 0) && (pdgId == g.pdgId())) return *ref;
711  else if (g.charge()*this->charge()*pdgId > 0) return *ref;
712  }
713  }
714  }
715  return reco::GenParticleRef();
716  }
std::vector< reco::GenParticleRef > genParticleRef_
Reference to a generator level particle.
Definition: PATObject.h:418
virtual int pdgId() const GCC11_FINAL
PDG identifier.
edm::Ref< GenParticleCollection > GenParticleRef
persistent reference to a GenParticle
std::vector< reco::GenParticleRef > genParticleRefs() const
Definition: PATObject.h:686
double charge(const std::vector< uint8_t > &Ampls)
std::vector< reco::GenParticle > genParticleEmbedded_
vector to hold an embedded generator level particle
Definition: PATObject.h:420
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 status() const GCC11_FINAL
status word
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
#define end
Definition: vmac.h:37
virtual int charge() const GCC11_FINAL
electric charge
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 217 of file PATObject.h.

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

217  {
218  if (idx >= genParticlesSize()) return reco::GenParticleRef();
220  }
std::vector< reco::GenParticleRef > genParticleRef_
Reference to a generator level particle.
Definition: PATObject.h:418
size_t genParticlesSize() const
Number of generator level particles stored as ref or embedded.
Definition: PATObject.h:241
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:420
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 686 of file PATObject.h.

References i, n, and run_regression::ret.

Referenced by getGenTau().

686  {
687  if (genParticleEmbedded_.empty()) return genParticleRef_;
688  std::vector<reco::GenParticleRef> ret(genParticleEmbedded_.size());
689  for (size_t i = 0, n = ret.size(); i < n; ++i) {
691  }
692  return ret;
693  }
int i
Definition: DBlmapReader.cc:9
std::vector< reco::GenParticleRef > genParticleRef_
Reference to a generator level particle.
Definition: PATObject.h:418
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:420
template<class ObjectType>
size_t pat::PATObject< ObjectType >::genParticlesSize ( ) const
inline

Number of generator level particles stored as ref or embedded.

Definition at line 241 of file PATObject.h.

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

241  {
242  return genParticleEmbedded_.empty() ? genParticleRef_.size() : genParticleEmbedded_.size();
243  }
std::vector< reco::GenParticleRef > genParticleRef_
Reference to a generator level particle.
Definition: PATObject.h:418
std::vector< reco::GenParticle > genParticleEmbedded_
vector to hold an embedded generator level particle
Definition: PATObject.h:420
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 811 of file PATObject.h.

References edm::hlt::Exception, spr::find(), 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().

811  {
812  if (label.empty()) {
813  if (kinResolutionLabels_.size()+1 == kinResolutions_.size()) {
814  return kinResolutions_[0];
815  } else {
816  throw cms::Exception("Missing Data", "This object does not contain an un-labelled kinematic resolution");
817  }
818  } else {
819  std::vector<std::string>::const_iterator match = std::find(kinResolutionLabels_.begin(), kinResolutionLabels_.end(), label);
820  if (match == kinResolutionLabels_.end()) {
821  cms::Exception ex("Missing Data");
822  ex << "This object does not contain a kinematic resolution with name '" << label << "'.\n";
823  ex << "The known labels are: " ;
824  for (std::vector<std::string>::const_iterator it = kinResolutionLabels_.begin(); it != kinResolutionLabels_.end(); ++it) {
825  ex << "'" << *it << "' ";
826  }
827  ex << "\n";
828  throw ex;
829  } else {
830  if (kinResolutionLabels_.size()+1 == kinResolutions_.size()) {
831  // skip un-labelled resolution
832  return kinResolutions_[match - kinResolutionLabels_.begin() + 1];
833  } else {
834  // all are labelled, so this is the real index
835  return kinResolutions_[match - kinResolutionLabels_.begin()];
836  }
837  }
838  }
839  }
std::vector< pat::CandKinResolution > kinResolutions_
Kinematic resolutions.
Definition: PATObject.h:441
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
Definition: FindCaloHit.cc:7
std::vector< std::string > kinResolutionLabels_
Definition: PATObject.h:444
std::pair< typename Association::data_type::first_type, double > match(Reference key, Association association, bool bestMatchByMaxValue)
Generic matching function.
Definition: Utils.h:6
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 842 of file PATObject.h.

References spr::find(), diffTwoXMLs::label, and match().

842  {
843  if (label.empty()) {
844  return (kinResolutionLabels_.size()+1 == kinResolutions_.size());
845  } else {
846  std::vector<std::string>::const_iterator match = std::find(kinResolutionLabels_.begin(), kinResolutionLabels_.end(), label);
847  return match != kinResolutionLabels_.end();
848  }
849  }
std::vector< pat::CandKinResolution > kinResolutions_
Kinematic resolutions.
Definition: PATObject.h:441
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
Definition: FindCaloHit.cc:7
std::vector< std::string > kinResolutionLabels_
Definition: PATObject.h:444
std::pair< typename Association::data_type::first_type, double > match(Reference key, Association association, bool bestMatchByMaxValue)
Generic matching function.
Definition: Utils.h:6
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 719 of file PATObject.h.

References spr::find(), and diffTwoXMLs::label.

719  {
720  return std::find(overlapLabels_.begin(), overlapLabels_.end(), label) != overlapLabels_.end();
721  }
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
Definition: FindCaloHit.cc:7
std::vector< std::string > overlapLabels_
Overlapping test labels (only if there are any overlaps)
Definition: PATObject.h:423
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 351 of file PATObject.h.

351  {
352  return std::find(userCandLabels_.begin(), userCandLabels_.end(), key) != userCandLabels_.end();
353  }
std::vector< std::string > userCandLabels_
Definition: PATObject.h:437
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
Definition: FindCaloHit.cc:7
list key
Definition: combine.py:13
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 278 of file PATObject.h.

278  {
279  return (userDataObject_(key) != 0);
280  }
const pat::UserData * userDataObject_(const std::string &key) const
Definition: PATObject.h:745
list key
Definition: combine.py:13
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 325 of file PATObject.h.

325  {
326  return std::find(userFloatLabels_.begin(), userFloatLabels_.end(), key) != userFloatLabels_.end();
327  }
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
Definition: FindCaloHit.cc:7
std::vector< std::string > userFloatLabels_
Definition: PATObject.h:431
list key
Definition: combine.py:13
template<class ObjectType>
bool pat::PATObject< ObjectType >::hasUserFloat ( const char *  key) const
inline

a CINT-friendly interface

Definition at line 329 of file PATObject.h.

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

329 {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:325
list key
Definition: combine.py:13
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 339 of file PATObject.h.

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

339  {
340  return std::find(userIntLabels_.begin(), userIntLabels_.end(), key) != userIntLabels_.end();
341  }
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
Definition: FindCaloHit.cc:7
list key
Definition: combine.py:13
std::vector< std::string > userIntLabels_
Definition: PATObject.h:434
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 471 of file PATObject.h.

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

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

471  {
472  if (refToOrig_.isNull()) {
473  // this object was not produced from a reference, so no link to the
474  // original object exists -> return a 0-pointer
475  return 0;
476  } else if (!refToOrig_.isAvailable()) {
477  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.";
478  } else {
479  return refToOrig_.get();
480  }
481  }
T const * get() const
Returns C++ pointer to the item.
Definition: Ptr.h:143
bool isNull() const
Checks for null.
Definition: Ptr.h:148
bool isAvailable() const
Definition: Ptr.h:158
edm::Ptr< reco::Candidate > refToOrig_
Definition: PATObject.h:407
template<class ObjectType >
const edm::Ptr< reco::Candidate > & pat::PATObject< ObjectType >::originalObjectRef ( ) const

reference to original object. Returns a null reference if not available

Definition at line 484 of file PATObject.h.

Referenced by modules::MuonCleanerBySegmentsT< T >::isSameMuon(), and FindCorrectedSubjet::operator()().

484 { return refToOrig_; }
edm::Ptr< reco::Candidate > refToOrig_
Definition: PATObject.h:407
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 265 of file PATObject.h.

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

References spr::find(), diffTwoXMLs::label, and match().

724  {
725  static const reco::CandidatePtrVector EMPTY;
726  std::vector<std::string>::const_iterator match = std::find(overlapLabels_.begin(), overlapLabels_.end(), label);
727  if (match == overlapLabels_.end()) return EMPTY;
728  return overlapItems_[match - overlapLabels_.begin()];
729  }
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
Definition: FindCaloHit.cc:7
std::vector< reco::CandidatePtrVector > overlapItems_
Overlapping items (sorted by distance)
Definition: PATObject.h:425
std::pair< typename Association::data_type::first_type, double > match(Reference key, Association association, bool bestMatchByMaxValue)
Generic matching function.
Definition: Utils.h:6
std::vector< std::string > overlapLabels_
Overlapping test labels (only if there are any overlaps)
Definition: PATObject.h:423
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 376 of file PATObject.h.

376 { 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:811
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 379 of file PATObject.h.

379 { 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:811
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 367 of file PATObject.h.

367 { 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:811
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 401 of file PATObject.h.

401 { 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:811
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 382 of file PATObject.h.

382 { 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:811
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 373 of file PATObject.h.

373 { 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:811
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 388 of file PATObject.h.

388 { 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:811
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 385 of file PATObject.h.

385 { 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:811
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 391 of file PATObject.h.

391 { 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:811
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 394 of file PATObject.h.

394 { 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:811
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 397 of file PATObject.h.

397 { 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:811
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 370 of file PATObject.h.

370 { 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:811
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 639 of file PATObject.h.

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

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

639  {
640  // look for the name, or to the place where we can insert it without violating the alphabetic order
641  std::vector<std::string>::iterator it = std::lower_bound(efficiencyNames_.begin(), efficiencyNames_.end(), name);
642  if (it == efficiencyNames_.end()) { // insert at the end
643  efficiencyNames_.push_back(name);
644  efficiencyValues_.push_back(value);
645  } else if (*it == name) { // replace existing
646  efficiencyValues_[it - efficiencyNames_.begin()] = value;
647  } else { // insert in the middle :-(
649  efficiencyValues_.insert( efficiencyValues_.begin() + (it - efficiencyNames_.begin()), value );
650  }
651  }
std::vector< std::string > efficiencyNames_
vector of the efficiencies (names)
Definition: PATObject.h:415
std::vector< pat::LookupTableRecord > efficiencyValues_
vector of the efficiencies (values)
Definition: PATObject.h:413
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 670 of file PATObject.h.

670  {
671  genParticleEmbedded_.clear();
672  genParticleEmbedded_.push_back(particle);
673  genParticleRef_.clear();
674  }
std::vector< reco::GenParticleRef > genParticleRef_
Reference to a generator level particle.
Definition: PATObject.h:418
std::vector< reco::GenParticle > genParticleEmbedded_
vector to hold an embedded generator level particle
Definition: PATObject.h:420
template<class ObjectType >
void pat::PATObject< ObjectType >::setGenParticleRef ( const reco::GenParticleRef ref,
bool  embed = false 
)

Set the generator level particle reference.

Definition at line 654 of file PATObject.h.

Referenced by pat::Lepton< reco::Muon >::setGenLepton().

654  {
655  genParticleRef_ = std::vector<reco::GenParticleRef>(1,ref);
656  genParticleEmbedded_.clear();
657  if (embed) embedGenParticle();
658  }
std::vector< reco::GenParticleRef > genParticleRef_
Reference to a generator level particle.
Definition: PATObject.h:418
std::vector< reco::GenParticle > genParticleEmbedded_
vector to hold an embedded generator level particle
Definition: PATObject.h:420
#define embed
Definition: AMPTWrapper.h:178
void embedGenParticle()
Definition: PATObject.h:677
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 852 of file PATObject.h.

References spr::find(), diffTwoXMLs::label, and match().

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

852  {
853  if (label.empty()) {
854  if (kinResolutionLabels_.size()+1 == kinResolutions_.size()) {
855  // There is already an un-labelled object. Replace it
856  kinResolutions_[0] = resol;
857  } else {
858  // Insert. Note that the un-labelled is always the first, so we need to insert before begin()
859  // (for an empty vector, this should not cost more than push_back)
860  kinResolutions_.insert(kinResolutions_.begin(), resol);
861  }
862  } else {
863  std::vector<std::string>::iterator match = std::find(kinResolutionLabels_.begin(), kinResolutionLabels_.end(), label);
864  if (match != kinResolutionLabels_.end()) {
865  // Existing object: replace
866  if (kinResolutionLabels_.size()+1 == kinResolutions_.size()) {
867  kinResolutions_[(match - kinResolutionLabels_.begin())+1] = resol;
868  } else {
869  kinResolutions_[(match - kinResolutionLabels_.begin())] = resol;
870  }
871  } else {
872  kinResolutionLabels_.push_back(label);
873  kinResolutions_.push_back(resol);
874  }
875  }
876  }
std::vector< pat::CandKinResolution > kinResolutions_
Kinematic resolutions.
Definition: PATObject.h:441
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
Definition: FindCaloHit.cc:7
std::vector< std::string > kinResolutionLabels_
Definition: PATObject.h:444
std::pair< typename Association::data_type::first_type, double > match(Reference key, Association association, bool bestMatchByMaxValue)
Generic matching function.
Definition: Utils.h:6
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 732 of file PATObject.h.

References edm::PtrVectorBase::empty(), spr::find(), diffTwoXMLs::label, match(), and analyzePatCleaning_cfg::overlaps.

732  {
733  if (!overlaps.empty()) {
734  std::vector<std::string>::const_iterator match = std::find(overlapLabels_.begin(), overlapLabels_.end(), label);
735  if (match == overlapLabels_.end()) {
736  overlapLabels_.push_back(label);
737  overlapItems_.push_back(overlaps);
738  } else {
739  overlapItems_[match - overlapLabels_.begin()] = overlaps;
740  }
741  }
742  }
bool empty() const
Is the RefVector empty.
Definition: PtrVectorBase.h:70
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
Definition: FindCaloHit.cc:7
const reco::CandidatePtrVector & overlaps(const std::string &label) const
Definition: PATObject.h:724
std::vector< reco::CandidatePtrVector > overlapItems_
Overlapping items (sorted by distance)
Definition: PATObject.h:425
std::pair< typename Association::data_type::first_type, double > match(Reference key, Association association, bool bestMatchByMaxValue)
Generic matching function.
Definition: Utils.h:6
std::vector< std::string > overlapLabels_
Overlapping test labels (only if there are any overlaps)
Definition: PATObject.h:423
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 487 of file PATObject.h.

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

487  {
488  if ( idx >= triggerObjectMatches().size() ) return 0;
490  return ref.isNonnull() ? ref.get() : 0;
491  }
TriggerObjectStandAloneCollection triggerObjectMatchesEmbedded_
vector of trigger matches
Definition: PATObject.h:410
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:69
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 565 of file PATObject.h.

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

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

565  {
566  std::vector< size_t > refs;
567  for ( size_t i = 0; i < triggerObjectMatches().size(); ++i ) {
568  if ( triggerObjectMatch( i ) != 0 && triggerObjectMatch( i )->hasAlgorithmName( nameAlgorithm, algoCondAccepted ) ) refs.push_back( i );
569  }
570  if ( idx >= refs.size() ) return 0;
572  return ref.isNonnull() ? ref.get() : 0;
573  }
int i
Definition: DBlmapReader.cc:9
TriggerObjectStandAloneCollection triggerObjectMatchesEmbedded_
vector of trigger matches
Definition: PATObject.h:410
bool hasAlgorithmName(const std::string &algorithmName, bool algoCondAccepted=true) const
Checks, if a certain L1 algorithm name is assigned.
bool isNonnull() const
Checks for non-null.
Definition: Ref.h:250
const TriggerObjectStandAlone * triggerObjectMatch(const size_t idx=0) const
get one matched trigger object by index
Definition: PATObject.h:487
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:69
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 136 of file PATObject.h.

136  {
137  return triggerObjectMatchByAlgorithm( std::string( nameAlgorithm ), algoCondAccepted, idx );
138  };
const TriggerObjectStandAlone * triggerObjectMatchByAlgorithm(const std::string &nameAlgorithm, const bool algoCondAccepted=true, const size_t idx=0) const
Definition: PATObject.h:565
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 140 of file PATObject.h.

140  {
141  return triggerObjectMatchByAlgorithm( nameAlgorithm, bool( algoCondAccepted ), idx );
142  };
const TriggerObjectStandAlone * triggerObjectMatchByAlgorithm(const std::string &nameAlgorithm, const bool algoCondAccepted=true, const size_t idx=0) const
Definition: PATObject.h:565
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 144 of file PATObject.h.

144  {
145  return triggerObjectMatchByAlgorithm( std::string( nameAlgorithm ), bool( algoCondAccepted ), idx );
146  };
const TriggerObjectStandAlone * triggerObjectMatchByAlgorithm(const std::string &nameAlgorithm, const bool algoCondAccepted=true, const size_t idx=0) const
Definition: PATObject.h:565
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 523 of file PATObject.h.

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

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

523  {
524  std::vector< size_t > refs;
525  for ( size_t i = 0; i < triggerObjectMatches().size(); ++i ) {
526  if ( triggerObjectMatch( i ) != 0 && triggerObjectMatch( i )->hasCollection( coll ) ) {
527  refs.push_back( i );
528  }
529  }
530  if ( idx >= refs.size() ) return 0;
532  return ref.isNonnull() ? ref.get() : 0;
533  }
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)
TriggerObjectStandAloneCollection triggerObjectMatchesEmbedded_
vector of trigger matches
Definition: PATObject.h:410
bool isNonnull() const
Checks for non-null.
Definition: Ref.h:250
const TriggerObjectStandAlone * triggerObjectMatch(const size_t idx=0) const
get one matched trigger object by index
Definition: PATObject.h:487
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:69
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 100 of file PATObject.h.

100  {
102  };
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:523
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 545 of file PATObject.h.

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

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

545  {
546  std::vector< size_t > refs;
547  for ( size_t i = 0; i < triggerObjectMatches().size(); ++i ) {
548  if ( triggerObjectMatch( i ) != 0 && triggerObjectMatch( i )->hasConditionName( nameCondition ) ) refs.push_back( i );
549  }
550  if ( idx >= refs.size() ) return 0;
552  return ref.isNonnull() ? ref.get() : 0;
553  }
int i
Definition: DBlmapReader.cc:9
TriggerObjectStandAloneCollection triggerObjectMatchesEmbedded_
vector of trigger matches
Definition: PATObject.h:410
bool isNonnull() const
Checks for non-null.
Definition: Ref.h:250
const TriggerObjectStandAlone * triggerObjectMatch(const size_t idx=0) const
get one matched trigger object by index
Definition: PATObject.h:487
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:69
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 112 of file PATObject.h.

112  {
113  return triggerObjectMatchByCondition( std::string( nameCondition ), idx );
114  };
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:545
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 585 of file PATObject.h.

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

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

585  {
586  std::vector< size_t > refs;
587  for ( size_t i = 0; i < triggerObjectMatches().size(); ++i ) {
588  if ( triggerObjectMatch( i ) != 0 && triggerObjectMatch( i )->hasFilterLabel( labelFilter ) ) refs.push_back( i );
589  }
590  if ( idx >= refs.size() ) return 0;
592  return ref.isNonnull() ? ref.get() : 0;
593  }
int i
Definition: DBlmapReader.cc:9
TriggerObjectStandAloneCollection triggerObjectMatchesEmbedded_
vector of trigger matches
Definition: PATObject.h:410
bool isNonnull() const
Checks for non-null.
Definition: Ref.h:250
const TriggerObjectStandAlone * triggerObjectMatch(const size_t idx=0) const
get one matched trigger object by index
Definition: PATObject.h:487
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:69
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 156 of file PATObject.h.

156  {
157  return triggerObjectMatchByFilter( std::string( labelFilter ), idx );
158  };
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:585
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 88 of file PATObject.h.

88  {
89  return triggerObjectMatchByType( trigger::TriggerObjectType( triggerObjectType ), idx );
90  };
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:503
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 605 of file PATObject.h.

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

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

605  {
606  std::vector< size_t > refs;
607  for ( size_t i = 0; i < triggerObjectMatches().size(); ++i ) {
608  if ( triggerObjectMatch( i ) != 0 && triggerObjectMatch( i )->hasPathName( namePath, pathLastFilterAccepted, pathL3FilterAccepted ) ) refs.push_back( i );
609  }
610  if ( idx >= refs.size() ) return 0;
612  return ref.isNonnull() ? ref.get() : 0;
613  }
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.
TriggerObjectStandAloneCollection triggerObjectMatchesEmbedded_
vector of trigger matches
Definition: PATObject.h:410
bool isNonnull() const
Checks for non-null.
Definition: Ref.h:250
const TriggerObjectStandAlone * triggerObjectMatch(const size_t idx=0) const
get one matched trigger object by index
Definition: PATObject.h:487
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:69
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 184 of file PATObject.h.

184  {
185  return triggerObjectMatchByPath( std::string( namePath ), pathLastFilterAccepted, pathL3FilterAccepted, idx );
186  };
const TriggerObjectStandAlone * triggerObjectMatchByPath(const std::string &namePath, const bool pathLastFilterAccepted=false, const bool pathL3FilterAccepted=true, const size_t idx=0) const
Definition: PATObject.h:605
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 188 of file PATObject.h.

188  {
189  return triggerObjectMatchByPath( namePath, bool( pathLastFilterAccepted ), bool( pathL3FilterAccepted ), idx );
190  };
const TriggerObjectStandAlone * triggerObjectMatchByPath(const std::string &namePath, const bool pathLastFilterAccepted=false, const bool pathL3FilterAccepted=true, const size_t idx=0) const
Definition: PATObject.h:605
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 192 of file PATObject.h.

192  {
193  return triggerObjectMatchByPath( std::string( namePath ), bool( pathLastFilterAccepted ), bool( 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:605
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 503 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().

503  {
504  std::vector< size_t > refs;
505  for ( size_t i = 0; i < triggerObjectMatches().size(); ++i ) {
506  if ( triggerObjectMatch( i ) != 0 && triggerObjectMatch( i )->hasTriggerObjectType( triggerObjectType ) ) refs.push_back( i );
507  }
508  if ( idx >= refs.size() ) return 0;
510  return ref.isNonnull() ? ref.get() : 0;
511  }
int i
Definition: DBlmapReader.cc:9
bool hasTriggerObjectType(trigger::TriggerObjectType triggerObjectType) const
Checks, if a certain trigger object type identifier is assigned.
TriggerObjectStandAloneCollection triggerObjectMatchesEmbedded_
vector of trigger matches
Definition: PATObject.h:410
bool isNonnull() const
Checks for non-null.
Definition: Ref.h:250
const TriggerObjectStandAlone * triggerObjectMatch(const size_t idx=0) const
get one matched trigger object by index
Definition: PATObject.h:487
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:69
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 84 of file PATObject.h.

84  {
85  return triggerObjectMatchByType( trigger::TriggerObjectType( triggerObjectType ), idx );
86  };
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:503
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 69 of file PATObject.h.

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

References i.

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

556  {
558  for ( size_t i = 0; i < triggerObjectMatches().size(); ++i ) {
559  if ( triggerObjectMatch( i ) != 0 && triggerObjectMatch( i )->hasAlgorithmName( nameAlgorithm, algoCondAccepted ) ) matches.push_back( *( triggerObjectMatch( i ) ) );
560  }
561  return matches;
562  }
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:487
const TriggerObjectStandAloneCollection & triggerObjectMatches() const
get all matched trigger objects
Definition: PATObject.h:69
template<class ObjectType>
const TriggerObjectStandAloneCollection pat::PATObject< ObjectType >::triggerObjectMatchesByAlgorithm ( const char *  nameAlgorithm,
const bool  algoCondAccepted = true 
) const
inline

Definition at line 120 of file PATObject.h.

120  {
121  return triggerObjectMatchesByAlgorithm( std::string( nameAlgorithm ), algoCondAccepted );
122  };
const TriggerObjectStandAloneCollection triggerObjectMatchesByAlgorithm(const std::string &nameAlgorithm, const bool algoCondAccepted=true) const
Definition: PATObject.h:556
template<class ObjectType>
const TriggerObjectStandAloneCollection pat::PATObject< ObjectType >::triggerObjectMatchesByAlgorithm ( const std::string &  nameAlgorithm,
const unsigned  algoCondAccepted 
) const
inline

Definition at line 124 of file PATObject.h.

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

Definition at line 128 of file PATObject.h.

128  {
129  return triggerObjectMatchesByAlgorithm( std::string( nameAlgorithm ), bool( algoCondAccepted ) );
130  };
const TriggerObjectStandAloneCollection triggerObjectMatchesByAlgorithm(const std::string &nameAlgorithm, const bool algoCondAccepted=true) const
Definition: PATObject.h:556
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 514 of file PATObject.h.

References i.

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

514  {
516  for ( size_t i = 0; i < triggerObjectMatches().size(); ++i ) {
517  if ( triggerObjectMatch( i ) != 0 && triggerObjectMatch( i )->hasCollection( coll ) ) matches.push_back( *( triggerObjectMatch( i ) ) );
518  }
519  return matches;
520  }
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:487
JetCorrectorParametersCollection coll
Definition: classes.h:10
const TriggerObjectStandAloneCollection & triggerObjectMatches() const
get all matched trigger objects
Definition: PATObject.h:69
template<class ObjectType>
const TriggerObjectStandAloneCollection pat::PATObject< ObjectType >::triggerObjectMatchesByCollection ( const char *  coll) const
inline

Definition at line 94 of file PATObject.h.

94  {
96  };
const TriggerObjectStandAloneCollection triggerObjectMatchesByCollection(const std::string &coll) const
get all matched trigger objects from a certain collection
Definition: PATObject.h:514
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 536 of file PATObject.h.

References i.

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

536  {
538  for ( size_t i = 0; i < triggerObjectMatches().size(); ++i ) {
539  if ( triggerObjectMatch( i ) != 0 && triggerObjectMatch( i )->hasConditionName( nameCondition ) ) matches.push_back( *( triggerObjectMatch( i ) ) );
540  }
541  return matches;
542  }
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:487
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:69
template<class ObjectType>
const TriggerObjectStandAloneCollection pat::PATObject< ObjectType >::triggerObjectMatchesByCondition ( const char *  nameCondition) const
inline

Definition at line 106 of file PATObject.h.

106  {
107  return triggerObjectMatchesByCondition( std::string( nameCondition ) );
108  };
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:536
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 576 of file PATObject.h.

References i.

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

576  {
578  for ( size_t i = 0; i < triggerObjectMatches().size(); ++i ) {
579  if ( triggerObjectMatch( i ) != 0 && triggerObjectMatch( i )->hasFilterLabel( labelFilter ) ) matches.push_back( *( triggerObjectMatch( i ) ) );
580  }
581  return matches;
582  }
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:487
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:69
template<class ObjectType>
const TriggerObjectStandAloneCollection pat::PATObject< ObjectType >::triggerObjectMatchesByFilter ( const char *  labelFilter) const
inline

Definition at line 150 of file PATObject.h.

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

Definition at line 79 of file PATObject.h.

79  {
80  return triggerObjectMatchesByType( trigger::TriggerObjectType( triggerObjectType ) );
81  };
const TriggerObjectStandAloneCollection triggerObjectMatchesByType(const trigger::TriggerObjectType triggerObjectType) const
Definition: PATObject.h:494
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 596 of file PATObject.h.

References i.

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

596  {
598  for ( size_t i = 0; i < triggerObjectMatches().size(); ++i ) {
599  if ( triggerObjectMatch( i ) != 0 && triggerObjectMatch( i )->hasPathName( namePath, pathLastFilterAccepted, pathL3FilterAccepted ) ) matches.push_back( *( triggerObjectMatch( i ) ) );
600  }
601  return matches;
602  }
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:487
const TriggerObjectStandAloneCollection & triggerObjectMatches() const
get all matched trigger objects
Definition: PATObject.h:69
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 166 of file PATObject.h.

166  {
167  return triggerObjectMatchesByPath( std::string( namePath ), pathLastFilterAccepted, pathL3FilterAccepted );
168  };
const TriggerObjectStandAloneCollection triggerObjectMatchesByPath(const std::string &namePath, const bool pathLastFilterAccepted=false, const bool pathL3FilterAccepted=true) const
Definition: PATObject.h:596
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 170 of file PATObject.h.

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

Definition at line 174 of file PATObject.h.

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

References i.

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

494  {
496  for ( size_t i = 0; i < triggerObjectMatches().size(); ++i ) {
497  if ( triggerObjectMatch( i ) != 0 && triggerObjectMatch( i )->hasTriggerObjectType( triggerObjectType ) ) matches.push_back( *( triggerObjectMatch( i ) ) );
498  }
499  return matches;
500  }
int i
Definition: DBlmapReader.cc:9
bool hasTriggerObjectType(trigger::TriggerObjectType triggerObjectType) const
Checks, if a certain trigger object type identifier 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:487
const TriggerObjectStandAloneCollection & triggerObjectMatches() const
get all matched trigger objects
Definition: PATObject.h:69
template<class ObjectType>
const TriggerObjectStandAloneCollection pat::PATObject< ObjectType >::triggerObjectMatchesByType ( const unsigned  triggerObjectType) const
inline

Definition at line 75 of file PATObject.h.

75  {
76  return triggerObjectMatchesByType( trigger::TriggerObjectType( triggerObjectType ) );
77  };
const TriggerObjectStandAloneCollection triggerObjectMatchesByType(const trigger::TriggerObjectType triggerObjectType) const
Definition: PATObject.h:494
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 198 of file PATObject.h.

198  {
199  for (std::vector<TriggerObjectStandAlone>::iterator it = triggerObjectMatchesEmbedded_.begin(), ed = triggerObjectMatchesEmbedded_.end(); it != ed; ++it) it->unpackPathNames(names);
200  }
TriggerObjectStandAloneCollection triggerObjectMatchesEmbedded_
vector of trigger matches
Definition: PATObject.h:410
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 792 of file PATObject.h.

References spr::find(), and combine::key.

793  {
794  std::vector<std::string>::const_iterator it = std::find(userCandLabels_.begin(), userCandLabels_.end(), key);
795  if (it != userCandLabels_.end()) {
796  return userCands_[it - userCandLabels_.begin()];
797  }
798  return reco::CandidatePtr();
799  }
std::vector< reco::CandidatePtr > userCands_
Definition: PATObject.h:438
std::vector< std::string > userCandLabels_
Definition: PATObject.h:437
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
Definition: FindCaloHit.cc:7
edm::Ptr< Candidate > CandidatePtr
persistent reference to an object in a collection of Candidate objects
Definition: CandidateFwd.h:25
list key
Definition: combine.py:13
template<class ObjectType>
const std::vector<std::string>& pat::PATObject< ObjectType >::userCandNames ( ) const
inline

Get list of user-defined cand names.

Definition at line 349 of file PATObject.h.

349 { return userCandLabels_; }
std::vector< std::string > userCandLabels_
Definition: PATObject.h:437
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 272 of file PATObject.h.

272  {
274  return (data != 0 ? data->template get<T>() : 0);
275 
276  }
const pat::UserData * userDataObject_(const std::string &key) const
Definition: PATObject.h:745
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:82
list key
Definition: combine.py:13
Base class for data that users can add to pat objects.
Definition: UserData.h:25
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 292 of file PATObject.h.

292  {
294  return (data != 0 ? data->bareData() : 0);
295  }
const pat::UserData * userDataObject_(const std::string &key) const
Definition: PATObject.h:745
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:82
list key
Definition: combine.py:13
Base class for data that users can add to pat objects.
Definition: UserData.h:25
const void * bareData() const
Definition: UserData.h:50
template<class ObjectType>
const std::vector<std::string>& pat::PATObject< ObjectType >::userDataNames ( ) const
inline

Get list of user data object names.

Definition at line 288 of file PATObject.h.

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

Definition at line 745 of file PATObject.h.

References spr::find(), and combine::key.

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

746  {
747  std::vector<std::string>::const_iterator it = std::find(userDataLabels_.begin(), userDataLabels_.end(), key);
748  if (it != userDataLabels_.end()) {
749  return & userDataObjects_[it - userDataLabels_.begin()];
750  }
751  return 0;
752  }
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
Definition: FindCaloHit.cc:7
std::vector< std::string > userDataLabels_
User data object.
Definition: PATObject.h:428
pat::UserDataCollection userDataObjects_
Definition: PATObject.h:429
list key
Definition: combine.py:13
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 282 of file PATObject.h.

282  {
283  static const std::string EMPTY("");
285  return (data != 0 ? data->typeName() : EMPTY);
286  };
const pat::UserData * userDataObject_(const std::string &key) const
Definition: PATObject.h:745
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:82
list key
Definition: combine.py:13
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:25
template<class ObjectType >
float pat::PATObject< ObjectType >::userFloat ( const std::string &  key) const

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

Definition at line 755 of file PATObject.h.

References spr::find(), and combine::key.

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

756  {
757  std::vector<std::string>::const_iterator it = std::find(userFloatLabels_.begin(), userFloatLabels_.end(), key);
758  if (it != userFloatLabels_.end()) {
759  return userFloats_[it - userFloatLabels_.begin()];
760  }
761  return 0.0;
762  }
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
Definition: FindCaloHit.cc:7
std::vector< float > userFloats_
Definition: PATObject.h:432
std::vector< std::string > userFloatLabels_
Definition: PATObject.h:431
list key
Definition: combine.py:13
template<class ObjectType>
float pat::PATObject< ObjectType >::userFloat ( const char *  key) const
inline

a CINT-friendly interface

Definition at line 318 of file PATObject.h.

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

318 { return userFloat( std::string(key) ); }
float userFloat(const std::string &key) const
Definition: PATObject.h:755
list key
Definition: combine.py:13
template<class ObjectType>
const std::vector<std::string>& pat::PATObject< ObjectType >::userFloatNames ( ) const
inline

Get list of user-defined float names.

Definition at line 323 of file PATObject.h.

323 { return userFloatLabels_; }
std::vector< std::string > userFloatLabels_
Definition: PATObject.h:431
template<class ObjectType >
int pat::PATObject< ObjectType >::userInt ( const std::string &  key) const

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

Definition at line 774 of file PATObject.h.

References spr::find(), and combine::key.

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

775  {
776  std::vector<std::string>::const_iterator it = std::find(userIntLabels_.begin(), userIntLabels_.end(), key);
777  if (it != userIntLabels_.end()) {
778  return userInts_[it - userIntLabels_.begin()];
779  }
780  return 0;
781  }
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
Definition: FindCaloHit.cc:7
list key
Definition: combine.py:13
std::vector< int32_t > userInts_
Definition: PATObject.h:435
std::vector< std::string > userIntLabels_
Definition: PATObject.h:434
template<class ObjectType>
const std::vector<std::string>& pat::PATObject< ObjectType >::userIntNames ( ) const
inline

Get list of user-defined int names.

Definition at line 337 of file PATObject.h.

337 { return userIntLabels_; }
std::vector< std::string > userIntLabels_
Definition: PATObject.h:434

Member Data Documentation

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

vector of the efficiencies (names)

Definition at line 415 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 413 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 420 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 418 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 444 of file PATObject.h.

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

Kinematic resolutions.

Definition at line 441 of file PATObject.h.

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

Overlapping items (sorted by distance)

Definition at line 425 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 423 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 438 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 432 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 435 of file PATObject.h.