CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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::TriggerObjectType
triggerObjectTypes_
 
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
Version
Id:
TriggerCondition.h,v 1.2 2013/06/11 13:24:49 vadler Exp

Definition at line 38 of file TriggerCondition.h.

Constructor & Destructor Documentation

TriggerCondition::TriggerCondition ( )

Constructors and Desctructor.

Default constructor

Definition at line 16 of file TriggerCondition.cc.

References objectKeys_, and triggerObjectTypes_.

16  :
17  name_()
18 , accept_()
19 , category_()
20 , type_()
21 {
22  triggerObjectTypes_.clear();
23  objectKeys_.clear();
24 }
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 28 of file TriggerCondition.cc.

References objectKeys_, and triggerObjectTypes_.

28  :
29  name_( name )
30 , accept_()
31 , category_()
32 , type_()
33 {
34  triggerObjectTypes_.clear();
35  objectKeys_.clear();
36 }
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 40 of file TriggerCondition.cc.

References objectKeys_, and triggerObjectTypes_.

40  :
41  name_( name )
42 , accept_( accept )
43 , category_()
44 , type_()
45 {
46  triggerObjectTypes_.clear();
47  objectKeys_.clear();
48 }
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:22
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 70 of file TriggerCondition.h.

70 {};

Member Function Documentation

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

Add a new trigger object collection index.

Definition at line 88 of file TriggerCondition.h.

References hasObjectKey(), and objectKeys_.

88 { 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 85 of file TriggerCondition.h.

References triggerObjectTypes_.

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

Definition at line 86 of file TriggerCondition.h.

References addTriggerObjectType().

Referenced by addTriggerObjectType().

86 { 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 94 of file TriggerCondition.h.

References category_.

Referenced by setCategory().

94 { 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 76 of file TriggerCondition.cc.

References objectKeys_.

Referenced by addObjectKey().

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

Checks, if a certain trigger object type is assigned.

Definition at line 66 of file TriggerCondition.cc.

References triggerObjectTypes_.

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

Definition at line 101 of file TriggerCondition.h.

References hasTriggerObjectType().

Referenced by hasTriggerObjectType().

101 { 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 90 of file TriggerCondition.h.

References name_.

Referenced by setName(), and Vispa.Views.PropertyView.Property::valueChanged().

90 { 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 103 of file TriggerCondition.h.

References objectKeys_.

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

Set the success flag.

Definition at line 77 of file TriggerCondition.h.

References accept(), and accept_.

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

Set the condition category.

Definition at line 79 of file TriggerCondition.h.

References category(), and category_.

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

79 { 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 80 of file TriggerCondition.h.

References category_.

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 75 of file TriggerCondition.h.

References name(), and name_.

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

75 { 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 82 of file TriggerCondition.h.

References type(), and type_.

82 { 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 83 of file TriggerCondition.h.

References type_.

83 { type_ = L1GtConditionType( type ); };
type
Definition: HCALResponse.h:22
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 55 of file TriggerCondition.cc.

References triggerObjectTypes_.

56 {
57  std::vector< int > triggerObjectTypes;
58  for ( size_t iT = 0; iT < triggerObjectTypes_.size(); ++iT ) {
59  triggerObjectTypes.push_back( int( triggerObjectTypes_.at( iT ) ) );
60  }
61  return triggerObjectTypes;
62 }
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 92 of file TriggerCondition.h.

References accept_.

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

Member Data Documentation

bool pat::TriggerCondition::accept_
private

Did condition succeed?

Definition at line 45 of file TriggerCondition.h.

Referenced by setAccept(), and wasAccept().

L1GtConditionCategory pat::TriggerCondition::category_
private

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

Definition at line 47 of file TriggerCondition.h.

Referenced by category(), and setCategory().

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

Data Members.

Name of the condition

Definition at line 43 of file TriggerCondition.h.

Referenced by name(), and setName().

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 56 of file TriggerCondition.h.

Referenced by addObjectKey(), 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 53 of file TriggerCondition.h.

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

L1GtConditionType pat::TriggerCondition::type_
private