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) {
179 for (HepMC::GenEvent::particle_const_iterator eventParticle = evt->particles_begin();
180 eventParticle != evt->particles_end();
182 if ((*eventParticle)->status() == 1) {
183 if (
abs((*eventParticle)->momentum().eta()) >
etacut) {
184 line = (*eventParticle)->barcode();
196 double mass = (*eventParticle)->generatedMass();
201 px = (*eventParticle)->momentum().px();
202 py = (*eventParticle)->momentum().py();
203 pz = (*eventParticle)->momentum().pz();
205 h_p->set4Momentum(
px,
py, pz, (*eventParticle)->momentum().e());
208 double XforPosition = (*eventParticle)->production_vertex()->position().x() / micrometer;
209 double YforPosition = (*eventParticle)->production_vertex()->position().y() / micrometer;
210 double ZforPosition = (*eventParticle)->production_vertex()->position().z() / meter;
213 double TXforPosition = 0.0, TYforPosition = 0.0;
216 h_p->setPosition(XforPosition, YforPosition, TXforPosition, TYforPosition, ZforPosition);
222 m_eta[
line] = (*eventParticle)->momentum().eta();
223 m_pdg[
line] = (*eventParticle)->pdg_id();
224 m_pz[
line] = (*eventParticle)->momentum().pz();
227 LogDebug(
"HectorEventProcessing") <<
"Hector:add: barcode = " <<
line <<
" status = " <<
g->status()
228 <<
" PDG Id = " <<
g->pdg_id() <<
" mass = " <<
mass <<
" pz = " << pz
239 H_BeamParticle *
part;
240 std::map<unsigned int, H_BeamParticle *>::iterator it;
254 LogDebug(
"HectorEventProcessing") <<
"Hector:filterFP420: barcode = " <<
line;
265 part->smearAng(STX, STY, rootEngine);
272 part->smearE(SBE, rootEngine);
280 <<
"Hector:filterFP420: barcode = " <<
line <<
" positive is_stop= " << is_stop;
286 <<
"Hector:filterFP420: barcode = " <<
line <<
" negative is_stop= " << is_stop;
291 <<
"Hector:filterFP420: barcode = " <<
line <<
" 0 is_stop= " << is_stop;
305 x1_420 =
part->getX();
306 y1_420 =
part->getY();
309 <<
"Hector:filterFP420: barcode = " <<
line <<
" x= " << x1_420 <<
" y= " << y1_420;
331 H_BeamParticle *
part;
332 std::map<unsigned int, H_BeamParticle *>::iterator it;
334 bool is_stop_zdc =
false;
351 LogDebug(
"HectorEventProcessing") <<
"Hector:filterZDC: barcode = " <<
line <<
" propagated ";
355 LogDebug(
"HectorEventProcessing") <<
"Hector:filterZDC: barcode = " <<
line <<
" direction = " << direction;
363 part->smearAng(STX, STY, rootEngine);
370 part->smearE(SBE, rootEngine);
379 <<
"Hector:filterZDC: barcode " <<
line <<
" positive is_stop_zdc= " << is_stop_zdc;
386 <<
"Hector:filterZDC: barcode " <<
line <<
" negative is_stop_zdc= " << is_stop_zdc;
391 <<
"Hector:filterZDC: barcode " <<
line <<
" 0 is_stop_zdc= " << is_stop_zdc;
416 H_BeamParticle *
part;
417 std::map<unsigned int, H_BeamParticle *>::iterator it;
434 LogDebug(
"HectorEventProcessing") <<
"Hector:filterD1: barcode = " <<
line <<
" propagated ";
438 LogDebug(
"HectorEventProcessing") <<
"Hector:filterD1:direction=" << direction;
446 part->smearAng(STX, STY, rootEngine);
453 part->smearE(SBE, rootEngine);
462 <<
"Hector:filterD1 barcode " <<
line <<
" positive is_stop_d1 = " << is_stop_d1;
469 <<
"Hector:filterD1 barcode " <<
line <<
" negative is_stop_d1 = " << is_stop_d1;
475 <<
"Hector:filterD1 barcode " <<
line <<
" 0 is_stop_d1 = " << is_stop_d1;
480 x1_d1 =
part->getX();
481 y1_d1 =
part->getY();
502 std::map<unsigned int, int>::const_iterator it =
m_direct.find(part_n);
510 for (std::map<unsigned int, H_BeamParticle *>::const_iterator it =
m_beamPart.begin(); it !=
m_beamPart.end(); ++it) {
511 (*it).second->printProperties();
522 std::map<unsigned int, H_BeamParticle *>::iterator it;
533 LogDebug(
"HectorEventProcessing") <<
"Hector:addPartToHepMC: barcode = " <<
line <<
"\n"
534 <<
"Hector:addPartToHepMC: isStoppedfp420="
542 gpart = evt->barcode_to_particle(
line);
561 fi = std::atan2(tx, ty);
564 time = (ddd * meter - gpart->production_vertex()->position().z() * mm);
570 <<
"Hector:: z= " << ddd * (*(
m_direct.find(
line))).second * 1000. <<
"\n"
571 <<
"Hector:: t= " <<
time;
574 HepMC::GenVertex *vert =
new HepMC::GenVertex(HepMC::FourVector((*(
m_xAtTrPoint.find(
line))).second * 0.001,
579 gpart->set_status(2);
580 vert->add_particle_in(gpart);
588 evt->add_vertex(vert);
590 int ingoing = (*vert->particles_in_const_begin())->barcode();
591 int outgoing = (*vert->particles_out_const_begin())->barcode();
594 LogDebug(
"HectorEventProcessing") <<
"Hector:addPartToHepMC: LHCTransportLink " << theLink;
598 LogDebug(
"HectorEventProcessing") <<
"Hector::TRANSPORTED pz= " << gpart->momentum().pz()
599 <<
" eta= " << gpart->momentum().eta() <<
" status= " << gpart->status();
606 gpart = evt->barcode_to_particle(
line);
609 gpart->set_status(2);
614 LogDebug(
"HectorEventProcessing") <<
"Hector::NON-transp. pz= " << gpart->momentum().pz()
615 <<
" eta= " << gpart->momentum().eta() <<
" status= " << gpart->status();