6 #include "HepMC/SimpleVector.h"
8 #include <CLHEP/Units/GlobalSystemOfUnits.h>
13 #include "H_Parameters.h"
42 edm::LogInfo(
"HectorSetup") <<
"==================================================================="
44 <<
" * * * * * * * * * * * * * * * * * * * * * * * * * * * * "
48 <<
" * --<--<-- A fast simulator --<--<-- * "
50 <<
" * | --<--<-- of particle --<--<-- * "
52 <<
" * ----HECTOR----< * "
54 <<
" * | -->-->-- transport through-->-->-- * "
56 <<
" * -->-->-- generic beamlines -->-->-- * "
60 <<
" * JINST 2:P09005 (2007) * "
62 <<
" * X Rouby, J de Favereau, K Piotrzkowski (CP3) * "
64 <<
" * http://www.fynu.ucl.ac.be/hector.html * "
68 <<
" * Center for Cosmology, Particle Physics and Phenomenology * "
70 <<
" * Universite catholique de Louvain * "
72 <<
" * Louvain-la-Neuve, Belgium * "
76 <<
" * * * * * * * * * * * * * * * * * * * * * * * * * * * * "
78 <<
" Hector configuration: \n"
85 <<
" lengthd1 = " <<
lengthd1 <<
"\n"
86 <<
"==================================================================="
134 for (std::map<unsigned int, H_BeamParticle *>::iterator it =
m_beamPart.begin(); it !=
m_beamPart.end(); ++it) {
153 for (std::map<unsigned int, H_BeamParticle *>::iterator it =
m_beamPart.begin(); it !=
m_beamPart.end(); ++it) {
168 for (HepMC::GenEvent::particle_const_iterator eventParticle = evt->particles_begin();
169 eventParticle != evt->particles_end();
171 if ((*eventParticle)->status() == 1) {
172 if (
abs((*eventParticle)->momentum().eta()) >
etacut) {
173 line = (*eventParticle)->barcode();
185 double mass = (*eventParticle)->generatedMass();
190 px = (*eventParticle)->momentum().px();
191 py = (*eventParticle)->momentum().py();
192 pz = (*eventParticle)->momentum().pz();
194 h_p->set4Momentum(
px,
py, pz, (*eventParticle)->momentum().e());
197 double XforPosition = (*eventParticle)->production_vertex()->position().x() / micrometer;
198 double YforPosition = (*eventParticle)->production_vertex()->position().y() / micrometer;
199 double ZforPosition = (*eventParticle)->production_vertex()->position().z() / meter;
202 double TXforPosition = 0.0, TYforPosition = 0.0;
205 h_p->setPosition(XforPosition, YforPosition, TXforPosition, TYforPosition, ZforPosition);
211 m_eta[
line] = (*eventParticle)->momentum().eta();
212 m_pdg[
line] = (*eventParticle)->pdg_id();
213 m_pz[
line] = (*eventParticle)->momentum().pz();
217 <<
"Hector:add: barcode = " <<
line <<
" status = " <<
g->status() <<
" PDG Id = " <<
g->pdg_id()
218 <<
" mass = " <<
mass <<
" pz = " << pz <<
" charge = " <<
charge
229 H_BeamParticle *
part;
230 std::map<unsigned int, H_BeamParticle *>::iterator it;
244 LogDebug(
"HectorEventProcessing") <<
"Hector:filterFP420: barcode = " <<
line;
255 part->smearAng(STX, STY, rootEngine);
262 part->smearE(SBE, rootEngine);
270 <<
"Hector:filterFP420: barcode = " <<
line <<
" positive is_stop= " << is_stop;
276 <<
"Hector:filterFP420: barcode = " <<
line <<
" negative is_stop= " << is_stop;
281 <<
"Hector:filterFP420: barcode = " <<
line <<
" 0 is_stop= " << is_stop;
295 x1_420 =
part->getX();
296 y1_420 =
part->getY();
299 <<
"Hector:filterFP420: barcode = " <<
line <<
" x= " << x1_420 <<
" y= " << y1_420;
321 H_BeamParticle *
part;
322 std::map<unsigned int, H_BeamParticle *>::iterator it;
324 bool is_stop_zdc =
false;
339 LogDebug(
"HectorEventProcessing") <<
"Hector:filterZDC: barcode = " <<
line <<
" propagated ";
343 LogDebug(
"HectorEventProcessing") <<
"Hector:filterZDC: barcode = " <<
line <<
" direction = " << direction;
351 part->smearAng(STX, STY, rootEngine);
358 part->smearE(SBE, rootEngine);
367 <<
"Hector:filterZDC: barcode " <<
line <<
" positive is_stop_zdc= " << is_stop_zdc;
374 <<
"Hector:filterZDC: barcode " <<
line <<
" negative is_stop_zdc= " << is_stop_zdc;
379 <<
"Hector:filterZDC: barcode " <<
line <<
" 0 is_stop_zdc= " << is_stop_zdc;
404 H_BeamParticle *
part;
405 std::map<unsigned int, H_BeamParticle *>::iterator it;
422 edm::LogVerbatim(
"HectorEventProcessing") <<
"Hector:filterD1: barcode = " <<
line <<
" propagated ";
426 LogDebug(
"HectorEventProcessing") <<
"Hector:filterD1:direction=" << direction;
434 part->smearAng(STX, STY, rootEngine);
441 part->smearE(SBE, rootEngine);
450 <<
"Hector:filterD1 barcode " <<
line <<
" positive is_stop_d1 = " << is_stop_d1;
457 <<
"Hector:filterD1 barcode " <<
line <<
" negative is_stop_d1 = " << is_stop_d1;
463 <<
"Hector:filterD1 barcode " <<
line <<
" 0 is_stop_d1 = " << is_stop_d1;
468 x1_d1 =
part->getX();
469 y1_d1 =
part->getY();
490 std::map<unsigned int, int>::const_iterator it =
m_direct.find(part_n);
498 for (std::map<unsigned int, H_BeamParticle *>::const_iterator it =
m_beamPart.begin(); it !=
m_beamPart.end(); ++it) {
499 (*it).second->printProperties();
510 std::map<unsigned int, H_BeamParticle *>::iterator it;
521 LogDebug(
"HectorEventProcessing") <<
"Hector:addPartToHepMC: barcode = " <<
line <<
"\n"
522 <<
"Hector:addPartToHepMC: isStoppedfp420="
530 gpart = evt->barcode_to_particle(
line);
549 fi = std::atan2(tx, ty);
552 time = (ddd * meter - gpart->production_vertex()->position().z() * mm);
558 <<
"Hector:: z= " << ddd * (*(
m_direct.find(
line))).second * 1000. <<
"\n"
559 <<
"Hector:: t= " <<
time;
562 HepMC::GenVertex *vert =
new HepMC::GenVertex(HepMC::FourVector((*(
m_xAtTrPoint.find(
line))).second * 0.001,
567 gpart->set_status(2);
568 vert->add_particle_in(gpart);
576 evt->add_vertex(vert);
578 int ingoing = (*vert->particles_in_const_begin())->barcode();
579 int outgoing = (*vert->particles_out_const_begin())->barcode();
582 LogDebug(
"HectorEventProcessing") <<
"Hector:addPartToHepMC: LHCTransportLink " << theLink;
586 LogDebug(
"HectorEventProcessing") <<
"Hector::TRANSPORTED pz= " << gpart->momentum().pz()
587 <<
" eta= " << gpart->momentum().eta() <<
" status= " << gpart->status();
594 gpart = evt->barcode_to_particle(
line);
597 gpart->set_status(2);
602 LogDebug(
"HectorEventProcessing") <<
"Hector::NON-transp. pz= " << gpart->momentum().pz()
603 <<
" eta= " << gpart->momentum().eta() <<
" status= " << gpart->status();