CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
BaseHadronizer.h
Go to the documentation of this file.
1 // -*- C++ -*-
2 //
3 //
4 
5 // class BaseHadronizer meant as base class for hadronizers
6 // implements a few common methods concerning communication with the
7 // gen::HadronizerFilter<...> and gen::GeneratorFilter<...> templates,
8 // mostly memory management regarding the GenEvent pointers and such
9 
10 #ifndef gen_BaseHadronizer_h
11 #define gen_BaseHadronizer_h
12 
13 #include <memory>
14 #include <string>
15 #include <vector>
16 
17 #include <boost/shared_ptr.hpp>
18 
20 
24 
27 
32 
33 #include "CLHEP/Random/RandomEngine.h"
34 
35 
36 // foward declarations
37 namespace edm {
38  class Event;
39 }
40 
41 namespace CLHEP {
42  class HepRandomEngine;
43 }
44 
45 namespace gen {
46 
48  public:
49  BaseHadronizer( edm::ParameterSet const& ps );
51 
52  // GenRunInfo and GenEvent passing
54  HepMC::GenEvent *getGenEvent() { return genEvent_.release(); }
56  virtual GenLumiInfoHeader *getGenLumiInfoHeader() const;
57 
58  void resetEvent(HepMC::GenEvent *event) { genEvent_.reset(event); }
60 
61  // LHERunInfo and LHEEvent passing
62  const boost::shared_ptr<lhef::LHERunInfo> &getLHERunInfo() const { return lheRunInfo_; }
63 
65  void setLHEEvent(lhef::LHEEvent *event) { lheEvent_.reset(event); }
66 
67  // interface for accessing the EDM information from the hadronizer
69  edm::Event &getEDMEvent() const { return *edmEvent_; }
70  virtual bool select(HepMC::GenEvent*) const { return true;}
71 
72  void setRandomEngine(CLHEP::HepRandomEngine* v) { doSetRandomEngine(v); }
73 
74  std::vector<std::string> const& sharedResources() const { return doSharedResources(); }
75 
76  int randomIndex() const { return randomIndex_; }
79 
80  void randomizeIndex(edm::LuminosityBlock const& lumi, CLHEP::HepRandomEngine* rengine);
81  void generateLHE(edm::LuminosityBlock const& lumi, CLHEP::HepRandomEngine* rengine);
82  void cleanLHE();
83 
84  protected:
86  std::auto_ptr<HepMC::GenEvent>& event() { return genEvent_; }
87  std::auto_ptr<GenEventInfoProduct>& eventInfo() { return genEventInfo_; }
88 
89  lhef::LHEEvent* lheEvent() { return lheEvent_.get(); }
93 
94  private:
95 
96  virtual void doSetRandomEngine(CLHEP::HepRandomEngine* v) { }
97 
98  virtual std::vector<std::string> const& doSharedResources() const { return theSharedResources; }
99 
101  std::auto_ptr<HepMC::GenEvent> genEvent_;
102  std::auto_ptr<GenEventInfoProduct> genEventInfo_;
103 
104  boost::shared_ptr<lhef::LHERunInfo> lheRunInfo_;
105  std::auto_ptr<lhef::LHEEvent> lheEvent_;
106 
108 
109  static const std::vector<std::string> theSharedResources;
110 
111  std::vector<double> randomInitWeights_;
112  std::vector<std::string> randomInitConfigDescriptions_;
113  std::vector<std::string> gridpackPaths_;
114 
115  };
116 
117 } // namespace gen
118 
119 #endif // gen_BaseHadronizer_h
virtual bool select(HepMC::GenEvent *) const
GenRunInfoProduct genRunInfo_
std::vector< double > randomInitWeights_
void setEDMEvent(edm::Event &event)
tuple lumi
Definition: fjr2json.py:35
BaseHadronizer(edm::ParameterSet const &ps)
edm::Event * edmEvent_
GenRunInfoProduct & getGenRunInfo()
void resetEventInfo(GenEventInfoProduct *eventInfo)
void generateLHE(edm::LuminosityBlock const &lumi, CLHEP::HepRandomEngine *rengine)
std::string lheFile_
double v[5][pyjets_maxn]
std::auto_ptr< HepMC::GenEvent > & event()
def gen
run2 Cosmic #### Run 256259 @ 0T 2015C### Run 272133 @ 3.8T 2016B###
void randomizeIndex(edm::LuminosityBlock const &lumi, CLHEP::HepRandomEngine *rengine)
GenRunInfoProduct & runInfo()
lhef::LHEEvent * lheEvent()
void setRandomEngine(CLHEP::HepRandomEngine *v)
std::auto_ptr< lhef::LHEEvent > lheEvent_
const std::string & randomInitConfigDescription() const
std::vector< std::string > const & sharedResources() const
std::vector< std::string > gridpackPaths_
void setLHEEvent(lhef::LHEEvent *event)
std::auto_ptr< GenEventInfoProduct > & eventInfo()
std::vector< std::string > randomInitConfigDescriptions_
lhef::LHERunInfo * lheRunInfo()
HepMC::GenEvent * getGenEvent()
virtual std::vector< std::string > const & doSharedResources() const
virtual void doSetRandomEngine(CLHEP::HepRandomEngine *v)
GenEventInfoProduct * getGenEventInfo()
int randomIndex() const
const std::string & gridpackPath() const
void setLHERunInfo(lhef::LHERunInfo *runInfo)
void resetEvent(HepMC::GenEvent *event)
std::auto_ptr< HepMC::GenEvent > genEvent_
boost::shared_ptr< lhef::LHERunInfo > lheRunInfo_
std::auto_ptr< GenEventInfoProduct > genEventInfo_
const boost::shared_ptr< lhef::LHERunInfo > & getLHERunInfo() const
static const std::vector< std::string > theSharedResources
edm::Event & getEDMEvent() const
virtual GenLumiInfoHeader * getGenLumiInfoHeader() const