CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_5_3_9_patch3/src/FastSimulation/Event/src/FlatPrimaryVertexGenerator.cc

Go to the documentation of this file.
00001 //Framework Headers
00002 #include "FWCore/ParameterSet/interface/ParameterSet.h"
00003 
00004 //Famos Headers
00005 #include "FastSimulation/Event/interface/FlatPrimaryVertexGenerator.h"
00006 #include "FastSimulation/Utilities/interface/RandomEngine.h"
00007 
00009 FlatPrimaryVertexGenerator::FlatPrimaryVertexGenerator(
00010   const edm::ParameterSet& vtx, const RandomEngine* engine) : 
00011   PrimaryVertexGenerator(engine),
00012   minX(vtx.getParameter<double>("MinX")),
00013   minY(vtx.getParameter<double>("MinY")),
00014   minZ(vtx.getParameter<double>("MinZ")),
00015   maxX(vtx.getParameter<double>("MaxX")),
00016   maxY(vtx.getParameter<double>("MaxY")),
00017   maxZ(vtx.getParameter<double>("MaxZ"))
00018 {
00019   beamSpot_ = math::XYZPoint((minX+maxX)/2.,(minY+maxY)/2.,(minZ+maxZ)/2.);
00020 }
00021   
00022 void
00023 FlatPrimaryVertexGenerator::generate() {
00024 
00025   this->SetX(random->flatShoot(minX,maxX));
00026   this->SetY(random->flatShoot(minY,maxY));
00027   this->SetZ(random->flatShoot(minZ,maxZ));
00028 
00029 }