CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
GBRForestGetterFromDB.cc
Go to the documentation of this file.
1 #ifndef CalibratedElectronProducer_h
2 #define CalibratedElectronProducer_h
3 
10 
13 #include <TFile.h>
14 
15 
17 {
18  public:
19  explicit GBRForestGetterFromDB( const edm::ParameterSet & ) ;
20  virtual ~GBRForestGetterFromDB() ;
21  virtual void analyze( const edm::Event &, const edm::EventSetup & ) override ;
22 
23  private:
28 };
29 
31  theGBRForestName(conf.getParameter<std::string>("grbForestName")),
32  theOutputFileName(conf.getUntrackedParameter<std::string>("outputFileName")),
33  theOutputObjectName(conf.getUntrackedParameter<std::string>("outputObjectName", theGBRForestName.empty() ? "GBRForest" : theGBRForestName))
34 {
35 }
36 
38 {
39 }
40 
41 void
43 {
45  TFile *fOut = TFile::Open(theOutputFileName.c_str(), "RECREATE");
46  fOut->WriteObject(theGBRForestHandle.product(), theOutputObjectName.c_str());
47  fOut->Close();
48  std::cout << "Wrote output to " << theOutputFileName << std::endl;
49 }
50 
53 
54 #endif
edm::ESHandle< GBRForest > theGBRForestHandle
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:17
int iEvent
Definition: GenABIO.cc:230
GBRForestGetterFromDB(const edm::ParameterSet &)
const T & get() const
Definition: EventSetup.h:56
T const * product() const
Definition: ESHandle.h:86
virtual void analyze(const edm::Event &, const edm::EventSetup &) override
tuple cout
Definition: gather_cfg.py:145