test
CMS 3D CMS Logo

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