CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
ExternalLHEAsciiDumper.cc
Go to the documentation of this file.
1 // F. Cossutti
2 // $Date: 2011/10/31 15:52:55 $
3 // $Revision: 1.1 $//
4 
5 // Dump in standard ascii format the LHE file stored as string lumi product
6 
7 
8 // system include files
9 #include <memory>
10 #include <string>
11 #include <fstream>
12 
13 // user include files
17 
23 
25 
26 //
27 // class declaration
28 //
29 
31 public:
34 
35 
36 private:
37  virtual void analyze(const edm::Event&, const edm::EventSetup&);
38  virtual void endRun(edm::Run const&, edm::EventSetup const&);
39  virtual void endJob();
40 
42  std::string lheFileName_;
43 
44  // ----------member data ---------------------------
45 
46 };
47 
49  lheProduct_( ps.getParameter<edm::InputTag>("lheProduct") ),
50  lheFileName_( ps.getParameter<std::string>("lheFileName") )
51 {
52 
53  return;
54 
55 }
56 
58 {
59 }
60 
61 void
63 {
64 }
65 
66 // ------------ method called once each job just after ending the event loop ------------
67 
68 void
70 
72  iRun.getByLabel(lheProduct_,LHEAscii);
73 
74  const char * theName(lheFileName_.c_str());
75  std::ofstream outfile;
76  outfile.open (theName, std::ofstream::out | std::ofstream::app);
77  outfile << (*LHEAscii);
78  outfile.close();
79 
80 }
81 
83 }
84 
bool getByLabel(std::string const &label, Handle< PROD > &result) const
Definition: Run.h:174
virtual void endRun(edm::Run const &, edm::EventSetup const &)
ExternalLHEAsciiDumper(const edm::ParameterSet &)
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:17
list outfile
Definition: EdgesToViz.py:91
virtual void analyze(const edm::Event &, const edm::EventSetup &)
tuple out
Definition: dbtoconf.py:99
Definition: Run.h:31