34 #include "CLHEP/Random/RandGaussQ.h"
35 #include "CLHEP/Units/GlobalSystemOfUnits.h"
36 #include "CLHEP/Units/GlobalPhysicalConstants.h"
38 #include "HepMC/SimpleVector.h"
45 using namespace CLHEP;
57 virtual HepMC::FourVector* newVertex() ;
59 virtual TMatrixD* GetInvLorentzBoost();
63 void sigmaZ(
double s=1.0);
66 void X0(
double m=0) { fX0=
m; }
68 void Y0(
double m=0) { fY0=
m; }
70 void Z0(
double m=0) { fZ0=
m; }
73 void Phi(
double m=0) { phi_=
m; }
84 double BetaFunction(
double z,
double z0);
85 CLHEP::HepRandomEngine& getEngine();
117 fVertex(0), boost_(0), fTimeOffset(0), fEngine(0),
118 sourceLabel(p.getParameter<edm::
InputTag>(
"src")),
119 verbosity_(p.getUntrackedParameter<bool>(
"verbosity",
false))
127 <<
"The BaseEvtVtxGenerator requires the RandomNumberGeneratorService\n"
128 "which is not present in the configuration file. You must add the service\n"
129 "in the configuration file or remove the modules that require it.";
132 CLHEP::HepRandomEngine& engine = rng->
getEngine();
148 <<
"Error in BetaBoostEvtVtxGenerator: "
149 <<
"Illegal resolution in Z (SigmaZ is negative)";
179 tmp_sigx /=
sqrt(2.0);
184 tmp_sigy /=
sqrt(2.0);
210 <<
"Error in BetaBoostEvtVtxGenerator::sigmaZ: "
211 <<
"Illegal resolution in Z (negative)";
223 TMatrixD tmpboost(4,4);
224 TMatrixD tmpboostZ(4,4);
225 TMatrixD tmpboostXYZ(4,4);
253 tmpboostZ(0,2)=-1.0*beta_*gama;
259 tmpboostZ(2,0)=-1.0*beta_*gama;
268 tmpboostXYZ=tmpboostZ*tmpboost;
269 tmpboostXYZ.Invert();
273 boost_ =
new TMatrixD(tmpboostXYZ);
295 auto_ptr<bool> NewProduct(
new bool(
true)) ;
296 evt.
put( NewProduct ) ;
const double Z[kNumberCalorimeter]
T getParameter(std::string const &) const
void Y0(double m=0)
set mean in Y in cm
virtual HepMC::FourVector * newVertex()
return a new event vertex
void emittance(double m=0)
emittance (no the normalized)
CLHEP::HepRandomEngine & getEngine()
#define DEFINE_FWK_MODULE(type)
Sin< T >::type sin(const T &t)
void X0(double m=0)
set mean in X in cm
void sigmaZ(double s=1.0)
set resolution in Z in cm
HepMC::FourVector * fVertex
BetaBoostEvtVtxGenerator(const edm::ParameterSet &p)
void Phi(double m=0)
set half crossing angle
CLHEP::RandGaussQ * fRandom
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
Cos< T >::type cos(const T &t)
Tan< T >::type tan(const T &t)
virtual CLHEP::HepRandomEngine & getEngine() const =0
Use this to get the random number engine, this is the only function most users should call...
void betastar(double m=0)
set beta_star
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
double BetaFunction(double z, double z0)
beta function
CLHEP::HepRandomEngine * fEngine
void Alpha(double m=0)
angle between crossing plane and horizontal plane
virtual ~BetaBoostEvtVtxGenerator()
void Z0(double m=0)
set mean in Z in cm
virtual TMatrixD * GetInvLorentzBoost()
edm::InputTag sourceLabel
virtual void produce(edm::Event &, const edm::EventSetup &)