CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
TriggerPath.h
Go to the documentation of this file.
1 #ifndef DataFormats_PatCandidates_TriggerPath_h
2 #define DataFormats_PatCandidates_TriggerPath_h
3 
4 // -*- C++ -*-
5 //
6 // Package: PatCandidates
7 // Class: pat::TriggerPath
8 //
9 //
21 #include <string>
22 #include <vector>
23 
28 
29 namespace pat {
30 
32  typedef std::pair<bool, std::string> L1Seed;
34  typedef std::vector<L1Seed> L1SeedCollection;
35 
36  class TriggerPath {
38 
42  unsigned index_;
44  unsigned prescale_;
46  bool run_;
48  bool accept_;
50  bool error_;
55  std::vector<std::string> modules_;
60  std::vector<unsigned> filterIndices_;
65  unsigned l3Filters_;
68 
69  public:
71 
73  TriggerPath();
78  unsigned index,
79  unsigned prescale,
80  bool run,
81  bool accept,
82  bool error,
83  unsigned lastActiveFilterSlot,
84  unsigned l3Filters = 0);
85 
87  virtual ~TriggerPath(){};
88 
90 
92  void setName(const std::string& name) { name_ = name; };
94  void setIndex(unsigned index) { index_ = index; };
96  void setPrescale(unsigned prescale) { prescale_ = prescale; };
98  void setRun(bool run) { run_ = run; };
100  void setAccept(bool accept) { accept_ = accept; };
102  void setError(bool error) { error_ = error; };
108  void addModule(const std::string& name) { modules_.push_back(name); };
110  void addFilterIndex(const unsigned index) { filterIndices_.push_back(index); };
112  void addL1Seed(const L1Seed& seed) { l1Seeds_.push_back(seed); };
113  void addL1Seed(bool decision, const std::string& expression) { l1Seeds_.push_back(L1Seed(decision, expression)); };
115  const std::string& name() const { return name_; };
117  unsigned index() const { return index_; };
119  unsigned prescale() const { return prescale_; };
121  bool wasRun() const { return run_; };
123  bool wasAccept() const { return accept_; };
125  bool wasError() const { return error_; };
127  unsigned lastActiveFilterSlot() const { return lastActiveFilterSlot_; };
130  unsigned l3Filters() const { return l3Filters_; };
133  bool xTrigger() const { return (l3Filters_ > 2); };
135  const std::vector<std::string>& modules() const { return modules_; };
137  const std::vector<unsigned>& filterIndices() const { return filterIndices_; };
141  int indexModule(const std::string& name) const;
143  const L1SeedCollection& l1Seeds() const { return l1Seeds_; };
145  std::vector<std::string> l1Seeds(const bool decision) const;
147  std::vector<std::string> acceptedL1Seeds() const { return l1Seeds(true); };
149  std::vector<std::string> failedL1Seeds() const { return l1Seeds(false); };
150  };
151 
153  typedef std::vector<TriggerPath> TriggerPathCollection;
162 
163 } // namespace pat
164 
165 #endif
void setIndex(unsigned index)
Set the path index.
Definition: TriggerPath.h:94
std::vector< unsigned > filterIndices_
Definition: TriggerPath.h:60
std::vector< L1Seed > L1SeedCollection
Collection of L1Seed.
Definition: TriggerPath.h:34
void setPrescale(unsigned prescale)
Set the path pre-scale.
Definition: TriggerPath.h:96
const L1SeedCollection & l1Seeds() const
Get all L1 seeds.
Definition: TriggerPath.h:143
edm::RefVector< TriggerPathCollection > TriggerPathRefVector
Vector of persistent references to items in the same TriggerPathCollection.
Definition: TriggerPath.h:159
unsigned prescale_
Pre-scale.
Definition: TriggerPath.h:44
bool xTrigger() const
Definition: TriggerPath.h:133
edm::Ref< TriggerPathCollection > TriggerPathRef
Persistent reference to an item in a TriggerPathCollection.
Definition: TriggerPath.h:155
edm::RefProd< TriggerPathCollection > TriggerPathRefProd
Persistent reference to a TriggerPathCollection product.
Definition: TriggerPath.h:157
bool accept_
Did path succeed?
Definition: TriggerPath.h:48
std::vector< std::string > modules_
Definition: TriggerPath.h:55
bool run_
Was path run?
Definition: TriggerPath.h:46
int indexModule(const std::string &name) const
Definition: TriggerPath.cc:48
bool accept(const edm::Event &event, const edm::TriggerResults &triggerTable, const std::string &triggerPath)
Definition: TopDQMHelpers.h:31
std::string name_
Data Members.
Definition: TriggerPath.h:40
const std::vector< std::string > & modules() const
Get all module labels.
Definition: TriggerPath.h:135
edm::RefVectorIterator< TriggerPathCollection > TriggerPathRefVectorIterator
Const iterator over vector of persistent references to items in the same TriggerPathCollection.
Definition: TriggerPath.h:161
unsigned l3Filters_
Definition: TriggerPath.h:65
std::vector< std::string > acceptedL1Seeds() const
Get names of all succeeding L1 seeds.
Definition: TriggerPath.h:147
unsigned prescale() const
Get the path pre-scale.
Definition: TriggerPath.h:119
Analysis-level HLTrigger path class.
Definition: TriggerPath.h:36
void setL3Filters(unsigned l3Filters)
Set the number of modules identified as L3 filter.
Definition: TriggerPath.h:106
void setRun(bool run)
Set the run flag.
Definition: TriggerPath.h:98
std::pair< bool, std::string > L1Seed
Pair to store decision and name of L1 seeds.
Definition: TriggerPath.h:32
void setName(const std::string &name)
Methods.
Definition: TriggerPath.h:92
void addL1Seed(bool decision, const std::string &expression)
Definition: TriggerPath.h:113
void addL1Seed(const L1Seed &seed)
Add a new L1 seed.
Definition: TriggerPath.h:112
unsigned l3Filters() const
Definition: TriggerPath.h:130
TriggerPath()
Constructors and Desctructor.
Definition: TriggerPath.cc:11
std::vector< std::string > failedL1Seeds() const
Get names of all failing L1 seeds.
Definition: TriggerPath.h:149
L1SeedCollection l1Seeds_
List of L1 seeds and their decisions.
Definition: TriggerPath.h:67
void setError(bool error)
Set the error flag.
Definition: TriggerPath.h:102
void setLastActiveFilterSlot(unsigned lastActiveFilterSlot)
Set the index of the last active filter.
Definition: TriggerPath.h:104
std::vector< TriggerPath > TriggerPathCollection
Collection of TriggerPath.
Definition: TriggerPath.h:153
void setAccept(bool accept)
Set the success flag.
Definition: TriggerPath.h:100
const std::vector< unsigned > & filterIndices() const
Get all trigger fillter collection indeces.
Definition: TriggerPath.h:137
bool error_
Was path in error?
Definition: TriggerPath.h:50
void addFilterIndex(const unsigned index)
Add a new trigger fillter collection index.
Definition: TriggerPath.h:110
virtual ~TriggerPath()
Destructor.
Definition: TriggerPath.h:87
const std::string & name() const
Get the path name.
Definition: TriggerPath.h:115
unsigned index() const
Get the path index.
Definition: TriggerPath.h:117
bool wasError() const
Get the error flag.
Definition: TriggerPath.h:125
bool wasRun() const
Get the run flag.
Definition: TriggerPath.h:121
unsigned lastActiveFilterSlot_
Index of the last active filter in the list of modules.
Definition: TriggerPath.h:62
unsigned lastActiveFilterSlot() const
Get the index of the last active filter.
Definition: TriggerPath.h:127
void addModule(const std::string &name)
Add a new module label.
Definition: TriggerPath.h:108
unsigned index_
Path index in trigger table.
Definition: TriggerPath.h:42
bool wasAccept() const
Get the success flag.
Definition: TriggerPath.h:123