6 #include "HepMC/SimpleVector.h" 8 #include <CLHEP/Units/GlobalSystemOfUnits.h> 13 #include "H_Parameters.h" 18 : m_verbosity(verbosity), m_FP420Transport(FP420Transport), m_ZDCTransport(ZDCTransport) {
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" 81 <<
" lengthfp420 = " << lengthfp420 <<
"\n" 82 <<
" m_rpp420_f = " << m_rpp420_f <<
"\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();
192 charge = part->charge();
196 double mass = (*eventParticle)->generatedMass();
198 h_p =
new H_BeamParticle(mass, charge);
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
229 <<
" charge = " << charge <<
" m_isCharged[line] = " <<
m_isCharged[
line];
239 H_BeamParticle *
part;
240 std::map<unsigned int, H_BeamParticle *>::iterator it;
254 LogDebug(
"HectorEventProcessing") <<
"Hector:filterFP420: barcode = " <<
line;
257 direction = (*
m_direct.find(line)).second;
265 part->smearAng(STX, STY, rootEngine);
270 part->smearE(
m_sig_e, 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;
298 <<
"Hector:filterFP420: barcode = " << line <<
" isStopped=" << (*
m_isStoppedfp420.find(line)).second;
305 x1_420 = part->getX();
306 y1_420 = part->getY();
309 <<
"Hector:filterFP420: barcode = " << line <<
" x= " << x1_420 <<
" y= " << y1_420;
322 <<
"Hector:filterFP420: barcode = " << line <<
" isStopped=" << (*
m_isStoppedfp420.find(line)).second;
331 H_BeamParticle *
part;
332 std::map<unsigned int, H_BeamParticle *>::iterator it;
334 bool is_stop_zdc =
false;
343 <<
"Hector:filterZDC: barcode = " << line <<
" charge = " << (*
m_isCharged.find(line)).
second;
351 LogDebug(
"HectorEventProcessing") <<
"Hector:filterZDC: barcode = " << line <<
" propagated ";
353 direction = (*
m_direct.find(line)).second;
355 LogDebug(
"HectorEventProcessing") <<
"Hector:filterZDC: barcode = " << line <<
" direction = " << direction;
363 part->smearAng(STX, STY, rootEngine);
368 part->smearE(
m_sig_e, 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;
407 <<
"Hector:filterZDC: barcode = " << line <<
" isStopped=" << (*
m_isStoppedzdc.find(line)).second;
416 H_BeamParticle *
part;
417 std::map<unsigned int, H_BeamParticle *>::iterator it;
431 <<
"Hector:filterD1: barcode = " << line <<
" isStoppedZDC =" << (*
m_isStoppedzdc.find(line)).
second;
434 LogDebug(
"HectorEventProcessing") <<
"Hector:filterD1: barcode = " << line <<
" propagated ";
436 direction = (*
m_direct.find(line)).second;
438 LogDebug(
"HectorEventProcessing") <<
"Hector:filterD1:direction=" << direction;
446 part->smearAng(STX, STY, rootEngine);
451 part->smearE(
m_sig_e, 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();
494 <<
"Hector:filterD1: barcode = " << line <<
" isStopped=" << (*
m_isStoppedd1.find(line)).second;
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();
521 long double tx, ty,
theta, fi, energy,
time = 0;
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);
546 theta =
sqrt((tx * tx) + (ty * ty));
549 if ((*
m_direct.find(line)).second > 0) {
551 }
else if ((*
m_direct.find(line)).second < 0) {
557 if ((*
m_direct.find(line)).second < 0)
561 fi = std::atan2(tx, ty);
564 time = (ddd * meter - gpart->production_vertex()->position().z() * mm);
568 LogDebug(
"HectorEventProcessing") <<
"Hector:: x= " << (*(
m_xAtTrPoint.find(line))).second * 0.001 <<
"\n" 569 <<
"Hector:: y= " << (*(
m_yAtTrPoint.find(line))).second * 0.001 <<
"\n" 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,
576 ddd * (*(
m_direct.find(line))).second * 1000.,
577 time + .001 *
time));
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();
T getParameter(std::string const &) const
std::map< unsigned int, int > m_direct
std::map< unsigned int, bool > m_isCharged
ZDCTransport
HepMC source to be processed.
int getDirect(unsigned int part_n) const
Sin< T >::type sin(const T &t)
Geom::Theta< T > theta() const
std::map< unsigned int, double > m_eta
std::map< unsigned int, bool > m_isStoppedzdc
H_BeamLine * m_beamlineZDC1
edm::ESHandle< ParticleDataTable > pdt
H_BeamLine * m_beamlineD11
std::map< unsigned int, bool > m_isStoppedd1
std::map< unsigned int, bool > m_isStoppedfp420
The Signals That Services Can Subscribe To This is based on ActivityRegistry and is current per Services can connect to the signals distributed by the ActivityRegistry in order to monitor the activity of the application Each possible callback has some defined which we here list in angle e g
Hector(const edm::ParameterSet &ps, bool verbosity, bool FP420Transport, bool ZDCTransport)
FP420Transport
main flag to set transport for ZDC
std::map< unsigned int, double > m_eAtTrPoint
bool getData(T &iHolder) const
U second(std::pair< T, U > const &p)
H_BeamLine * m_beamlineZDC2
void filterD1(TRandom3 *)
std::map< unsigned int, double > m_pz
Cos< T >::type cos(const T &t)
std::map< unsigned int, double > m_TyAtTrPoint
Abs< T >::type abs(const T &t)
void filterFP420(TRandom3 *)
std::vector< LHCTransportLink > theCorrespondenceMap
HepPDT::ParticleData ParticleData
void filterZDC(TRandom3 *)
H_BeamLine * m_beamlineFP4201
void add(const HepMC::GenEvent *ev, const edm::EventSetup &es)
H_BeamLine * m_beamlineD12
H_BeamLine * m_beamlineFP4202
HepMC::GenEvent * addPartToHepMC(HepMC::GenEvent *event)
std::map< unsigned int, double > m_yAtTrPoint
std::map< unsigned int, int > m_pdg
std::map< unsigned int, double > m_TxAtTrPoint
std::map< unsigned int, double > m_xAtTrPoint
std::map< unsigned int, H_BeamParticle * > m_beamPart
void clearApertureFlags()