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();
59 virtual HepMC::FourVector* getVertex(
edm::Event&);
60 virtual HepMC::FourVector* getRecVertex(
edm::Event&);
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);
118 fVertex(0), boost_(0), fTimeOffset(0),
119 signalLabel(pset.getParameter<edm::
InputTag>(
"signalLabel")),
120 hiLabel(pset.getParameter<edm::
InputTag>(
"heavyIonLabel")),
121 useRecVertex(pset.exists(
"useRecVertex")?pset.getParameter<bool>(
"useRecVertex"):
false)
127 produces<edm::HepMCProduct>();
150 tmp_sigx /=
sqrt(2.0);
155 tmp_sigy /=
sqrt(2.0);
181 <<
"Error in MixBoostEvtVtxGenerator::sigmaZ: "
182 <<
"Illegal resolution in Z (negative)";
194 TMatrixD tmpboost(4,4);
195 TMatrixD tmpboostZ(4,4);
196 TMatrixD tmpboostXYZ(4,4);
224 tmpboostZ(0,2)=-1.0*beta_*gama;
230 tmpboostZ(2,0)=-1.0*beta_*gama;
239 tmpboostXYZ=tmpboost*tmpboostZ;
244 boost_ =
new TMatrixD(tmpboostXYZ);
255 const HepMC::GenEvent* inev = input->GetEvent();
256 HepMC::GenVertex* genvtx = inev->signal_process_vertex();
258 cout<<
"No Signal Process Vertex!"<<endl;
259 HepMC::GenEvent::particle_const_iterator
pt=inev->particles_begin();
260 HepMC::GenEvent::particle_const_iterator ptend=inev->particles_end();
261 while(!genvtx || ( genvtx->particles_in_size() == 1 && pt != ptend ) ){
262 if(!genvtx)
cout<<
"No Gen Vertex!"<<endl;
263 if(pt == ptend)
cout<<
"End reached!"<<endl;
264 genvtx = (*pt)->production_vertex();
270 aX = genvtx->position().x();
271 aY = genvtx->position().y();
272 aZ = genvtx->position().z();
273 aT = genvtx->position().t();
290 aX = input->begin()->position().x() +
vtxOffset[0];
291 aY = input->begin()->position().y() +
vtxOffset[1];
292 aZ = input->begin()->position().z() +
vtxOffset[2];
295 fVertex->set(10.0*aX,10.0*aY,10.0*aZ,0.0);
308 HepMC::GenEvent* genevt =
new HepMC::GenEvent(*HepUnsmearedMCEvt->GetEvent());
const double Z[kNumberCalorimeter]
T getParameter(std::string const &) const
virtual ~MixBoostEvtVtxGenerator()
CLHEP::RandGaussQ * fRandom
HepMC::FourVector * fVertex
void Z0(double m=0)
set mean in Z in cm
std::vector< double > vtxOffset
#define DEFINE_FWK_MODULE(type)
Sin< T >::type sin(const T &t)
void emittance(double m=0)
emittance (no the normalized)
void X0(double m=0)
set mean in X in cm
bool exists(std::string const ¶meterName) const
checks if a parameter exists
static std::string const input
edm::InputTag signalLabel
void sigmaZ(double s=1.0)
set resolution in Z in cm
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
virtual void produce(edm::Event &, const edm::EventSetup &) override
Cos< T >::type cos(const T &t)
virtual HepMC::FourVector * newVertex()
return a new event vertex
edm::InputTag sourceLabel
virtual TMatrixD * GetInvLorentzBoost()
Tan< T >::type tan(const T &t)
MixBoostEvtVtxGenerator(const edm::ParameterSet &p)
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
void Alpha(double m=0)
angle between crossing plane and horizontal plane
void Phi(double m=0)
set half crossing angle
void betastar(double m=0)
set beta_star
void Y0(double m=0)
set mean in Y in cm
return(e1-e2)*(e1-e2)+dp *dp
virtual HepMC::FourVector * getRecVertex(edm::Event &)
volatile std::atomic< bool > shutdown_flag false
virtual HepMC::FourVector * getVertex(edm::Event &)
double BetaFunction(double z, double z0)
beta function