CMS 3D CMS Logo

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 //
29 
30 #include <string>
31 #include <vector>
32 #include <boost/cstdint.hpp>
33 
38 
39 
40 namespace pat {
41 
42  class TriggerEvent {
43 
45 
51  bool run_;
53  bool accept_;
55  bool error_;
57  bool physDecl_;
59  boost::uint32_t lhcFill_;
62  boost::uint16_t beamMode_;
64  boost::uint16_t beamMomentum_;
66  boost::uint32_t intensityBeam1_;
68  boost::uint32_t intensityBeam2_;
71  boost::uint16_t bstMasterStatus_;
73  boost::uint32_t turnCount_;
79  float bCurrentAvg_;
80 
94 
95  public:
96 
98 
100  TriggerEvent();
102  TriggerEvent( const std::string & nameHltTable, bool run = true, bool accept = true, bool error = false, bool physDecl = true );
104  TriggerEvent( const std::string & nameL1Menu, const std::string & nameHltTable, bool run = true, bool accept = true, bool error = false, bool physDecl = true );
105 
107  virtual ~TriggerEvent() {};
108 
110 
113  void setNameL1Menu( const std::string & name ) { nameL1Menu_ = name; };
115  void setNameHltTable( const std::string & name ) { nameHltTable_ = name; };
117  void setRun( bool run ) { run_ = run; };
119  void setAccept( bool accept ) { accept_ = accept; };
121  void setError( bool error ) { error_ = error; };
123  void setPhysDecl( bool physDecl ) { physDecl_ = physDecl; };
125  void setLhcFill( boost::uint32_t lhcFill ) { lhcFill_ = lhcFill; };
127  void setBeamMode( boost::uint16_t beamMode ) { beamMode_ = beamMode; };
129  void setBeamMomentum( boost::uint16_t beamMomentum ) { beamMomentum_ = beamMomentum; };
131  void setIntensityBeam1( boost::uint32_t intensityBeam1 ) { intensityBeam1_ = intensityBeam1; };
133  void setIntensityBeam2( boost::uint32_t intensityBeam2 ) { intensityBeam2_ = intensityBeam2; };
135  void setBstMasterStatus( boost::uint16_t bstMasterStatus ) { bstMasterStatus_ = bstMasterStatus; };
137  void setTurnCount( boost::uint32_t turnCount ) { turnCount_ = turnCount; };
139  void setBCurrentStart( float bCurrentStart ) { bCurrentStart_ = bCurrentStart; };
141  void setBCurrentStop( float bCurrentStop ) { bCurrentStop_ = bCurrentStop; };
143  void setBCurrentAvg( float bCurrentAvg ) { bCurrentAvg_ = bCurrentAvg; };
145  const std::string & nameL1Menu() const { return nameL1Menu_; };
147  const std::string & nameHltTable() const { return nameHltTable_; };
149  bool wasRun() const { return run_; };
151  bool wasAccept() const { return accept_; };
153  bool wasError() const { return error_; };
155  bool wasPhysDecl() const { return physDecl_; };
157  boost::uint32_t lhcFill() const { return lhcFill_; };
159  boost::uint16_t beamMode() const { return beamMode_; };
161  boost::uint16_t beamMomentum() const { return beamMomentum_; };
163  boost::uint32_t intensityBeam1() const { return intensityBeam1_; };
165  boost::uint32_t intensityBeam2() const { return intensityBeam2_; };
167  boost::uint16_t bstMasterStatus() const { return bstMasterStatus_; };
169  boost::uint32_t turnCount() const { return turnCount_; };
171  float bCurrentStart() const { return bCurrentStart_; };
173  float bCurrentStop() const { return bCurrentStop_; };
175  float bCurrentAvg() const { return bCurrentAvg_; };
176 
179  void setAlgorithms( const edm::Handle< TriggerAlgorithmCollection > & handleTriggerAlgorithms ) { algorithms_ = TriggerAlgorithmRefProd( handleTriggerAlgorithms ); };
182  const TriggerAlgorithmCollection * algorithms() const { return algorithms_.get(); };
188  const TriggerAlgorithm * algorithm( const std::string & nameAlgorithm ) const;
191  const TriggerAlgorithmRef algorithmRef( const std::string & nameAlgorithm ) const;
194  std::string nameAlgorithm( const unsigned bitAlgorithm, const bool techAlgorithm = true ) const;
197  unsigned indexAlgorithm( const std::string & nameAlgorithm ) const;
214 
217  void setConditions( const edm::Handle< TriggerConditionCollection > & handleTriggerConditions ) { conditions_ = TriggerConditionRefProd( handleTriggerConditions ); };
220  const TriggerConditionCollection * conditions() const { return conditions_.get(); };
226  const TriggerCondition * condition( const std::string & nameCondition ) const;
229  const TriggerConditionRef conditionRef( const std::string & nameCondition ) const;
232  unsigned indexCondition( const std::string & nameCondition ) const;
235 
238  void setPaths( const edm::Handle< TriggerPathCollection > & handleTriggerPaths ) { paths_ = TriggerPathRefProd( handleTriggerPaths ); };
241  const TriggerPathCollection * paths() const { return paths_.get(); };
244  const TriggerPathRefVector pathRefs() const;
247  const TriggerPath * path( const std::string & namePath ) const;
250  const TriggerPathRef pathRef( const std::string & namePath ) const;
253  unsigned indexPath( const std::string & namePath ) const;
256 
259  void setFilters( const edm::Handle< TriggerFilterCollection > & handleTriggerFilters ) { filters_ = TriggerFilterRefProd( handleTriggerFilters ); };
262  const TriggerFilterCollection * filters() const { return filters_.get(); };
265  const TriggerFilterRefVector filterRefs() const;
268  const TriggerFilter * filter( const std::string & labelFilter ) const;
271  const TriggerFilterRef filterRef( const std::string & labelFilter ) const;
274  unsigned indexFilter( const std::string & labelFilter ) const;
277 
280  void setObjects( const edm::Handle< TriggerObjectCollection > & handleTriggerObjects ) { objects_ = TriggerObjectRefProd( handleTriggerObjects ); };
283  const TriggerObjectCollection * objects() const { return objects_.get(); };
286  const TriggerObjectRefVector objectRefs() const;
288  TriggerObjectRefVector objects( trigger::TriggerObjectType triggerObjectType ) const;
289  TriggerObjectRefVector objects( int triggerObjectType ) const { return objects( trigger::TriggerObjectType( triggerObjectType ) ); }; // for backward compatibility
290 
293  TriggerConditionRefVector algorithmConditions( const std::string & nameAlgorithm ) const;
295  bool conditionInAlgorithm( const TriggerConditionRef & conditionRef, const std::string & nameAlgorithm ) const;
299  std::vector< std::string > conditionCollections( const std::string & nameAlgorithm ) const;
301  TriggerObjectRefVector conditionObjects( const std::string & nameCondition ) const;
303  bool objectInCondition( const TriggerObjectRef & objectRef, const std::string & nameCondition ) const;
307  TriggerObjectRefVector algorithmObjects( const std::string & nameAlgorithm ) const;
309  bool objectInAlgorithm( const TriggerObjectRef & objectRef, const std::string & nameAlgorithm ) const;
312 
316  TriggerFilterRefVector pathModules( const std::string & namePath, bool all = true ) const;
318  TriggerFilterRefVector pathFilters( const std::string & namePath, bool firing = true ) const;
320  bool filterInPath( const TriggerFilterRef & filterRef, const std::string & namePath, bool firing = true ) const;
322  TriggerPathRefVector filterPaths( const TriggerFilterRef & filterRef, bool firing = true ) const;
324  std::vector< std::string > filterCollections( const std::string & labelFilter ) const;
326  TriggerObjectRefVector filterObjects( const std::string & labelFilter ) const;
328  bool objectInFilter( const TriggerObjectRef & objectRef, const std::string & labelFilter ) const;
330  TriggerFilterRefVector objectFilters( const TriggerObjectRef & objectRef, bool firing = true ) const;
332  TriggerObjectRefVector pathObjects( const std::string & namePath, bool firing = true ) const;
334  bool objectInPath( const TriggerObjectRef & objectRef, const std::string & namePath, bool firing = true ) const;
336  TriggerPathRefVector objectPaths( const TriggerObjectRef & objectRef, bool firing = true ) const;
337 
340  bool addObjectMatchResult( const TriggerObjectMatchRefProd & trigMatches, const std::string & labelMatcher );
341  bool addObjectMatchResult( const edm::Handle< TriggerObjectMatch > & trigMatches, const std::string & labelMatcher ) { return addObjectMatchResult( TriggerObjectMatchRefProd( trigMatches ), labelMatcher ); };
342  bool addObjectMatchResult( const edm::OrphanHandle< TriggerObjectMatch > & trigMatches, const std::string & labelMatcher ) { return addObjectMatchResult( TriggerObjectMatchRefProd( trigMatches ), labelMatcher ); };
344  std::vector< std::string > triggerMatchers() const;
350  const TriggerObjectMatch * triggerObjectMatchResult( const std::string & labelMatcher ) const;
351 
353 
354  };
355 
356 }
357 
358 
359 #endif
const TriggerObjectMatchContainer * triggerObjectMatchResults() const
Get all trigger matches.
Definition: TriggerEvent.h:346
void setBeamMode(boost::uint16_t beamMode)
Set the LHC beam mode.
Definition: TriggerEvent.h:127
bool wasAccept() const
Get the success flag.
Definition: TriggerEvent.h:151
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:143
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.
std::string nameHltTable_
Name of the HLT trigger table.
Definition: TriggerEvent.h:49
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:107
TriggerConditionRefProd conditions_
Reference to pat::TriggerConditionCollection in event.
Definition: TriggerEvent.h:85
const TriggerObjectRefVector objectRefs() const
void setBCurrentStop(float bCurrentStop)
Set the CMS magnet current at end of run.
Definition: TriggerEvent.h:141
boost::uint16_t beamMomentum() const
Get the LHC beam momentum.
Definition: TriggerEvent.h:161
boost::uint16_t beamMode_
Definition: TriggerEvent.h:62
const std::string & nameHltTable() const
Get the name of the HLT trigger table.
Definition: TriggerEvent.h:147
boost::uint16_t beamMomentum_
LHC beam momentum in GeV.
Definition: TriggerEvent.h:64
std::vector< std::string > triggerMatchers() const
Get a list of all linked trigger matches.
bool objectInPath(const TriggerObjectRef &objectRef, const std::string &namePath, bool firing=true) const
Checks, if an object was used in a certain path given by name.
bool physDecl_
PhysicsDeclared GT bit.
Definition: TriggerEvent.h:57
bool accept_
Did HLT succeed?
Definition: TriggerEvent.h:53
bool error_
Was HLT in error?
Definition: TriggerEvent.h:55
const TriggerPathRef pathRef(const std::string &namePath) const
const TriggerCondition * condition(const std::string &nameCondition) const
const TriggerConditionCollection * conditions() const
Definition: TriggerEvent.h:220
void setRun(bool run)
Set the run flag.
Definition: TriggerEvent.h:117
void setAccept(bool accept)
Set the success flag.
Definition: TriggerEvent.h:119
TriggerFilterRefVector acceptedFilters() const
Get a vector of references to all succeeding HLT filters.
edm::RefProd< TriggerObjectCollection > TriggerObjectRefProd
Persistent reference to a TriggerObjectCollection product.
const TriggerFilterRefVector filterRefs() const
TriggerAlgorithmRefVector acceptedTechAlgorithms() const
Get a vector of references to all succeeding technical L1 algorithms.
TriggerFilterRefVector pathFilters(const std::string &namePath, bool firing=true) const
Get a vector of references to all active HLT filters assigned to a certain path given by name...
std::string nameL1Menu_
Data Members.
Definition: TriggerEvent.h:47
void setConditions(const edm::Handle< TriggerConditionCollection > &handleTriggerConditions)
Definition: TriggerEvent.h:217
TriggerEvent()
Constructors and Desctructor.
Definition: TriggerEvent.cc:15
TriggerPathRefProd paths_
Reference to pat::TriggerPathCollection in event.
Definition: TriggerEvent.h:87
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:30
const TriggerPathCollection * paths() const
Definition: TriggerEvent.h:241
unsigned indexFilter(const std::string &labelFilter) const
const std::string & nameL1Menu() const
Get the name of the L1 trigger menu.
Definition: TriggerEvent.h:145
void setIntensityBeam2(boost::uint32_t intensityBeam2)
Set the LHC beam 2 intensity.
Definition: TriggerEvent.h:133
TriggerFilterRefVector pathModules(const std::string &namePath, bool all=true) const
void setAlgorithms(const edm::Handle< TriggerAlgorithmCollection > &handleTriggerAlgorithms)
Definition: TriggerEvent.h:179
void setNameL1Menu(const std::string &name)
Methods.
Definition: TriggerEvent.h:113
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:75
TriggerConditionRefVector acceptedConditions() const
Get a vector of references to all succeeding L1 condition.
TriggerAlgorithmRefProd algorithms_
Definition: TriggerEvent.h:83
void setFilters(const edm::Handle< TriggerFilterCollection > &handleTriggerFilters)
Definition: TriggerEvent.h:259
Definition: HeavyIon.h:7
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:125
std::vector< TriggerAlgorithm > TriggerAlgorithmCollection
Collection of TriggerAlgorithm.
const TriggerObjectCollection * objects() const
Definition: TriggerEvent.h:283
unsigned indexAlgorithm(const std::string &nameAlgorithm) const
Analysis-level HLTrigger filter class.
Definition: TriggerFilter.h:35
bool filterInPath(const TriggerFilterRef &filterRef, const std::string &namePath, bool firing=true) const
Checks, if a filter is assigned to and was run in a certain path given by name.
bool wasPhysDecl() const
Get the PhysicsDeclared GT bit.
Definition: TriggerEvent.h:155
boost::uint16_t bstMasterStatus_
Definition: TriggerEvent.h:71
unsigned indexCondition(const std::string &nameCondition) const
Analysis-level L1 trigger condition class.
Analysis-level HLTrigger path class.
Definition: TriggerPath.h:39
bool addObjectMatchResult(const TriggerObjectMatchRefProd &trigMatches, const std::string &labelMatcher)
TriggerObjectRefVector pathObjects(const std::string &namePath, bool firing=true) const
Get a vector of references to all objects, which were used in a certain path given by name...
boost::uint32_t intensityBeam1() const
Get the LHC beam 1 intensity.
Definition: TriggerEvent.h:163
const TriggerPath * path(const std::string &namePath) const
const TriggerFilterRef filterRef(const std::string &labelFilter) const
boost::uint32_t intensityBeam2() const
Get the LHC beam 2 intensity.
Definition: TriggerEvent.h:165
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:79
void setPaths(const edm::Handle< TriggerPathCollection > &handleTriggerPaths)
Definition: TriggerEvent.h:238
boost::uint32_t lhcFill_
LHC fill number.
Definition: TriggerEvent.h:59
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:167
TriggerAlgorithmRefVector acceptedPhysAlgorithms() const
Get a vector of references to all succeeding physics L1 algorithms.
const TriggerAlgorithmCollection * algorithms() const
Definition: TriggerEvent.h:182
void setNameHltTable(const std::string &name)
Set the name of the HLT trigger table.
Definition: TriggerEvent.h:115
float bCurrentAvg() const
Get the CMS magnet current averaged over run.
Definition: TriggerEvent.h:175
TriggerAlgorithmRefVector acceptedAlgorithms() const
Get a vector of references to all succeeding L1 algorithms.
bool addObjectMatchResult(const edm::Handle< TriggerObjectMatch > &trigMatches, const std::string &labelMatcher)
Definition: TriggerEvent.h:341
const TriggerObjectMatch * triggerObjectMatchResult(const std::string &labelMatcher) const
TriggerFilterRefVector objectFilters(const TriggerObjectRef &objectRef, bool firing=true) const
Get a vector of references to all filters, which have a certain object assigned.
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:89
std::string nameAlgorithm(const unsigned bitAlgorithm, const bool techAlgorithm=true) const
Analysis-level trigger event class.
Definition: TriggerEvent.h:42
boost::uint32_t turnCount() const
Get the LHC beam turn counter.
Definition: TriggerEvent.h:169
const TriggerAlgorithmRef algorithmRef(const std::string &nameAlgorithm) const
std::vector< TriggerFilter > TriggerFilterCollection
Collection of TriggerFilter.
void setTurnCount(boost::uint32_t turnCount)
Set the LHC beam turn counter.
Definition: TriggerEvent.h:137
TriggerPathRefVector objectPaths(const TriggerObjectRef &objectRef, bool firing=true) const
Get a vector of references to all paths, which have a certain object assigned.
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.
const TriggerFilterCollection * filters() const
Definition: TriggerEvent.h:262
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:129
bool wasError() const
Get the error flag.
Definition: TriggerEvent.h:153
const TriggerAlgorithmRefVector algorithmRefs() const
Definition: TriggerEvent.cc:87
float bCurrentStart() const
Get the CMS magnet current at start of run.
Definition: TriggerEvent.h:171
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:139
bool addObjectMatchResult(const edm::OrphanHandle< TriggerObjectMatch > &trigMatches, const std::string &labelMatcher)
Definition: TriggerEvent.h:342
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...
boost::uint32_t intensityBeam1_
LHC beam 1 intensity in ???
Definition: TriggerEvent.h:66
boost::uint32_t turnCount_
LHC beam turn counter.
Definition: TriggerEvent.h:73
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.
const TriggerConditionRefVector conditionRefs() const
float bCurrentStop_
CMS magnet current in ??? at end of run.
Definition: TriggerEvent.h:77
product_type const * get() const
Definition: RefProd.h:113
void setIntensityBeam1(boost::uint32_t intensityBeam1)
Set the LHC beam 1 intensity.
Definition: TriggerEvent.h:131
TriggerObjectRefVector objects(int triggerObjectType) const
Definition: TriggerEvent.h:289
std::vector< TriggerObject > TriggerObjectCollection
Collection of TriggerObject.
const TriggerAlgorithm * algorithm(const std::string &nameAlgorithm) const
TriggerPathRefVector filterPaths(const TriggerFilterRef &filterRef, bool firing=true) const
Get a vector of references to all paths, which have a certain filter assigned.
std::vector< TriggerCondition > TriggerConditionCollection
Collection of TriggerCondition.
TriggerObjectRefProd objects_
Reference to pat::TriggerObjectCollection in event.
Definition: TriggerEvent.h:91
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:280
edm::RefProd< TriggerFilterCollection > TriggerFilterRefProd
Persistent reference to a TriggerFilterCollection product.
TriggerObjectMatchContainer objectMatchResults_
Table of references to pat::TriggerObjectMatch associations in event.
Definition: TriggerEvent.h:93
edm::RefProd< TriggerPathCollection > TriggerPathRefProd
Persistent reference to a TriggerPathCollection product.
Definition: TriggerPath.h:157
bool run_
Was HLT run?
Definition: TriggerEvent.h:51
boost::uint32_t lhcFill() const
Get the LHC fill number.
Definition: TriggerEvent.h:157
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:123
std::vector< TriggerPath > TriggerPathCollection
Collection of TriggerPath.
Definition: TriggerPath.h:153
const TriggerConditionRef conditionRef(const std::string &nameCondition) const
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:159
void setError(bool error)
Set the error flag.
Definition: TriggerEvent.h:121
unsigned indexPath(const std::string &namePath) const
void setBstMasterStatus(boost::uint16_t bstMasterStatus)
Set the LHC master status.
Definition: TriggerEvent.h:135
boost::uint32_t intensityBeam2_
LHC beam 2 intensity in ???
Definition: TriggerEvent.h:68
bool wasRun() const
Get the run flag.
Definition: TriggerEvent.h:149
const TriggerPathRefVector pathRefs() const
float bCurrentStop() const
Get the CMS magnet current at end of run.
Definition: TriggerEvent.h:173