CMS 3D CMS Logo

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules 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::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 34 of file TriggerCondition.h.

Constructor & Destructor Documentation

◆ TriggerCondition() [1/3]

TriggerCondition::TriggerCondition ( )

Constructors and Desctructor.

Default constructor

Definition at line 11 of file TriggerCondition.cc.

References objectKeys_, and triggerObjectTypes_.

11  : name_(), accept_(), category_(), type_() {
12  triggerObjectTypes_.clear();
13  objectKeys_.clear();
14 }
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() [2/3]

TriggerCondition::TriggerCondition ( const std::string &  name)

Constructor from condition name "only".

Definition at line 17 of file TriggerCondition.cc.

References objectKeys_, and triggerObjectTypes_.

17  : name_(name), accept_(), category_(), type_() {
18  triggerObjectTypes_.clear();
19  objectKeys_.clear();
20 }
L1GtConditionType type_
L1 condition type as defined in CondFormats/L1TObjects/interface/L1GtFwd.h.
const std::string & name() const
Get the filter label.
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() [3/3]

TriggerCondition::TriggerCondition ( const std::string &  name,
bool  accept 
)

Constructor from values.

Definition at line 23 of file TriggerCondition.cc.

References objectKeys_, and triggerObjectTypes_.

24  : name_(name), accept_(accept), category_(), type_() {
25  triggerObjectTypes_.clear();
26  objectKeys_.clear();
27 }
L1GtConditionType type_
L1 condition type as defined in CondFormats/L1TObjects/interface/L1GtFwd.h.
const std::string & name() const
Get the filter label.
bool accept(const edm::Event &event, const edm::TriggerResults &triggerTable, const std::string &triggerPath)
Definition: TopDQMHelpers.h:31
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()

virtual pat::TriggerCondition::~TriggerCondition ( )
inlinevirtual

Destructor.

Definition at line 64 of file TriggerCondition.h.

64 {};

Member Function Documentation

◆ addObjectKey()

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

Add a new trigger object collection index.

Definition at line 86 of file TriggerCondition.h.

References hasObjectKey(), and objectKeys_.

86  {
87  if (!hasObjectKey(objectKey))
88  objectKeys_.push_back(objectKey);
89  };
bool hasObjectKey(unsigned objectKey) const
Checks, if a certain trigger object collection index is assigned.
std::vector< unsigned > objectKeys_

◆ addTriggerObjectType() [1/2]

void pat::TriggerCondition::addTriggerObjectType ( trigger::TriggerObjectType  triggerObjectType)
inline

Add a new trigger object type.

Definition at line 79 of file TriggerCondition.h.

References triggerObjectTypes_.

Referenced by addTriggerObjectType().

79  {
80  triggerObjectTypes_.push_back(triggerObjectType);
81  }; // explicitely NOT checking for existence
std::vector< trigger::TriggerObjectType > triggerObjectTypes_

◆ addTriggerObjectType() [2/2]

void pat::TriggerCondition::addTriggerObjectType ( int  triggerObjectType)
inline

Definition at line 82 of file TriggerCondition.h.

References addTriggerObjectType().

82  {
84  };
void addTriggerObjectType(trigger::TriggerObjectType triggerObjectType)
Add a new trigger object type.

◆ category()

int pat::TriggerCondition::category ( ) const
inline

Get the condition category.

Definition at line 95 of file TriggerCondition.h.

References category_, and createfilelist::int.

Referenced by setCategory().

95 { return int(category_); };
L1GtConditionCategory category_
L1 condition category as defined in CondFormats/L1TObjects/interface/L1GtFwd.h.

◆ hasObjectKey()

bool TriggerCondition::hasObjectKey ( unsigned  objectKey) const

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

Definition at line 50 of file TriggerCondition.cc.

References objectKeys_.

Referenced by addObjectKey().

50  {
51  for (size_t iO = 0; iO < objectKeys_.size(); ++iO) {
52  if (objectKeys_.at(iO) == objectKey)
53  return true;
54  }
55  return false;
56 }
std::vector< unsigned > objectKeys_

◆ hasTriggerObjectType() [1/2]

bool TriggerCondition::hasTriggerObjectType ( trigger::TriggerObjectType  triggerObjectType) const

Checks, if a certain trigger object type is assigned.

Definition at line 41 of file TriggerCondition.cc.

References triggerObjectTypes_.

Referenced by hasTriggerObjectType().

41  {
42  for (size_t iT = 0; iT < triggerObjectTypes_.size(); ++iT) {
43  if (triggerObjectTypes_.at(iT) == triggerObjectType)
44  return true;
45  }
46  return false;
47 }
std::vector< trigger::TriggerObjectType > triggerObjectTypes_

◆ hasTriggerObjectType() [2/2]

bool pat::TriggerCondition::hasTriggerObjectType ( int  triggerObjectType) const
inline

Definition at line 102 of file TriggerCondition.h.

References hasTriggerObjectType().

102  {
103  return hasTriggerObjectType(trigger::TriggerObjectType(triggerObjectType));
104  };
bool hasTriggerObjectType(trigger::TriggerObjectType triggerObjectType) const
Checks, if a certain trigger object type is assigned.

◆ name()

const std::string& pat::TriggerCondition::name ( ) const
inline

Get the filter label.

Definition at line 91 of file TriggerCondition.h.

References name_.

Referenced by config.CFG::__str__(), validation.Sample::digest(), VIDSelectorBase.VIDSelectorBase::initialize(), and setName().

91 { return name_; };
std::string name_
Data Members.

◆ objectKeys()

const std::vector<unsigned>& pat::TriggerCondition::objectKeys ( ) const
inline

Get all trigger object collection indeces.

Definition at line 106 of file TriggerCondition.h.

References objectKeys_.

106 { return objectKeys_; };
std::vector< unsigned > objectKeys_

◆ setAccept()

void pat::TriggerCondition::setAccept ( bool  accept)
inline

Set the success flag.

Definition at line 71 of file TriggerCondition.h.

References accept(), and accept_.

71 { accept_ = accept; };
bool accept(const edm::Event &event, const edm::TriggerResults &triggerTable, const std::string &triggerPath)
Definition: TopDQMHelpers.h:31
bool accept_
Did condition succeed?

◆ setCategory() [1/2]

void pat::TriggerCondition::setCategory ( L1GtConditionCategory  category)
inline

Set the condition category.

Definition at line 73 of file TriggerCondition.h.

References category(), and category_.

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

73 { category_ = category; };
int category() const
Get the condition category.
L1GtConditionCategory category_
L1 condition category as defined in CondFormats/L1TObjects/interface/L1GtFwd.h.

◆ setCategory() [2/2]

void pat::TriggerCondition::setCategory ( int  category)
inline

Definition at line 74 of file TriggerCondition.h.

References category(), and category_.

int category() const
Get the condition category.
L1GtConditionCategory category_
L1 condition category as defined in CondFormats/L1TObjects/interface/L1GtFwd.h.
L1GtConditionCategory
condition categories

◆ setName()

void pat::TriggerCondition::setName ( const std::string &  name)
inline

Methods.

Set the condition name

Definition at line 69 of file TriggerCondition.h.

References name(), and name_.

69 { name_ = name; };
const std::string & name() const
Get the filter label.
std::string name_
Data Members.

◆ setType() [1/2]

void pat::TriggerCondition::setType ( L1GtConditionType  type)
inline

Set the condition type.

Definition at line 76 of file TriggerCondition.h.

References type(), and type_.

76 { type_ = type; };
L1GtConditionType type_
L1 condition type as defined in CondFormats/L1TObjects/interface/L1GtFwd.h.
int type() const
Get the condition type.

◆ setType() [2/2]

void pat::TriggerCondition::setType ( int  type)
inline

Definition at line 77 of file TriggerCondition.h.

References type_.

L1GtConditionType type_
L1 condition type as defined in CondFormats/L1TObjects/interface/L1GtFwd.h.
L1GtConditionType

◆ triggerObjectTypes()

std::vector< int > TriggerCondition::triggerObjectTypes ( ) const

Get the trigger object types.

Definition at line 32 of file TriggerCondition.cc.

References triggerObjectTypes_.

32  {
33  std::vector<int> triggerObjectTypes;
34  for (size_t iT = 0; iT < triggerObjectTypes_.size(); ++iT) {
35  triggerObjectTypes.push_back(int(triggerObjectTypes_.at(iT)));
36  }
37  return triggerObjectTypes;
38 }
std::vector< int > triggerObjectTypes() const
Get the trigger object types.
std::vector< trigger::TriggerObjectType > triggerObjectTypes_

◆ type()

int pat::TriggerCondition::type ( ) const
inline

Get the condition type.

Definition at line 97 of file TriggerCondition.h.

References createfilelist::int, and type_.

Referenced by setType().

97 { return int(type_); };
L1GtConditionType type_
L1 condition type as defined in CondFormats/L1TObjects/interface/L1GtFwd.h.

◆ wasAccept()

bool pat::TriggerCondition::wasAccept ( ) const
inline

Get the success flag.

Definition at line 93 of file TriggerCondition.h.

References accept_.

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

Member Data Documentation

◆ accept_

bool pat::TriggerCondition::accept_
private

Did condition succeed?

Definition at line 40 of file TriggerCondition.h.

Referenced by setAccept(), and wasAccept().

◆ category_

L1GtConditionCategory pat::TriggerCondition::category_
private

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

Definition at line 42 of file TriggerCondition.h.

Referenced by category(), and setCategory().

◆ name_

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

Data Members.

Name of the condition

Definition at line 38 of file TriggerCondition.h.

Referenced by name(), and setName().

◆ objectKeys_

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

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

◆ triggerObjectTypes_

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

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

◆ type_

L1GtConditionType pat::TriggerCondition::type_
private