CMS 3D CMS Logo

TriggerCondition.h
Go to the documentation of this file.
1 #ifndef DataFormats_PatCandidates_TriggerCondition_h
2 #define DataFormats_PatCandidates_TriggerCondition_h
3 
4 // -*- C++ -*-
5 //
6 // Package: PatCandidates
7 // Class: pat::TriggerCondition
8 //
9 //
21 #include <string>
22 #include <vector>
23 
31 
32 namespace pat {
33 
36 
40  bool accept_;
48  std::vector<trigger::TriggerObjectType> triggerObjectTypes_;
51  std::vector<unsigned> objectKeys_;
52 
53  public:
55 
62 
64  virtual ~TriggerCondition(){};
65 
67 
69  void setName(const std::string& name) { name_ = name; };
71  void setAccept(bool accept) { accept_ = accept; };
80  triggerObjectTypes_.push_back(triggerObjectType);
81  }; // explicitely NOT checking for existence
82  void addTriggerObjectType(int triggerObjectType) {
84  };
86  void addObjectKey(unsigned objectKey) {
87  if (!hasObjectKey(objectKey))
88  objectKeys_.push_back(objectKey);
89  };
91  const std::string& name() const { return name_; };
93  bool wasAccept() const { return accept_; };
95  int category() const { return int(category_); };
97  int type() const { return int(type_); };
99  std::vector<int> triggerObjectTypes() const;
101  bool hasTriggerObjectType(trigger::TriggerObjectType triggerObjectType) const;
102  bool hasTriggerObjectType(int triggerObjectType) const {
103  return hasTriggerObjectType(trigger::TriggerObjectType(triggerObjectType));
104  };
106  const std::vector<unsigned>& objectKeys() const { return objectKeys_; };
108  bool hasObjectKey(unsigned objectKey) const;
109  };
110 
112  typedef std::vector<TriggerCondition> TriggerConditionCollection;
121 
122 } // namespace pat
123 
124 #endif
trigger::TriggerObjectType
TriggerObjectType
Definition: TriggerTypeDefs.h:23
pat::TriggerCondition::name_
std::string name_
Data Members.
Definition: TriggerCondition.h:38
edm::RefProd< TriggerConditionCollection >
RefProd.h
pat::TriggerCondition::hasTriggerObjectType
bool hasTriggerObjectType(int triggerObjectType) const
Definition: TriggerCondition.h:102
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::TriggerConditionCollection
std::vector< TriggerCondition > TriggerConditionCollection
Collection of TriggerCondition.
Definition: TriggerCondition.h:112
pat::TriggerCondition::type
int type() const
Get the condition type.
Definition: TriggerCondition.h:97
RefVectorIterator.h
pat::TriggerCondition::name
const std::string & name() const
Get the filter label.
Definition: TriggerCondition.h:91
TriggerTypeDefs.h
edm::RefVector
Definition: EDProductfwd.h:27
pat::TriggerCondition::wasAccept
bool wasAccept() const
Get the success flag.
Definition: TriggerCondition.h:93
L1GtDefinitions.h
pat::TriggerCondition::accept_
bool accept_
Did condition succeed?
Definition: TriggerCondition.h:40
pat::TriggerConditionRefProd
edm::RefProd< TriggerConditionCollection > TriggerConditionRefProd
Persistent reference to a TriggerConditionCollection product.
Definition: TriggerCondition.h:116
pat::TriggerCondition
Analysis-level L1 trigger condition class.
Definition: TriggerCondition.h:34
edm::Ref
Definition: AssociativeIterator.h:58
L1GtConditionCategory
L1GtConditionCategory
condition categories
Definition: L1GtDefinitions.h:26
accept
bool accept(const edm::Event &event, const edm::TriggerResults &triggerTable, const std::string &triggerPath)
Definition: TopDQMHelpers.h:31
pat::TriggerCondition::type_
L1GtConditionType type_
L1 condition type as defined in CondFormats/L1TObjects/interface/L1GtFwd.h.
Definition: TriggerCondition.h:44
pat::TriggerCondition::hasTriggerObjectType
bool hasTriggerObjectType(trigger::TriggerObjectType triggerObjectType) const
Checks, if a certain trigger object type is assigned.
Definition: TriggerCondition.cc:41
pat::TriggerCondition::objectKeys
const std::vector< unsigned > & objectKeys() const
Get all trigger object collection indeces.
Definition: TriggerCondition.h:106
L1GtConditionType
L1GtConditionType
Definition: L1GtDefinitions.h:4
pat::TriggerCondition::setName
void setName(const std::string &name)
Methods.
Definition: TriggerCondition.h:69
RefVector.h
pat::TriggerCondition::addTriggerObjectType
void addTriggerObjectType(int triggerObjectType)
Definition: TriggerCondition.h:82
type
type
Definition: SiPixelVCal_PayloadInspector.cc:39
createfilelist.int
int
Definition: createfilelist.py:10
pat
Definition: HeavyIon.h:7
pat::TriggerCondition::addTriggerObjectType
void addTriggerObjectType(trigger::TriggerObjectType triggerObjectType)
Add a new trigger object type.
Definition: TriggerCondition.h:79
AlCaHLTBitMon_QueryRunRegistry.string
string string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
pat::TriggerConditionRef
edm::Ref< TriggerConditionCollection > TriggerConditionRef
Persistent reference to an item in a TriggerConditionCollection.
Definition: TriggerCondition.h:114
InputTag.h
pat::TriggerCondition::setType
void setType(L1GtConditionType type)
Set the condition type.
Definition: TriggerCondition.h:76
pat::TriggerConditionRefVector
edm::RefVector< TriggerConditionCollection > TriggerConditionRefVector
Vector of persistent references to items in the same TriggerConditionCollection.
Definition: TriggerCondition.h:118
pat::TriggerCondition::addObjectKey
void addObjectKey(unsigned objectKey)
Add a new trigger object collection index.
Definition: TriggerCondition.h:86
pat::TriggerCondition::~TriggerCondition
virtual ~TriggerCondition()
Destructor.
Definition: TriggerCondition.h:64
pat::TriggerCondition::category_
L1GtConditionCategory category_
L1 condition category as defined in CondFormats/L1TObjects/interface/L1GtFwd.h.
Definition: TriggerCondition.h:42
pat::TriggerConditionRefVectorIterator
edm::RefVectorIterator< TriggerConditionCollection > TriggerConditionRefVectorIterator
Const iterator over vector of persistent references to items in the same TriggerConditionCollection.
Definition: TriggerCondition.h:120
Ref.h
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
edm::RefVectorIterator
Definition: EDProductfwd.h:33
pat::TriggerCondition::setCategory
void setCategory(L1GtConditionCategory category)
Set the condition category.
Definition: TriggerCondition.h:73
pat::TriggerCondition::setCategory
void setCategory(int category)
Definition: TriggerCondition.h:74
pat::TriggerCondition::triggerObjectTypes
std::vector< int > triggerObjectTypes() const
Get the trigger object types.
Definition: TriggerCondition.cc:32
pat::TriggerCondition::TriggerCondition
TriggerCondition()
Constructors and Desctructor.
Definition: TriggerCondition.cc:11
pat::TriggerCondition::setType
void setType(int type)
Definition: TriggerCondition.h:77
pat::TriggerCondition::setAccept
void setAccept(bool accept)
Set the success flag.
Definition: TriggerCondition.h:71