CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
TriggerCondition.cc
Go to the documentation of this file.
1 //
2 //
3 
4 
6 
7 
8 using namespace pat;
9 
10 
11 // Constructors and Destructor
12 
13 
14 // Default constructor
16  name_()
17 , accept_()
18 , category_()
19 , type_()
20 {
21  triggerObjectTypes_.clear();
22  objectKeys_.clear();
23 }
24 
25 
26 // Constructor from condition name "only"
28  name_( name )
29 , accept_()
30 , category_()
31 , type_()
32 {
33  triggerObjectTypes_.clear();
34  objectKeys_.clear();
35 }
36 
37 
38 // Constructor from values
40  name_( name )
41 , accept_( accept )
42 , category_()
43 , type_()
44 {
45  triggerObjectTypes_.clear();
46  objectKeys_.clear();
47 }
48 
49 
50 // Methods
51 
52 
53 // Get the trigger object types
54 std::vector< int > TriggerCondition::triggerObjectTypes() const
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 }
62 
63 
64 // Checks, if a certain trigger object type is assigned
66 {
67  for ( size_t iT = 0; iT < triggerObjectTypes_.size(); ++iT ) {
68  if ( triggerObjectTypes_.at( iT ) == triggerObjectType ) return true;
69  }
70  return false;
71 }
72 
73 
74 // Checks, if a certain trigger object collection index is assigned
75 bool TriggerCondition::hasObjectKey( unsigned objectKey ) const
76 {
77  for ( size_t iO = 0; iO < objectKeys_.size(); ++iO ) {
78  if ( objectKeys_.at( iO ) == objectKey ) return true;
79  }
80  return false;
81 }
bool hasObjectKey(unsigned objectKey) const
Checks, if a certain trigger object collection index is assigned.
std::vector< int > triggerObjectTypes() const
Get the trigger object types.
bool accept(const edm::Event &event, const edm::TriggerResults &triggerTable, const std::string &triggerPath)
Definition: TopDQMHelpers.h:26
TriggerCondition()
Constructors and Desctructor.
std::vector< trigger::TriggerObjectType > triggerObjectTypes_
std::vector< unsigned > objectKeys_
bool hasTriggerObjectType(trigger::TriggerObjectType triggerObjectType) const
Checks, if a certain trigger object type is assigned.