CMS 3D CMS Logo

HGCalTriggerNtupleManager.cc
Go to the documentation of this file.
10 
12 public:
13  typedef std::unique_ptr<HGCalTriggerNtupleBase> ntuple_ptr;
14 
15 public:
16  explicit HGCalTriggerNtupleManager(const edm::ParameterSet& conf);
18  void beginRun(const edm::Run&, const edm::EventSetup&) override{};
19  void analyze(const edm::Event&, const edm::EventSetup&) override;
20 
21 private:
23  std::vector<ntuple_ptr> hgc_ntuples_;
24  TTree* tree_;
25 };
26 
28 
30  tree_ = file_service_->make<TTree>("HGCalTriggerNtuple", "HGCalTriggerNtuple");
31  const std::vector<edm::ParameterSet>& ntuple_cfgs = conf.getParameterSetVector("Ntuples");
32  for (const auto& ntuple_cfg : ntuple_cfgs) {
33  const std::string& ntuple_name = ntuple_cfg.getParameter<std::string>("NtupleName");
34  hgc_ntuples_.emplace_back(HGCalTriggerNtupleFactory::get()->create(ntuple_name, ntuple_cfg));
35  hgc_ntuples_.back()->initialize(*tree_, ntuple_cfg, consumesCollector());
36  }
37 }
38 
40  for (auto& hgc_ntuple : hgc_ntuples_) {
41  hgc_ntuple->fill(e, es);
42  }
43  tree_->Fill();
44 }
HGCalTriggerNtupleManager
Definition: HGCalTriggerNtupleManager.cc:11
HGCalTriggerNtupleManager::hgc_ntuples_
std::vector< ntuple_ptr > hgc_ntuples_
Definition: HGCalTriggerNtupleManager.cc:23
edm::Run
Definition: Run.h:45
edm::EDConsumerBase::consumesCollector
ConsumesCollector consumesCollector()
Use a ConsumesCollector to gather consumes information from helper functions.
Definition: EDConsumerBase.cc:47
EDAnalyzer.h
HGCalTriggerNtupleManager::~HGCalTriggerNtupleManager
~HGCalTriggerNtupleManager() override
Definition: HGCalTriggerNtupleManager.cc:17
beamerCreator.create
def create(alignables, pedeDump, additionalData, outputFile, config)
Definition: beamerCreator.py:44
edm::EDAnalyzer
Definition: EDAnalyzer.h:28
MakerMacros.h
DEFINE_FWK_MODULE
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:16
HGCalTriggerNtupleManager::tree_
TTree * tree_
Definition: HGCalTriggerNtupleManager.cc:24
Service.h
HGCalTriggerNtupleManager::HGCalTriggerNtupleManager
HGCalTriggerNtupleManager(const edm::ParameterSet &conf)
Definition: HGCalTriggerNtupleManager.cc:29
HGCalTriggerNtupleManager::file_service_
edm::Service< TFileService > file_service_
Definition: HGCalTriggerNtupleManager.cc:22
TFileService.h
HGCalTriggerNtupleManager::ntuple_ptr
std::unique_ptr< HGCalTriggerNtupleBase > ntuple_ptr
Definition: HGCalTriggerNtupleManager.cc:13
edm::ParameterSet
Definition: ParameterSet.h:47
HGCalTriggerNtupleManager::beginRun
void beginRun(const edm::Run &, const edm::EventSetup &) override
Definition: HGCalTriggerNtupleManager.cc:18
Event.h
HGCalTriggerNtupleBase.h
edm::Service< TFileService >
edm::EventSetup
Definition: EventSetup.h:58
get
#define get
TFileService::make
T * make(const Args &...args) const
make new ROOT object
Definition: TFileService.h:64
AlCaHLTBitMon_QueryRunRegistry.string
string string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
Frameworkfwd.h
EventSetup.h
edm::ParameterSet::getParameterSetVector
VParameterSet const & getParameterSetVector(std::string const &name) const
Definition: ParameterSet.cc:2160
ParameterSet.h
edm::Event
Definition: Event.h:73
HGCalTriggerNtupleManager::analyze
void analyze(const edm::Event &, const edm::EventSetup &) override
Definition: HGCalTriggerNtupleManager.cc:39
MillePedeFileConverter_cfg.e
e
Definition: MillePedeFileConverter_cfg.py:37