CMS 3D CMS Logo

TriggerOutputFields.h
Go to the documentation of this file.
1 #ifndef PhysicsTools_NanoAOD_TriggerOutputFields_h
2 #define PhysicsTools_NanoAOD_TriggerOutputFields_h
3 
4 #include "RNTupleFieldPtr.h"
5 
7 
8 namespace edm {
9  class EventForOutput;
10  class TriggerResults;
11 } // namespace edm
12 
14 public:
15  TriggerFieldPtr() = default;
16  TriggerFieldPtr(std::string name, int index, std::string fieldName, std::string fieldDesc, RNTupleModel& model);
17  void fill(const edm::TriggerResults& triggers);
18  const std::string& getTriggerName() const { return m_triggerName; }
19  void setIndex(int newIndex) { m_triggerIndex = newIndex; }
20 
21 private:
23  // The trigger results name extracted from the TriggerResults with version suffixes trimmed
25  int m_triggerIndex = -1;
26 };
27 
29 public:
30  TriggerOutputFields() = default;
33  void createFields(const edm::EventForOutput& event, RNTupleModel& model);
34  void fill(const edm::EventForOutput& event);
35 
36 private:
37  static std::vector<std::string> getTriggerNames(const edm::TriggerResults& triggerResults);
38  // Update trigger field information on run boundaries
40  void makeUniqueFieldName(/*const*/ RNTupleModel& model, std::string& name);
41 
43  long m_lastRun;
45  std::vector<TriggerFieldPtr> m_triggerFields;
46 };
47 
48 #endif
void makeUniqueFieldName(RNTupleModel &model, std::string &name)
void fill(const edm::EventForOutput &event)
void updateTriggerFields(const edm::TriggerResults &triggerResults)
void setIndex(int newIndex)
TriggerFieldPtr()=default
TriggerOutputFields()=default
std::vector< TriggerFieldPtr > m_triggerFields
const std::string & getTriggerName() const
void fill(const edm::TriggerResults &triggers)
static std::string const triggerResults
Definition: EdmProvDump.cc:47
void createFields(const edm::EventForOutput &event, RNTupleModel &model)
static std::vector< std::string > getTriggerNames(const edm::TriggerResults &triggerResults)
HLT enums.
edm::EDGetToken m_token
std::string m_triggerName
TriggerOutputFields(const std::string &processName, const edm::EDGetToken &token)
Definition: event.py:1
RNTupleFieldPtr< bool > m_field