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 // $Id: TriggerPath.h,v 1.12 2013/06/11 13:24:49 vadler Exp $
11 //
25 #include <string>
26 #include <vector>
27 
32 
33 
34 namespace pat {
35 
37  typedef std::pair< bool, std::string > L1Seed;
39  typedef std::vector< L1Seed > L1SeedCollection;
40 
41  class TriggerPath {
42 
44 
48  unsigned index_;
50  unsigned prescale_;
52  bool run_;
54  bool accept_;
56  bool error_;
61  std::vector< std::string > modules_;
66  std::vector< unsigned > filterIndices_;
71  unsigned l3Filters_;
74 
75  public:
76 
78 
80  TriggerPath();
82  TriggerPath( const std::string & name );
84  TriggerPath( const std::string & name, unsigned index, unsigned prescale, bool run, bool accept, bool error, unsigned lastActiveFilterSlot, 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; };
106  void setL3Filters( unsigned l3Filters ) { l3Filters_ = l3Filters; };
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  };
152 
153 
155  typedef std::vector< TriggerPath > TriggerPathCollection;
164 
165 }
166 
167 
168 #endif
void setIndex(unsigned index)
Set the path index.
Definition: TriggerPath.h:94
std::vector< std::string > failedL1Seeds() const
Get names of all failing L1 seeds.
Definition: TriggerPath.h:149
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
unsigned prescale_
Pre-scale.
Definition: TriggerPath.h:50
const std::vector< std::string > & modules() const
Get all module labels.
Definition: TriggerPath.h:135
bool xTrigger() const
Definition: TriggerPath.h:133
const std::vector< unsigned > & filterIndices() const
Get all trigger fillter collection indeces.
Definition: TriggerPath.h:137
bool accept_
Did path succeed?
Definition: TriggerPath.h:54
bool run_
Was path run?
Definition: TriggerPath.h:52
int indexModule(const std::string &name) const
Definition: TriggerPath.cc:67
std::vector< std::string > modules_
Definition: TriggerPath.h:61
std::vector< unsigned > filterIndices_
Definition: TriggerPath.h:66
bool accept(const edm::Event &event, const edm::TriggerResults &triggerTable, const std::string &triggerPath)
Definition: TopDQMHelpers.h:22
edm::Ref< TriggerPathCollection > TriggerPathRef
Persistent reference to an item in a TriggerPathCollection.
Definition: TriggerPath.h:157
std::string name_
Data Members.
Definition: TriggerPath.h:46
unsigned l3Filters_
Definition: TriggerPath.h:71
unsigned prescale() const
Get the path pre-scale.
Definition: TriggerPath.h:119
Analysis-level HLTrigger path class.
Definition: TriggerPath.h:41
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
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:16
L1SeedCollection l1Seeds_
List of L1 seeds and their decisions.
Definition: TriggerPath.h:73
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
edm::RefVectorIterator< TriggerPathCollection > TriggerPathRefVectorIterator
Const iterator over vector of persistent references to items in the same TriggerPathCollection.
Definition: TriggerPath.h:163
std::vector< std::string > acceptedL1Seeds() const
Get names of all succeeding L1 seeds.
Definition: TriggerPath.h:147
std::pair< bool, std::string > L1Seed
Pair to store decision and name of L1 seeds.
Definition: TriggerPath.h:37
void setAccept(bool accept)
Set the success flag.
Definition: TriggerPath.h:100
bool error_
Was path in error?
Definition: TriggerPath.h:56
edm::RefVector< TriggerPathCollection > TriggerPathRefVector
Vector of persistent references to items in the same TriggerPathCollection.
Definition: TriggerPath.h:161
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:68
std::vector< L1Seed > L1SeedCollection
Collection of L1Seed.
Definition: TriggerPath.h:39
edm::RefProd< TriggerPathCollection > TriggerPathRefProd
Persistent reference to a TriggerPathCollection product.
Definition: TriggerPath.h:159
unsigned lastActiveFilterSlot() const
Get the index of the last active filter.
Definition: TriggerPath.h:127
std::vector< TriggerPath > TriggerPathCollection
Collection of TriggerPath.
Definition: TriggerPath.h:155
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:48
bool wasAccept() const
Get the success flag.
Definition: TriggerPath.h:123