13 #include "CLHEP/Units/GlobalSystemOfUnits.h"
14 #include "CLHEP/Units/GlobalPhysicalConstants.h"
15 #include "HepMC/SimpleVector.h"
22 using namespace CLHEP;
32 virtual HepMC::FourVector* newVertex() ;
34 virtual TMatrixD* GetInvLorentzBoost();
35 virtual HepMC::FourVector* getVertex(
edm::Event&);
36 virtual HepMC::FourVector* getRecVertex(
edm::Event&);
39 void sigmaZ(
double s=1.0);
42 void X0(
double m=0) { fX0=
m; }
44 void Y0(
double m=0) { fY0=
m; }
46 void Z0(
double m=0) { fZ0=
m; }
49 void Phi(
double m=0) { phi_=
m; }
60 double BetaFunction(
double z,
double z0);
97 fVertex(0), boost_(0), fTimeOffset(0),
98 signalLabel(pset.getParameter<edm::
InputTag>(
"signalLabel")),
99 hiLabel(pset.getParameter<edm::
InputTag>(
"heavyIonLabel")),
100 useRecVertex(pset.exists(
"useRecVertex")?pset.getParameter<bool>(
"useRecVertex"):
false),
101 verbosity_(pset.getUntrackedParameter<bool>(
"verbosity",
false))
115 produces<bool>(
"matchedVertex");
144 <<
"Error in MixBoostEvtVtxGenerator::sigmaZ: "
145 <<
"Illegal resolution in Z (negative)";
151 TMatrixD tmpboost(4,4);
152 TMatrixD tmpboostZ(4,4);
153 TMatrixD tmpboostXYZ(4,4);
178 tmpboostZ(0,2)=-1.0*beta_*gama;
184 tmpboostZ(2,0)=-1.0*beta_*gama;
193 tmpboostXYZ=tmpboost*tmpboostZ;
194 tmpboostXYZ.Invert();
196 boost_ =
new TMatrixD(tmpboostXYZ);
207 const HepMC::GenEvent* inev = input->GetEvent();
208 HepMC::GenVertex* genvtx = inev->signal_process_vertex();
210 cout<<
"No Signal Process Vertex!"<<endl;
211 HepMC::GenEvent::particle_const_iterator pt=inev->particles_begin();
212 HepMC::GenEvent::particle_const_iterator ptend=inev->particles_end();
213 while(!genvtx || ( genvtx->particles_in_size() == 1 && pt != ptend ) ){
214 if(!genvtx)
cout<<
"No Gen Vertex!"<<endl;
215 if(pt == ptend)
cout<<
"End reached!"<<endl;
216 genvtx = (*pt)->production_vertex();
223 aX = genvtx->position().x();
224 aY = genvtx->position().y();
225 aZ = genvtx->position().z();
226 aT = genvtx->position().t();
243 aX = input->begin()->position().x() +
vtxOffset[0];
244 aY = input->begin()->position().y() +
vtxOffset[1];
245 aZ = input->begin()->position().z() +
vtxOffset[2];
248 fVertex->set(10.0*aX,10.0*aY,10.0*aZ,0.0);
273 auto_ptr<bool> NewProduct(
new bool(
true)) ;
274 evt.
put( NewProduct ,
"matchedVertex") ;
nocap nocap const skelname & operator=(const skelname &)
T getParameter(std::string const &) const
virtual ~MixBoostEvtVtxGenerator()
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
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.
Cos< T >::type cos(const T &t)
virtual HepMC::FourVector * newVertex()
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
virtual void produce(edm::Event &, const edm::EventSetup &)
virtual HepMC::FourVector * getRecVertex(edm::Event &)
virtual HepMC::FourVector * getVertex(edm::Event &)
double BetaFunction(double z, double z0)
beta function