CMS 3D CMS Logo

L1MenuTreeProducer.cc
Go to the documentation of this file.
1 // -*- C++ -*-
2 //
3 // Package: L1Trigger/L1TNtuples
4 // Class: L1ExtraTreeProducer
5 //
13 //
14 // Original Author: Alex Tapper
15 // Created:
16 // $Id: L1ExtraTreeProducer.cc,v 1.6 2010/06/17 20:44:45 econte Exp $
17 //
18 //
19 
20 
21 // system include files
22 #include <memory>
23 
24 // framework
31 
32 // L1Gt Utils
34 
35 // ROOT output stuff
38 #include "TTree.h"
39 
41 
42 //
43 // class declaration
44 //
45 
47 {
48 public:
49  explicit L1MenuTreeProducer(const edm::ParameterSet&);
50  ~L1MenuTreeProducer() override;
51 
52 
53 private:
54  void beginJob(void) override;
55  void beginRun(const edm::Run&, const edm::EventSetup&) override;
56  void analyze(const edm::Event&, const edm::EventSetup&) override;
57  void endRun(const edm::Run&, const edm::EventSetup&) override {}
58  void endJob() override;
59 
60 public:
61 
64 
65 private:
66 
67  // output file
69 
70  // tree
71  TTree * tree_;
72 
73  // EDM input tags
74  // edm::InputTag l1MenuInputTag_;
76 };
77 
78 
79 
81  // l1MenuInputTag_(iConfig.getParameter<edm::InputTag>("L1MenuInputTag")),
82  l1GtUtils_(iConfig, consumesCollector(), true)
83 {
86 
87  // set up output
88  tree_=fs_->make<TTree>("L1MenuTree", "L1MenuTree");
89  tree_->Branch("L1Menu", "L1Analysis::L1AnalysisL1MenuDataFormat", &l1MenuData, 32000, 0 /*3*/);
90 
91 }
92 
93 
95 {}
96 
97 
98 //
99 // member functions
100 //
101 
102 // ------------ method called to for each event ------------
103 void
105 {
106 
107  l1Menu->Reset();
108 
109  // getting l1GtUtils
110  edm::LogInfo("L1TNtuples") << "Extracting menu ... "<<std::endl;
112 
113  // testing menu
114  edm::LogInfo("L1TNtuples") << "L1 trigger menu name and implementation:" << "\n"
115  << l1GtUtils_.l1TriggerMenu() << "\n"
117  << std::endl;
118 
119  // adding PrescaleFactorIndex
121 
122  tree_->Fill();
123 
124 }
125 
126 // ------------ method called once each job just before starting event loop ------------
127 void
129 {
130 }
131 
132 void
134  const edm::EventSetup& evSetup)
135 {
136  // L1GtTriggerMenuLite input tag from provenance
137  //l1GtUtils_.getL1GtRunCache(iRun, evSetup, true, true);
138 }
139 
140 // ------------ method called once each job just after ending the event loop ------------
141 void
143 {
144 }
145 
146 //define this as a plug-in
void endJob() override
edm::Service< TFileService > fs_
void analyze(const edm::Event &, const edm::EventSetup &) override
T * make(const Args &...args) const
make new ROOT object
Definition: TFileService.h:64
const std::string & l1TriggerMenu() const
return the L1 trigger menu name
Definition: L1GtUtils.cc:1833
L1MenuTreeProducer(const edm::ParameterSet &)
int iEvent
Definition: GenABIO.cc:224
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:16
void SetPrescaleFactorIndex(L1GtUtils &l1GtUtils_, const edm::Event &iEvent)
L1Analysis::L1AnalysisL1Menu * l1Menu
const std::string & l1TriggerMenuImplementation() const
return the L1 trigger menu implementation
Definition: L1GtUtils.cc:1858
ConsumesCollector consumesCollector()
Use a ConsumesCollector to gather consumes information from helper functions.
void retrieveL1EventSetup(const edm::EventSetup &)
retrieve all the relevant L1 trigger event setup records and cache them to improve the speed ...
Definition: L1GtUtils.cc:121
void beginJob(void) override
void endRun(const edm::Run &, const edm::EventSetup &) override
L1Analysis::L1AnalysisL1MenuDataFormat * l1MenuData
~L1MenuTreeProducer() override
L1AnalysisL1MenuDataFormat * getData()
void beginRun(const edm::Run &, const edm::EventSetup &) override
Definition: Run.h:45