#include <FlatEvtVtxGenerator.h>
Public Member Functions | |
FlatEvtVtxGenerator (const edm::ParameterSet &p) | |
virtual TMatrixD * | GetInvLorentzBoost () |
void | maxX (double m=0) |
set max in X in cm | |
void | maxY (double m=0) |
set max in Y in cm | |
void | maxZ (double m=0) |
set max in Z in cm | |
void | minX (double m=0.0) |
set min in X in cm | |
void | minY (double m=0.0) |
set min in Y in cm | |
void | minZ (double m=0.0) |
set min in Z in cm | |
virtual HepMC::FourVector * | newVertex () |
return a new event vertex | |
virtual | ~FlatEvtVtxGenerator () |
Private Member Functions | |
FlatEvtVtxGenerator (const FlatEvtVtxGenerator &p) | |
FlatEvtVtxGenerator & | operator= (const FlatEvtVtxGenerator &rhs) |
Private Attributes | |
double | fMaxX |
double | fMaxY |
double | fMaxZ |
double | fMinX |
double | fMinY |
double | fMinZ |
CLHEP::RandFlat * | fRandom |
double | fTimeOffset |
Definition at line 17 of file FlatEvtVtxGenerator.h.
FlatEvtVtxGenerator::FlatEvtVtxGenerator | ( | const edm::ParameterSet & | p | ) |
Definition at line 15 of file FlatEvtVtxGenerator.cc.
References Exception, fMaxX, fMaxY, fMaxZ, fMinX, fMinY, fMinZ, fRandom, fTimeOffset, BaseEvtVtxGenerator::getEngine(), and edm::ParameterSet::getParameter().
: BaseEvtVtxGenerator(p) { fRandom = new CLHEP::RandFlat(getEngine()) ; fMinX = p.getParameter<double>("MinX")*cm; fMinY = p.getParameter<double>("MinY")*cm; fMinZ = p.getParameter<double>("MinZ")*cm; fMaxX = p.getParameter<double>("MaxX")*cm; fMaxY = p.getParameter<double>("MaxY")*cm; fMaxZ = p.getParameter<double>("MaxZ")*cm; fTimeOffset = p.getParameter<double>("TimeOffset")*ns*c_light; if (fMinX > fMaxX) { throw cms::Exception("Configuration") << "Error in FlatEvtVtxGenerator: " << "MinX is greater than MaxX"; } if (fMinY > fMaxY) { throw cms::Exception("Configuration") << "Error in FlatEvtVtxGenerator: " << "MinY is greater than MaxY"; } if (fMinZ > fMaxZ) { throw cms::Exception("Configuration") << "Error in FlatEvtVtxGenerator: " << "MinZ is greater than MaxZ"; } }
FlatEvtVtxGenerator::~FlatEvtVtxGenerator | ( | ) | [virtual] |
FlatEvtVtxGenerator::FlatEvtVtxGenerator | ( | const FlatEvtVtxGenerator & | p | ) | [private] |
Copy constructor
virtual TMatrixD* FlatEvtVtxGenerator::GetInvLorentzBoost | ( | ) | [inline, virtual] |
void FlatEvtVtxGenerator::maxX | ( | double | m = 0 | ) |
void FlatEvtVtxGenerator::maxY | ( | double | m = 0 | ) |
void FlatEvtVtxGenerator::maxZ | ( | double | m = 0 | ) |
void FlatEvtVtxGenerator::minX | ( | double | m = 0.0 | ) |
void FlatEvtVtxGenerator::minY | ( | double | m = 0.0 | ) |
void FlatEvtVtxGenerator::minZ | ( | double | m = 0.0 | ) |
HepMC::FourVector * FlatEvtVtxGenerator::newVertex | ( | ) | [virtual] |
return a new event vertex
Implements BaseEvtVtxGenerator.
Definition at line 53 of file FlatEvtVtxGenerator.cc.
References fMaxX, fMaxY, fMaxZ, fMinX, fMinY, fMinZ, fRandom, fTimeOffset, and BaseEvtVtxGenerator::fVertex.
{ double aX,aY,aZ; aX = fRandom->fire(fMinX,fMaxX) ; aY = fRandom->fire(fMinY,fMaxY) ; aZ = fRandom->fire(fMinZ,fMaxZ) ; //if (fVertex == 0) fVertex = new CLHEP::Hep3Vector; //fVertex->set(aX,aY,aZ); if ( fVertex == 0 ) fVertex = new HepMC::FourVector() ; fVertex->set(aX,aY,aZ,fTimeOffset); return fVertex; }
FlatEvtVtxGenerator& FlatEvtVtxGenerator::operator= | ( | const FlatEvtVtxGenerator & | rhs | ) | [private] |
Copy assignment operator
double FlatEvtVtxGenerator::fMaxX [private] |
Definition at line 53 of file FlatEvtVtxGenerator.h.
Referenced by FlatEvtVtxGenerator(), maxX(), and newVertex().
double FlatEvtVtxGenerator::fMaxY [private] |
Definition at line 53 of file FlatEvtVtxGenerator.h.
Referenced by FlatEvtVtxGenerator(), maxY(), and newVertex().
double FlatEvtVtxGenerator::fMaxZ [private] |
Definition at line 53 of file FlatEvtVtxGenerator.h.
Referenced by FlatEvtVtxGenerator(), maxZ(), and newVertex().
double FlatEvtVtxGenerator::fMinX [private] |
Definition at line 52 of file FlatEvtVtxGenerator.h.
Referenced by FlatEvtVtxGenerator(), minX(), and newVertex().
double FlatEvtVtxGenerator::fMinY [private] |
Definition at line 52 of file FlatEvtVtxGenerator.h.
Referenced by FlatEvtVtxGenerator(), minY(), and newVertex().
double FlatEvtVtxGenerator::fMinZ [private] |
Definition at line 52 of file FlatEvtVtxGenerator.h.
Referenced by FlatEvtVtxGenerator(), minZ(), and newVertex().
CLHEP::RandFlat* FlatEvtVtxGenerator::fRandom [private] |
Definition at line 54 of file FlatEvtVtxGenerator.h.
Referenced by FlatEvtVtxGenerator(), newVertex(), and ~FlatEvtVtxGenerator().
double FlatEvtVtxGenerator::fTimeOffset [private] |
Reimplemented from BaseEvtVtxGenerator.
Definition at line 55 of file FlatEvtVtxGenerator.h.
Referenced by FlatEvtVtxGenerator(), and newVertex().