CMS 3D CMS Logo

TriggerCondition.cc
Go to the documentation of this file.
1 //
2 //
3 
5 
6 using namespace pat;
7 
8 // Constructors and Destructor
9 
10 // Default constructor
11 TriggerCondition::TriggerCondition() : name_(), accept_(), category_(), type_() {
12  triggerObjectTypes_.clear();
13  objectKeys_.clear();
14 }
15 
16 // Constructor from condition name "only"
17 TriggerCondition::TriggerCondition(const std::string& name) : name_(name), accept_(), category_(), type_() {
18  triggerObjectTypes_.clear();
19  objectKeys_.clear();
20 }
21 
22 // Constructor from values
24  : name_(name), accept_(accept), category_(), type_() {
25  triggerObjectTypes_.clear();
26  objectKeys_.clear();
27 }
28 
29 // Methods
30 
31 // Get the trigger object types
32 std::vector<int> TriggerCondition::triggerObjectTypes() const {
33  std::vector<int> triggerObjectTypes;
34  for (size_t iT = 0; iT < triggerObjectTypes_.size(); ++iT) {
35  triggerObjectTypes.push_back(int(triggerObjectTypes_.at(iT)));
36  }
37  return triggerObjectTypes;
38 }
39 
40 // Checks, if a certain trigger object type is assigned
42  for (size_t iT = 0; iT < triggerObjectTypes_.size(); ++iT) {
43  if (triggerObjectTypes_.at(iT) == triggerObjectType)
44  return true;
45  }
46  return false;
47 }
48 
49 // Checks, if a certain trigger object collection index is assigned
50 bool TriggerCondition::hasObjectKey(unsigned objectKey) const {
51  for (size_t iO = 0; iO < objectKeys_.size(); ++iO) {
52  if (objectKeys_.at(iO) == objectKey)
53  return true;
54  }
55  return false;
56 }
bool hasObjectKey(unsigned objectKey) const
Checks, if a certain trigger object collection index is assigned.
bool hasTriggerObjectType(trigger::TriggerObjectType triggerObjectType) const
Checks, if a certain trigger object type is assigned.
bool accept(const edm::Event &event, const edm::TriggerResults &triggerTable, const std::string &triggerPath)
Definition: TopDQMHelpers.h:31
TriggerCondition()
Constructors and Desctructor.
Definition: HeavyIon.h:7
std::vector< int > triggerObjectTypes() const
Get the trigger object types.
std::vector< trigger::TriggerObjectType > triggerObjectTypes_
std::vector< unsigned > objectKeys_