CMS 3D CMS Logo

GBRForestGetterFromDB.cc
Go to the documentation of this file.
1 #ifndef CalibratedElectronProducer_h
2 #define CalibratedElectronProducer_h
3 
4 #include <iostream>
5 #include <string>
6 
13 
16 #include <TFile.h>
17 
19 public:
20  explicit GBRForestGetterFromDB(const edm::ParameterSet &);
21  ~GBRForestGetterFromDB() override;
22  void analyze(const edm::Event &, const edm::EventSetup &) override;
23 
24 private:
29 };
30 
32  : theGBRForestName(conf.getParameter<std::string>("grbForestName")),
33  theOutputFileName(conf.getUntrackedParameter<std::string>("outputFileName")),
34  theOutputObjectName(conf.getUntrackedParameter<std::string>(
35  "outputObjectName", theGBRForestName.empty() ? "GBRForest" : theGBRForestName)) {}
36 
38 
41  TFile *fOut = TFile::Open(theOutputFileName.c_str(), "RECREATE");
42  fOut->WriteObject(theGBRForestHandle.product(), theOutputObjectName.c_str());
43  fOut->Close();
44  std::cout << "Wrote output to " << theOutputFileName << std::endl;
45 }
46 
49 
50 #endif
edm::ESHandle::product
T const * product() const
Definition: ESHandle.h:86
Handle.h
EDAnalyzer.h
ESHandle.h
GBRWrapperRcd.h
gather_cfg.cout
cout
Definition: gather_cfg.py:144
GBRForestGetterFromDB
Definition: GBRForestGetterFromDB.cc:18
edm::one::EDAnalyzer
Definition: EDAnalyzer.h:30
GBRForest.h
MakerMacros.h
GBRForestGetterFromDB::theGBRForestHandle
edm::ESHandle< GBRForest > theGBRForestHandle
Definition: GBRForestGetterFromDB.cc:28
edm::EventSetup::get
T get() const
Definition: EventSetup.h:87
DEFINE_FWK_MODULE
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:16
GBRForestGetterFromDB::theGBRForestName
std::string theGBRForestName
Definition: GBRForestGetterFromDB.cc:25
edm::ESHandle< GBRForest >
GBRForestGetterFromDB::theOutputFileName
std::string theOutputFileName
Definition: GBRForestGetterFromDB.cc:26
edm::ParameterSet
Definition: ParameterSet.h:47
Event.h
GBRForestGetterFromDB::theOutputObjectName
std::string theOutputObjectName
Definition: GBRForestGetterFromDB.cc:27
iEvent
int iEvent
Definition: GenABIO.cc:224
GBRForestGetterFromDB::~GBRForestGetterFromDB
~GBRForestGetterFromDB() override
Definition: GBRForestGetterFromDB.cc:37
edm::EventSetup
Definition: EventSetup.h:58
get
#define get
AlCaHLTBitMon_QueryRunRegistry.string
string string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
GBRForestGetterFromDB::analyze
void analyze(const edm::Event &, const edm::EventSetup &) override
Definition: GBRForestGetterFromDB.cc:39
std
Definition: JetResolutionObject.h:76
GBRForestGetterFromDB::GBRForestGetterFromDB
GBRForestGetterFromDB(const edm::ParameterSet &)
Definition: GBRForestGetterFromDB.cc:31
relativeConstraints.empty
bool empty
Definition: relativeConstraints.py:46
GBRWrapperRcd
Definition: GBRWrapperRcd.h:24
EventSetup.h
ParameterSet.h
edm::Event
Definition: Event.h:73