#include <GaussEvtVtxGenerator.h>
Public Member Functions | |
GaussEvtVtxGenerator (const edm::ParameterSet &p) | |
virtual TMatrixD * | GetInvLorentzBoost () |
void | meanX (double m=0) |
set mean in X in cm | |
void | meanY (double m=0) |
set mean in Y in cm | |
void | meanZ (double m=0) |
set mean in Z in cm | |
virtual HepMC::FourVector * | newVertex () |
return a new event vertex | |
void | sigmaX (double s=1.0) |
set resolution in X in cm | |
void | sigmaY (double s=1.0) |
set resolution in Y in cm | |
void | sigmaZ (double s=1.0) |
set resolution in Z in cm | |
virtual | ~GaussEvtVtxGenerator () |
Private Member Functions | |
GaussEvtVtxGenerator (const GaussEvtVtxGenerator &p) | |
GaussEvtVtxGenerator & | operator= (const GaussEvtVtxGenerator &rhs) |
Private Attributes | |
double | fMeanX |
double | fMeanY |
double | fMeanZ |
CLHEP::RandGaussQ * | fRandom |
double | fSigmaX |
double | fSigmaY |
double | fSigmaZ |
double | fTimeOffset |
Definition at line 17 of file GaussEvtVtxGenerator.h.
GaussEvtVtxGenerator::GaussEvtVtxGenerator | ( | const edm::ParameterSet & | p | ) |
Definition at line 15 of file GaussEvtVtxGenerator.cc.
References Exception, fMeanX, fMeanY, fMeanZ, fRandom, fSigmaX, fSigmaY, fSigmaZ, fTimeOffset, BaseEvtVtxGenerator::getEngine(), and edm::ParameterSet::getParameter().
: BaseEvtVtxGenerator(p) { fRandom = new CLHEP::RandGaussQ(getEngine()); fMeanX = p.getParameter<double>("MeanX")*cm; fMeanY = p.getParameter<double>("MeanY")*cm; fMeanZ = p.getParameter<double>("MeanZ")*cm; fSigmaX = p.getParameter<double>("SigmaX")*cm; fSigmaY = p.getParameter<double>("SigmaY")*cm; fSigmaZ = p.getParameter<double>("SigmaZ")*cm; fTimeOffset = p.getParameter<double>("TimeOffset")*ns*c_light; if (fSigmaX < 0) { throw cms::Exception("Configuration") << "Error in GaussEvtVtxGenerator: " << "Illegal resolution in X (SigmaX is negative)"; } if (fSigmaY < 0) { throw cms::Exception("Configuration") << "Error in GaussEvtVtxGenerator: " << "Illegal resolution in Y (SigmaY is negative)"; } if (fSigmaZ < 0) { throw cms::Exception("Configuration") << "Error in GaussEvtVtxGenerator: " << "Illegal resolution in Z (SigmaZ is negative)"; } }
GaussEvtVtxGenerator::~GaussEvtVtxGenerator | ( | ) | [virtual] |
GaussEvtVtxGenerator::GaussEvtVtxGenerator | ( | const GaussEvtVtxGenerator & | p | ) | [private] |
Copy constructor
virtual TMatrixD* GaussEvtVtxGenerator::GetInvLorentzBoost | ( | ) | [inline, virtual] |
void GaussEvtVtxGenerator::meanX | ( | double | m = 0 | ) | [inline] |
void GaussEvtVtxGenerator::meanY | ( | double | m = 0 | ) | [inline] |
void GaussEvtVtxGenerator::meanZ | ( | double | m = 0 | ) | [inline] |
HepMC::FourVector * GaussEvtVtxGenerator::newVertex | ( | ) | [virtual] |
return a new event vertex
Implements BaseEvtVtxGenerator.
Definition at line 53 of file GaussEvtVtxGenerator.cc.
References fMeanX, fMeanY, fMeanZ, fRandom, fSigmaX, fSigmaY, fSigmaZ, fTimeOffset, BaseEvtVtxGenerator::fVertex, X, and Gflash::Z.
{ double X,Y,Z; X = fSigmaX * fRandom->fire() + fMeanX ; Y = fSigmaY * fRandom->fire() + fMeanY ; Z = fSigmaZ * fRandom->fire() + fMeanZ ; //if (fVertex == 0) fVertex = new CLHEP::Hep3Vector; if ( fVertex == 0 ) fVertex = new HepMC::FourVector() ; fVertex->set( X, Y, Z, fTimeOffset ) ; return fVertex; }
GaussEvtVtxGenerator& GaussEvtVtxGenerator::operator= | ( | const GaussEvtVtxGenerator & | rhs | ) | [private] |
Copy assignment operator
void GaussEvtVtxGenerator::sigmaX | ( | double | s = 1.0 | ) |
set resolution in X in cm
Definition at line 66 of file GaussEvtVtxGenerator.cc.
References Exception, fSigmaX, and asciidump::s.
{ if (s>=0 ) { fSigmaX=s; } else { throw cms::Exception("LogicError") << "Error in GaussEvtVtxGenerator::sigmaX: " << "Illegal resolution in X (negative)"; } }
void GaussEvtVtxGenerator::sigmaY | ( | double | s = 1.0 | ) |
set resolution in Y in cm
Definition at line 78 of file GaussEvtVtxGenerator.cc.
References Exception, fSigmaY, and asciidump::s.
{ if (s>=0 ) { fSigmaY=s; } else { throw cms::Exception("LogicError") << "Error in GaussEvtVtxGenerator::sigmaY: " << "Illegal resolution in Y (negative)"; } }
void GaussEvtVtxGenerator::sigmaZ | ( | double | s = 1.0 | ) |
set resolution in Z in cm
Definition at line 90 of file GaussEvtVtxGenerator.cc.
References Exception, fSigmaZ, and asciidump::s.
{ if (s>=0 ) { fSigmaZ=s; } else { throw cms::Exception("LogicError") << "Error in GaussEvtVtxGenerator::sigmaZ: " << "Illegal resolution in Z (negative)"; } }
double GaussEvtVtxGenerator::fMeanX [private] |
Definition at line 53 of file GaussEvtVtxGenerator.h.
Referenced by GaussEvtVtxGenerator(), meanX(), and newVertex().
double GaussEvtVtxGenerator::fMeanY [private] |
Definition at line 53 of file GaussEvtVtxGenerator.h.
Referenced by GaussEvtVtxGenerator(), meanY(), and newVertex().
double GaussEvtVtxGenerator::fMeanZ [private] |
Definition at line 53 of file GaussEvtVtxGenerator.h.
Referenced by GaussEvtVtxGenerator(), meanZ(), and newVertex().
CLHEP::RandGaussQ* GaussEvtVtxGenerator::fRandom [private] |
Definition at line 54 of file GaussEvtVtxGenerator.h.
Referenced by GaussEvtVtxGenerator(), newVertex(), and ~GaussEvtVtxGenerator().
double GaussEvtVtxGenerator::fSigmaX [private] |
Definition at line 52 of file GaussEvtVtxGenerator.h.
Referenced by GaussEvtVtxGenerator(), newVertex(), and sigmaX().
double GaussEvtVtxGenerator::fSigmaY [private] |
Definition at line 52 of file GaussEvtVtxGenerator.h.
Referenced by GaussEvtVtxGenerator(), newVertex(), and sigmaY().
double GaussEvtVtxGenerator::fSigmaZ [private] |
Definition at line 52 of file GaussEvtVtxGenerator.h.
Referenced by GaussEvtVtxGenerator(), newVertex(), and sigmaZ().
double GaussEvtVtxGenerator::fTimeOffset [private] |
Reimplemented from BaseEvtVtxGenerator.
Definition at line 55 of file GaussEvtVtxGenerator.h.
Referenced by GaussEvtVtxGenerator(), and newVertex().