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: TriggerCondition.cc,v 1.2 2011/11/30 13:39:45 vadler Exp $
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 , category_()
20 , type_()
21 {
22  triggerObjectTypes_.clear();
23  objectKeys_.clear();
24 }
25 
26 
27 // Constructor from condition name "only"
28 TriggerCondition::TriggerCondition( const std::string & name ) :
29  name_( name )
30 , accept_()
31 , category_()
32 , type_()
33 {
34  triggerObjectTypes_.clear();
35  objectKeys_.clear();
36 }
37 
38 
39 // Constructor from values
40 TriggerCondition::TriggerCondition( const std::string & name, bool accept ) :
41  name_( name )
42 , accept_( accept )
43 , category_()
44 , type_()
45 {
46  triggerObjectTypes_.clear();
47  objectKeys_.clear();
48 }
49 
50 
51 // Methods
52 
53 
54 // Get the trigger object types
55 std::vector< int > TriggerCondition::triggerObjectTypes() const
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 }
63 
64 
65 // Checks, if a certain trigger object type is assigned
67 {
68  for ( size_t iT = 0; iT < triggerObjectTypes_.size(); ++iT ) {
69  if ( triggerObjectTypes_.at( iT ) == triggerObjectType ) return true;
70  }
71  return false;
72 }
73 
74 
75 // Checks, if a certain trigger object collection index is assigned
76 bool TriggerCondition::hasObjectKey( unsigned objectKey ) const
77 {
78  for ( size_t iO = 0; iO < objectKeys_.size(); ++iO ) {
79  if ( objectKeys_.at( iO ) == objectKey ) return true;
80  }
81  return false;
82 }
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:22
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.