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 
26 #include <iostream>
27 
28 using namespace edm;
29 using namespace std;
30 using namespace CLHEP;
31 
32 
34  fEvt(nullptr)
35 {
37  if(!rng.isAvailable()) {
38  throw cms::Exception("Configuration")
39  << "The RandomNumberProducer module requires the RandomNumberGeneratorService\n"
40  "which appears to be absent. Please add that service to your configuration\n"
41  "or remove the modules that require it.";
42  }
43 
44  ParameterSet pgun_params = pset.getParameter<ParameterSet>("PGunParameters") ;
45 
46  // although there's the method ParameterSet::empty(),
47  // it looks like it's NOT even necessary to check if it is,
48  // before trying to extract parameters - if it is empty,
49  // the default values seem to be taken
50  fPartIDs = pgun_params.getParameter< vector<int> >("PartID");
51  fMinPhi = pgun_params.getParameter<double>("MinPhi");
52  fMaxPhi = pgun_params.getParameter<double>("MaxPhi");
53  fECMS = pgun_params.getParameter<double>("ECMS");
54  fpEnergy = fECMS/2.0;
55 
56 
57 
58  fVerbosity = pset.getUntrackedParameter<int>( "Verbosity",0 ) ;
59 
60  fFireBackward = pset.getParameter<bool>("FireBackward") ;
61  fFireForward = pset.getParameter<bool>("FireForward") ;
62 
63  produces<GenRunInfoProduct, Transition::EndRun>();
64 }
65 
67 {
68 
69 }
70 
71 
73 {
74  es.getData( fPDGTable ) ;
75  return ;
76 
77 }
78 
80 {}
82 {
83  // just create an empty product
84  // to keep the EventContent definitions happy
85  // later on we might put the info into the run info that this is a PGun
86  run.put( std::make_unique<GenRunInfoProduct>() );
87 }
T getParameter(std::string const &) const
T getUntrackedParameter(std::string const &, T const &) const
BaseRandomtXiGunProducer(const ParameterSet &)
void endRun(const edm::Run &r, const edm::EventSetup &) override
#define nullptr
void beginRun(const edm::Run &r, const edm::EventSetup &) override
void getData(T &iHolder) const
Definition: EventSetup.h:81
bool isAvailable() const
Definition: Service.h:46
ESHandle< HepPDT::ParticleDataTable > fPDGTable
void put(std::unique_ptr< PROD > product)
Put a new product.
Definition: Run.h:114
void endRunProduce(edm::Run &r, const edm::EventSetup &) override
return(e1-e2)*(e1-e2)+dp *dp
HLT enums.
Definition: Run.h:43