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.8 2010/12/16 18:39:17 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 
46  std::string name_;
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 
72  public:
73 
75 
77  TriggerPath();
79  TriggerPath( const std::string & name );
81  TriggerPath( const std::string & name, unsigned index, unsigned prescale, bool run, bool accept, bool error, unsigned lastActiveFilterSlot );
82 
84  virtual ~TriggerPath() {};
85 
87 
89  void setName( const std::string & name ) { name_ = name; };
91  void setIndex( unsigned index ) { index_ = index; };
93  void setPrescale( unsigned prescale ) { prescale_ = prescale; };
95  void setRun( bool run ) { run_ = run; };
97  void setAccept( bool accept ) { accept_ = accept; };
99  void setError( bool error ) { error_ = error; };
103  void addModule( const std::string & name ) { modules_.push_back( name ); };
105  void addFilterIndex( const unsigned index ) { filterIndices_.push_back( index ); };
107  void addL1Seed( const L1Seed & seed ) { l1Seeds_.push_back( seed ); };
108  void addL1Seed( bool decision, const std::string & expression ) { l1Seeds_.push_back( L1Seed( decision, expression ) ); };
110  std::string name() const { return name_; };
112  unsigned index() const { return index_; };
114  unsigned prescale() const { return prescale_; };
116  bool wasRun() const { return run_; };
118  bool wasAccept() const { return accept_; };
120  bool wasError() const { return error_; };
122  unsigned lastActiveFilterSlot() const { return lastActiveFilterSlot_; };
124  std::vector< std::string > modules() const { return modules_; };
126  std::vector< unsigned > filterIndices() const { return filterIndices_; };
130  int indexModule( const std::string & name ) const;
132  L1SeedCollection l1Seeds() const { return l1Seeds_; };
134  std::vector< std::string > l1Seeds( const bool decision ) const;
136  std::vector< std::string > acceptedL1Seeds() const { return l1Seeds( true ); };
138  std::vector< std::string > failedL1Seeds() const { return l1Seeds( false ); };
139 
140  };
141 
142 
144  typedef std::vector< TriggerPath > TriggerPathCollection;
153 
154 }
155 
156 
157 #endif
std::string name() const
Get the path name.
Definition: TriggerPath.h:110
void setIndex(unsigned index)
Set the path index.
Definition: TriggerPath.h:91
std::vector< std::string > failedL1Seeds() const
Get names of all failing L1 seeds.
Definition: TriggerPath.h:138
void setPrescale(unsigned prescale)
Set the path pre-scale.
Definition: TriggerPath.h:93
unsigned prescale_
Pre-scale.
Definition: TriggerPath.h:50
L1SeedCollection l1Seeds() const
Get all L1 seeds.
Definition: TriggerPath.h:132
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:64
std::vector< std::string > modules_
Definition: TriggerPath.h:61
std::vector< unsigned > filterIndices() const
Get all trigger fillter collection indeces.
Definition: TriggerPath.h:126
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:21
edm::Ref< TriggerPathCollection > TriggerPathRef
Persistent reference to an item in a TriggerPathCollection.
Definition: TriggerPath.h:146
std::string name_
Data Members.
Definition: TriggerPath.h:46
unsigned prescale() const
Get the path pre-scale.
Definition: TriggerPath.h:114
Analysis-level HLTrigger path class.
Definition: TriggerPath.h:41
void setRun(bool run)
Set the run flag.
Definition: TriggerPath.h:95
void setName(const std::string &name)
Methods.
Definition: TriggerPath.h:89
void addL1Seed(bool decision, const std::string &expression)
Definition: TriggerPath.h:108
void addL1Seed(const L1Seed &seed)
Add a new L1 seed.
Definition: TriggerPath.h:107
TriggerPath()
Constructors and Desctructor.
Definition: TriggerPath.cc:16
L1SeedCollection l1Seeds_
List of L1 seeds and their decisions.
Definition: TriggerPath.h:70
void setError(bool error)
Set the error flag.
Definition: TriggerPath.h:99
void setLastActiveFilterSlot(unsigned lastActiveFilterSlot)
Set the index of the last active filter.
Definition: TriggerPath.h:101
edm::RefVectorIterator< TriggerPathCollection > TriggerPathRefVectorIterator
Const iterator over vector of persistent references to items in the same TriggerPathCollection.
Definition: TriggerPath.h:152
std::vector< std::string > acceptedL1Seeds() const
Get names of all succeeding L1 seeds.
Definition: TriggerPath.h:136
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:97
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:150
void addFilterIndex(const unsigned index)
Add a new trigger fillter collection index.
Definition: TriggerPath.h:105
virtual ~TriggerPath()
Destructor.
Definition: TriggerPath.h:84
std::vector< std::string > modules() const
Get all module labels.
Definition: TriggerPath.h:124
unsigned index() const
Get the path index.
Definition: TriggerPath.h:112
bool wasError() const
Get the error flag.
Definition: TriggerPath.h:120
bool wasRun() const
Get the run flag.
Definition: TriggerPath.h:116
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:148
unsigned lastActiveFilterSlot() const
Get the index of the last active filter.
Definition: TriggerPath.h:122
std::vector< TriggerPath > TriggerPathCollection
Collection of TriggerPath.
Definition: TriggerPath.h:144
void addModule(const std::string &name)
Add a new module label.
Definition: TriggerPath.h:103
unsigned index_
Path index in trigger table.
Definition: TriggerPath.h:48
bool wasAccept() const
Get the success flag.
Definition: TriggerPath.h:118