CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Private Member Functions | Private Attributes
BetaFuncPrimaryVertexGenerator Class Reference

#include <BetaFuncPrimaryVertexGenerator.h>

Inheritance diagram for BetaFuncPrimaryVertexGenerator:
PrimaryVertexGenerator

Public Member Functions

 BetaFuncPrimaryVertexGenerator (const edm::ParameterSet &vtx, const RandomEngine *engine)
 Default constructor. More...
 
double BetaFunction (double z, double z0)
 
virtual void generate ()
 Generation process (to be implemented) More...
 
 ~BetaFuncPrimaryVertexGenerator ()
 Destructor. More...
 
- Public Member Functions inherited from PrimaryVertexGenerator
const math::XYZPointbeamSpot () const
 Return x0, y0, z0. More...
 
TMatrixD * boost () const
 
 PrimaryVertexGenerator ()
 Default constructor. More...
 
 PrimaryVertexGenerator (const RandomEngine *engine)
 
virtual ~PrimaryVertexGenerator ()
 Destructor. More...
 

Private Member Functions

TMatrixD * inverseLorentzBoost ()
 

Private Attributes

double alpha_
 
double fbetastar
 
double femittance
 
double fSigmaZ
 
double fX0
 
double fY0
 
double fZ0
 
double phi_
 

Additional Inherited Members

- Protected Member Functions inherited from PrimaryVertexGenerator
void setBoost (TMatrixD *)
 
- Protected Attributes inherited from PrimaryVertexGenerator
math::XYZPoint beamSpot_
 
TMatrixD * boost_
 
const RandomEnginerandom
 

Detailed Description

Definition at line 15 of file BetaFuncPrimaryVertexGenerator.h.

Constructor & Destructor Documentation

BetaFuncPrimaryVertexGenerator::BetaFuncPrimaryVertexGenerator ( const edm::ParameterSet vtx,
const RandomEngine engine 
)

Default constructor.

Definition at line 8 of file BetaFuncPrimaryVertexGenerator.cc.

References PrimaryVertexGenerator::beamSpot_, fX0, fY0, fZ0, inverseLorentzBoost(), and PrimaryVertexGenerator::setBoost().

9  :
10  PrimaryVertexGenerator(engine),
11  fX0(vtx.getParameter<double>("X0")),
12  fY0(vtx.getParameter<double>("Y0")),
13  fZ0(vtx.getParameter<double>("Z0")),
14  fSigmaZ(vtx.getParameter<double>("SigmaZ")),
15  alpha_(vtx.getParameter<double>("Alpha")),
16  phi_(vtx.getParameter<double>("Phi")),
17  fbetastar(vtx.getParameter<double>("BetaStar")),
18  femittance(vtx.getParameter<double>("Emittance"))
19 {
20 
23 
24 }
T getParameter(std::string const &) const
PrimaryVertexGenerator()
Default constructor.
XYZPointD XYZPoint
point in space with cartesian internal representation
Definition: Point3D.h:13
BetaFuncPrimaryVertexGenerator::~BetaFuncPrimaryVertexGenerator ( )
inline

Destructor.

Definition at line 24 of file BetaFuncPrimaryVertexGenerator.h.

24 {;}

Member Function Documentation

double BetaFuncPrimaryVertexGenerator::BetaFunction ( double  z,
double  z0 
)

set resolution in Z in cm set mean in X in cm beta function

Definition at line 44 of file BetaFuncPrimaryVertexGenerator.cc.

References fbetastar, femittance, and mathSSE::sqrt().

Referenced by generate().

45 {
46  return sqrt(femittance*(fbetastar+(((z-z0)*(z-z0))/fbetastar)));
47 
48 }
double double double z
T sqrt(T t)
Definition: SSEVec.h:46
void BetaFuncPrimaryVertexGenerator::generate ( )
virtual

Generation process (to be implemented)

Implements PrimaryVertexGenerator.

Definition at line 27 of file BetaFuncPrimaryVertexGenerator.cc.

References BetaFunction(), fSigmaZ, fX0, fY0, fZ0, RandomEngine::gaussShoot(), and PrimaryVertexGenerator::random.

27  {
28 
29  double tmp_sigz = random->gaussShoot(0., fSigmaZ);
30  this->SetZ(tmp_sigz + fZ0);
31 
32  double tmp_sigx = BetaFunction(tmp_sigz,fZ0);
33  // need to divide by sqrt(2) for beamspot width relative to single beam width
34  tmp_sigx *= 0.707107;
35  this->SetX(random->gaussShoot(fX0,tmp_sigx));
36 
37  double tmp_sigy = BetaFunction(tmp_sigz,fZ0);
38  // need to divide by sqrt(2) for beamspot width relative to single beam width
39  tmp_sigy *= 0.707107;
40  this->SetY(random->gaussShoot(fY0,tmp_sigy));
41 
42 }
const RandomEngine * random
double gaussShoot(double mean=0.0, double sigma=1.0) const
Definition: RandomEngine.h:37
TMatrixD * BetaFuncPrimaryVertexGenerator::inverseLorentzBoost ( )
private

Definition at line 52 of file BetaFuncPrimaryVertexGenerator.cc.

References alpha_, funct::cos(), phi_, and funct::sin().

Referenced by BetaFuncPrimaryVertexGenerator().

52  {
53 
54  TMatrixD* aBoost = 0;
55  if ( fabs(alpha_) < 1E-12 && fabs(phi_) < 1E-12 ) return aBoost;
56 
57  TMatrixD tmpboost(4,4);
58 
59  // Lorentz boost to frame where the collision is head-on
60  // phi is the half crossing angle in the plane ZS
61  // alpha is the angle to the S axis from the X axis in the XY plane
62 
63  double calpha = std::cos(alpha_);
64  double salpha = std::sin(alpha_);
65  double cphi = std::cos(phi_);
66  double sphi = std::sin(phi_);
67  double tphi = sphi/cphi;
68  tmpboost(0,0) = 1./cphi;
69  tmpboost(0,1) = - calpha*sphi;
70  tmpboost(0,2) = - tphi*sphi;
71  tmpboost(0,3) = - salpha*sphi;
72  tmpboost(1,0) = - calpha*tphi;
73  tmpboost(1,1) = 1.;
74  tmpboost(1,2) = calpha*tphi;
75  tmpboost(1,3) = 0.;
76  tmpboost(2,0) = 0.;
77  tmpboost(2,1) = -calpha*sphi;
78  tmpboost(2,2) = cphi;
79  tmpboost(2,3) = - salpha*sphi;
80  tmpboost(3,0) = - salpha*tphi;
81  tmpboost(3,1) = 0.;
82  tmpboost(3,2) = salpha*tphi;
83  tmpboost(3,3) = 1.;
84 
85  tmpboost.Invert();
86  aBoost = new TMatrixD(tmpboost);
87 
88  return aBoost;
89 
90 }
Sin< T >::type sin(const T &t)
Definition: Sin.h:22
Cos< T >::type cos(const T &t)
Definition: Cos.h:22

Member Data Documentation

double BetaFuncPrimaryVertexGenerator::alpha_
private

Definition at line 40 of file BetaFuncPrimaryVertexGenerator.h.

Referenced by inverseLorentzBoost().

double BetaFuncPrimaryVertexGenerator::fbetastar
private

Definition at line 41 of file BetaFuncPrimaryVertexGenerator.h.

Referenced by BetaFunction().

double BetaFuncPrimaryVertexGenerator::femittance
private

Definition at line 41 of file BetaFuncPrimaryVertexGenerator.h.

Referenced by BetaFunction().

double BetaFuncPrimaryVertexGenerator::fSigmaZ
private

Definition at line 39 of file BetaFuncPrimaryVertexGenerator.h.

Referenced by generate().

double BetaFuncPrimaryVertexGenerator::fX0
private

Definition at line 38 of file BetaFuncPrimaryVertexGenerator.h.

Referenced by BetaFuncPrimaryVertexGenerator(), and generate().

double BetaFuncPrimaryVertexGenerator::fY0
private

Definition at line 38 of file BetaFuncPrimaryVertexGenerator.h.

Referenced by BetaFuncPrimaryVertexGenerator(), and generate().

double BetaFuncPrimaryVertexGenerator::fZ0
private

Definition at line 38 of file BetaFuncPrimaryVertexGenerator.h.

Referenced by BetaFuncPrimaryVertexGenerator(), and generate().

double BetaFuncPrimaryVertexGenerator::phi_
private

Definition at line 40 of file BetaFuncPrimaryVertexGenerator.h.

Referenced by inverseLorentzBoost().