test
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)
 Default constructor. More...
 
double BetaFunction (double z, double z0)
 
virtual void generate (RandomEngineAndDistribution const *)
 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 TMatrixD * boost () const
 
 PrimaryVertexGenerator ()
 Default constructor. More...
 
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_
 

Detailed Description

Definition at line 15 of file BetaFuncPrimaryVertexGenerator.h.

Constructor & Destructor Documentation

BetaFuncPrimaryVertexGenerator::BetaFuncPrimaryVertexGenerator ( const edm::ParameterSet vtx)

Default constructor.

Definition at line 8 of file BetaFuncPrimaryVertexGenerator.cc.

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

9  :
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 }
T getParameter(std::string const &) const
XYZPointD XYZPoint
point in space with cartesian internal representation
Definition: Point3D.h:12
BetaFuncPrimaryVertexGenerator::~BetaFuncPrimaryVertexGenerator ( )
inline

Destructor.

Definition at line 23 of file BetaFuncPrimaryVertexGenerator.h.

23 {;}

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 43 of file BetaFuncPrimaryVertexGenerator.cc.

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

Referenced by generate().

void BetaFuncPrimaryVertexGenerator::generate ( RandomEngineAndDistribution const *  random)
virtual

Generation process (to be implemented)

Implements PrimaryVertexGenerator.

Definition at line 26 of file BetaFuncPrimaryVertexGenerator.cc.

References BetaFunction(), fSigmaZ, fX0, fY0, fZ0, and RandomEngineAndDistribution::gaussShoot().

26  {
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 }
TRandom random
Definition: MVATrainer.cc:138
TMatrixD * BetaFuncPrimaryVertexGenerator::inverseLorentzBoost ( )
private

Definition at line 51 of file BetaFuncPrimaryVertexGenerator.cc.

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

Referenced by BetaFuncPrimaryVertexGenerator().

51  {
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
Cos< T >::type cos(const T &t)
Definition: Cos.h:22

Member Data Documentation

double BetaFuncPrimaryVertexGenerator::alpha_
private

Definition at line 39 of file BetaFuncPrimaryVertexGenerator.h.

Referenced by inverseLorentzBoost().

double BetaFuncPrimaryVertexGenerator::fbetastar
private

Definition at line 40 of file BetaFuncPrimaryVertexGenerator.h.

Referenced by BetaFunction().

double BetaFuncPrimaryVertexGenerator::femittance
private

Definition at line 40 of file BetaFuncPrimaryVertexGenerator.h.

Referenced by BetaFunction().

double BetaFuncPrimaryVertexGenerator::fSigmaZ
private

Definition at line 38 of file BetaFuncPrimaryVertexGenerator.h.

Referenced by generate().

double BetaFuncPrimaryVertexGenerator::fX0
private

Definition at line 37 of file BetaFuncPrimaryVertexGenerator.h.

Referenced by BetaFuncPrimaryVertexGenerator(), and generate().

double BetaFuncPrimaryVertexGenerator::fY0
private

Definition at line 37 of file BetaFuncPrimaryVertexGenerator.h.

Referenced by BetaFuncPrimaryVertexGenerator(), and generate().

double BetaFuncPrimaryVertexGenerator::fZ0
private

Definition at line 37 of file BetaFuncPrimaryVertexGenerator.h.

Referenced by BetaFuncPrimaryVertexGenerator(), and generate().

double BetaFuncPrimaryVertexGenerator::phi_
private

Definition at line 39 of file BetaFuncPrimaryVertexGenerator.h.

Referenced by inverseLorentzBoost().