CMS 3D CMS Logo

List of all members | Public Member Functions | Private Attributes
pat::TriggerCondition Class Reference

Analysis-level L1 trigger condition class. More...

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

Public Member Functions

void addObjectKey (unsigned objectKey)
 Add a new trigger object collection index. More...
 
void addTriggerObjectType (trigger::TriggerObjectType triggerObjectType)
 Add a new trigger object type. More...
 
void addTriggerObjectType (int triggerObjectType)
 
int category () const
 Get the condition category. More...
 
bool hasObjectKey (unsigned objectKey) const
 Checks, if a certain trigger object collection index is assigned. More...
 
bool hasTriggerObjectType (trigger::TriggerObjectType triggerObjectType) const
 Checks, if a certain trigger object type is assigned. More...
 
bool hasTriggerObjectType (int triggerObjectType) const
 
const std::string & name () const
 Get the filter label. More...
 
const std::vector< unsigned > & objectKeys () const
 Get all trigger object collection indeces. More...
 
void setAccept (bool accept)
 Set the success flag. More...
 
void setCategory (L1GtConditionCategory category)
 Set the condition category. More...
 
void setCategory (int category)
 
void setName (const std::string &name)
 Methods. More...
 
void setType (L1GtConditionType type)
 Set the condition type. More...
 
void setType (int type)
 
 TriggerCondition ()
 Constructors and Desctructor. More...
 
 TriggerCondition (const std::string &name)
 Constructor from condition name "only". More...
 
 TriggerCondition (const std::string &name, bool accept)
 Constructor from values. More...
 
std::vector< int > triggerObjectTypes () const
 Get the trigger object types. More...
 
int type () const
 Get the condition type. More...
 
bool wasAccept () const
 Get the success flag. More...
 
virtual ~TriggerCondition ()
 Destructor. More...
 

Private Attributes

bool accept_
 Did condition succeed? More...
 
L1GtConditionCategory category_
 L1 condition category as defined in CondFormats/L1TObjects/interface/L1GtFwd.h. More...
 
std::string name_
 Data Members. More...
 
std::vector< unsigned > objectKeys_
 
std::vector< trigger::TriggerObjectTypetriggerObjectTypes_
 
L1GtConditionType type_
 L1 condition type as defined in CondFormats/L1TObjects/interface/L1GtFwd.h. More...
 

Detailed Description

Analysis-level L1 trigger condition class.

TriggerCondition implements a container for trigger conditions' information within the 'pat' namespace. For detailed information, consult https://twiki.cern.ch/twiki/bin/view/CMS/SWGuidePATTrigger#TriggerCondition

Author
Volker Adler

Definition at line 36 of file TriggerCondition.h.

Constructor & Destructor Documentation

TriggerCondition::TriggerCondition ( )

Constructors and Desctructor.

Default constructor

Definition at line 15 of file TriggerCondition.cc.

References objectKeys_, and triggerObjectTypes_.

15  :
16  name_()
17 , accept_()
18 , category_()
19 , type_()
20 {
21  triggerObjectTypes_.clear();
22  objectKeys_.clear();
23 }
L1GtConditionType type_
L1 condition type as defined in CondFormats/L1TObjects/interface/L1GtFwd.h.
std::vector< trigger::TriggerObjectType > triggerObjectTypes_
std::string name_
Data Members.
L1GtConditionCategory category_
L1 condition category as defined in CondFormats/L1TObjects/interface/L1GtFwd.h.
std::vector< unsigned > objectKeys_
bool accept_
Did condition succeed?
TriggerCondition::TriggerCondition ( const std::string &  name)

Constructor from condition name "only".

Definition at line 27 of file TriggerCondition.cc.

References objectKeys_, and triggerObjectTypes_.

27  :
28  name_( name )
29 , accept_()
30 , category_()
31 , type_()
32 {
33  triggerObjectTypes_.clear();
34  objectKeys_.clear();
35 }
L1GtConditionType type_
L1 condition type as defined in CondFormats/L1TObjects/interface/L1GtFwd.h.
std::vector< trigger::TriggerObjectType > triggerObjectTypes_
const std::string & name() const
Get the filter label.
std::string name_
Data Members.
L1GtConditionCategory category_
L1 condition category as defined in CondFormats/L1TObjects/interface/L1GtFwd.h.
std::vector< unsigned > objectKeys_
bool accept_
Did condition succeed?
TriggerCondition::TriggerCondition ( const std::string &  name,
bool  accept 
)

Constructor from values.

Definition at line 39 of file TriggerCondition.cc.

References objectKeys_, and triggerObjectTypes_.

39  :
40  name_( name )
41 , accept_( accept )
42 , category_()
43 , type_()
44 {
45  triggerObjectTypes_.clear();
46  objectKeys_.clear();
47 }
L1GtConditionType type_
L1 condition type as defined in CondFormats/L1TObjects/interface/L1GtFwd.h.
bool accept(const edm::Event &event, const edm::TriggerResults &triggerTable, const std::string &triggerPath)
Definition: TopDQMHelpers.h:30
std::vector< trigger::TriggerObjectType > triggerObjectTypes_
const std::string & name() const
Get the filter label.
std::string name_
Data Members.
L1GtConditionCategory category_
L1 condition category as defined in CondFormats/L1TObjects/interface/L1GtFwd.h.
std::vector< unsigned > objectKeys_
bool accept_
Did condition succeed?
virtual pat::TriggerCondition::~TriggerCondition ( )
inlinevirtual

Destructor.

Definition at line 68 of file TriggerCondition.h.

68 {};

Member Function Documentation

void pat::TriggerCondition::addObjectKey ( unsigned  objectKey)
inline

Add a new trigger object collection index.

Definition at line 86 of file TriggerCondition.h.

References hasObjectKey().

86 { if ( ! hasObjectKey( objectKey ) ) objectKeys_.push_back( objectKey ); };
bool hasObjectKey(unsigned objectKey) const
Checks, if a certain trigger object collection index is assigned.
std::vector< unsigned > objectKeys_
void pat::TriggerCondition::addTriggerObjectType ( trigger::TriggerObjectType  triggerObjectType)
inline

Add a new trigger object type.

Definition at line 83 of file TriggerCondition.h.

83 { triggerObjectTypes_.push_back( triggerObjectType ); }; // explicitely NOT checking for existence
std::vector< trigger::TriggerObjectType > triggerObjectTypes_
void pat::TriggerCondition::addTriggerObjectType ( int  triggerObjectType)
inline

Definition at line 84 of file TriggerCondition.h.

References addTriggerObjectType().

Referenced by addTriggerObjectType().

84 { addTriggerObjectType( trigger::TriggerObjectType( triggerObjectType ) ); };
void addTriggerObjectType(trigger::TriggerObjectType triggerObjectType)
Add a new trigger object type.
int pat::TriggerCondition::category ( ) const
inline

Get the condition category.

Definition at line 92 of file TriggerCondition.h.

References createfilelist::int.

Referenced by setCategory().

92 { return int( category_ ); };
L1GtConditionCategory category_
L1 condition category as defined in CondFormats/L1TObjects/interface/L1GtFwd.h.
bool TriggerCondition::hasObjectKey ( unsigned  objectKey) const

Checks, if a certain trigger object collection index is assigned.

Definition at line 75 of file TriggerCondition.cc.

References objectKeys_.

Referenced by addObjectKey(), and objectKeys().

76 {
77  for ( size_t iO = 0; iO < objectKeys_.size(); ++iO ) {
78  if ( objectKeys_.at( iO ) == objectKey ) return true;
79  }
80  return false;
81 }
std::vector< unsigned > objectKeys_
bool TriggerCondition::hasTriggerObjectType ( trigger::TriggerObjectType  triggerObjectType) const

Checks, if a certain trigger object type is assigned.

Definition at line 65 of file TriggerCondition.cc.

References triggerObjectTypes_.

Referenced by type().

66 {
67  for ( size_t iT = 0; iT < triggerObjectTypes_.size(); ++iT ) {
68  if ( triggerObjectTypes_.at( iT ) == triggerObjectType ) return true;
69  }
70  return false;
71 }
std::vector< trigger::TriggerObjectType > triggerObjectTypes_
bool pat::TriggerCondition::hasTriggerObjectType ( int  triggerObjectType) const
inline

Definition at line 99 of file TriggerCondition.h.

References hasTriggerObjectType().

Referenced by hasTriggerObjectType().

99 { return hasTriggerObjectType( trigger::TriggerObjectType( triggerObjectType ) ); };
bool hasTriggerObjectType(trigger::TriggerObjectType triggerObjectType) const
Checks, if a certain trigger object type is assigned.
const std::string& pat::TriggerCondition::name ( ) const
inline

Get the filter label.

Definition at line 88 of file TriggerCondition.h.

References name_.

Referenced by config.CFG::__str__(), validation.Sample::digest(), VIDSelectorBase.VIDSelectorBase::initialize(), setName(), and Vispa.Views.PropertyView.Property::valueChanged().

88 { return name_; };
std::string name_
Data Members.
const std::vector< unsigned >& pat::TriggerCondition::objectKeys ( ) const
inline

Get all trigger object collection indeces.

Definition at line 101 of file TriggerCondition.h.

References hasObjectKey(), and objectKeys_.

101 { return objectKeys_; };
std::vector< unsigned > objectKeys_
void pat::TriggerCondition::setAccept ( bool  accept)
inline

Set the success flag.

Definition at line 75 of file TriggerCondition.h.

References accept().

75 { accept_ = accept; };
bool accept(const edm::Event &event, const edm::TriggerResults &triggerTable, const std::string &triggerPath)
Definition: TopDQMHelpers.h:30
bool accept_
Did condition succeed?
void pat::TriggerCondition::setCategory ( L1GtConditionCategory  category)
inline

Set the condition category.

Definition at line 77 of file TriggerCondition.h.

References category().

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

77 { category_ = category; };
int category() const
Get the condition category.
L1GtConditionCategory category_
L1 condition category as defined in CondFormats/L1TObjects/interface/L1GtFwd.h.
void pat::TriggerCondition::setCategory ( int  category)
inline

Definition at line 78 of file TriggerCondition.h.

L1GtConditionCategory
condition categories
int category() const
Get the condition category.
L1GtConditionCategory category_
L1 condition category as defined in CondFormats/L1TObjects/interface/L1GtFwd.h.
void pat::TriggerCondition::setName ( const std::string &  name)
inline

Methods.

Set the condition name

Definition at line 73 of file TriggerCondition.h.

References name().

Referenced by Vispa.Gui.PortWidget.PortWidget::__init__(), and Vispa.Views.PropertyView.Property::__init__().

73 { name_ = name; };
const std::string & name() const
Get the filter label.
std::string name_
Data Members.
void pat::TriggerCondition::setType ( L1GtConditionType  type)
inline

Set the condition type.

Definition at line 80 of file TriggerCondition.h.

References type().

80 { type_ = type; };
L1GtConditionType type_
L1 condition type as defined in CondFormats/L1TObjects/interface/L1GtFwd.h.
int type() const
Get the condition type.
void pat::TriggerCondition::setType ( int  type)
inline

Definition at line 81 of file TriggerCondition.h.

81 { type_ = L1GtConditionType( type ); };
type
Definition: HCALResponse.h:21
L1GtConditionType type_
L1 condition type as defined in CondFormats/L1TObjects/interface/L1GtFwd.h.
L1GtConditionType
std::vector< int > TriggerCondition::triggerObjectTypes ( ) const

Get the trigger object types.

Definition at line 54 of file TriggerCondition.cc.

References triggerObjectTypes_.

Referenced by type().

55 {
56  std::vector< int > triggerObjectTypes;
57  for ( size_t iT = 0; iT < triggerObjectTypes_.size(); ++iT ) {
58  triggerObjectTypes.push_back( int( triggerObjectTypes_.at( iT ) ) );
59  }
60  return triggerObjectTypes;
61 }
std::vector< int > triggerObjectTypes() const
Get the trigger object types.
std::vector< trigger::TriggerObjectType > triggerObjectTypes_
int pat::TriggerCondition::type ( ) const
inline
bool pat::TriggerCondition::wasAccept ( ) const
inline

Get the success flag.

Definition at line 90 of file TriggerCondition.h.

References accept_.

90 { return accept_; };
bool accept_
Did condition succeed?

Member Data Documentation

bool pat::TriggerCondition::accept_
private

Did condition succeed?

Definition at line 43 of file TriggerCondition.h.

Referenced by wasAccept().

L1GtConditionCategory pat::TriggerCondition::category_
private

L1 condition category as defined in CondFormats/L1TObjects/interface/L1GtFwd.h.

Definition at line 45 of file TriggerCondition.h.

std::string pat::TriggerCondition::name_
private

Data Members.

Name of the condition

Definition at line 41 of file TriggerCondition.h.

Referenced by name().

std::vector< unsigned > pat::TriggerCondition::objectKeys_
private

Indeces of trigger objects from succeeding combinations in pat::TriggerObjectCollection in event as produced together with the pat::TriggerAlgorithmCollection

Definition at line 54 of file TriggerCondition.h.

Referenced by hasObjectKey(), objectKeys(), and TriggerCondition().

std::vector< trigger::TriggerObjectType > pat::TriggerCondition::triggerObjectTypes_
private

Special identifiers for the used trigger object type as defined in DataFormats/HLTReco/interface/TriggerTypeDefs.h translated from L1GtObject type (DataFormats/L1GlobalTrigger/interface/L1GlobalTriggerReadoutSetupFwd.h)

Definition at line 51 of file TriggerCondition.h.

Referenced by hasTriggerObjectType(), TriggerCondition(), and triggerObjectTypes().

L1GtConditionType pat::TriggerCondition::type_
private