12 #include <hgenmanager.h>
15 #include <HepMC/GenEvent.h>
24 , _p_electron_lab(-20)
26 , _p4_electron_lab(nullptr)
27 , _p4_hadron_lab(nullptr)
28 , _p4_hadron_lab_invert(nullptr)
29 , _p4_electron_prest(nullptr)
30 , _p4_hadron_prest(nullptr)
32 , _datacardFile(
"hepgen_dvcs.data")
46 double mass_e = 5.109989e-4;
47 double mass_p = 9.382720e-1;
77 cout <<
"Electron and proton in laboratory frame:" << endl;
81 cout <<
"Electron and proton in proton-at-rest frame:" << endl;
88 flip_pz.setZ(flip_pz.Z() * -1);
97 cout <<
"Colliding " <<
_p4_electron_lab->getVector().Z() <<
" GeV electron with " <<
_p4_hadron_lab->getVector().Z() <<
" GeV proton (laboratory frame)" << endl;
98 cout <<
"----ELEPT (proton-at-rest): " <<
_p4_electron_prest->getVector().Z() <<
" GeV" << endl;
119 cout <<
"Reached the sHEPGen::End()" << endl;
123 if (verbosity > 1) cout <<
"sHEPGen::End - I'm here!" << endl;
130 if (verbosity > 1) cout <<
"sHEPGen::process_event - event: " <<
_eventcount << endl;
140 HepMC::GenEvent *evt =
new HepMC::GenEvent();
143 evt->use_units(HepMC::Units::GEV, HepMC::Units::MM);
149 HepMC::PdfInfo pdfinfo;
150 pdfinfo.set_scalePDF(evt_mc->getQsq());
151 pdfinfo.set_x2(evt_mc->getXbj());
152 evt->set_pdf_info(pdfinfo);
155 evt->set_event_scale(evt_mc->getQsq());
170 HepMC::GenVertex *hepmcvtx =
new HepMC::GenVertex(HepMC::FourVector(0,
176 HEventData *edata = evt_mc->getStruct();
177 for (
unsigned p = 0;
p < edata->listOfParticles.size();
p++)
181 cout <<
"______new particle_______" << endl;
182 cout <<
"Index: " <<
p + 1 << endl;
183 cout <<
"PID: " << edata->listOfParticles.at(
p)->getParticleType() <<
" -- " << (edata->listOfParticles.at(
p) == &(edata->incBeamParticle)) << endl;
184 cout <<
"Particle aux flag: " << edata->listOfParticles.at(
p)->getParticleAuxFlag() << endl;
185 cout <<
"Particle origin: " << edata->listOfParticles.at(
p)->getParticleOrigin() << endl;
186 cout <<
"Particle daughter1: " << edata->listOfParticles.at(
p)->getParticleDaughter1() << endl;
187 cout <<
"Particle daughter2: " << edata->listOfParticles.at(
p)->getParticleDaughter2() << endl;
190 HLorentzVector v4_particle_p = edata->listOfParticles.at(
p)->getVector();
194 HVector3 flip_pz(v4_particle_p.getVector());
195 flip_pz.setZ(flip_pz.Z() * -1);
196 v4_particle_p.setVector(flip_pz);
199 HLorentzVector v4_particle_p_lab(v4_particle_p);
205 cout <<
"EVENT RECORD particle: " << edata->listOfParticles.at(
p)->getParticleType()
206 <<
" (status: " << edata->listOfParticles.at(
p)->getParticleAuxFlag() <<
")" << endl;
207 cout <<
" --> PROTON REST frame: ";
208 v4_particle_p.print();
209 cout <<
" --> LABORATORY frame: ";
210 v4_particle_p_lab.print();
213 HepMC::GenParticle *particle_hepmc =
new HepMC::GenParticle(HepMC::FourVector(v4_particle_p_lab.getVector().X(),
214 v4_particle_p_lab.getVector().Y(),
215 v4_particle_p_lab.getVector().Z(),
216 v4_particle_p_lab.getEnergy()),
217 edata->listOfParticles.at(
p)->getParticleType());
218 particle_hepmc->set_status(edata->listOfParticles.at(
p)->getParticleAuxFlag());
219 hepmcvtx->add_particle_out(particle_hepmc);
223 evt->add_vertex(hepmcvtx);
229 cout <<
"sHEPGen::process_event - Failed to add event to HepMC record!" << endl;
234 if (verbosity > 2) cout <<
"sHEPGen::process_event - FINISHED WHOLE EVENT" << endl;
245 for (
int i = 0; i < hepconst::logolength; i++)
246 cout << hepconst::logo[i] << endl;