7 #include "CLHEP/Units/GlobalSystemOfUnits.h"
8 #include "CLHEP/Units/GlobalPhysicalConstants.h"
9 #include "HepMC/SimpleVector.h"
13 #include "H_Parameters.h"
18 m_verbosity(verbosity),
19 m_FP420Transport(FP420Transport),
20 m_ZDCTransport(ZDCTransport)
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"
67 <<
" lengthfp420 = " << lengthfp420 <<
"\n"
68 <<
" m_rpp420_f = " << m_rpp420_f <<
"\n"
71 <<
" lengthd1 = " << lengthd1 <<
"\n"
72 <<
"===================================================================\n";
123 for (std::map<unsigned int,H_BeamParticle*>::iterator it =
m_beamPart.begin(); it !=
m_beamPart.end(); ++it ) {
143 for ( std::map<unsigned int,H_BeamParticle*>::iterator it =
m_beamPart.begin(); it !=
m_beamPart.end(); ++it ) {
167 H_BeamParticle * h_p;
170 for (HepMC::GenEvent::particle_const_iterator eventParticle =evt->particles_begin();
171 eventParticle != evt->particles_end();
173 if ( (*eventParticle)->status() == 1 ) {
174 if (
abs( (*eventParticle)->momentum().eta())>
etacut){
175 line = (*eventParticle)->barcode();
183 charge = part->charge();
186 double mass = (*eventParticle)->generatedMass();
188 h_p =
new H_BeamParticle(mass,charge);
191 px = (*eventParticle)->momentum().px();
192 py = (*eventParticle)->momentum().py();
193 pz = (*eventParticle)->momentum().pz();
195 h_p->set4Momentum( px, py, pz, (*eventParticle)->momentum().e() );
198 double XforPosition = (*eventParticle)->production_vertex()->position().x()/micrometer;
199 double YforPosition = (*eventParticle)->production_vertex()->position().y()/micrometer;
200 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();
216 LogDebug(
"HectorEventProcessing") <<
"Hector:add: barcode = " << line
217 <<
" status = " << g->status()
218 <<
" PDG Id = " << g->pdg_id()
219 <<
" mass = " << mass
221 <<
" charge = " << charge
233 H_BeamParticle *
part;
234 std::map< unsigned int, H_BeamParticle* >::iterator it;
249 LogDebug(
"HectorEventProcessing") <<
"Hector:filterFP420: barcode = " <<
line;
252 direction = (*
m_direct.find( line )).second;
260 part->smearAng(STX,STY,rootEngine);
265 part->smearE(
m_sig_e,rootEngine);
268 part->smearE(SBE,rootEngine);
274 if(
m_verbosity)
LogDebug(
"HectorEventProcessing") <<
"Hector:filterFP420: barcode = " << line <<
" positive is_stop= "<< is_stop;
279 if(
m_verbosity)
LogDebug(
"HectorEventProcessing") <<
"Hector:filterFP420: barcode = " << line <<
" negative is_stop= "<< is_stop;
283 if(
m_verbosity)
LogDebug(
"HectorEventProcessing") <<
"Hector:filterFP420: barcode = " << line <<
" 0 is_stop= "<< is_stop;
291 if ( direction == 1 ) part->propagate(
m_rpp420_f );
292 if ( direction == -1 ) part->propagate(
m_rpp420_b );
293 x1_420 = part->getX();
294 y1_420 = part->getY();
295 if(
m_verbosity)
LogDebug(
"HectorEventProcessing") <<
"Hector:filterFP420: barcode = " << line <<
" x= "<< x1_420 <<
" y= " << y1_420;
317 H_BeamParticle *
part;
318 std::map< unsigned int, H_BeamParticle* >::iterator it;
320 bool is_stop_zdc =
false;
329 LogDebug(
"HectorEventProcessing") <<
"Hector:filterZDC: barcode = " << line <<
" charge = " << (*
m_isCharged.find(line)).
second;
335 if(
m_verbosity)
LogDebug(
"HectorEventProcessing") <<
"Hector:filterZDC: barcode = " << line <<
" propagated ";
337 direction = (*
m_direct.find( line )).second;
338 if(
m_verbosity)
LogDebug(
"HectorEventProcessing") <<
"Hector:filterZDC: barcode = " << line <<
" direction = " << direction;
345 part->smearAng(STX,STY,rootEngine);
350 part->smearE(
m_sig_e,rootEngine);
352 part->smearE(SBE,rootEngine);
359 if(
m_verbosity)
LogDebug(
"HectorEventProcessing") <<
"Hector:filterZDC: barcode " << line <<
" positive is_stop_zdc= "<< is_stop_zdc;
364 if(
m_verbosity)
LogDebug(
"HectorEventProcessing") <<
"Hector:filterZDC: barcode " << line <<
" negative is_stop_zdc= "<< is_stop_zdc;
367 if(
m_verbosity)
LogDebug(
"HectorEventProcessing") <<
"Hector:filterZDC: barcode " << line <<
" 0 is_stop_zdc= "<< is_stop_zdc;
388 H_BeamParticle *
part;
389 std::map< unsigned int, H_BeamParticle* >::iterator it;
405 if(
m_verbosity)
LogDebug(
"HectorEventProcessing") <<
"Hector:filterD1: barcode = " << line <<
" propagated ";
407 direction = (*
m_direct.find( line )).second;
408 if(
m_verbosity)
LogDebug(
"HectorEventProcessing") <<
"Hector:filterD1:direction=" << direction;
415 part->smearAng(STX,STY,rootEngine);
420 part->smearE(
m_sig_e,rootEngine);
422 part->smearE(SBE,rootEngine);
429 if(
m_verbosity)
LogDebug(
"HectorEventProcessing") <<
"Hector:filterD1 barcode " << line <<
" positive is_stop_d1 = "<< is_stop_d1;
434 if(
m_verbosity)
LogDebug(
"HectorEventProcessing") <<
"Hector:filterD1 barcode " << line <<
" negative is_stop_d1 = "<< is_stop_d1;
438 if(
m_verbosity)
LogDebug(
"HectorEventProcessing") <<
"Hector:filterD1 barcode " << line <<
" 0 is_stop_d1 = "<< is_stop_d1;
443 x1_d1 = part->getX();
444 y1_d1 = part->getY();
463 std::map<unsigned int, int>::const_iterator it =
m_direct.find( part_n );
471 for (std::map<unsigned int,H_BeamParticle*>::const_iterator it =
m_beamPart.begin(); it !=
m_beamPart.end(); ++it ) {
472 (*it).second->printProperties();
485 std::map< unsigned int, H_BeamParticle* >::iterator it;
493 LogDebug(
"HectorEventProcessing") <<
"Hector:addPartToHepMC: barcode = " << line <<
"\n"
500 gpart = evt->barcode_to_particle( line );
504 theta =
sqrt((tx*tx) + (ty*ty));
507 if( (*
m_direct.find( line )).second >0 ) {
510 else if((*
m_direct.find( line )).second <0 ) {
520 fi = std::atan2(tx,ty);
523 time = ( ddd*meter - gpart->production_vertex()->position().z()*mm );
527 LogDebug(
"HectorEventProcessing") <<
"Hector:: x= "<< (*(
m_xAtTrPoint.find(line))).second*0.001<<
"\n"
528 <<
"Hector:: y= "<< (*(
m_yAtTrPoint.find(line))).second*0.001<<
"\n"
529 <<
"Hector:: z= "<< ddd * (*(
m_direct.find( line ))).second*1000. <<
"\n"
530 <<
"Hector:: t= "<<
time;
533 HepMC::GenVertex * vert =
new HepMC::GenVertex( HepMC::FourVector( (*(
m_xAtTrPoint.find(line))).second*0.001,
535 ddd * (*(
m_direct.find( line ))).second*1000.,
536 time + .001*
time ) );
538 gpart->set_status( 2 );
539 vert->add_particle_in( gpart );
544 gpart->pdg_id(), 1, gpart->flow() ) );
545 evt->add_vertex( vert );
547 int ingoing = (*vert->particles_in_const_begin())->barcode();
548 int outgoing = (*vert->particles_out_const_begin())->barcode();
550 if (
m_verbosity)
LogDebug(
"HectorEventProcessing") <<
"Hector:addPartToHepMC: LHCTransportLink " << theLink;
553 if(
m_verbosity)
LogDebug(
"HectorEventProcessing") <<
"Hector::TRANSPORTED pz= " << gpart->momentum().pz()
554 <<
" eta= "<< gpart->momentum().eta()
555 <<
" status= "<< gpart->status();
563 gpart = evt->barcode_to_particle( line );
566 gpart->set_status( 2 );
570 if(
m_verbosity)
LogDebug(
"HectorEventProcessing") <<
"Hector::NON-transp. pz= " << gpart->momentum().pz()
571 <<
" eta= "<< gpart->momentum().eta()
572 <<
" status= "<< gpart->status();
T getParameter(std::string const &) const
std::map< unsigned int, int > m_direct
std::map< unsigned int, bool > m_isCharged
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
edm::ESHandle< ParticleDataTable > pdt
std::map< unsigned int, bool > m_isStoppedzdc
H_BeamLine * m_beamlineZDC1
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
void getData(T &iHolder) const
Hector(const edm::ParameterSet &ps, bool verbosity, bool FP420Transport, bool ZDCTransport)
std::map< unsigned int, double > m_eAtTrPoint
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
std::map< unsigned int, H_BeamParticle * > m_beamPart
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
void clearApertureFlags()