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 
45 class L1MenuTreeProducer : public edm::one::EDAnalyzer<edm::one::SharedResources> {
46 public:
47  explicit L1MenuTreeProducer(const edm::ParameterSet&);
48  ~L1MenuTreeProducer() override;
49 
50 private:
51  void analyze(const edm::Event&, const edm::EventSetup&) override;
52 
53 public:
56 
57 private:
58  // output file
60 
61  // tree
62  TTree* tree_;
63 
64  // EDM input tags
65  // edm::InputTag l1MenuInputTag_;
67 };
68 
70  : // l1MenuInputTag_(iConfig.getParameter<edm::InputTag>("L1MenuInputTag")),
71  l1GtUtils_(iConfig, consumesCollector(), true, L1GtUtils::UseEventSetupIn::Event) {
72  usesResource(TFileService::kSharedResource);
73 
76 
77  // set up output
78  tree_ = fs_->make<TTree>("L1MenuTree", "L1MenuTree");
79  tree_->Branch("L1Menu", "L1Analysis::L1AnalysisL1MenuDataFormat", &l1MenuData, 32000, 0 /*3*/);
80 }
81 
83 
84 //
85 // member functions
86 //
87 
88 // ------------ method called to for each event ------------
90  l1Menu->Reset();
91 
92  // getting l1GtUtils
93  edm::LogInfo("L1TNtuples") << "Extracting menu ... " << std::endl;
95 
96  // testing menu
97  edm::LogInfo("L1TNtuples") << "L1 trigger menu name and implementation:"
98  << "\n"
99  << l1GtUtils_.l1TriggerMenu() << "\n"
100  << l1GtUtils_.l1TriggerMenuImplementation() << std::endl;
101 
102  // adding PrescaleFactorIndex
104 
105  tree_->Fill();
106 }
107 
108 //define this as a plug-in
static const std::string kSharedResource
Definition: TFileService.h:76
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
L1MenuTreeProducer(const edm::ParameterSet &)
const std::string & l1TriggerMenuImplementation() const
return the L1 trigger menu implementation
Definition: L1GtUtils.cc:1598
int iEvent
Definition: GenABIO.cc:224
void SetPrescaleFactorIndex(L1GtUtils &l1GtUtils_, const edm::Event &iEvent)
L1Analysis::L1AnalysisL1Menu * l1Menu
const std::string & l1TriggerMenu() const
return the L1 trigger menu name
Definition: L1GtUtils.cc:1577
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:16
Log< level::Info, false > LogInfo
L1Analysis::L1AnalysisL1MenuDataFormat * l1MenuData
~L1MenuTreeProducer() override
T * make(const Args &...args) const
make new ROOT object
Definition: TFileService.h:64
L1AnalysisL1MenuDataFormat * getData()
UseEventSetupIn
Definition: L1TGlobalUtil.h:42