#include <IOMC/EventVertexGenerators/interface/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) | |
Copy constructor. | |
GaussEvtVtxGenerator & | operator= (const GaussEvtVtxGenerator &rhs) |
Copy assignment operator. | |
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().
00016 : BaseEvtVtxGenerator(p) 00017 { 00018 00019 fRandom = new CLHEP::RandGaussQ(getEngine()); 00020 00021 fMeanX = p.getParameter<double>("MeanX")*cm; 00022 fMeanY = p.getParameter<double>("MeanY")*cm; 00023 fMeanZ = p.getParameter<double>("MeanZ")*cm; 00024 fSigmaX = p.getParameter<double>("SigmaX")*cm; 00025 fSigmaY = p.getParameter<double>("SigmaY")*cm; 00026 fSigmaZ = p.getParameter<double>("SigmaZ")*cm; 00027 fTimeOffset = p.getParameter<double>("TimeOffset")*ns*c_light; 00028 00029 if (fSigmaX < 0) { 00030 throw cms::Exception("Configuration") 00031 << "Error in GaussEvtVtxGenerator: " 00032 << "Illegal resolution in X (SigmaX is negative)"; 00033 } 00034 if (fSigmaY < 0) { 00035 throw cms::Exception("Configuration") 00036 << "Error in GaussEvtVtxGenerator: " 00037 << "Illegal resolution in Y (SigmaY is negative)"; 00038 } 00039 if (fSigmaZ < 0) { 00040 throw cms::Exception("Configuration") 00041 << "Error in GaussEvtVtxGenerator: " 00042 << "Illegal resolution in Z (SigmaZ is negative)"; 00043 } 00044 }
GaussEvtVtxGenerator::~GaussEvtVtxGenerator | ( | ) | [virtual] |
Definition at line 46 of file GaussEvtVtxGenerator.cc.
References fRandom.
00047 { 00048 delete fRandom; 00049 }
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, and X.
00053 { 00054 double X,Y,Z; 00055 X = fSigmaX * fRandom->fire() + fMeanX ; 00056 Y = fSigmaY * fRandom->fire() + fMeanY ; 00057 Z = fSigmaZ * fRandom->fire() + fMeanZ ; 00058 00059 //if (fVertex == 0) fVertex = new CLHEP::Hep3Vector; 00060 if ( fVertex == 0 ) fVertex = new HepMC::FourVector() ; 00061 fVertex->set( X, Y, Z, fTimeOffset ) ; 00062 00063 return fVertex; 00064 }
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, and fSigmaX.
00067 { 00068 if (s>=0 ) { 00069 fSigmaX=s; 00070 } 00071 else { 00072 throw cms::Exception("LogicError") 00073 << "Error in GaussEvtVtxGenerator::sigmaX: " 00074 << "Illegal resolution in X (negative)"; 00075 } 00076 }
void GaussEvtVtxGenerator::sigmaY | ( | double | s = 1.0 |
) |
set resolution in Y in cm
Definition at line 78 of file GaussEvtVtxGenerator.cc.
References Exception, and fSigmaY.
00079 { 00080 if (s>=0 ) { 00081 fSigmaY=s; 00082 } 00083 else { 00084 throw cms::Exception("LogicError") 00085 << "Error in GaussEvtVtxGenerator::sigmaY: " 00086 << "Illegal resolution in Y (negative)"; 00087 } 00088 }
void GaussEvtVtxGenerator::sigmaZ | ( | double | s = 1.0 |
) |
set resolution in Z in cm
Definition at line 90 of file GaussEvtVtxGenerator.cc.
References Exception, and fSigmaZ.
00091 { 00092 if (s>=0 ) { 00093 fSigmaZ=s; 00094 } 00095 else { 00096 throw cms::Exception("LogicError") 00097 << "Error in GaussEvtVtxGenerator::sigmaZ: " 00098 << "Illegal resolution in Z (negative)"; 00099 } 00100 }
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().