![]() |
![]() |
#include <IOMC/EventVertexGenerators/interface/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) | |
Copy constructor. | |
FlatEvtVtxGenerator & | operator= (const FlatEvtVtxGenerator &rhs) |
Copy assignment operator. | |
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().
00016 : BaseEvtVtxGenerator(p) 00017 { 00018 00019 fRandom = new CLHEP::RandFlat(getEngine()) ; 00020 00021 fMinX = p.getParameter<double>("MinX")*cm; 00022 fMinY = p.getParameter<double>("MinY")*cm; 00023 fMinZ = p.getParameter<double>("MinZ")*cm; 00024 fMaxX = p.getParameter<double>("MaxX")*cm; 00025 fMaxY = p.getParameter<double>("MaxY")*cm; 00026 fMaxZ = p.getParameter<double>("MaxZ")*cm; 00027 fTimeOffset = p.getParameter<double>("TimeOffset")*ns*c_light; 00028 00029 if (fMinX > fMaxX) { 00030 throw cms::Exception("Configuration") 00031 << "Error in FlatEvtVtxGenerator: " 00032 << "MinX is greater than MaxX"; 00033 } 00034 if (fMinY > fMaxY) { 00035 throw cms::Exception("Configuration") 00036 << "Error in FlatEvtVtxGenerator: " 00037 << "MinY is greater than MaxY"; 00038 } 00039 if (fMinZ > fMaxZ) { 00040 throw cms::Exception("Configuration") 00041 << "Error in FlatEvtVtxGenerator: " 00042 << "MinZ is greater than MaxZ"; 00043 } 00044 }
FlatEvtVtxGenerator::~FlatEvtVtxGenerator | ( | ) | [virtual] |
Definition at line 46 of file FlatEvtVtxGenerator.cc.
References fRandom.
00047 { 00048 delete fRandom; 00049 }
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.
00053 { 00054 double aX,aY,aZ; 00055 aX = fRandom->fire(fMinX,fMaxX) ; 00056 aY = fRandom->fire(fMinY,fMaxY) ; 00057 aZ = fRandom->fire(fMinZ,fMaxZ) ; 00058 00059 //if (fVertex == 0) fVertex = new CLHEP::Hep3Vector; 00060 //fVertex->set(aX,aY,aZ); 00061 if ( fVertex == 0 ) fVertex = new HepMC::FourVector() ; 00062 fVertex->set(aX,aY,aZ,fTimeOffset); 00063 00064 return fVertex; 00065 }
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().