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 // -*- C++ -*-
5 //
6 // Package: PatCandidates
7 // Class: pat::TriggerEvent
8 //
9 //
27 
28 #include <string>
29 #include <vector>
30 
35 #include <cstdint>
36 
37 namespace pat {
38 
39  class TriggerEvent {
41 
47  bool run_;
49  bool accept_;
51  bool error_;
53  bool physDecl_;
55  uint32_t lhcFill_;
58  uint16_t beamMode_;
60  uint16_t beamMomentum_;
62  uint32_t intensityBeam1_;
64  uint32_t intensityBeam2_;
67  uint16_t bstMasterStatus_;
69  uint32_t turnCount_;
75  float bCurrentAvg_;
76 
90 
91  public:
93 
95  TriggerEvent();
98  const std::string& nameHltTable, bool run = true, bool accept = true, bool error = false, bool physDecl = true);
101  const std::string& nameHltTable,
102  bool run = true,
103  bool accept = true,
104  bool error = false,
105  bool physDecl = true);
106 
108  virtual ~TriggerEvent(){};
109 
111 
114  void setNameL1Menu(const std::string& name) { nameL1Menu_ = name; };
116  void setNameHltTable(const std::string& name) { nameHltTable_ = name; };
118  void setRun(bool run) { run_ = run; };
120  void setAccept(bool accept) { accept_ = accept; };
122  void setError(bool error) { error_ = error; };
124  void setPhysDecl(bool physDecl) { physDecl_ = physDecl; };
126  void setLhcFill(uint32_t lhcFill) { lhcFill_ = lhcFill; };
128  void setBeamMode(uint16_t beamMode) { beamMode_ = beamMode; };
130  void setBeamMomentum(uint16_t beamMomentum) { beamMomentum_ = beamMomentum; };
132  void setIntensityBeam1(uint32_t intensityBeam1) { intensityBeam1_ = intensityBeam1; };
134  void setIntensityBeam2(uint32_t intensityBeam2) { intensityBeam2_ = intensityBeam2; };
136  void setBstMasterStatus(uint16_t bstMasterStatus) { bstMasterStatus_ = bstMasterStatus; };
138  void setTurnCount(uint32_t turnCount) { turnCount_ = turnCount; };
140  void setBCurrentStart(float bCurrentStart) { bCurrentStart_ = bCurrentStart; };
142  void setBCurrentStop(float bCurrentStop) { bCurrentStop_ = bCurrentStop; };
144  void setBCurrentAvg(float bCurrentAvg) { bCurrentAvg_ = bCurrentAvg; };
146  const std::string& nameL1Menu() const { return nameL1Menu_; };
148  const std::string& nameHltTable() const { return nameHltTable_; };
150  bool wasRun() const { return run_; };
152  bool wasAccept() const { return accept_; };
154  bool wasError() const { return error_; };
156  bool wasPhysDecl() const { return physDecl_; };
158  uint32_t lhcFill() const { return lhcFill_; };
160  uint16_t beamMode() const { return beamMode_; };
162  uint16_t beamMomentum() const { return beamMomentum_; };
164  uint32_t intensityBeam1() const { return intensityBeam1_; };
166  uint32_t intensityBeam2() const { return intensityBeam2_; };
168  uint16_t bstMasterStatus() const { return bstMasterStatus_; };
170  uint32_t turnCount() const { return turnCount_; };
172  float bCurrentStart() const { return bCurrentStart_; };
174  float bCurrentStop() const { return bCurrentStop_; };
176  float bCurrentAvg() const { return bCurrentAvg_; };
177 
180  void setAlgorithms(const edm::Handle<TriggerAlgorithmCollection>& handleTriggerAlgorithms) {
181  algorithms_ = TriggerAlgorithmRefProd(handleTriggerAlgorithms);
182  };
185  const TriggerAlgorithmCollection* algorithms() const { return algorithms_.get(); };
194  const TriggerAlgorithmRef algorithmRef(const std::string& nameAlgorithm) const;
197  std::string nameAlgorithm(const unsigned bitAlgorithm, const bool techAlgorithm = true) const;
200  unsigned indexAlgorithm(const std::string& nameAlgorithm) const;
217 
220  void setConditions(const edm::Handle<TriggerConditionCollection>& handleTriggerConditions) {
221  conditions_ = TriggerConditionRefProd(handleTriggerConditions);
222  };
225  const TriggerConditionCollection* conditions() const { return conditions_.get(); };
231  const TriggerCondition* condition(const std::string& nameCondition) const;
234  const TriggerConditionRef conditionRef(const std::string& nameCondition) const;
237  unsigned indexCondition(const std::string& nameCondition) const;
240 
243  void setPaths(const edm::Handle<TriggerPathCollection>& handleTriggerPaths) {
244  paths_ = TriggerPathRefProd(handleTriggerPaths);
245  };
248  const TriggerPathCollection* paths() const { return paths_.get(); };
251  const TriggerPathRefVector pathRefs() const;
254  const TriggerPath* path(const std::string& namePath) const;
257  const TriggerPathRef pathRef(const std::string& namePath) const;
260  unsigned indexPath(const std::string& namePath) const;
263 
266  void setFilters(const edm::Handle<TriggerFilterCollection>& handleTriggerFilters) {
267  filters_ = TriggerFilterRefProd(handleTriggerFilters);
268  };
271  const TriggerFilterCollection* filters() const { return filters_.get(); };
274  const TriggerFilterRefVector filterRefs() const;
277  const TriggerFilter* filter(const std::string& labelFilter) const;
280  const TriggerFilterRef filterRef(const std::string& labelFilter) const;
283  unsigned indexFilter(const std::string& labelFilter) const;
286 
289  void setObjects(const edm::Handle<TriggerObjectCollection>& handleTriggerObjects) {
290  objects_ = TriggerObjectRefProd(handleTriggerObjects);
291  };
294  const TriggerObjectCollection* objects() const { return objects_.get(); };
297  const TriggerObjectRefVector objectRefs() const;
300  TriggerObjectRefVector objects(int triggerObjectType) const {
301  return objects(trigger::TriggerObjectType(triggerObjectType));
302  }; // for backward compatibility
303 
306  TriggerConditionRefVector algorithmConditions(const std::string& nameAlgorithm) const;
308  bool conditionInAlgorithm(const TriggerConditionRef& conditionRef, const std::string& nameAlgorithm) const;
312  std::vector<std::string> conditionCollections(const std::string& nameAlgorithm) const;
314  TriggerObjectRefVector conditionObjects(const std::string& nameCondition) const;
316  bool objectInCondition(const TriggerObjectRef& objectRef, const std::string& nameCondition) const;
320  TriggerObjectRefVector algorithmObjects(const std::string& nameAlgorithm) const;
322  bool objectInAlgorithm(const TriggerObjectRef& objectRef, const std::string& nameAlgorithm) const;
325 
329  TriggerFilterRefVector pathModules(const std::string& namePath, bool all = true) const;
331  TriggerFilterRefVector pathFilters(const std::string& namePath, bool firing = true) const;
333  bool filterInPath(const TriggerFilterRef& filterRef, const std::string& namePath, bool firing = true) const;
335  TriggerPathRefVector filterPaths(const TriggerFilterRef& filterRef, bool firing = true) const;
337  std::vector<std::string> filterCollections(const std::string& labelFilter) const;
339  TriggerObjectRefVector filterObjects(const std::string& labelFilter) const;
341  bool objectInFilter(const TriggerObjectRef& objectRef, const std::string& labelFilter) const;
343  TriggerFilterRefVector objectFilters(const TriggerObjectRef& objectRef, bool firing = true) const;
345  TriggerObjectRefVector pathObjects(const std::string& namePath, bool firing = true) const;
347  bool objectInPath(const TriggerObjectRef& objectRef, const std::string& namePath, bool firing = true) const;
349  TriggerPathRefVector objectPaths(const TriggerObjectRef& objectRef, bool firing = true) const;
350 
353  bool addObjectMatchResult(const TriggerObjectMatchRefProd& trigMatches, const std::string& labelMatcher);
354  bool addObjectMatchResult(const edm::Handle<TriggerObjectMatch>& trigMatches, const std::string& labelMatcher) {
355  return addObjectMatchResult(TriggerObjectMatchRefProd(trigMatches), labelMatcher);
356  };
358  const std::string& labelMatcher) {
359  return addObjectMatchResult(TriggerObjectMatchRefProd(trigMatches), labelMatcher);
360  };
362  std::vector<std::string> triggerMatchers() const;
368  const TriggerObjectMatch* triggerObjectMatchResult(const std::string& labelMatcher) const;
369 
371  };
372 
373 } // namespace pat
374 
375 #endif
const TriggerObjectMatchContainer * triggerObjectMatchResults() const
Get all trigger matches.
Definition: TriggerEvent.h:364
bool wasAccept() const
Get the success flag.
Definition: TriggerEvent.h:152
TriggerConditionRefVector algorithmConditions(const std::string &nameAlgorithm) const
void setBCurrentAvg(float bCurrentAvg)
Set the CMS magnet current averaged over run.
Definition: TriggerEvent.h:144
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:45
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:108
TriggerConditionRefProd conditions_
Reference to pat::TriggerConditionCollection in event.
Definition: TriggerEvent.h:81
const TriggerObjectRefVector objectRefs() const
void setBCurrentStop(float bCurrentStop)
Set the CMS magnet current at end of run.
Definition: TriggerEvent.h:142
const std::string & nameHltTable() const
Get the name of the HLT trigger table.
Definition: TriggerEvent.h:148
void setBeamMode(uint16_t beamMode)
Set the LHC beam mode.
Definition: TriggerEvent.h:128
void setBeamMomentum(uint16_t beamMomentum)
Set the LHC beam momentum.
Definition: TriggerEvent.h:130
std::vector< std::string > triggerMatchers() const
Get a list of all linked trigger matches.
edm::RefProd< TriggerObjectCollection > TriggerObjectRefProd
Persistent reference to a TriggerObjectCollection product.
std::map< std::string, TriggerObjectMatchRefProd > TriggerObjectMatchContainer
Container to store references to matches from different producers in the trigger event.
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:53
bool accept_
Did HLT succeed?
Definition: TriggerEvent.h:49
edm::RefProd< TriggerPathCollection > TriggerPathRefProd
Persistent reference to a TriggerPathCollection product.
Definition: TriggerPath.h:157
bool error_
Was HLT in error?
Definition: TriggerEvent.h:51
std::vector< TriggerAlgorithm > TriggerAlgorithmCollection
Collection of TriggerAlgorithm.
const TriggerPathRef pathRef(const std::string &namePath) const
const TriggerCondition * condition(const std::string &nameCondition) const
const TriggerConditionCollection * conditions() const
Definition: TriggerEvent.h:225
void setRun(bool run)
Set the run flag.
Definition: TriggerEvent.h:118
void setAccept(bool accept)
Set the success flag.
Definition: TriggerEvent.h:120
void setIntensityBeam2(uint32_t intensityBeam2)
Set the LHC beam 2 intensity.
Definition: TriggerEvent.h:134
edm::RefProd< TriggerObjectMatch > TriggerObjectMatchRefProd
Persistent reference to a TriggerObjectMatch product.
TriggerFilterRefVector acceptedFilters() const
Get a vector of references to all succeeding HLT filters.
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:43
void setConditions(const edm::Handle< TriggerConditionCollection > &handleTriggerConditions)
Definition: TriggerEvent.h:220
TriggerEvent()
Constructors and Desctructor.
Definition: TriggerEvent.cc:11
TriggerPathRefProd paths_
Reference to pat::TriggerPathCollection in event.
Definition: TriggerEvent.h:83
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:248
unsigned indexFilter(const std::string &labelFilter) const
const std::string & nameL1Menu() const
Get the name of the L1 trigger menu.
Definition: TriggerEvent.h:146
TriggerFilterRefVector pathModules(const std::string &namePath, bool all=true) const
void setAlgorithms(const edm::Handle< TriggerAlgorithmCollection > &handleTriggerAlgorithms)
Definition: TriggerEvent.h:180
void setNameL1Menu(const std::string &name)
Methods.
Definition: TriggerEvent.h:114
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:71
TriggerConditionRefVector acceptedConditions() const
Get a vector of references to all succeeding L1 condition.
TriggerAlgorithmRefProd algorithms_
Definition: TriggerEvent.h:79
uint32_t lhcFill_
LHC fill number.
Definition: TriggerEvent.h:55
void setFilters(const edm::Handle< TriggerFilterCollection > &handleTriggerFilters)
Definition: TriggerEvent.h:266
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...
const TriggerObjectCollection * objects() const
Definition: TriggerEvent.h:294
unsigned indexAlgorithm(const std::string &nameAlgorithm) const
Analysis-level HLTrigger filter class.
Definition: TriggerFilter.h:33
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:156
unsigned indexCondition(const std::string &nameCondition) const
Analysis-level L1 trigger condition class.
Analysis-level HLTrigger path class.
Definition: TriggerPath.h:36
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...
std::vector< TriggerCondition > TriggerConditionCollection
Collection of TriggerCondition.
const TriggerPath * path(const std::string &namePath) const
const TriggerFilterRef filterRef(const std::string &labelFilter) const
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:75
void setPaths(const edm::Handle< TriggerPathCollection > &handleTriggerPaths)
Definition: TriggerEvent.h:243
bool objectInCondition(const TriggerObjectRef &objectRef, const std::string &nameCondition) const
Checks, if an object was used in a certain condition given by name.
TriggerAlgorithmRefVector acceptedPhysAlgorithms() const
Get a vector of references to all succeeding physics L1 algorithms.
const TriggerAlgorithmCollection * algorithms() const
Definition: TriggerEvent.h:185
void setNameHltTable(const std::string &name)
Set the name of the HLT trigger table.
Definition: TriggerEvent.h:116
float bCurrentAvg() const
Get the CMS magnet current averaged over run.
Definition: TriggerEvent.h:176
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:354
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.
uint32_t intensityBeam1() const
Get the LHC beam 1 intensity.
Definition: TriggerEvent.h:164
uint32_t intensityBeam1_
LHC beam 1 intensity in ???
Definition: TriggerEvent.h:62
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:85
std::string nameAlgorithm(const unsigned bitAlgorithm, const bool techAlgorithm=true) const
Analysis-level trigger event class.
Definition: TriggerEvent.h:39
void setBstMasterStatus(uint16_t bstMasterStatus)
Set the LHC master status.
Definition: TriggerEvent.h:136
const TriggerAlgorithmRef algorithmRef(const std::string &nameAlgorithm) const
Definition: TriggerEvent.cc:99
std::vector< TriggerPath > TriggerPathCollection
Collection of TriggerPath.
Definition: TriggerPath.h:153
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.
uint32_t intensityBeam2_
LHC beam 2 intensity in ???
Definition: TriggerEvent.h:64
const TriggerFilterCollection * filters() const
Definition: TriggerEvent.h:271
uint16_t beamMomentum_
LHC beam momentum in GeV.
Definition: TriggerEvent.h:60
bool objectInFilter(const TriggerObjectRef &objectRef, const std::string &labelFilter) const
Checks, if an object was used in a certain filter given by name.
uint32_t turnCount() const
Get the LHC beam turn counter.
Definition: TriggerEvent.h:170
uint16_t bstMasterStatus() const
Get the LHC master status.
Definition: TriggerEvent.h:168
bool wasError() const
Get the error flag.
Definition: TriggerEvent.h:154
const TriggerAlgorithmRefVector algorithmRefs() const
Definition: TriggerEvent.cc:77
edm::RefProd< TriggerAlgorithmCollection > TriggerAlgorithmRefProd
Persistent reference to a TriggerAlgorithmCollection product.
float bCurrentStart() const
Get the CMS magnet current at start of run.
Definition: TriggerEvent.h:172
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:140
bool addObjectMatchResult(const edm::OrphanHandle< TriggerObjectMatch > &trigMatches, const std::string &labelMatcher)
Definition: TriggerEvent.h:357
uint32_t lhcFill() const
Get the LHC fill number.
Definition: TriggerEvent.h:158
void setLhcFill(uint32_t lhcFill)
Set the LHC fill number.
Definition: TriggerEvent.h:126
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...
uint16_t bstMasterStatus_
Definition: TriggerEvent.h:67
uint16_t beamMomentum() const
Get the LHC beam momentum.
Definition: TriggerEvent.h:162
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.
uint16_t beamMode_
Definition: TriggerEvent.h:58
const TriggerConditionRefVector conditionRefs() const
float bCurrentStop_
CMS magnet current in ??? at end of run.
Definition: TriggerEvent.h:73
product_type const * get() const
Definition: RefProd.h:106
void setTurnCount(uint32_t turnCount)
Set the LHC beam turn counter.
Definition: TriggerEvent.h:138
TriggerObjectRefVector objects(int triggerObjectType) const
Definition: TriggerEvent.h:300
const TriggerAlgorithm * algorithm(const std::string &nameAlgorithm) const
Definition: TriggerEvent.cc:89
TriggerPathRefVector filterPaths(const TriggerFilterRef &filterRef, bool firing=true) const
Get a vector of references to all paths, which have a certain filter assigned.
TriggerObjectRefProd objects_
Reference to pat::TriggerObjectCollection in event.
Definition: TriggerEvent.h:87
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:289
uint32_t turnCount_
LHC beam turn counter.
Definition: TriggerEvent.h:69
TriggerObjectMatchContainer objectMatchResults_
Table of references to pat::TriggerObjectMatch associations in event.
Definition: TriggerEvent.h:89
bool run_
Was HLT run?
Definition: TriggerEvent.h:47
uint16_t beamMode() const
Get the LHC beam mode.
Definition: TriggerEvent.h:160
void setPhysDecl(bool physDecl)
Set the PhysicsDeclared GT bit.
Definition: TriggerEvent.h:124
uint32_t intensityBeam2() const
Get the LHC beam 2 intensity.
Definition: TriggerEvent.h:166
const TriggerConditionRef conditionRef(const std::string &nameCondition) const
std::vector< TriggerObject > TriggerObjectCollection
Collection of TriggerObject.
TriggerPathRefVector acceptedPaths() const
Get a vector of references to all succeeding HLT paths.
std::vector< TriggerFilter > TriggerFilterCollection
Collection of TriggerFilter.
void setError(bool error)
Set the error flag.
Definition: TriggerEvent.h:122
unsigned indexPath(const std::string &namePath) const
bool wasRun() const
Get the run flag.
Definition: TriggerEvent.h:150
edm::RefProd< TriggerFilterCollection > TriggerFilterRefProd
Persistent reference to a TriggerFilterCollection product.
void setIntensityBeam1(uint32_t intensityBeam1)
Set the LHC beam 1 intensity.
Definition: TriggerEvent.h:132
const TriggerPathRefVector pathRefs() const
edm::RefProd< TriggerConditionCollection > TriggerConditionRefProd
Persistent reference to a TriggerConditionCollection product.
float bCurrentStop() const
Get the CMS magnet current at end of run.
Definition: TriggerEvent.h:174