CMS 3D CMS Logo

FlatBaseThetaGunProducer.cc
Go to the documentation of this file.
1 #include <iostream>
2 #include <memory>
3 
9 
12 
14 
16 
17 
18 using namespace edm;
19 
21  fEvt(nullptr) {
22 
23  edm::ParameterSet pgun_params = pset.getParameter<edm::ParameterSet>("PGunParameters") ;
24 
25  fPartIDs = pgun_params.getParameter<std::vector<int> >("PartID");
26  fMinTheta = pgun_params.getParameter<double>("MinTheta");
27  fMaxTheta = pgun_params.getParameter<double>("MaxTheta");
28  fMinPhi = pgun_params.getParameter<double>("MinPhi");
29  fMaxPhi = pgun_params.getParameter<double>("MaxPhi");
30  fVerbosity = pset.getUntrackedParameter<int>( "Verbosity",0 ) ;
31 
32  fAddAntiParticle = pset.getParameter<bool>("AddAntiParticle") ;
33 
35  if(!rng.isAvailable()) {
36  throw cms::Exception("Configuration")
37  << "The module inheriting from FlatBaseThetaGunProducer requires the\n"
38  "RandomNumberGeneratorService, which appears to be absent. Please\n"
39  "add that service to your configuration or remove the modules that"
40  "require it.";
41  }
42 
43  produces<GenRunInfoProduct, Transition::EndRun>();
44 }
45 
47 }
48 
49 
51  es.getData( fPDGTable ) ;
52 }
54 }
55 
57 {
58  // just create an empty product
59  // to keep the EventContent definitions happy
60  // later on we might put the info into the run info that this is a PGun
61  std::unique_ptr<GenRunInfoProduct> genRunInfo( new GenRunInfoProduct() );
62  run.put(std::move(genRunInfo));
63 }
T getParameter(std::string const &) const
T getUntrackedParameter(std::string const &, T const &) const
void endRunProduce(edm::Run &r, const edm::EventSetup &) override
#define nullptr
ESHandle< HepPDT::ParticleDataTable > fPDGTable
bool getData(T &iHolder) const
Definition: EventSetup.h:111
void endRun(const edm::Run &r, const edm::EventSetup &) override
void beginRun(const edm::Run &, const edm::EventSetup &) override
void put(std::unique_ptr< PROD > product)
Put a new product.
Definition: Run.h:108
HLT enums.
FlatBaseThetaGunProducer(const ParameterSet &)
def move(src, dest)
Definition: eostools.py:511
Definition: Run.h:45