#include <IOMC/EventVertexGenerators/interface/BetafuncEvtVtxGenerator.h>
Public Member Functions | |
void | Alpha (double m=0) |
angle between crossing plane and horizontal plane | |
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) | |
Copy constructor. | |
BetafuncEvtVtxGenerator & | operator= (const BetafuncEvtVtxGenerator &rhs) |
Copy assignment operator. | |
Private Attributes | |
double | alpha_ |
double | falpha |
double | fbetastar |
double | femittance |
CLHEP::RandGaussQ * | fRandom |
double | fSigmaZ |
double | fTimeOffset |
double | fX0 |
double | fY0 |
double | fZ0 |
double | phi_ |
Definition at line 29 of file BetafuncEvtVtxGenerator.h.
BetafuncEvtVtxGenerator::BetafuncEvtVtxGenerator | ( | const edm::ParameterSet & | p | ) |
Definition at line 36 of file BetafuncEvtVtxGenerator.cc.
References alpha_, Exception, fbetastar, femittance, fRandom, fSigmaZ, fTimeOffset, fX0, fY0, fZ0, BaseEvtVtxGenerator::getEngine(), edm::ParameterSet::getParameter(), and phi_.
00037 : BaseEvtVtxGenerator(p) 00038 { 00039 00040 fRandom = new CLHEP::RandGaussQ(getEngine()); 00041 00042 fX0 = p.getParameter<double>("X0")*cm; 00043 fY0 = p.getParameter<double>("Y0")*cm; 00044 fZ0 = p.getParameter<double>("Z0")*cm; 00045 fSigmaZ = p.getParameter<double>("SigmaZ")*cm; 00046 alpha_ = p.getParameter<double>("Alpha")*radian; 00047 phi_ = p.getParameter<double>("Phi")*radian; 00048 fbetastar = p.getParameter<double>("BetaStar")*cm; 00049 femittance = p.getParameter<double>("Emittance")*cm; // this is not the normalized emittance 00050 fTimeOffset = p.getParameter<double>("TimeOffset")*ns*c_light; // HepMC time units are mm 00051 00052 if (fSigmaZ <= 0) { 00053 throw cms::Exception("Configuration") 00054 << "Error in BetafuncEvtVtxGenerator: " 00055 << "Illegal resolution in Z (SigmaZ is negative)"; 00056 } 00057 00058 00059 }
BetafuncEvtVtxGenerator::~BetafuncEvtVtxGenerator | ( | ) | [virtual] |
Definition at line 61 of file BetafuncEvtVtxGenerator.cc.
References fRandom.
00062 { 00063 delete fRandom; 00064 }
BetafuncEvtVtxGenerator::BetafuncEvtVtxGenerator | ( | const BetafuncEvtVtxGenerator & | p | ) | [private] |
Copy constructor.
void BetafuncEvtVtxGenerator::Alpha | ( | double | m = 0 |
) | [inline] |
double BetafuncEvtVtxGenerator::BetaFunction | ( | double | z, | |
double | z0 | |||
) |
beta function
Definition at line 90 of file BetafuncEvtVtxGenerator.cc.
References fbetastar, femittance, and funct::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 60 of file BetafuncEvtVtxGenerator.h.
References femittance, and m.
00060 { femittance=m; }
TMatrixD * BetafuncEvtVtxGenerator::GetInvLorentzBoost | ( | ) | [virtual] |
Implements BaseEvtVtxGenerator.
Definition at line 109 of file BetafuncEvtVtxGenerator.cc.
References alpha_, BaseEvtVtxGenerator::boost_, funct::cos(), phi_, funct::sin(), and funct::tan().
00109 { 00110 00111 //alpha_ = 0; 00112 //phi_ = 142.e-6; 00113 00114 if (boost_ != 0 ) return boost_; 00115 00116 //boost_.ResizeTo(4,4); 00117 //boost_ = new TMatrixD(4,4); 00118 TMatrixD tmpboost(4,4); 00119 00120 //if ( (alpha_ == 0) && (phi_==0) ) { boost_->Zero(); return boost_; } 00121 00122 // Lorentz boost to frame where the collision is head-on 00123 // phi is the half crossing angle in the plane ZS 00124 // alpha is the angle to the S axis from the X axis in the XY plane 00125 00126 tmpboost(0,0) = 1./cos(phi_); 00127 tmpboost(0,1) = - cos(alpha_)*sin(phi_); 00128 tmpboost(0,2) = - tan(phi_)*sin(phi_); 00129 tmpboost(0,3) = - sin(alpha_)*sin(phi_); 00130 tmpboost(1,0) = - cos(alpha_)*tan(phi_); 00131 tmpboost(1,1) = 1.; 00132 tmpboost(1,2) = cos(alpha_)*tan(phi_); 00133 tmpboost(1,3) = 0.; 00134 tmpboost(2,0) = 0.; 00135 tmpboost(2,1) = - cos(alpha_)*sin(phi_); 00136 tmpboost(2,2) = cos(phi_); 00137 tmpboost(2,3) = - sin(alpha_)*sin(phi_); 00138 tmpboost(3,0) = - sin(alpha_)*tan(phi_); 00139 tmpboost(3,1) = 0.; 00140 tmpboost(3,2) = sin(alpha_)*tan(phi_); 00141 tmpboost(3,3) = 1.; 00142 00143 tmpboost.Invert(); 00144 boost_ = new TMatrixD(tmpboost); 00145 //boost_->Print(); 00146 00147 return boost_; 00148 }
HepMC::FourVector * BetafuncEvtVtxGenerator::newVertex | ( | ) | [virtual] |
return a new event vertex
Implements BaseEvtVtxGenerator.
Definition at line 68 of file BetafuncEvtVtxGenerator.cc.
References BetaFunction(), fRandom, fSigmaZ, fTimeOffset, BaseEvtVtxGenerator::fVertex, fX0, fY0, fZ0, and X.
00068 { 00069 00070 00071 double X,Y,Z; 00072 00073 double tmp_sigz = fRandom->fire(0., fSigmaZ); 00074 Z = tmp_sigz + fZ0; 00075 00076 double tmp_sigx = BetaFunction(tmp_sigz,fZ0); 00077 X = fRandom->fire(0.,tmp_sigx) + fX0; // + Z*fdxdz ; 00078 00079 double tmp_sigy = BetaFunction(tmp_sigz,fZ0); 00080 Y = fRandom->fire(0.,tmp_sigy) + fY0; // + Z*fdydz; 00081 00082 //if (fVertex == 0) fVertex = new CLHEP::Hep3Vector; 00083 //fVertex->set(X, Y, Z); 00084 if ( fVertex == 0 ) fVertex = new HepMC::FourVector(); 00085 fVertex->set(X,Y,Z,fTimeOffset); 00086 00087 return fVertex; 00088 }
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 97 of file BetafuncEvtVtxGenerator.cc.
References Exception, and fSigmaZ.
00098 { 00099 if (s>=0 ) { 00100 fSigmaZ=s; 00101 } 00102 else { 00103 throw cms::Exception("LogicError") 00104 << "Error in BetafuncEvtVtxGenerator::sigmaZ: " 00105 << "Illegal resolution in Z (negative)"; 00106 } 00107 }
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 73 of file BetafuncEvtVtxGenerator.h.
Referenced by Alpha(), BetafuncEvtVtxGenerator(), and GetInvLorentzBoost().
double BetafuncEvtVtxGenerator::falpha [private] |
Definition at line 80 of file BetafuncEvtVtxGenerator.h.
double BetafuncEvtVtxGenerator::fbetastar [private] |
Definition at line 79 of file BetafuncEvtVtxGenerator.h.
Referenced by BetafuncEvtVtxGenerator(), BetaFunction(), and betastar().
double BetafuncEvtVtxGenerator::femittance [private] |
Definition at line 79 of file BetafuncEvtVtxGenerator.h.
Referenced by BetafuncEvtVtxGenerator(), BetaFunction(), and emittance().
CLHEP::RandGaussQ* BetafuncEvtVtxGenerator::fRandom [private] |
Definition at line 83 of file BetafuncEvtVtxGenerator.h.
Referenced by BetafuncEvtVtxGenerator(), newVertex(), and ~BetafuncEvtVtxGenerator().
double BetafuncEvtVtxGenerator::fSigmaZ [private] |
Definition at line 77 of file BetafuncEvtVtxGenerator.h.
Referenced by BetafuncEvtVtxGenerator(), newVertex(), and sigmaZ().
double BetafuncEvtVtxGenerator::fTimeOffset [private] |
Reimplemented from BaseEvtVtxGenerator.
Definition at line 81 of file BetafuncEvtVtxGenerator.h.
Referenced by BetafuncEvtVtxGenerator(), and newVertex().
double BetafuncEvtVtxGenerator::fX0 [private] |
Definition at line 76 of file BetafuncEvtVtxGenerator.h.
Referenced by BetafuncEvtVtxGenerator(), newVertex(), and X0().
double BetafuncEvtVtxGenerator::fY0 [private] |
Definition at line 76 of file BetafuncEvtVtxGenerator.h.
Referenced by BetafuncEvtVtxGenerator(), newVertex(), and Y0().
double BetafuncEvtVtxGenerator::fZ0 [private] |
Definition at line 76 of file BetafuncEvtVtxGenerator.h.
Referenced by BetafuncEvtVtxGenerator(), newVertex(), and Z0().
double BetafuncEvtVtxGenerator::phi_ [private] |
Definition at line 73 of file BetafuncEvtVtxGenerator.h.
Referenced by BetafuncEvtVtxGenerator(), GetInvLorentzBoost(), and Phi().