CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
TriggerCondition.h
Go to the documentation of this file.
1 #ifndef DataFormats_PatCandidates_TriggerCondition_h
2 #define DataFormats_PatCandidates_TriggerCondition_h
3 
4 
5 // -*- C++ -*-
6 //
7 // Package: PatCandidates
8 // Class: pat::TriggerCondition
9 //
10 // $Id:$
11 //
25 #include <string>
26 #include <vector>
27 
35 
36 namespace pat {
37 
39 
41 
43  std::string name_;
45  bool accept_;
53  std::vector< trigger::TriggerObjectType > triggerObjectTypes_;
56  std::vector< unsigned > objectKeys_;
57 
58  public:
59 
61 
65  TriggerCondition( const std::string & name );
67  TriggerCondition( const std::string & name, bool accept );
68 
70  virtual ~TriggerCondition() {};
71 
73 
75  void setName( const std::string & name ) { name_ = name; };
77  void setAccept( bool accept ) { accept_ = accept; };
80  void setCategory( int category ) { category_ = L1GtConditionCategory( category ); };
83  void setType( int type ) { type_ = L1GtConditionType( type ); };
85  void addTriggerObjectType( trigger::TriggerObjectType triggerObjectType ) { triggerObjectTypes_.push_back( triggerObjectType ); }; // explicitely NOT checking for existence
86  void addTriggerObjectType( int triggerObjectType ) { addTriggerObjectType( trigger::TriggerObjectType( triggerObjectType ) ); };
88  void addObjectKey( unsigned objectKey ) { if ( ! hasObjectKey( objectKey ) ) objectKeys_.push_back( objectKey ); };
90  std::string name() const { return name_; };
92  bool wasAccept() const { return accept_; };
94  int category() const { return int( category_ ); };
96  int type() const { return int( type_ ); };
98  std::vector< int > triggerObjectTypes() const;
100  bool hasTriggerObjectType( trigger::TriggerObjectType triggerObjectType ) const;
101  bool hasTriggerObjectType( int triggerObjectType ) const { return hasTriggerObjectType( trigger::TriggerObjectType( triggerObjectType ) ); };
103  std::vector< unsigned > objectKeys() const { return objectKeys_; };
105  bool hasObjectKey( unsigned objectKey ) const;
106 
107  };
108 
109 
111  typedef std::vector< TriggerCondition > TriggerConditionCollection;
120 
121 }
122 
123 
124 #endif
type
Definition: HCALResponse.h:22
bool hasObjectKey(unsigned objectKey) const
Checks, if a certain trigger object collection index is assigned.
std::string name() const
Get the filter label.
edm::RefVectorIterator< TriggerConditionCollection > TriggerConditionRefVectorIterator
Const iterator over vector of persistent references to items in the same TriggerConditionCollection.
L1GtConditionType type_
L1 condition type as defined in CondFormats/L1TObjects/interface/L1GtFwd.h.
void addTriggerObjectType(int triggerObjectType)
int type() const
Get the condition type.
void setAccept(bool accept)
Set the success flag.
bool wasAccept() const
Get the success flag.
void addTriggerObjectType(trigger::TriggerObjectType triggerObjectType)
Add a new trigger object type.
std::vector< int > triggerObjectTypes() const
Get the trigger object types.
edm::RefVector< TriggerConditionCollection > TriggerConditionRefVector
Vector of persistent references to items in the same TriggerConditionCollection.
bool accept(const edm::Event &event, const edm::TriggerResults &triggerTable, const std::string &triggerPath)
Definition: TopDQMHelpers.h:21
void setCategory(int category)
TriggerCondition()
Constructors and Desctructor.
edm::Ref< TriggerConditionCollection > TriggerConditionRef
Persistent reference to an item in a TriggerConditionCollection.
std::vector< trigger::TriggerObjectType > triggerObjectTypes_
Analysis-level L1 trigger condition class.
edm::RefProd< TriggerConditionCollection > TriggerConditionRefProd
Persistent reference to a TriggerConditionCollection product.
std::string name_
Data Members.
L1GtConditionType
Definition: L1GtFwd.h:52
void setType(int type)
int category() const
Get the condition category.
void setCategory(L1GtConditionCategory category)
Set the condition category.
L1GtConditionCategory
condition categories
Definition: L1GtFwd.h:63
L1GtConditionCategory category_
L1 condition category as defined in CondFormats/L1TObjects/interface/L1GtFwd.h.
void addObjectKey(unsigned objectKey)
Add a new trigger object collection index.
std::vector< unsigned > objectKeys_
bool hasTriggerObjectType(int triggerObjectType) const
virtual ~TriggerCondition()
Destructor.
std::vector< unsigned > objectKeys() const
Get all trigger object collection indeces.
bool hasTriggerObjectType(trigger::TriggerObjectType triggerObjectType) const
Checks, if a certain trigger object type is assigned.
void setName(const std::string &name)
Methods.
std::vector< TriggerCondition > TriggerConditionCollection
Collection of TriggerCondition.
bool accept_
Did condition succeed?
void setType(L1GtConditionType type)
Set the condition type.