#include <BetafuncEvtVtxGenerator.h>
Public Member Functions | |
void | Alpha (double m=0) |
angle between crossing plane and horizontal plane | |
virtual void | beginLuminosityBlock (edm::LuminosityBlock &, edm::EventSetup const &) |
virtual void | beginRun (edm::Run &, const edm::EventSetup &) |
BetafuncEvtVtxGenerator (const edm::ParameterSet &p) | |
double | BetaFunction (double z, double z0) |
beta function | |
void | betastar (double m=0) |
set beta_star | |
void | emittance (double m=0) |
emittance (no the normalized) | |
virtual TMatrixD * | GetInvLorentzBoost () |
virtual HepMC::FourVector * | newVertex () |
return a new event vertex | |
void | Phi (double m=0) |
set half crossing angle | |
void | sigmaZ (double s=1.0) |
set resolution in Z in cm | |
void | X0 (double m=0) |
set mean in X in cm | |
void | Y0 (double m=0) |
set mean in Y in cm | |
void | Z0 (double m=0) |
set mean in Z in cm | |
virtual | ~BetafuncEvtVtxGenerator () |
Private Member Functions | |
BetafuncEvtVtxGenerator (const BetafuncEvtVtxGenerator &p) | |
BetafuncEvtVtxGenerator & | operator= (const BetafuncEvtVtxGenerator &rhs) |
void | update (const edm::EventSetup &iEventSetup) |
Private Attributes | |
double | alpha_ |
double | fbetastar |
double | femittance |
CLHEP::RandGaussQ * | fRandom |
double | fSigmaZ |
double | fTimeOffset |
double | fX0 |
double | fY0 |
double | fZ0 |
edm::ESWatcher < SimBeamSpotObjectsRcd > | parameterWatcher_ |
double | phi_ |
bool | readDB_ |
Definition at line 30 of file BetafuncEvtVtxGenerator.h.
BetafuncEvtVtxGenerator::BetafuncEvtVtxGenerator | ( | const edm::ParameterSet & | p | ) |
Definition at line 41 of file BetafuncEvtVtxGenerator.cc.
References alpha_, Exception, fbetastar, femittance, fRandom, fSigmaZ, fTimeOffset, fX0, fY0, fZ0, BaseEvtVtxGenerator::getEngine(), edm::ParameterSet::getParameter(), phi_, and readDB_.
: BaseEvtVtxGenerator(p) { fRandom = new CLHEP::RandGaussQ(getEngine()); readDB_=p.getParameter<bool>("readDB"); if (!readDB_){ fX0 = p.getParameter<double>("X0")*cm; fY0 = p.getParameter<double>("Y0")*cm; fZ0 = p.getParameter<double>("Z0")*cm; fSigmaZ = p.getParameter<double>("SigmaZ")*cm; alpha_ = p.getParameter<double>("Alpha")*radian; phi_ = p.getParameter<double>("Phi")*radian; fbetastar = p.getParameter<double>("BetaStar")*cm; femittance = p.getParameter<double>("Emittance")*cm; // this is not the normalized emittance fTimeOffset = p.getParameter<double>("TimeOffset")*ns*c_light; // HepMC time units are mm if (fSigmaZ <= 0) { throw cms::Exception("Configuration") << "Error in BetafuncEvtVtxGenerator: " << "Illegal resolution in Z (SigmaZ is negative)"; } } }
BetafuncEvtVtxGenerator::~BetafuncEvtVtxGenerator | ( | ) | [virtual] |
BetafuncEvtVtxGenerator::BetafuncEvtVtxGenerator | ( | const BetafuncEvtVtxGenerator & | p | ) | [private] |
Copy constructor
void BetafuncEvtVtxGenerator::Alpha | ( | double | m = 0 | ) | [inline] |
void BetafuncEvtVtxGenerator::beginLuminosityBlock | ( | edm::LuminosityBlock & | , |
edm::EventSetup const & | iEventSetup | ||
) | [virtual] |
Reimplemented from edm::EDProducer.
Definition at line 74 of file BetafuncEvtVtxGenerator.cc.
References update().
{ update(iEventSetup); }
void BetafuncEvtVtxGenerator::beginRun | ( | edm::Run & | , |
const edm::EventSetup & | iEventSetup | ||
) | [virtual] |
Reimplemented from BaseEvtVtxGenerator.
Definition at line 77 of file BetafuncEvtVtxGenerator.cc.
References update().
{ update(iEventSetup); }
double BetafuncEvtVtxGenerator::BetaFunction | ( | double | z, |
double | z0 | ||
) |
beta function
Definition at line 131 of file BetafuncEvtVtxGenerator.cc.
References fbetastar, femittance, and mathSSE::sqrt().
Referenced by newVertex().
void BetafuncEvtVtxGenerator::betastar | ( | double | m = 0 | ) | [inline] |
void BetafuncEvtVtxGenerator::emittance | ( | double | m = 0 | ) | [inline] |
emittance (no the normalized)
Definition at line 64 of file BetafuncEvtVtxGenerator.h.
References femittance, and m.
{ femittance=m; }
TMatrixD * BetafuncEvtVtxGenerator::GetInvLorentzBoost | ( | ) | [virtual] |
Implements BaseEvtVtxGenerator.
Definition at line 150 of file BetafuncEvtVtxGenerator.cc.
References alpha_, BaseEvtVtxGenerator::boost_, funct::cos(), phi_, funct::sin(), and funct::tan().
{ //alpha_ = 0; //phi_ = 142.e-6; if (boost_ != 0 ) return boost_; //boost_.ResizeTo(4,4); //boost_ = new TMatrixD(4,4); TMatrixD tmpboost(4,4); //if ( (alpha_ == 0) && (phi_==0) ) { boost_->Zero(); return boost_; } // Lorentz boost to frame where the collision is head-on // phi is the half crossing angle in the plane ZS // alpha is the angle to the S axis from the X axis in the XY plane tmpboost(0,0) = 1./cos(phi_); tmpboost(0,1) = - cos(alpha_)*sin(phi_); tmpboost(0,2) = - tan(phi_)*sin(phi_); tmpboost(0,3) = - sin(alpha_)*sin(phi_); tmpboost(1,0) = - cos(alpha_)*tan(phi_); tmpboost(1,1) = 1.; tmpboost(1,2) = cos(alpha_)*tan(phi_); tmpboost(1,3) = 0.; tmpboost(2,0) = 0.; tmpboost(2,1) = - cos(alpha_)*sin(phi_); tmpboost(2,2) = cos(phi_); tmpboost(2,3) = - sin(alpha_)*sin(phi_); tmpboost(3,0) = - sin(alpha_)*tan(phi_); tmpboost(3,1) = 0.; tmpboost(3,2) = sin(alpha_)*tan(phi_); tmpboost(3,3) = 1.; tmpboost.Invert(); boost_ = new TMatrixD(tmpboost); //boost_->Print(); return boost_; }
HepMC::FourVector * BetafuncEvtVtxGenerator::newVertex | ( | ) | [virtual] |
return a new event vertex
Implements BaseEvtVtxGenerator.
Definition at line 104 of file BetafuncEvtVtxGenerator.cc.
References BetaFunction(), fRandom, fSigmaZ, fTimeOffset, BaseEvtVtxGenerator::fVertex, fX0, fY0, fZ0, mathSSE::sqrt(), X, and Gflash::Z.
{ double X,Y,Z; double tmp_sigz = fRandom->fire(0., fSigmaZ); Z = tmp_sigz + fZ0; double tmp_sigx = BetaFunction(Z,fZ0); // need sqrt(2) for beamspot width relative to single beam width tmp_sigx /= sqrt(2.0); X = fRandom->fire(0.,tmp_sigx) + fX0; // + Z*fdxdz ; double tmp_sigy = BetaFunction(Z,fZ0); // need sqrt(2) for beamspot width relative to single beam width tmp_sigy /= sqrt(2.0); Y = fRandom->fire(0.,tmp_sigy) + fY0; // + Z*fdydz; double tmp_sigt = fRandom->fire(0., fSigmaZ); double T = tmp_sigt + fTimeOffset; if ( fVertex == 0 ) fVertex = new HepMC::FourVector(); fVertex->set(X,Y,Z,T); return fVertex; }
BetafuncEvtVtxGenerator& BetafuncEvtVtxGenerator::operator= | ( | const BetafuncEvtVtxGenerator & | rhs | ) | [private] |
Copy assignment operator
void BetafuncEvtVtxGenerator::Phi | ( | double | m = 0 | ) | [inline] |
void BetafuncEvtVtxGenerator::sigmaZ | ( | double | s = 1.0 | ) |
set resolution in Z in cm
Definition at line 138 of file BetafuncEvtVtxGenerator.cc.
References Exception, fSigmaZ, and alignCSCRings::s.
{ if (s>=0 ) { fSigmaZ=s; } else { throw cms::Exception("LogicError") << "Error in BetafuncEvtVtxGenerator::sigmaZ: " << "Illegal resolution in Z (negative)"; } }
void BetafuncEvtVtxGenerator::update | ( | const edm::EventSetup & | iEventSetup | ) | [private] |
Definition at line 81 of file BetafuncEvtVtxGenerator.cc.
References alpha_, BaseEvtVtxGenerator::boost_, edm::ESWatcher< T >::check(), fbetastar, femittance, fSigmaZ, fTimeOffset, fX0, fY0, fZ0, edm::EventSetup::get(), parameterWatcher_, phi_, and readDB_.
Referenced by beginLuminosityBlock(), and beginRun().
{ if (readDB_ && parameterWatcher_.check(iEventSetup)){ edm::ESHandle< SimBeamSpotObjects > beamhandle; iEventSetup.get<SimBeamSpotObjectsRcd>().get(beamhandle); fX0=beamhandle->fX0; fY0=beamhandle->fY0; fZ0=beamhandle->fZ0; // falpha=beamhandle->fAlpha; alpha_=beamhandle->fAlpha; phi_=beamhandle->fPhi; fSigmaZ=beamhandle->fSigmaZ; fTimeOffset=beamhandle->fTimeOffset; fbetastar=beamhandle->fbetastar; femittance=beamhandle->femittance; //re-initialize the boost matrix delete boost_; boost_=0; } }
void BetafuncEvtVtxGenerator::X0 | ( | double | m = 0 | ) | [inline] |
void BetafuncEvtVtxGenerator::Y0 | ( | double | m = 0 | ) | [inline] |
void BetafuncEvtVtxGenerator::Z0 | ( | double | m = 0 | ) | [inline] |
double BetafuncEvtVtxGenerator::alpha_ [private] |
Definition at line 79 of file BetafuncEvtVtxGenerator.h.
Referenced by Alpha(), BetafuncEvtVtxGenerator(), GetInvLorentzBoost(), and update().
double BetafuncEvtVtxGenerator::fbetastar [private] |
Definition at line 85 of file BetafuncEvtVtxGenerator.h.
Referenced by BetafuncEvtVtxGenerator(), BetaFunction(), betastar(), and update().
double BetafuncEvtVtxGenerator::femittance [private] |
Definition at line 85 of file BetafuncEvtVtxGenerator.h.
Referenced by BetafuncEvtVtxGenerator(), BetaFunction(), emittance(), and update().
CLHEP::RandGaussQ* BetafuncEvtVtxGenerator::fRandom [private] |
Definition at line 89 of file BetafuncEvtVtxGenerator.h.
Referenced by BetafuncEvtVtxGenerator(), newVertex(), and ~BetafuncEvtVtxGenerator().
double BetafuncEvtVtxGenerator::fSigmaZ [private] |
Definition at line 83 of file BetafuncEvtVtxGenerator.h.
Referenced by BetafuncEvtVtxGenerator(), newVertex(), sigmaZ(), and update().
double BetafuncEvtVtxGenerator::fTimeOffset [private] |
Reimplemented from BaseEvtVtxGenerator.
Definition at line 87 of file BetafuncEvtVtxGenerator.h.
Referenced by BetafuncEvtVtxGenerator(), newVertex(), and update().
double BetafuncEvtVtxGenerator::fX0 [private] |
Definition at line 82 of file BetafuncEvtVtxGenerator.h.
Referenced by BetafuncEvtVtxGenerator(), newVertex(), update(), and X0().
double BetafuncEvtVtxGenerator::fY0 [private] |
Definition at line 82 of file BetafuncEvtVtxGenerator.h.
Referenced by BetafuncEvtVtxGenerator(), newVertex(), update(), and Y0().
double BetafuncEvtVtxGenerator::fZ0 [private] |
Definition at line 82 of file BetafuncEvtVtxGenerator.h.
Referenced by BetafuncEvtVtxGenerator(), newVertex(), update(), and Z0().
Definition at line 92 of file BetafuncEvtVtxGenerator.h.
Referenced by update().
double BetafuncEvtVtxGenerator::phi_ [private] |
Definition at line 79 of file BetafuncEvtVtxGenerator.h.
Referenced by BetafuncEvtVtxGenerator(), GetInvLorentzBoost(), Phi(), and update().
bool BetafuncEvtVtxGenerator::readDB_ [private] |
Definition at line 77 of file BetafuncEvtVtxGenerator.h.
Referenced by BetafuncEvtVtxGenerator(), and update().