CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
TriggerEvent.h
Go to the documentation of this file.
1 #ifndef DataFormats_PatCandidates_TriggerEvent_h
2 #define DataFormats_PatCandidates_TriggerEvent_h
3 
4 
5 // -*- C++ -*-
6 //
7 // Package: PatCandidates
8 // Class: pat::TriggerEvent
9 //
10 // $Id: TriggerEvent.h,v 1.19 2011/03/08 10:48:45 vadler Exp $
11 //
31 
32 #include <string>
33 #include <vector>
34 #include <boost/cstdint.hpp>
35 
40 
41 
42 namespace pat {
43 
44  class TriggerEvent {
45 
47 
49  std::string nameL1Menu_;
51  std::string nameHltTable_;
53  bool run_;
55  bool accept_;
57  bool error_;
59  bool physDecl_;
61  boost::uint32_t lhcFill_;
64  boost::uint16_t beamMode_;
66  boost::uint16_t beamMomentum_;
68  boost::uint32_t intensityBeam1_;
70  boost::uint32_t intensityBeam2_;
73  boost::uint16_t bstMasterStatus_;
75  boost::uint32_t turnCount_;
81  float bCurrentAvg_;
82 
96 
97  public:
98 
100 
104  TriggerEvent( const std::string & nameHltTable, bool run = true, bool accept = true, bool error = false, bool physDecl = true );
106  TriggerEvent( const std::string & nameL1Menu, const std::string & nameHltTable, bool run = true, bool accept = true, bool error = false, bool physDecl = true );
107 
109  virtual ~TriggerEvent() {};
110 
112 
115  void setNameL1Menu( const std::string & name ) { nameL1Menu_ = name; };
117  void setNameHltTable( const std::string & name ) { nameHltTable_ = name; };
119  void setRun( bool run ) { run_ = run; };
121  void setAccept( bool accept ) { accept_ = accept; };
123  void setError( bool error ) { error = error; };
125  void setPhysDecl( bool physDecl ) { physDecl_ = physDecl; };
127  void setLhcFill( boost::uint32_t lhcFill ) { lhcFill_ = lhcFill; };
129  void setBeamMode( boost::uint16_t beamMode ) { beamMode_ = beamMode; };
131  void setBeamMomentum( boost::uint16_t beamMomentum ) { beamMomentum_ = beamMomentum; };
139  void setTurnCount( boost::uint32_t turnCount ) { turnCount_ = turnCount; };
147  std::string nameL1Menu() const { return nameL1Menu_; };
149  std::string nameHltTable() const { return nameHltTable_; };
151  bool wasRun() const { return run_; };
153  bool wasAccept() const { return accept_; };
155  bool wasError() const { return error_; };
157  bool wasPhysDecl() const { return physDecl_; };
159  boost::uint32_t lhcFill() const { return lhcFill_; };
161  boost::uint16_t beamMode() const { return beamMode_; };
163  boost::uint16_t beamMomentum() const { return beamMomentum_; };
165  boost::uint32_t intensityBeam1() const { return intensityBeam1_; };
167  boost::uint32_t intensityBeam2() const { return intensityBeam2_; };
169  boost::uint16_t bstMasterStatus() const { return bstMasterStatus_; };
171  boost::uint32_t turnCount() const { return turnCount_; };
173  float bCurrentStart() const { return bCurrentStart_; };
175  float bCurrentStop() const { return bCurrentStop_; };
177  float bCurrentAvg() const { return bCurrentAvg_; };
178 
181  void setAlgorithms( const edm::Handle< TriggerAlgorithmCollection > & handleTriggerAlgorithms ) { algorithms_ = TriggerAlgorithmRefProd( handleTriggerAlgorithms ); };
184  const TriggerAlgorithmCollection * algorithms() const { return algorithms_.get(); };
187  const TriggerAlgorithm * algorithm( const std::string & nameAlgorithm ) const;
190  std::string nameAlgorithm( const unsigned bitAlgorithm, const bool techAlgorithm = true ) const;
193  unsigned indexAlgorithm( const std::string & nameAlgorithm ) const;
210 
213  void setConditions( const edm::Handle< TriggerConditionCollection > & handleTriggerConditions ) { conditions_ = TriggerConditionRefProd( handleTriggerConditions ); };
216  const TriggerConditionCollection * conditions() const { return conditions_.get(); };
219  const TriggerCondition * condition( const std::string & nameCondition ) const;
222  unsigned indexCondition( const std::string & nameCondition ) const;
225 
228  void setPaths( const edm::Handle< TriggerPathCollection > & handleTriggerPaths ) { paths_ = TriggerPathRefProd( handleTriggerPaths ); };
231  const TriggerPathCollection * paths() const { return paths_.get(); };
234  const TriggerPath * path( const std::string & namePath ) const;
237  unsigned indexPath( const std::string & namePath ) const;
240 
243  void setFilters( const edm::Handle< TriggerFilterCollection > & handleTriggerFilters ) { filters_ = TriggerFilterRefProd( handleTriggerFilters ); };
246  const TriggerFilterCollection * filters() const { return filters_.get(); };
249  const TriggerFilter * filter( const std::string & labelFilter ) const;
252  unsigned indexFilter( const std::string & labelFilter ) const;
255 
258  void setObjects( const edm::Handle< TriggerObjectCollection > & handleTriggerObjects ) { objects_ = TriggerObjectRefProd( handleTriggerObjects ); };
261  const TriggerObjectCollection * objects() const { return objects_.get(); };
263  TriggerObjectRefVector objects( trigger::TriggerObjectType triggerObjectType ) const;
264  TriggerObjectRefVector objects( int triggerObjectType ) const { return objects( trigger::TriggerObjectType( triggerObjectType ) ); }; // for backward compatibility
265 
268  TriggerConditionRefVector algorithmConditions( const std::string & nameAlgorithm ) const;
270  bool conditionInAlgorithm( const TriggerConditionRef & conditionRef, const std::string & nameAlgorithm ) const;
274  std::vector< std::string > conditionCollections( const std::string & nameAlgorithm ) const;
276  TriggerObjectRefVector conditionObjects( const std::string & nameCondition ) const;
278  bool objectInCondition( const TriggerObjectRef & objectRef, const std::string & nameCondition ) const;
282  TriggerObjectRefVector algorithmObjects( const std::string & nameAlgorithm ) const;
284  bool objectInAlgorithm( const TriggerObjectRef & objectRef, const std::string & nameAlgorithm ) const;
287 
291  TriggerFilterRefVector pathModules( const std::string & namePath, bool all = true ) const;
293  TriggerFilterRefVector pathFilters( const std::string & namePath ) const;
295  bool filterInPath( const TriggerFilterRef & filterRef, const std::string & namePath ) const;
297  TriggerPathRefVector filterPaths( const TriggerFilterRef & filterRef ) const;
299  std::vector< std::string > filterCollections( const std::string & labelFilter ) const;
301  TriggerObjectRefVector filterObjects( const std::string & labelFilter ) const;
303  bool objectInFilter( const TriggerObjectRef & objectRef, const std::string & labelFilter ) const;
305  TriggerFilterRefVector objectFilters( const TriggerObjectRef & objectRef ) const;
307  TriggerObjectRefVector pathObjects( const std::string & namePath ) const;
309  bool objectInPath( const TriggerObjectRef & objectRef, const std::string & namePath ) const;
311  TriggerPathRefVector objectPaths( const TriggerObjectRef & objectRef ) const;
312 
315  bool addObjectMatchResult( const TriggerObjectMatchRefProd & trigMatches, const std::string & labelMatcher );
316  bool addObjectMatchResult( const edm::Handle< TriggerObjectMatch > & trigMatches, const std::string & labelMatcher ) { return addObjectMatchResult( TriggerObjectMatchRefProd( trigMatches ), labelMatcher ); };
317  bool addObjectMatchResult( const edm::OrphanHandle< TriggerObjectMatch > & trigMatches, const std::string & labelMatcher ) { return addObjectMatchResult( TriggerObjectMatchRefProd( trigMatches ), labelMatcher ); };
319  std::vector< std::string > triggerMatchers() const;
325  const TriggerObjectMatch * triggerObjectMatchResult( const std::string & labelMatcher ) const;
326 
328 
329  };
330 
331 }
332 
333 
334 #endif
const TriggerObjectMatchContainer * triggerObjectMatchResults() const
Get all trigger matches.
Definition: TriggerEvent.h:321
TriggerFilterRefVector objectFilters(const TriggerObjectRef &objectRef) const
Get a vector of references to all filters, which have a certain object assigned.
void setBeamMode(boost::uint16_t beamMode)
Set the LHC beam mode.
Definition: TriggerEvent.h:129
bool wasAccept() const
Get the success flag.
Definition: TriggerEvent.h:153
TriggerConditionRefVector algorithmConditions(const std::string &nameAlgorithm) const
edm::RefProd< TriggerObjectMatch > TriggerObjectMatchRefProd
Persistent reference to a TriggerObjectMatch product.
void setBCurrentAvg(float bCurrentAvg)
Set the CMS magnet current averaged over run.
Definition: TriggerEvent.h:145
Analysis-level L1 trigger algorithm class.
TriggerAlgorithmRefVector physAlgorithms() const
Get a vector of references to all physics L1 algorithms.
TriggerAlgorithmRefVector acceptedAlgorithmsGtl() const
Get a vector of references to all L1 algorithms succeeding on the GTL board.
Definition: TriggerEvent.cc:88
std::string nameHltTable_
Name of the HLT trigger table.
Definition: TriggerEvent.h:51
TriggerConditionRefVector objectConditions(const TriggerObjectRef &objectRef) const
Get a vector of references to all conditions, which have a certain object assigned.
virtual ~TriggerEvent()
Destructor.
Definition: TriggerEvent.h:109
TriggerConditionRefProd conditions_
Reference to pat::TriggerConditionCollection in event.
Definition: TriggerEvent.h:87
void setBCurrentStop(float bCurrentStop)
Set the CMS magnet current at end of run.
Definition: TriggerEvent.h:143
std::string nameL1Menu() const
Get the name of the L1 trigger menu.
Definition: TriggerEvent.h:147
boost::uint16_t beamMomentum() const
Get the LHC beam momentum.
Definition: TriggerEvent.h:163
boost::uint16_t beamMode_
Definition: TriggerEvent.h:64
boost::uint16_t beamMomentum_
LHC beam momentum in GeV.
Definition: TriggerEvent.h:66
std::vector< std::string > triggerMatchers() const
Get a list of all linked trigger matches.
TriggerPathRefVector filterPaths(const TriggerFilterRef &filterRef) const
Get a vector of references to all paths, which have a certain filter assigned.
bool physDecl_
PhysicsDeclared GT bit.
Definition: TriggerEvent.h:59
std::string nameHltTable() const
Get the name of the HLT trigger table.
Definition: TriggerEvent.h:149
bool accept_
Did HLT succeed?
Definition: TriggerEvent.h:55
bool error_
Was HLT in error?
Definition: TriggerEvent.h:57
const TriggerCondition * condition(const std::string &nameCondition) const
const TriggerConditionCollection * conditions() const
Definition: TriggerEvent.h:216
void setRun(bool run)
Set the run flag.
Definition: TriggerEvent.h:119
void setAccept(bool accept)
Set the success flag.
Definition: TriggerEvent.h:121
TriggerFilterRefVector acceptedFilters() const
Get a vector of references to all succeeding HLT filters.
edm::RefProd< TriggerObjectCollection > TriggerObjectRefProd
Persistent reference to a TriggerObjectCollection product.
TriggerAlgorithmRefVector acceptedTechAlgorithms() const
Get a vector of references to all succeeding technical L1 algorithms.
TriggerObjectRefVector pathObjects(const std::string &namePath) const
Get a vector of references to all objects, which were used in a certain path given by name...
std::string nameL1Menu_
Data Members.
Definition: TriggerEvent.h:49
void setConditions(const edm::Handle< TriggerConditionCollection > &handleTriggerConditions)
Definition: TriggerEvent.h:213
TriggerPathRefProd paths_
Reference to pat::TriggerPathCollection in event.
Definition: TriggerEvent.h:89
TriggerAlgorithmRefVector objectAlgorithms(const TriggerObjectRef &objectRef) const
Get a vector of references to all algorithms, which have a certain object assigned.
bool accept(const edm::Event &event, const edm::TriggerResults &triggerTable, const std::string &triggerPath)
Definition: TopDQMHelpers.h:21
const TriggerPathCollection * paths() const
Definition: TriggerEvent.h:231
unsigned indexFilter(const std::string &labelFilter) const
void setIntensityBeam2(boost::uint32_t intensityBeam2)
Set the LHC beam 2 intensity.
Definition: TriggerEvent.h:135
TriggerFilterRefVector pathModules(const std::string &namePath, bool all=true) const
void setAlgorithms(const edm::Handle< TriggerAlgorithmCollection > &handleTriggerAlgorithms)
Definition: TriggerEvent.h:181
void setNameL1Menu(const std::string &name)
Methods.
Definition: TriggerEvent.h:115
bool objectInAlgorithm(const TriggerObjectRef &objectRef, const std::string &nameAlgorithm) const
Checks, if an object was used in a certain algorithm given by name.
float bCurrentStart_
CMS magnet current in ??? at start of run.
Definition: TriggerEvent.h:77
TriggerConditionRefVector acceptedConditions() const
Get a vector of references to all succeeding L1 condition.
TriggerAlgorithmRefProd algorithms_
Definition: TriggerEvent.h:85
void setFilters(const edm::Handle< TriggerFilterCollection > &handleTriggerFilters)
Definition: TriggerEvent.h:243
TriggerObjectRefVector filterObjects(const std::string &labelFilter) const
Get a vector of references to all objects, which were used in a certain filter given by name...
void setLhcFill(boost::uint32_t lhcFill)
Set the LHC fill number.
Definition: TriggerEvent.h:127
std::vector< TriggerAlgorithm > TriggerAlgorithmCollection
Collection of TriggerAlgorithm.
const TriggerObjectCollection * objects() const
Definition: TriggerEvent.h:261
unsigned indexAlgorithm(const std::string &nameAlgorithm) const
Definition: TriggerEvent.cc:64
Analysis-level HLTrigger filter class.
Definition: TriggerFilter.h:37
bool wasPhysDecl() const
Get the PhysicsDeclared GT bit.
Definition: TriggerEvent.h:157
boost::uint16_t bstMasterStatus_
Definition: TriggerEvent.h:73
unsigned indexCondition(const std::string &nameCondition) const
Analysis-level L1 trigger condition class.
Analysis-level HLTrigger path class.
Definition: TriggerPath.h:41
bool addObjectMatchResult(const TriggerObjectMatchRefProd &trigMatches, const std::string &labelMatcher)
boost::uint32_t intensityBeam1() const
Get the LHC beam 1 intensity.
Definition: TriggerEvent.h:165
const TriggerPath * path(const std::string &namePath) const
boost::uint32_t intensityBeam2() const
Get the LHC beam 2 intensity.
Definition: TriggerEvent.h:167
TriggerAlgorithmRefVector techAlgorithms() const
Get a vector of references to all technical L1 algorithms.
float bCurrentAvg_
CMS magnet current in ??? averaged over run.
Definition: TriggerEvent.h:81
void setPaths(const edm::Handle< TriggerPathCollection > &handleTriggerPaths)
Definition: TriggerEvent.h:228
boost::uint32_t lhcFill_
LHC fill number.
Definition: TriggerEvent.h:61
TriggerPathRefVector objectPaths(const TriggerObjectRef &objectRef) const
Get a vector of references to all paths, which have a certain object assigned.
bool objectInCondition(const TriggerObjectRef &objectRef, const std::string &nameCondition) const
Checks, if an object was used in a certain condition given by name.
edm::RefProd< TriggerConditionCollection > TriggerConditionRefProd
Persistent reference to a TriggerConditionCollection product.
boost::uint16_t bstMasterStatus() const
Get the LHC master status.
Definition: TriggerEvent.h:169
TriggerAlgorithmRefVector acceptedPhysAlgorithms() const
Get a vector of references to all succeeding physics L1 algorithms.
const TriggerAlgorithmCollection * algorithms() const
Definition: TriggerEvent.h:184
void setNameHltTable(const std::string &name)
Set the name of the HLT trigger table.
Definition: TriggerEvent.h:117
float bCurrentAvg() const
Get the CMS magnet current averaged over run.
Definition: TriggerEvent.h:177
TriggerAlgorithmRefVector acceptedAlgorithms() const
Get a vector of references to all succeeding L1 algorithms.
Definition: TriggerEvent.cc:73
bool addObjectMatchResult(const edm::Handle< TriggerObjectMatch > &trigMatches, const std::string &labelMatcher)
Definition: TriggerEvent.h:316
TriggerEvent()
Constructors and Desctructor.
Definition: TriggerEvent.h:102
const TriggerObjectMatch * triggerObjectMatchResult(const std::string &labelMatcher) const
std::vector< std::string > conditionCollections(const std::string &nameAlgorithm) const
Get a list of all trigger object collections used in a certain condition given by name...
TriggerAlgorithmRefVector conditionAlgorithms(const TriggerConditionRef &conditionRef) const
Get a vector of references to all algorithms, which have a certain condition assigned.
TriggerFilterRefProd filters_
Reference to pat::TriggerAlgorithmCollection in event.
Definition: TriggerEvent.h:91
std::string nameAlgorithm(const unsigned bitAlgorithm, const bool techAlgorithm=true) const
Definition: TriggerEvent.cc:54
Analysis-level trigger event class.
Definition: TriggerEvent.h:44
boost::uint32_t turnCount() const
Get the LHC beam turn counter.
Definition: TriggerEvent.h:171
std::vector< TriggerFilter > TriggerFilterCollection
Collection of TriggerFilter.
void setTurnCount(boost::uint32_t turnCount)
Set the LHC beam turn counter.
Definition: TriggerEvent.h:139
std::vector< std::string > filterCollections(const std::string &labelFilter) const
Get a list of all trigger object collections used in a certain filter given by name.
bool filterInPath(const TriggerFilterRef &filterRef, const std::string &namePath) const
Checks, if a filter is assigned to and was run in a certain path given by name.
const TriggerFilterCollection * filters() const
Definition: TriggerEvent.h:246
TriggerFilterRefVector pathFilters(const std::string &namePath) const
Get a vector of references to all active HLT filters assigned to a certain path given by name...
bool objectInFilter(const TriggerObjectRef &objectRef, const std::string &labelFilter) const
Checks, if an object was used in a certain filter given by name.
edm::RefProd< TriggerAlgorithmCollection > TriggerAlgorithmRefProd
Persistent reference to a TriggerAlgorithmCollection product.
void setBeamMomentum(boost::uint16_t beamMomentum)
Set the LHC beam momentum.
Definition: TriggerEvent.h:131
bool wasError() const
Get the error flag.
Definition: TriggerEvent.h:155
float bCurrentStart() const
Get the CMS magnet current at start of run.
Definition: TriggerEvent.h:173
TriggerObjectRefVector conditionObjects(const std::string &nameCondition) const
Get a vector of references to all objects, which were used in a certain condition given by name...
void setBCurrentStart(float bCurrentStart)
Set the CMS magnet current at start of run.
Definition: TriggerEvent.h:141
bool addObjectMatchResult(const edm::OrphanHandle< TriggerObjectMatch > &trigMatches, const std::string &labelMatcher)
Definition: TriggerEvent.h:317
TriggerObjectRefVector algorithmObjects(const std::string &nameAlgorithm) const
Get a vector of references to all objects, which were used in a certain algorithm given by name...
product_type const * get() const
Definition: RefProd.h:117
boost::uint32_t intensityBeam1_
LHC beam 1 intensity in ???
Definition: TriggerEvent.h:68
boost::uint32_t turnCount_
LHC beam turn counter.
Definition: TriggerEvent.h:75
TriggerAlgorithmRefVector acceptedPhysAlgorithmsGtl() const
Get a vector of references to all physics L1 algorithms succeeding on the GTL board.
TriggerAlgorithmRefVector acceptedTechAlgorithmsGtl() const
Get a vector of references to all technical L1 algorithms succeeding on the GTL board.
float bCurrentStop_
CMS magnet current in ??? at end of run.
Definition: TriggerEvent.h:79
void setIntensityBeam1(boost::uint32_t intensityBeam1)
Set the LHC beam 1 intensity.
Definition: TriggerEvent.h:133
TriggerObjectRefVector objects(int triggerObjectType) const
Definition: TriggerEvent.h:264
std::vector< TriggerObject > TriggerObjectCollection
Collection of TriggerObject.
const TriggerAlgorithm * algorithm(const std::string &nameAlgorithm) const
Definition: TriggerEvent.cc:44
bool objectInPath(const TriggerObjectRef &objectRef, const std::string &namePath) const
Checks, if an object was used in a certain path given by name.
std::vector< TriggerCondition > TriggerConditionCollection
Collection of TriggerCondition.
TriggerObjectRefProd objects_
Reference to pat::TriggerObjectCollection in event.
Definition: TriggerEvent.h:93
const TriggerFilter * filter(const std::string &labelFilter) const
bool conditionInAlgorithm(const TriggerConditionRef &conditionRef, const std::string &nameAlgorithm) const
Checks, if a condition is assigned to a certain algorithm given by name.
void setObjects(const edm::Handle< TriggerObjectCollection > &handleTriggerObjects)
Definition: TriggerEvent.h:258
edm::RefProd< TriggerFilterCollection > TriggerFilterRefProd
Persistent reference to a TriggerFilterCollection product.
TriggerObjectMatchContainer objectMatchResults_
Table of references to pat::TriggerObjectMatch associations in event.
Definition: TriggerEvent.h:95
edm::RefProd< TriggerPathCollection > TriggerPathRefProd
Persistent reference to a TriggerPathCollection product.
Definition: TriggerPath.h:148
bool run_
Was HLT run?
Definition: TriggerEvent.h:53
boost::uint32_t lhcFill() const
Get the LHC fill number.
Definition: TriggerEvent.h:159
std::map< std::string, TriggerObjectMatchRefProd > TriggerObjectMatchContainer
Container to store references to matches from different producers in the trigger event.
void setPhysDecl(bool physDecl)
Set the PhysicsDeclared GT bit.
Definition: TriggerEvent.h:125
std::vector< TriggerPath > TriggerPathCollection
Collection of TriggerPath.
Definition: TriggerPath.h:144
TriggerPathRefVector acceptedPaths() const
Get a vector of references to all succeeding HLT paths.
boost::uint16_t beamMode() const
Get the LHC beam mode.
Definition: TriggerEvent.h:161
void setError(bool error)
Set the error flag.
Definition: TriggerEvent.h:123
unsigned indexPath(const std::string &namePath) const
void setBstMasterStatus(boost::uint16_t bstMasterStatus)
Set the LHC master status.
Definition: TriggerEvent.h:137
boost::uint32_t intensityBeam2_
LHC beam 2 intensity in ???
Definition: TriggerEvent.h:70
bool wasRun() const
Get the run flag.
Definition: TriggerEvent.h:151
float bCurrentStop() const
Get the CMS magnet current at end of run.
Definition: TriggerEvent.h:175