CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
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 // system include files
21 #include <memory>
22 
23 // framework
30 
31 // L1Gt Utils
33 
34 // ROOT output stuff
37 #include "TTree.h"
38 
40 
41 //
42 // class declaration
43 //
44 
46 public:
47  explicit L1MenuTreeProducer(const edm::ParameterSet&);
48  ~L1MenuTreeProducer() override;
49 
50 private:
51  void beginJob(void) override;
52  void beginRun(const edm::Run&, const edm::EventSetup&) override;
53  void analyze(const edm::Event&, const edm::EventSetup&) override;
54  void endRun(const edm::Run&, const edm::EventSetup&) override {}
55  void endJob() override;
56 
57 public:
60 
61 private:
62  // output file
64 
65  // tree
66  TTree* tree_;
67 
68  // EDM input tags
69  // edm::InputTag l1MenuInputTag_;
71 };
72 
74  : // l1MenuInputTag_(iConfig.getParameter<edm::InputTag>("L1MenuInputTag")),
75  l1GtUtils_(iConfig, consumesCollector(), true, L1GtUtils::UseEventSetupIn::Event) {
78 
79  // set up output
80  tree_ = fs_->make<TTree>("L1MenuTree", "L1MenuTree");
81  tree_->Branch("L1Menu", "L1Analysis::L1AnalysisL1MenuDataFormat", &l1MenuData, 32000, 0 /*3*/);
82 }
83 
85 
86 //
87 // member functions
88 //
89 
90 // ------------ method called to for each event ------------
92  l1Menu->Reset();
93 
94  // getting l1GtUtils
95  edm::LogInfo("L1TNtuples") << "Extracting menu ... " << std::endl;
97 
98  // testing menu
99  edm::LogInfo("L1TNtuples") << "L1 trigger menu name and implementation:"
100  << "\n"
101  << l1GtUtils_.l1TriggerMenu() << "\n"
102  << l1GtUtils_.l1TriggerMenuImplementation() << std::endl;
103 
104  // adding PrescaleFactorIndex
106 
107  tree_->Fill();
108 }
109 
110 // ------------ method called once each job just before starting event loop ------------
112 
113 void L1MenuTreeProducer::beginRun(const edm::Run& iRun, const edm::EventSetup& evSetup) {
114  // L1GtTriggerMenuLite input tag from provenance
115  //l1GtUtils_.getL1GtRunCache(iRun, evSetup, true, true);
116 }
117 
118 // ------------ method called once each job just after ending the event loop ------------
120 
121 //define this as a plug-in
void endJob() override
void retrieveL1EventSetup(const edm::EventSetup &, bool isRun=true)
retrieve all the relevant L1 trigger event setup records and cache them to improve the speed ...
Definition: L1GtUtils.cc:128
edm::Service< TFileService > fs_
void analyze(const edm::Event &, const edm::EventSetup &) override
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:16
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:1577
L1MenuTreeProducer(const edm::ParameterSet &)
int iEvent
Definition: GenABIO.cc:224
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:1598
void beginJob(void) override
Log< level::Info, false > LogInfo
void endRun(const edm::Run &, const edm::EventSetup &) override
L1Analysis::L1AnalysisL1MenuDataFormat * l1MenuData
~L1MenuTreeProducer() override
L1AnalysisL1MenuDataFormat * getData()
UseEventSetupIn
Definition: L1TGlobalUtil.h:42
void beginRun(const edm::Run &, const edm::EventSetup &) override
Definition: Run.h:45