7 #include <CLHEP/Units/SystemOfUnits.h> 8 #include <CLHEP/Units/GlobalPhysicalConstants.h> 9 #include "HepMC/SimpleVector.h" 13 #include "H_Parameters.h" 46 edm::LogInfo(
"HectorSetup") <<
"===================================================================\n" 47 <<
" * * * * * * * * * * * * * * * * * * * * * * * * * * * * \n" 49 <<
" * --<--<-- A fast simulator --<--<-- * \n" 50 <<
" * | --<--<-- of particle --<--<-- * \n" 51 <<
" * ----HECTOR----< * \n" 52 <<
" * | -->-->-- transport through-->-->-- * \n" 53 <<
" * -->-->-- generic beamlines -->-->-- * \n" 55 <<
" * JINST 2:P09005 (2007) * \n" 56 <<
" * X Rouby, J de Favereau, K Piotrzkowski (CP3) * \n" 57 <<
" * http://www.fynu.ucl.ac.be/hector.html * \n" 59 <<
" * Center for Cosmology, Particle Physics and Phenomenology * \n" 60 <<
" * Universite catholique de Louvain * \n" 61 <<
" * Louvain-la-Neuve, Belgium * \n" 63 <<
" * * * * * * * * * * * * * * * * * * * * * * * * * * * * \n" 64 <<
" Hector configuration: \n" 71 <<
" lengthd1 = " <<
lengthd1 <<
"\n" 72 <<
"===================================================================\n";
153 for (HepMC::GenEvent::particle_const_iterator eventParticle = evt->particles_begin();
154 eventParticle != evt->particles_end();
156 if ((*eventParticle)->status() == 1) {
157 if (
abs((*eventParticle)->momentum().eta()) >
etacut) {
158 line = (*eventParticle)->barcode();
170 double mass = (*eventParticle)->generatedMass();
175 px = (*eventParticle)->momentum().px();
176 py = (*eventParticle)->momentum().py();
177 pz = (*eventParticle)->momentum().pz();
179 h_p->set4Momentum(
px,
py, pz, (*eventParticle)->momentum().e());
182 double XforPosition = (*eventParticle)->production_vertex()->position().x() / CLHEP::micrometer;
183 double YforPosition = (*eventParticle)->production_vertex()->position().y() / CLHEP::micrometer;
184 double ZforPosition = (*eventParticle)->production_vertex()->position().z() / CLHEP::meter;
186 double TXforPosition = 0.0, TYforPosition = 0.0;
189 h_p->setPosition(XforPosition, YforPosition, TXforPosition, TYforPosition, ZforPosition);
195 m_eta[
line] = (*eventParticle)->momentum().eta();
196 m_pdg[
line] = (*eventParticle)->pdg_id();
197 m_pz[
line] = (*eventParticle)->momentum().pz();
201 <<
"Hector:add: barcode = " <<
line <<
" status = " <<
g->status() <<
" PDG Id = " <<
g->pdg_id()
202 <<
" mass = " <<
mass <<
" pz = " << pz <<
" charge = " <<
charge 213 H_BeamParticle*
part;
214 std::map<unsigned int, H_BeamParticle*>::iterator
it;
238 part->smearAng(STX, STY, rootEngine);
245 part->smearE(SBE, rootEngine);
253 <<
"Hector:filterFP420: barcode = " <<
line <<
" positive is_stop= " << is_stop;
259 <<
"Hector:filterFP420: barcode = " <<
line <<
" negative is_stop= " << is_stop;
264 <<
"Hector:filterFP420: barcode = " <<
line <<
" 0 is_stop= " << is_stop;
278 x1_420 =
part->getX();
279 y1_420 =
part->getY();
282 <<
"Hector:filterFP420: barcode = " <<
line <<
" x= " << x1_420 <<
" y= " << y1_420;
304 H_BeamParticle*
part;
305 std::map<unsigned int, H_BeamParticle*>::iterator
it;
307 bool is_stop_zdc =
false;
323 edm::LogVerbatim(
"HectorEventProcessing") <<
"Hector:filterZDC: barcode = " <<
line <<
" propagated ";
328 <<
"Hector:filterZDC: barcode = " <<
line <<
" direction = " << direction;
335 part->smearAng(STX, STY, rootEngine);
342 part->smearE(SBE, rootEngine);
351 <<
"Hector:filterZDC: barcode " <<
line <<
" positive is_stop_zdc= " << is_stop_zdc;
358 <<
"Hector:filterZDC: barcode " <<
line <<
" negative is_stop_zdc= " << is_stop_zdc;
363 <<
"Hector:filterZDC: barcode " <<
line <<
" 0 is_stop_zdc= " << is_stop_zdc;
380 H_BeamParticle*
part;
381 std::map<unsigned int, H_BeamParticle*>::iterator
it;
398 edm::LogVerbatim(
"HectorEventProcessing") <<
"Hector:filterD1: barcode = " <<
line <<
" propagated ";
402 edm::LogVerbatim(
"HectorEventProcessing") <<
"Hector:filterD1:direction=" << direction;
409 part->smearAng(STX, STY, rootEngine);
416 part->smearE(SBE, rootEngine);
425 <<
"Hector:filterD1 barcode " <<
line <<
" positive is_stop_d1 = " << is_stop_d1;
432 <<
"Hector:filterD1 barcode " <<
line <<
" negative is_stop_d1 = " << is_stop_d1;
438 <<
"Hector:filterD1 barcode " <<
line <<
" 0 is_stop_d1 = " << is_stop_d1;
443 x1_d1 =
part->getX();
444 y1_d1 =
part->getY();
464 std::map<unsigned int, int>::const_iterator
it =
m_direct.find(part_n);
473 (*it).second->printProperties();
484 std::map<unsigned int, H_BeamParticle*>::iterator
it;
496 <<
"Hector:addPartToHepMC: barcode = " <<
line <<
"\n" 503 gpart = evt->barcode_to_particle(
line);
522 fi = std::atan2(tx, ty);
525 time = (ddd * CLHEP::meter - gpart->production_vertex()->position().z() * CLHEP::mm);
532 <<
"Hector:: z= " << ddd * (*(
m_direct.find(
line))).second * 1000. <<
"\n" 533 <<
"Hector:: t= " <<
time;
536 HepMC::GenVertex* vert =
new HepMC::GenVertex(HepMC::FourVector((*(
m_xAtTrPoint.find(
line))).second * 0.001,
541 gpart->set_status(2);
542 vert->add_particle_in(gpart);
550 evt->add_vertex(vert);
552 int ingoing = (*vert->particles_in_const_begin())->barcode();
553 int outgoing = (*vert->particles_out_const_begin())->barcode();
556 edm::LogVerbatim(
"HectorEventProcessing") <<
"Hector:addPartToHepMC: LHCTransportLink " << theLink;
561 <<
"Hector::TRANSPORTED pz= " << gpart->momentum().pz() <<
" eta= " << gpart->momentum().eta()
562 <<
" status= " << gpart->status();
569 gpart = evt->barcode_to_particle(
line);
572 gpart->set_status(2);
578 <<
"Hector::NON-transp. pz= " << gpart->momentum().pz() <<
" eta= " << gpart->momentum().eta()
579 <<
" status= " << gpart->status();
Log< level::Info, true > LogVerbatim
std::map< unsigned int, int > m_direct
std::map< unsigned int, bool > m_isCharged
T getParameter(std::string const &) const
ZDCTransport
HepMC source to be processed.
Sin< T >::type sin(const T &t)
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
FP420Transport
main flag to set transport for ZDC
std::map< unsigned int, double > m_eAtTrPoint
U second(std::pair< T, U > const &p)
std::string beam2filename
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
Hector(const edm::ParameterSet &ps, const edm::ESGetToken< HepPDT::ParticleDataTable, PDTRecord > &, bool verbosity, bool FP420Transport, bool ZDCTransport)
HepPDT::ParticleData ParticleData
ESHandle< T > getHandle(const ESGetToken< T, R > &iToken) const
Log< level::Info, false > LogInfo
int getDirect(unsigned int part_n) const
void filterZDC(TRandom3 *)
H_BeamLine * m_beamlineFP4201
const edm::ESGetToken< HepPDT::ParticleDataTable, PDTRecord > tok_pdt_
std::string beam1filename
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
Geom::Theta< T > theta() const
std::map< unsigned int, H_BeamParticle * > m_beamPart
static constexpr float b1
void clearApertureFlags()