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 // $Id:$
3 //
4 
5 
7 
8 
9 using namespace pat;
10 
11 
12 // Constructors and Destructor
13 
14 
15 // Default constructor
17  name_()
18 , accept_()
19 {
20  triggerObjectTypes_.clear();
21  objectKeys_.clear();
22 }
23 
24 
25 // Constructor from condition name "only"
26 TriggerCondition::TriggerCondition( const std::string & name ) :
27  name_( name )
28 , accept_()
29 {
30  triggerObjectTypes_.clear();
31  objectKeys_.clear();
32 }
33 
34 
35 // Constructor from values
36 TriggerCondition::TriggerCondition( const std::string & name, bool accept ) :
37  name_( name )
38 , accept_( accept )
39 {
40  triggerObjectTypes_.clear();
41  objectKeys_.clear();
42 }
43 
44 
45 // Methods
46 
47 
48 // Get the trigger object types
49 std::vector< int > TriggerCondition::triggerObjectTypes() const
50 {
51  std::vector< int > triggerObjectTypes;
52  for ( size_t iT = 0; iT < triggerObjectTypes_.size(); ++iT ) {
53  triggerObjectTypes.push_back( int( triggerObjectTypes_.at( iT ) ) );
54  }
55  return triggerObjectTypes;
56 }
57 
58 
59 // Checks, if a certain trigger object type is assigned
61 {
62  for ( size_t iT = 0; iT < triggerObjectTypes_.size(); ++iT ) {
63  if ( triggerObjectTypes_.at( iT ) == triggerObjectType ) return true;
64  }
65  return false;
66 }
67 
68 
69 // Checks, if a certain trigger object collection index is assigned
70 bool TriggerCondition::hasObjectKey( unsigned objectKey ) const
71 {
72  for ( size_t iO = 0; iO < objectKeys_.size(); ++iO ) {
73  if ( objectKeys_.at( iO ) == objectKey ) return true;
74  }
75  return false;
76 }
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:21
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.