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 (int triggerObjectType)
 
void addTriggerObjectType (trigger::TriggerObjectType triggerObjectType)
 Add a new trigger object type. More...
 
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 (int triggerObjectType) const
 
bool hasTriggerObjectType (trigger::TriggerObjectType triggerObjectType) const
 Checks, if a certain trigger object type is assigned. More...
 
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 (int category)
 
void setCategory (L1GtConditionCategory category)
 Set the condition category. More...
 
void setName (const std::string &name)
 Methods. More...
 
void setType (int type)
 
void setType (L1GtConditionType type)
 Set the condition type. More...
 
 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.

11  : name_(), accept_(), category_(), type_() {
12  triggerObjectTypes_.clear();
13  objectKeys_.clear();
14 }

References objectKeys_, and triggerObjectTypes_.

◆ TriggerCondition() [2/3]

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

Constructor from condition name "only".

Definition at line 17 of file TriggerCondition.cc.

17  : name_(name), accept_(), category_(), type_() {
18  triggerObjectTypes_.clear();
19  objectKeys_.clear();
20 }

References objectKeys_, and triggerObjectTypes_.

◆ TriggerCondition() [3/3]

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

Constructor from values.

Definition at line 23 of file TriggerCondition.cc.

24  : name_(name), accept_(accept), category_(), type_() {
25  triggerObjectTypes_.clear();
26  objectKeys_.clear();
27 }

References objectKeys_, and triggerObjectTypes_.

◆ ~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.

86  {
87  if (!hasObjectKey(objectKey))
88  objectKeys_.push_back(objectKey);
89  };

References hasObjectKey(), and objectKeys_.

◆ addTriggerObjectType() [1/2]

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

Definition at line 82 of file TriggerCondition.h.

82  {
84  };

References addTriggerObjectType().

◆ addTriggerObjectType() [2/2]

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

Add a new trigger object type.

Definition at line 79 of file TriggerCondition.h.

79  {
80  triggerObjectTypes_.push_back(triggerObjectType);
81  }; // explicitely NOT checking for existence

References triggerObjectTypes_.

Referenced by addTriggerObjectType().

◆ category()

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

Get the condition category.

Definition at line 95 of file TriggerCondition.h.

95 { return int(category_); };

References category_, and createfilelist::int.

Referenced by setCategory().

◆ 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.

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 }

References objectKeys_.

Referenced by addObjectKey().

◆ hasTriggerObjectType() [1/2]

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

Definition at line 102 of file TriggerCondition.h.

102  {
103  return hasTriggerObjectType(trigger::TriggerObjectType(triggerObjectType));
104  };

References hasTriggerObjectType().

◆ hasTriggerObjectType() [2/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.

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 }

References triggerObjectTypes_.

Referenced by hasTriggerObjectType().

◆ name()

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

Get the filter label.

Definition at line 91 of file TriggerCondition.h.

91 { return name_; };

References name_.

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

◆ objectKeys()

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

Get all trigger object collection indeces.

Definition at line 106 of file TriggerCondition.h.

106 { return objectKeys_; };

References objectKeys_.

◆ setAccept()

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

Set the success flag.

Definition at line 71 of file TriggerCondition.h.

71 { accept_ = accept; };

References accept(), and accept_.

◆ setCategory() [1/2]

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

Definition at line 74 of file TriggerCondition.h.

References category(), and category_.

◆ setCategory() [2/2]

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

Set the condition category.

Definition at line 73 of file TriggerCondition.h.

73 { category_ = category; };

References category(), and category_.

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

◆ setName()

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

Methods.

Set the condition name

Definition at line 69 of file TriggerCondition.h.

69 { name_ = name; };

References name(), and name_.

◆ setType() [1/2]

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

Definition at line 77 of file TriggerCondition.h.

References type_.

◆ setType() [2/2]

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

Set the condition type.

Definition at line 76 of file TriggerCondition.h.

76 { type_ = type; };

References type(), and type_.

◆ triggerObjectTypes()

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

Get the trigger object types.

Definition at line 32 of file TriggerCondition.cc.

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 }

References triggerObjectTypes_.

◆ type()

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

Get the condition type.

Definition at line 97 of file TriggerCondition.h.

97 { return int(type_); };

References createfilelist::int, and type_.

Referenced by setType().

◆ wasAccept()

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

Get the success flag.

Definition at line 93 of file TriggerCondition.h.

93 { return accept_; };

References accept_.

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
trigger::TriggerObjectType
TriggerObjectType
Definition: TriggerTypeDefs.h:23
pat::TriggerCondition::name_
std::string name_
Data Members.
Definition: TriggerCondition.h:38
pat::TriggerCondition::hasObjectKey
bool hasObjectKey(unsigned objectKey) const
Checks, if a certain trigger object collection index is assigned.
Definition: TriggerCondition.cc:50
pat::TriggerCondition::objectKeys_
std::vector< unsigned > objectKeys_
Definition: TriggerCondition.h:51
pat::TriggerCondition::type
int type() const
Get the condition type.
Definition: TriggerCondition.h:97
pat::TriggerCondition::name
const std::string & name() const
Get the filter label.
Definition: TriggerCondition.h:91
L1GtConditionType
L1GtConditionType
Definition: L1GtDefinitions.h:91
pat::TriggerCondition::accept_
bool accept_
Did condition succeed?
Definition: TriggerCondition.h:40
accept
bool accept(const edm::Event &event, const edm::TriggerResults &triggerTable, const std::string &triggerPath)
Definition: TopDQMHelpers.h:30
pat::TriggerCondition::type_
L1GtConditionType type_
L1 condition type as defined in CondFormats/L1TObjects/interface/L1GtFwd.h.
Definition: TriggerCondition.h:44
L1GtConditionCategory
L1GtConditionCategory
condition categories
Definition: L1GtDefinitions.h:121
pat::TriggerCondition::hasTriggerObjectType
bool hasTriggerObjectType(trigger::TriggerObjectType triggerObjectType) const
Checks, if a certain trigger object type is assigned.
Definition: TriggerCondition.cc:41
createfilelist.int
int
Definition: createfilelist.py:10
pat::TriggerCondition::addTriggerObjectType
void addTriggerObjectType(trigger::TriggerObjectType triggerObjectType)
Add a new trigger object type.
Definition: TriggerCondition.h:79
type
type
Definition: HCALResponse.h:21
pat::TriggerCondition::category_
L1GtConditionCategory category_
L1 condition category as defined in CondFormats/L1TObjects/interface/L1GtFwd.h.
Definition: TriggerCondition.h:42
pat::TriggerCondition::category
int category() const
Get the condition category.
Definition: TriggerCondition.h:95
pat::TriggerCondition::triggerObjectTypes_
std::vector< trigger::TriggerObjectType > triggerObjectTypes_
Definition: TriggerCondition.h:48
pat::TriggerCondition::triggerObjectTypes
std::vector< int > triggerObjectTypes() const
Get the trigger object types.
Definition: TriggerCondition.cc:32