33 #include "CLHEP/Random/RandGaussQ.h"
34 #include "CLHEP/Units/GlobalSystemOfUnits.h"
35 #include "CLHEP/Units/GlobalPhysicalConstants.h"
37 #include "HepMC/SimpleVector.h"
44 using namespace CLHEP;
56 virtual HepMC::FourVector* newVertex() ;
58 virtual TMatrixD* GetInvLorentzBoost();
62 void sigmaZ(
double s=1.0);
65 void X0(
double m=0) { fX0=
m; }
67 void Y0(
double m=0) { fY0=
m; }
69 void Z0(
double m=0) { fZ0=
m; }
72 void Phi(
double m=0) { phi_=
m; }
83 double BetaFunction(
double z,
double z0);
84 CLHEP::HepRandomEngine& getEngine();
116 fVertex(0), boost_(0), fTimeOffset(0), fEngine(0),
117 sourceLabel(p.getParameter<edm::
InputTag>(
"src")),
118 verbosity_(p.getUntrackedParameter<bool>(
"verbosity",
false))
126 <<
"The BaseEvtVtxGenerator requires the RandomNumberGeneratorService\n"
127 "which is not present in the configuration file. You must add the service\n"
128 "in the configuration file or remove the modules that require it.";
131 CLHEP::HepRandomEngine& engine = rng->
getEngine();
147 <<
"Error in BetaBoostEvtVtxGenerator: "
148 <<
"Illegal resolution in Z (SigmaZ is negative)";
178 tmp_sigx /=
sqrt(2.0);
183 tmp_sigy /=
sqrt(2.0);
209 <<
"Error in BetaBoostEvtVtxGenerator::sigmaZ: "
210 <<
"Illegal resolution in Z (negative)";
222 TMatrixD tmpboost(4,4);
223 TMatrixD tmpboostZ(4,4);
224 TMatrixD tmpboostXYZ(4,4);
252 tmpboostZ(0,2)=-1.0*beta_*gama;
258 tmpboostZ(2,0)=-1.0*beta_*gama;
267 tmpboostXYZ=tmpboostZ*tmpboost;
268 tmpboostXYZ.Invert();
272 boost_ =
new TMatrixD(tmpboostXYZ);
294 auto_ptr<bool> NewProduct(
new bool(
true)) ;
295 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 void produce(edm::Event &, const edm::EventSetup &) override
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()
return(e1-e2)*(e1-e2)+dp *dp
volatile std::atomic< bool > shutdown_flag false
void Z0(double m=0)
set mean in Z in cm
virtual TMatrixD * GetInvLorentzBoost()
edm::InputTag sourceLabel