Analysis-level trigger object class. More...
#include <DataFormats/PatCandidates/interface/TriggerObject.h>
Public Member Functions | |
void | addFilterId (trigger::TriggerObjectType triggerObjectType) |
void | addFilterId (int triggerObjectType) |
void | addTriggerObjectType (int triggerObjectType) |
void | addTriggerObjectType (trigger::TriggerObjectType triggerObjectType) |
Add a new trigger object type identifier. | |
virtual bool | coll (const std::string &collName) const |
Calls 'hasCollection(...)'. | |
std::string | collection () const |
Get the label of the collection the trigger object originates from. | |
std::vector< int > | filterIds () const |
virtual bool | hasCollection (const std::string &collName) const |
Checks, if a certain label of original collection is assigned. | |
virtual bool | hasCollection (const edm::InputTag &collName) const |
bool | hasFilterId (trigger::TriggerObjectType triggerObjectType) const |
bool | hasFilterId (int triggerObjectType) const |
bool | hasTriggerObjectType (trigger::TriggerObjectType triggerObjectType) const |
Checks, if a certain trigger object type identifier is assigned. | |
bool | hasTriggerObjectType (int triggerObjectType) const |
bool | id (trigger::TriggerObjectType triggerObjectType) const |
bool | id (int triggerObjectType) const |
const l1extra::L1EmParticleRef | origL1EmRef () const |
const l1extra::L1EtMissParticleRef | origL1EtMissRef () const |
| |
const L1GctEmCand * | origL1GctEmCand () const |
const L1GctEtHad * | origL1GctEtHad () const |
const L1GctEtMiss * | origL1GctEtMiss () const |
const L1GctEtTotal * | origL1GctEtTotal () const |
const L1GctHtMiss * | origL1GctHtMiss () const |
const L1GctJetCand * | origL1GctJetCand () const |
const L1MuGMTExtendedCand * | origL1GmtMuonCand () const |
const l1extra::L1JetParticleRef | origL1JetRef () const |
| |
const l1extra::L1MuonParticleRef | origL1MuonRef () const |
| |
const reco::Candidate * | origObjCand () const |
const reco::CandidateBaseRef & | origObjRef () const |
Special methods for 'l1extra' particles. | |
void | setCollection (const std::string &collName) |
Methods. | |
void | setCollection (const edm::InputTag &collName) |
TriggerObject (const trigger::TriggerObject &trigObj) | |
Constructor from trigger::TriggerObject. | |
TriggerObject () | |
Constructors and Destructor. | |
TriggerObject (const reco::LeafCandidate &leafCand) | |
Constructors from base class object. | |
TriggerObject (const reco::CandidateBaseRef &candRef) | |
Constructors from base candidate reference (for 'l1extra' particles) | |
TriggerObject (const reco::Particle::PolarLorentzVector &vec, int id=0) | |
TriggerObject (const reco::Particle::LorentzVector &vec, int id=0) | |
Constructors from Lorentz-vectors and (optional) PDG ID. | |
std::vector< int > | triggerObjectTypes () const |
Get all trigger object type identifiers. | |
bool | type (trigger::TriggerObjectType triggerObjectType) const |
Calls 'hasTriggerObjectType(...)'. | |
bool | type (int triggerObjectType) const |
virtual | ~TriggerObject () |
Destructor. | |
Private Attributes | |
std::string | collection_ |
Data Members. | |
reco::CandidateBaseRef | refToOrig_ |
std::vector < trigger::TriggerObjectType > | triggerObjectTypes_ |
Analysis-level trigger object class.
TriggerObject implements a container for trigger objects' information within the 'pat' namespace. For detailed information, consult https://twiki.cern.ch/twiki/bin/view/CMS/SWGuidePATTrigger#TriggerObject
Definition at line 49 of file TriggerObject.h.
TriggerObject::TriggerObject | ( | ) |
Constructors and Destructor.
Default constructor
Definition at line 17 of file TriggerObject.cc.
References triggerObjectTypes_.
: reco::LeafCandidate() { triggerObjectTypes_.clear(); }
TriggerObject::TriggerObject | ( | const trigger::TriggerObject & | trigObj | ) |
Constructor from trigger::TriggerObject.
Definition at line 25 of file TriggerObject.cc.
References triggerObjectTypes_.
: reco::LeafCandidate( 0, trigObj.particle().p4(), reco::Particle::Point( 0., 0., 0. ), trigObj.id() ), refToOrig_() { triggerObjectTypes_.clear(); }
TriggerObject::TriggerObject | ( | const reco::LeafCandidate & | leafCand | ) |
Constructors from base class object.
Definition at line 34 of file TriggerObject.cc.
References triggerObjectTypes_.
: reco::LeafCandidate( leafCand ), refToOrig_() { triggerObjectTypes_.clear(); }
TriggerObject::TriggerObject | ( | const reco::CandidateBaseRef & | candRef | ) |
Constructors from base candidate reference (for 'l1extra' particles)
Definition at line 43 of file TriggerObject.cc.
References triggerObjectTypes_.
: reco::LeafCandidate( *candRef ), refToOrig_( candRef ) { triggerObjectTypes_.clear(); }
TriggerObject::TriggerObject | ( | const reco::Particle::LorentzVector & | vec, |
int | id = 0 |
||
) |
Constructors from Lorentz-vectors and (optional) PDG ID.
Definition at line 52 of file TriggerObject.cc.
References triggerObjectTypes_.
: reco::LeafCandidate( 0, vec, reco::Particle::Point( 0., 0., 0. ), id ), refToOrig_() { triggerObjectTypes_.clear(); }
TriggerObject::TriggerObject | ( | const reco::Particle::PolarLorentzVector & | vec, |
int | id = 0 |
||
) |
Definition at line 58 of file TriggerObject.cc.
References triggerObjectTypes_.
: reco::LeafCandidate( 0, vec, reco::Particle::Point( 0., 0., 0. ), id ), refToOrig_() { triggerObjectTypes_.clear(); }
virtual pat::TriggerObject::~TriggerObject | ( | ) | [inline, virtual] |
void pat::TriggerObject::addFilterId | ( | trigger::TriggerObjectType | triggerObjectType | ) | [inline] |
Definition at line 91 of file TriggerObject.h.
References addTriggerObjectType().
{ addTriggerObjectType( triggerObjectType ); }; // for backward compatibility
void pat::TriggerObject::addFilterId | ( | int | triggerObjectType | ) | [inline] |
Definition at line 92 of file TriggerObject.h.
References addTriggerObjectType().
{ addTriggerObjectType( trigger::TriggerObjectType( triggerObjectType ) ); }; // for backward compatibility
void pat::TriggerObject::addTriggerObjectType | ( | trigger::TriggerObjectType | triggerObjectType | ) | [inline] |
Add a new trigger object type identifier.
Definition at line 89 of file TriggerObject.h.
References hasTriggerObjectType(), and triggerObjectTypes_.
Referenced by addFilterId(), pat::PATTriggerProducer::produce(), and pat::TriggerObjectStandAlone::triggerObject().
{ if ( ! hasTriggerObjectType( triggerObjectType ) ) triggerObjectTypes_.push_back( triggerObjectType ); };
void pat::TriggerObject::addTriggerObjectType | ( | int | triggerObjectType | ) | [inline] |
Definition at line 90 of file TriggerObject.h.
References addTriggerObjectType().
Referenced by addTriggerObjectType().
{ addTriggerObjectType( trigger::TriggerObjectType( triggerObjectType ) ); };
virtual bool pat::TriggerObject::coll | ( | const std::string & | collName | ) | const [inline, virtual] |
Calls 'hasCollection(...)'.
Special methods for the cut string parser
Reimplemented in pat::TriggerObjectStandAlone.
Definition at line 136 of file TriggerObject.h.
References hasCollection().
{ return hasCollection( collName ); };
std::string pat::TriggerObject::collection | ( | ) | const [inline] |
Get the label of the collection the trigger object originates from.
Definition at line 94 of file TriggerObject.h.
References collection_.
Referenced by pat::TriggerObjectStandAlone::hasCollection(), and pat::TriggerObjectStandAlone::triggerObject().
{ return collection_; };
std::vector< int > pat::TriggerObject::filterIds | ( | ) | const [inline] |
Definition at line 99 of file TriggerObject.h.
References triggerObjectTypes().
{ return triggerObjectTypes(); }; // for double backward compatibility
bool TriggerObject::hasCollection | ( | const std::string & | collName | ) | const [virtual] |
Checks, if a certain label of original collection is assigned.
Reimplemented in pat::TriggerObjectStandAlone.
Definition at line 81 of file TriggerObject.cc.
References collection_, edm::InputTag::instance(), edm::InputTag::label(), and edm::InputTag::process().
Referenced by coll().
{ // True, if collection name is simply fine if ( collName == collection_ ) return true; // Check, if collection name possibly fits in an edm::InputTag approach const edm::InputTag collectionTag( collection_ ); const edm::InputTag collTag( collName ); // If evaluated collection tag contains a process name, it must have been found already by identity check if ( collTag.process().empty() ) { // Check instance ... if ( ( collTag.instance().empty() && collectionTag.instance().empty() ) || collTag.instance() == collectionTag.instance() ) { // ... and label return ( collTag.label() == collectionTag.label() ); } } return false; }
virtual bool pat::TriggerObject::hasCollection | ( | const edm::InputTag & | collName | ) | const [inline, virtual] |
Reimplemented in pat::TriggerObjectStandAlone.
Definition at line 102 of file TriggerObject.h.
References edm::InputTag::encode(), and hasCollection().
Referenced by hasCollection().
{ return hasCollection( collName.encode() ); };
bool pat::TriggerObject::hasFilterId | ( | trigger::TriggerObjectType | triggerObjectType | ) | const [inline] |
Definition at line 106 of file TriggerObject.h.
References hasTriggerObjectType().
{ return hasTriggerObjectType( triggerObjectType ); }; // for backward compatibility
bool pat::TriggerObject::hasFilterId | ( | int | triggerObjectType | ) | const [inline] |
Definition at line 107 of file TriggerObject.h.
References hasTriggerObjectType().
{ return hasTriggerObjectType( trigger::TriggerObjectType( triggerObjectType ) ); }; // for backward compatibility
bool TriggerObject::hasTriggerObjectType | ( | trigger::TriggerObjectType | triggerObjectType | ) | const |
Checks, if a certain trigger object type identifier is assigned.
Definition at line 101 of file TriggerObject.cc.
References triggerObjectTypes_.
Referenced by addTriggerObjectType(), hasFilterId(), id(), and type().
{ for ( size_t iF = 0; iF < triggerObjectTypes_.size(); ++iF ) { if ( triggerObjectType == triggerObjectTypes_.at( iF ) ) return true; } return false; }
bool pat::TriggerObject::hasTriggerObjectType | ( | int | triggerObjectType | ) | const [inline] |
Definition at line 105 of file TriggerObject.h.
References hasTriggerObjectType().
Referenced by hasTriggerObjectType().
{ return hasTriggerObjectType( trigger::TriggerObjectType( triggerObjectType ) ); };
bool pat::TriggerObject::id | ( | trigger::TriggerObjectType | triggerObjectType | ) | const [inline] |
Definition at line 140 of file TriggerObject.h.
References hasTriggerObjectType().
{ return hasTriggerObjectType( triggerObjectType ); }; // for backward compatibility
bool pat::TriggerObject::id | ( | int | triggerObjectType | ) | const [inline] |
Definition at line 141 of file TriggerObject.h.
References hasTriggerObjectType().
{ return hasTriggerObjectType( trigger::TriggerObjectType ( triggerObjectType ) ); }; // for backward compatibility
const l1extra::L1EmParticleRef TriggerObject::origL1EmRef | ( | ) | const |
Getters specific to the 'l1extra' particle type for
Definition at line 118 of file TriggerObject.cc.
References edm::RefToBase< T >::castTo(), edm::Exception::categoryCode(), edm::errors::InvalidReference, origObjRef(), and X.
Referenced by origL1GctEmCand().
{ l1extra::L1EmParticleRef l1Ref; try { l1Ref = origObjRef().castTo< l1extra::L1EmParticleRef >(); } catch ( edm::Exception X ) { if ( X.categoryCode() != edm::errors::InvalidReference ) throw X; } return l1Ref; }
const l1extra::L1EtMissParticleRef TriggerObject::origL1EtMissRef | ( | ) | const |
Definition at line 130 of file TriggerObject.cc.
References edm::RefToBase< T >::castTo(), edm::Exception::categoryCode(), edm::errors::InvalidReference, origObjRef(), and X.
Referenced by origL1GctEtHad(), origL1GctEtMiss(), origL1GctEtTotal(), and origL1GctHtMiss().
{ l1extra::L1EtMissParticleRef l1Ref; try { l1Ref = origObjRef().castTo< l1extra::L1EtMissParticleRef >(); } catch ( edm::Exception X ) { if ( X.categoryCode() != edm::errors::InvalidReference ) throw X; } return l1Ref; }
const L1GctEmCand* pat::TriggerObject::origL1GctEmCand | ( | ) | const [inline] |
Definition at line 117 of file TriggerObject.h.
References edm::Ref< C, T, F >::isNonnull(), and origL1EmRef().
{ return origL1EmRef().isNonnull() ? origL1EmRef()->gctEmCand() : 0; };
const L1GctEtHad* pat::TriggerObject::origL1GctEtHad | ( | ) | const [inline] |
Definition at line 123 of file TriggerObject.h.
References edm::Ref< C, T, F >::isNonnull(), and origL1EtMissRef().
{ return origL1EtMissRef().isNonnull() ? origL1EtMissRef()->gctEtHad() : 0; };
const L1GctEtMiss* pat::TriggerObject::origL1GctEtMiss | ( | ) | const [inline] |
Definition at line 120 of file TriggerObject.h.
References edm::Ref< C, T, F >::isNonnull(), and origL1EtMissRef().
{ return origL1EtMissRef().isNonnull() ? origL1EtMissRef()->gctEtMiss() : 0; };
const L1GctEtTotal* pat::TriggerObject::origL1GctEtTotal | ( | ) | const [inline] |
Definition at line 121 of file TriggerObject.h.
References edm::Ref< C, T, F >::isNonnull(), and origL1EtMissRef().
{ return origL1EtMissRef().isNonnull() ? origL1EtMissRef()->gctEtTotal() : 0; };
const L1GctHtMiss* pat::TriggerObject::origL1GctHtMiss | ( | ) | const [inline] |
Definition at line 122 of file TriggerObject.h.
References edm::Ref< C, T, F >::isNonnull(), and origL1EtMissRef().
{ return origL1EtMissRef().isNonnull() ? origL1EtMissRef()->gctHtMiss() : 0; };
const L1GctJetCand* pat::TriggerObject::origL1GctJetCand | ( | ) | const [inline] |
Definition at line 126 of file TriggerObject.h.
References edm::Ref< C, T, F >::isNonnull(), and origL1JetRef().
{ return origL1JetRef().isNonnull() ? origL1JetRef()->gctJetCand() : 0; };
const L1MuGMTExtendedCand* pat::TriggerObject::origL1GmtMuonCand | ( | ) | const [inline] |
Definition at line 129 of file TriggerObject.h.
References edm::Ref< C, T, F >::isNonnull(), and origL1MuonRef().
{ return origL1MuonRef().isNonnull() ? &( origL1MuonRef()->gmtMuonCand() ) : 0; };
const l1extra::L1JetParticleRef TriggerObject::origL1JetRef | ( | ) | const |
Definition at line 142 of file TriggerObject.cc.
References edm::RefToBase< T >::castTo(), edm::Exception::categoryCode(), edm::errors::InvalidReference, origObjRef(), and X.
Referenced by origL1GctJetCand().
{ l1extra::L1JetParticleRef l1Ref; try { l1Ref = origObjRef().castTo< l1extra::L1JetParticleRef >(); } catch ( edm::Exception X ) { if ( X.categoryCode() != edm::errors::InvalidReference ) throw X; } return l1Ref; }
const l1extra::L1MuonParticleRef TriggerObject::origL1MuonRef | ( | ) | const |
Definition at line 154 of file TriggerObject.cc.
References edm::RefToBase< T >::castTo(), edm::Exception::categoryCode(), edm::errors::InvalidReference, origObjRef(), and X.
Referenced by origL1GmtMuonCand().
{ l1extra::L1MuonParticleRef l1Ref; try { l1Ref = origObjRef().castTo< l1extra::L1MuonParticleRef >(); } catch ( edm::Exception X ) { if ( X.categoryCode() != edm::errors::InvalidReference ) throw X; } return l1Ref; }
const reco::Candidate* pat::TriggerObject::origObjCand | ( | ) | const [inline] |
Definition at line 113 of file TriggerObject.h.
References edm::RefToBase< T >::get(), and refToOrig_.
{ return refToOrig_.get(); };
const reco::CandidateBaseRef& pat::TriggerObject::origObjRef | ( | ) | const [inline] |
Special methods for 'l1extra' particles.
General getters
Definition at line 112 of file TriggerObject.h.
References refToOrig_.
Referenced by origL1EmRef(), origL1EtMissRef(), origL1JetRef(), and origL1MuonRef().
{ return refToOrig_; };
void pat::TriggerObject::setCollection | ( | const std::string & | collName | ) | [inline] |
Methods.
Set the label of the collection the trigger object originates from
Definition at line 86 of file TriggerObject.h.
References collection_.
Referenced by pat::PATTriggerProducer::produce(), and pat::TriggerObjectStandAlone::triggerObject().
{ collection_ = collName; };
void pat::TriggerObject::setCollection | ( | const edm::InputTag & | collName | ) | [inline] |
Definition at line 87 of file TriggerObject.h.
References collection_, and edm::InputTag::encode().
{ collection_ = collName.encode(); };
std::vector< int > TriggerObject::triggerObjectTypes | ( | ) | const |
Get all trigger object type identifiers.
Definition at line 70 of file TriggerObject.cc.
References triggerObjectTypes_.
Referenced by filterIds(), and pat::TriggerObjectStandAlone::triggerObject().
{ std::vector< int > triggerObjectTypes; for ( size_t iTo = 0; iTo < triggerObjectTypes_.size(); ++iTo ) { triggerObjectTypes.push_back( triggerObjectTypes_.at( iTo ) ); } return triggerObjectTypes; }
bool pat::TriggerObject::type | ( | trigger::TriggerObjectType | triggerObjectType | ) | const [inline] |
Calls 'hasTriggerObjectType(...)'.
Definition at line 138 of file TriggerObject.h.
References hasTriggerObjectType().
{ return hasTriggerObjectType( triggerObjectType ); };
bool pat::TriggerObject::type | ( | int | triggerObjectType | ) | const [inline] |
Definition at line 139 of file TriggerObject.h.
References hasTriggerObjectType().
{ return hasTriggerObjectType( trigger::TriggerObjectType ( triggerObjectType ) ); };
std::string pat::TriggerObject::collection_ [private] |
Data Members.
Label of the collection the trigger object originates from
Definition at line 54 of file TriggerObject.h.
Referenced by collection(), hasCollection(), and setCollection().
Reference to trigger object, meant for 'l1extra' particles to access their additional functionalities, empty otherwise
Definition at line 62 of file TriggerObject.h.
Referenced by origObjCand(), and origObjRef().
std::vector< trigger::TriggerObjectType > pat::TriggerObject::triggerObjectTypes_ [private] |
Vector of special identifiers for the trigger object type as defined in trigger::TriggerObjectType (DataFormats/HLTReco/interface/TriggerTypeDefs.h), possibly empty
Definition at line 58 of file TriggerObject.h.
Referenced by addTriggerObjectType(), hasTriggerObjectType(), TriggerObject(), and triggerObjectTypes().