test
CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
BetaFuncPrimaryVertexGenerator.cc
Go to the documentation of this file.
1 //Framework Headers
3 
4 //Famos Headers
7 
9  const edm::ParameterSet& vtx) :
10  fX0(vtx.getParameter<double>("X0")),
11  fY0(vtx.getParameter<double>("Y0")),
12  fZ0(vtx.getParameter<double>("Z0")),
13  fSigmaZ(vtx.getParameter<double>("SigmaZ")),
14  alpha_(vtx.getParameter<double>("Alpha")),
15  phi_(vtx.getParameter<double>("Phi")),
16  fbetastar(vtx.getParameter<double>("BetaStar")),
17  femittance(vtx.getParameter<double>("Emittance"))
18 {
19 
22 
23 }
24 
25 
27 
28  double tmp_sigz = random->gaussShoot(0., fSigmaZ);
29  this->SetZ(tmp_sigz + fZ0);
30 
31  double tmp_sigx = BetaFunction(tmp_sigz,fZ0);
32  // need to divide by sqrt(2) for beamspot width relative to single beam width
33  tmp_sigx *= 0.707107;
34  this->SetX(random->gaussShoot(fX0,tmp_sigx));
35 
36  double tmp_sigy = BetaFunction(tmp_sigz,fZ0);
37  // need to divide by sqrt(2) for beamspot width relative to single beam width
38  tmp_sigy *= 0.707107;
39  this->SetY(random->gaussShoot(fY0,tmp_sigy));
40 
41 }
42 
44 {
45  return sqrt(femittance*(fbetastar+(((z-z0)*(z-z0))/fbetastar)));
46 
47 }
48 
49 
50 TMatrixD*
52 
53  TMatrixD* aBoost = 0;
54  if ( fabs(alpha_) < 1E-12 && fabs(phi_) < 1E-12 ) return aBoost;
55 
56  TMatrixD tmpboost(4,4);
57 
58  // Lorentz boost to frame where the collision is head-on
59  // phi is the half crossing angle in the plane ZS
60  // alpha is the angle to the S axis from the X axis in the XY plane
61 
62  double calpha = std::cos(alpha_);
63  double salpha = std::sin(alpha_);
64  double cphi = std::cos(phi_);
65  double sphi = std::sin(phi_);
66  double tphi = sphi/cphi;
67  tmpboost(0,0) = 1./cphi;
68  tmpboost(0,1) = - calpha*sphi;
69  tmpboost(0,2) = - tphi*sphi;
70  tmpboost(0,3) = - salpha*sphi;
71  tmpboost(1,0) = - calpha*tphi;
72  tmpboost(1,1) = 1.;
73  tmpboost(1,2) = calpha*tphi;
74  tmpboost(1,3) = 0.;
75  tmpboost(2,0) = 0.;
76  tmpboost(2,1) = -calpha*sphi;
77  tmpboost(2,2) = cphi;
78  tmpboost(2,3) = - salpha*sphi;
79  tmpboost(3,0) = - salpha*tphi;
80  tmpboost(3,1) = 0.;
81  tmpboost(3,2) = salpha*tphi;
82  tmpboost(3,3) = 1.;
83 
84  tmpboost.Invert();
85  aBoost = new TMatrixD(tmpboost);
86 
87  return aBoost;
88 
89 }
Sin< T >::type sin(const T &t)
Definition: Sin.h:22
BetaFuncPrimaryVertexGenerator(const edm::ParameterSet &vtx)
Default constructor.
TRandom random
Definition: MVATrainer.cc:138
float float float z
T sqrt(T t)
Definition: SSEVec.h:48
Cos< T >::type cos(const T &t)
Definition: Cos.h:22
virtual void generate(RandomEngineAndDistribution const *)
Generation process (to be implemented)
XYZPointD XYZPoint
point in space with cartesian internal representation
Definition: Point3D.h:12
double gaussShoot(double mean=0.0, double sigma=1.0) const