CMS 3D CMS Logo

BaseRandomtXiGunProducer.cc
Go to the documentation of this file.
1 /*
2  * $Date: 2010/01/19 16:17:26 $
3  * $Revision: 1.7 $
4  * \author Julia Yarba
5  */
6 
7 #include <ostream>
8 #include <memory>
9 
17 
20 
22 
24 
25 #include <iostream>
26 
27 using namespace edm;
28 using namespace std;
29 using namespace CLHEP;
30 
33  if (!rng.isAvailable()) {
34  throw cms::Exception("Configuration")
35  << "The RandomNumberProducer module requires the RandomNumberGeneratorService\n"
36  "which appears to be absent. Please add that service to your configuration\n"
37  "or remove the modules that require it.";
38  }
39 
40  ParameterSet pgun_params = pset.getParameter<ParameterSet>("PGunParameters");
41 
42  // although there's the method ParameterSet::empty(),
43  // it looks like it's NOT even necessary to check if it is,
44  // before trying to extract parameters - if it is empty,
45  // the default values seem to be taken
46  fPartIDs = pgun_params.getParameter<vector<int> >("PartID");
47  fMinPhi = pgun_params.getParameter<double>("MinPhi");
48  fMaxPhi = pgun_params.getParameter<double>("MaxPhi");
49  fECMS = pgun_params.getParameter<double>("ECMS");
50  fpEnergy = fECMS / 2.0;
51 
52  fVerbosity = pset.getUntrackedParameter<int>("Verbosity", 0);
53 
54  fFireBackward = pset.getParameter<bool>("FireBackward");
55  fFireForward = pset.getParameter<bool>("FireForward");
56 
57  produces<GenRunInfoProduct, Transition::EndRun>();
58 }
59 
61 
63  es.getData(fPDGTable);
64  return;
65 }
66 
69  // just create an empty product
70  // to keep the EventContent definitions happy
71  // later on we might put the info into the run info that this is a PGun
72  run.put(std::make_unique<GenRunInfoProduct>());
73 }
T getParameter(std::string const &) const
T getUntrackedParameter(std::string const &, T const &) const
#define nullptr
BaseRandomtXiGunProducer(const ParameterSet &)
void endRun(const edm::Run &r, const edm::EventSetup &) override
void beginRun(const edm::Run &r, const edm::EventSetup &) override
bool getData(T &iHolder) const
Definition: EventSetup.h:113
bool isAvailable() const
Definition: Service.h:40
ESHandle< HepPDT::ParticleDataTable > fPDGTable
void put(std::unique_ptr< PROD > product)
Put a new product.
Definition: Run.h:108
void endRunProduce(edm::Run &r, const edm::EventSetup &) override
HLT enums.
Definition: Run.h:45