CMS 3D CMS Logo

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
pat::TriggerPath::addL1Seed
void addL1Seed(bool decision, const std::string &expression)
Definition: TriggerPath.h:113
pat::TriggerPath::run_
bool run_
Was path run?
Definition: TriggerPath.h:46
edm::RefProd< TriggerPathCollection >
RefProd.h
pat::TriggerPath::addL1Seed
void addL1Seed(const L1Seed &seed)
Add a new L1 seed.
Definition: TriggerPath.h:112
pat::TriggerPathRefVectorIterator
edm::RefVectorIterator< TriggerPathCollection > TriggerPathRefVectorIterator
Const iterator over vector of persistent references to items in the same TriggerPathCollection.
Definition: TriggerPath.h:161
pat::TriggerPath::index
unsigned index() const
Get the path index.
Definition: TriggerPath.h:117
pat::TriggerPath::setError
void setError(bool error)
Set the error flag.
Definition: TriggerPath.h:102
pat::TriggerPath::lastActiveFilterSlot
unsigned lastActiveFilterSlot() const
Get the index of the last active filter.
Definition: TriggerPath.h:127
pat::TriggerPath::TriggerPath
TriggerPath()
Constructors and Desctructor.
Definition: TriggerPath.cc:11
pat::TriggerPath::addModule
void addModule(const std::string &name)
Add a new module label.
Definition: TriggerPath.h:108
pat::TriggerPath::name_
std::string name_
Data Members.
Definition: TriggerPath.h:40
pat::TriggerPath::l3Filters
unsigned l3Filters() const
Definition: TriggerPath.h:130
pat::L1Seed
std::pair< bool, std::string > L1Seed
Pair to store decision and name of L1 seeds.
Definition: TriggerPath.h:32
RefVectorIterator.h
pat::TriggerPath::wasAccept
bool wasAccept() const
Get the success flag.
Definition: TriggerPath.h:123
pat::TriggerPath::l3Filters_
unsigned l3Filters_
Definition: TriggerPath.h:65
pat::TriggerPath::setPrescale
void setPrescale(unsigned prescale)
Set the path pre-scale.
Definition: TriggerPath.h:96
pat::TriggerPath::setAccept
void setAccept(bool accept)
Set the success flag.
Definition: TriggerPath.h:100
pat::TriggerPath::filterIndices_
std::vector< unsigned > filterIndices_
Definition: TriggerPath.h:60
pat::TriggerPath::indexModule
int indexModule(const std::string &name) const
Definition: TriggerPath.cc:48
edm::RefVector
Definition: EDProductfwd.h:27
pat::TriggerPath::prescale_
unsigned prescale_
Pre-scale.
Definition: TriggerPath.h:44
pat::TriggerPath::setName
void setName(const std::string &name)
Methods.
Definition: TriggerPath.h:92
relativeConstraints.error
error
Definition: relativeConstraints.py:53
pat::TriggerPath::setRun
void setRun(bool run)
Set the run flag.
Definition: TriggerPath.h:98
edm::Ref
Definition: AssociativeIterator.h:58
pat::TriggerPathCollection
std::vector< TriggerPath > TriggerPathCollection
Collection of TriggerPath.
Definition: TriggerPath.h:153
fileCollector.seed
seed
Definition: fileCollector.py:127
accept
bool accept(const edm::Event &event, const edm::TriggerResults &triggerTable, const std::string &triggerPath)
Definition: TopDQMHelpers.h:31
pat::TriggerPath::setLastActiveFilterSlot
void setLastActiveFilterSlot(unsigned lastActiveFilterSlot)
Set the index of the last active filter.
Definition: TriggerPath.h:104
pat::TriggerPath::prescale
unsigned prescale() const
Get the path pre-scale.
Definition: TriggerPath.h:119
pat::TriggerPath::wasError
bool wasError() const
Get the error flag.
Definition: TriggerPath.h:125
pat::TriggerPath::acceptedL1Seeds
std::vector< std::string > acceptedL1Seeds() const
Get names of all succeeding L1 seeds.
Definition: TriggerPath.h:147
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
pat::TriggerPath::setIndex
void setIndex(unsigned index)
Set the path index.
Definition: TriggerPath.h:94
pat::TriggerPath::modules
const std::vector< std::string > & modules() const
Get all module labels.
Definition: TriggerPath.h:135
pat::L1SeedCollection
std::vector< L1Seed > L1SeedCollection
Collection of L1Seed.
Definition: TriggerPath.h:34
RefVector.h
pat::TriggerPath
Analysis-level HLTrigger path class.
Definition: TriggerPath.h:36
pat::TriggerPath::failedL1Seeds
std::vector< std::string > failedL1Seeds() const
Get names of all failing L1 seeds.
Definition: TriggerPath.h:149
pat::TriggerPath::modules_
std::vector< std::string > modules_
Definition: TriggerPath.h:55
pat::TriggerPath::name
const std::string & name() const
Get the path name.
Definition: TriggerPath.h:115
pat::TriggerPathRefProd
edm::RefProd< TriggerPathCollection > TriggerPathRefProd
Persistent reference to a TriggerPathCollection product.
Definition: TriggerPath.h:157
pat
Definition: HeavyIon.h:7
pat::TriggerPath::lastActiveFilterSlot_
unsigned lastActiveFilterSlot_
Index of the last active filter in the list of modules.
Definition: TriggerPath.h:62
prescale
Definition: PrescaleEventFilter.cc:32
pat::TriggerPath::wasRun
bool wasRun() const
Get the run flag.
Definition: TriggerPath.h:121
writedatasetfile.run
run
Definition: writedatasetfile.py:27
Ref.h
pat::TriggerPathRefVector
edm::RefVector< TriggerPathCollection > TriggerPathRefVector
Vector of persistent references to items in the same TriggerPathCollection.
Definition: TriggerPath.h:159
pat::TriggerPath::index_
unsigned index_
Path index in trigger table.
Definition: TriggerPath.h:42
pat::TriggerPath::xTrigger
bool xTrigger() const
Definition: TriggerPath.h:133
edm::RefVectorIterator
Definition: EDProductfwd.h:33
pat::TriggerPathRef
edm::Ref< TriggerPathCollection > TriggerPathRef
Persistent reference to an item in a TriggerPathCollection.
Definition: TriggerPath.h:155
pat::TriggerPath::l1Seeds
const L1SeedCollection & l1Seeds() const
Get all L1 seeds.
Definition: TriggerPath.h:143
pat::TriggerPath::error_
bool error_
Was path in error?
Definition: TriggerPath.h:50
pat::TriggerPath::filterIndices
const std::vector< unsigned > & filterIndices() const
Get all trigger fillter collection indeces.
Definition: TriggerPath.h:137
pat::TriggerPath::~TriggerPath
virtual ~TriggerPath()
Destructor.
Definition: TriggerPath.h:87
pat::TriggerPath::addFilterIndex
void addFilterIndex(const unsigned index)
Add a new trigger fillter collection index.
Definition: TriggerPath.h:110
pat::TriggerPath::setL3Filters
void setL3Filters(unsigned l3Filters)
Set the number of modules identified as L3 filter.
Definition: TriggerPath.h:106
pat::TriggerPath::accept_
bool accept_
Did path succeed?
Definition: TriggerPath.h:48
pat::TriggerPath::l1Seeds_
L1SeedCollection l1Seeds_
List of L1 seeds and their decisions.
Definition: TriggerPath.h:67