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 // 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
L1MenuTreeProducer::~L1MenuTreeProducer
~L1MenuTreeProducer() override
Definition: L1MenuTreeProducer.cc:84
L1Analysis::L1AnalysisL1Menu::Reset
void Reset()
Definition: L1AnalysisL1Menu.h:18
MessageLogger.h
L1GtUtils::l1TriggerMenuImplementation
const std::string & l1TriggerMenuImplementation() const
return the L1 trigger menu implementation
Definition: L1GtUtils.cc:1598
edm::Run
Definition: Run.h:45
L1MenuTreeProducer::L1MenuTreeProducer
L1MenuTreeProducer(const edm::ParameterSet &)
Definition: L1MenuTreeProducer.cc:73
l1t::UseEventSetupIn
UseEventSetupIn
Definition: L1TGlobalUtil.h:40
L1MenuTreeProducer::beginJob
void beginJob(void) override
Definition: L1MenuTreeProducer.cc:111
EDAnalyzer.h
edm::LogInfo
Log< level::Info, false > LogInfo
Definition: MessageLogger.h:125
L1Analysis::L1AnalysisL1Menu::getData
L1AnalysisL1MenuDataFormat * getData()
Definition: L1AnalysisL1Menu.h:20
edm::EDAnalyzer
Definition: EDAnalyzer.h:28
MakerMacros.h
L1MenuTreeProducer::analyze
void analyze(const edm::Event &, const edm::EventSetup &) override
Definition: L1MenuTreeProducer.cc:91
DEFINE_FWK_MODULE
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:16
Service.h
L1MenuTreeProducer::fs_
edm::Service< TFileService > fs_
Definition: L1MenuTreeProducer.cc:63
Event
L1Analysis::L1AnalysisL1MenuDataFormat
Definition: L1AnalysisL1MenuDataFormat.h:7
L1GtUtils
Definition: L1GtUtils.h:66
L1MenuTreeProducer::l1GtUtils_
L1GtUtils l1GtUtils_
Definition: L1MenuTreeProducer.cc:70
L1GtUtils::l1TriggerMenu
const std::string & l1TriggerMenu() const
return the L1 trigger menu name
Definition: L1GtUtils.cc:1577
TFileService.h
funct::true
true
Definition: Factorize.h:173
L1MenuTreeProducer::l1Menu
L1Analysis::L1AnalysisL1Menu * l1Menu
Definition: L1MenuTreeProducer.cc:58
edm::ParameterSet
Definition: ParameterSet.h:47
L1MenuTreeProducer::endJob
void endJob() override
Definition: L1MenuTreeProducer.cc:119
Event.h
L1Analysis::L1AnalysisL1Menu
Definition: L1AnalysisL1Menu.h:14
L1MenuTreeProducer::endRun
void endRun(const edm::Run &, const edm::EventSetup &) override
Definition: L1MenuTreeProducer.cc:54
L1MenuTreeProducer::l1MenuData
L1Analysis::L1AnalysisL1MenuDataFormat * l1MenuData
Definition: L1MenuTreeProducer.cc:59
edm::Service< TFileService >
iEvent
int iEvent
Definition: GenABIO.cc:224
L1GtUtils::retrieveL1EventSetup
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
L1MenuTreeProducer
Definition: L1MenuTreeProducer.cc:45
L1AnalysisL1Menu.h
edm::EventSetup
Definition: EventSetup.h:57
L1MenuTreeProducer::tree_
TTree * tree_
Definition: L1MenuTreeProducer.cc:66
L1MenuTreeProducer::beginRun
void beginRun(const edm::Run &, const edm::EventSetup &) override
Definition: L1MenuTreeProducer.cc:113
Frameworkfwd.h
L1GtUtils.h
ParameterSet.h
edm::Event
Definition: Event.h:73
TFileService::make
T * make(const Args &... args) const
make new ROOT object
Definition: TFileService.h:64
L1Analysis::L1AnalysisL1Menu::SetPrescaleFactorIndex
void SetPrescaleFactorIndex(L1GtUtils &l1GtUtils_, const edm::Event &iEvent)
Definition: L1AnalysisL1Menu.cc:4