hepmc - Diff between revs 43 and 65
Subversion Repositories:
| Rev 43 | Rev 65 | |||
|---|---|---|---|---|
| Line 26... | Line 26... | |||
| 26 | << ", print_inconsistency_errors = " | 26 | << ", print_inconsistency_errors = " | |
| 27 | << m_print_inconsistency_errors << std::endl; | 27 | << m_print_inconsistency_errors << std::endl; | |
| 28 | } | 28 | } | |
| 29 | 29 | |||
| 30 | bool IO_HEPEVT::fill_next_event( GenEvent* evt ) { | 30 | bool IO_HEPEVT::fill_next_event( GenEvent* evt ) { | |
| 31 | // read one event from the HEPEVT common block and fill GenEvent | - | ||
| 32 | // return T/F =success/failure | - | ||
| 33 | // | - | ||
| 34 | // For HEPEVT commons built with the luhepc routine of Pythia 5.7 | - | ||
| 35 | // the children pointers are not always correct (i.e. there is | - | ||
| 36 | // oftentimes an internal inconsistency between the parents and | - | ||
| 37 | // children pointers). The parent pointers always seem to be correct. | - | ||
| 38 | // Thus the switch trust_mothers_before_daughters=1 is appropriate for | - | ||
| 39 | // pythia. NOTE: you should also set the switch MSTP(128) = 2 in | - | ||
| 40 | // pythia (not the default!), so that pythia doesn't | - | ||
| 41 | // store two copies of resonances in the event record. | - | ||
| 42 | // The situation is opposite for the HEPEVT which comes from Isajet | - | ||
| 43 | // via stdhep, so then use the switch trust_mothers_before_daughters=0 | - | ||
| - | 31 | /// read one event from the HEPEVT common block and fill GenEvent | ||
| - | 32 | /// return T/F =success/failure | ||
| - | 33 | /// | ||
| - | 34 | /// For HEPEVT commons built with the luhepc routine of Pythia 5.7 | ||
| - | 35 | /// the children pointers are not always correct (i.e. there is | ||
| - | 36 | /// oftentimes an internal inconsistency between the parents and | ||
| - | 37 | /// children pointers). The parent pointers always seem to be correct. | ||
| - | 38 | /// Thus the switch trust_mothers_before_daughters=1 is appropriate for | ||
| - | 39 | /// pythia. NOTE: you should also set the switch MSTP(128) = 2 in | ||
| - | 40 | /// pythia (not the default!), so that pythia doesn't | ||
| - | 41 | /// store two copies of resonances in the event record. | ||
| - | 42 | /// The situation is opposite for the HEPEVT which comes from Isajet | ||
| - | 43 | /// via stdhep, so then use the switch trust_mothers_before_daughters=0 | ||
| 44 | // | 44 | // | |
| 45 | // 1. test that evt pointer is not null and set event number | 45 | // 1. test that evt pointer is not null and set event number | |
| 46 | if ( !evt ) { | 46 | if ( !evt ) { | |
| 47 | std::cerr | 47 | std::cerr | |
| 48 | << "IO_HEPEVT::fill_next_event error - passed null event." | 48 | << "IO_HEPEVT::fill_next_event error - passed null event." | |
| Line 99... | Line 99... | |||
| 99 | } | 99 | } | |
| 100 | return 1; | 100 | return 1; | |
| 101 | } | 101 | } | |
| 102 | 102 | |||
| 103 | void IO_HEPEVT::write_event( const GenEvent* evt ) { | 103 | void IO_HEPEVT::write_event( const GenEvent* evt ) { | |
| 104 | // This writes an event out to the HEPEVT common block. The daughters | - | ||
| 105 | // field is NOT filled, because it is possible to contruct graphs | - | ||
| 106 | // for which the mothers and daughters cannot both be make sequential. | - | ||
| 107 | // This is consistent with how pythia fills HEPEVT (daughters are not | - | ||
| 108 | // necessarily filled properly) and how IO_HEPEVT reads HEPEVT. | - | ||
| - | 104 | /// This writes an event out to the HEPEVT common block. The daughters | ||
| - | 105 | /// field is NOT filled, because it is possible to contruct graphs | ||
| - | 106 | /// for which the mothers and daughters cannot both be make sequential. | ||
| - | 107 | /// This is consistent with how pythia fills HEPEVT (daughters are not | ||
| - | 108 | /// necessarily filled properly) and how IO_HEPEVT reads HEPEVT. | ||
| 109 | // | 109 | // | |
| 110 | if ( !evt ) return; | 110 | if ( !evt ) return; | |
| 111 | // | 111 | // | |
| 112 | // map all particles onto a unique index | 112 | // map all particles onto a unique index | |
| 113 | std::vector<GenParticle*> index_to_particle( | 113 | std::vector<GenParticle*> index_to_particle( | |
| Line 180... | Line 180... | |||
| 180 | 180 | |||
| 181 | void IO_HEPEVT::build_production_vertex(int i, | 181 | void IO_HEPEVT::build_production_vertex(int i, | |
| 182 | std::vector<GenParticle*>& | 182 | std::vector<GenParticle*>& | |
| 183 | hepevt_particle, | 183 | hepevt_particle, | |
| 184 | GenEvent* evt ) { | 184 | GenEvent* evt ) { | |
| 185 | // | - | ||
| 186 | // for particle in HEPEVT with index i, build a production vertex | - | ||
| 187 | // if appropriate, and add that vertex to the event | - | ||
| - | 185 | /// | ||
| - | 186 | /// for particle in HEPEVT with index i, build a production vertex | ||
| - | 187 | /// if appropriate, and add that vertex to the event | ||
| 188 | GenParticle* p = hepevt_particle[i]; | 188 | GenParticle* p = hepevt_particle[i]; | |
| 189 | // a. search to see if a production vertex already exists | 189 | // a. search to see if a production vertex already exists | |
| 190 | int mother = HEPEVT_Wrapper::first_parent(i); | 190 | int mother = HEPEVT_Wrapper::first_parent(i); | |
| 191 | GenVertex* prod_vtx = p->production_vertex(); | 191 | GenVertex* prod_vtx = p->production_vertex(); | |
| 192 | while ( !prod_vtx && mother > 0 ) { | 192 | while ( !prod_vtx && mother > 0 ) { | |
| Line 244... | Line 244... | |||
| 244 | } | 244 | } | |
| 245 | 245 | |||
| 246 | void IO_HEPEVT::build_end_vertex | 246 | void IO_HEPEVT::build_end_vertex | |
| 247 | ( int i, std::vector<GenParticle*>& hepevt_particle, GenEvent* evt ) | 247 | ( int i, std::vector<GenParticle*>& hepevt_particle, GenEvent* evt ) | |
| 248 | { | 248 | { | |
| 249 | // | - | ||
| 250 | // for particle in HEPEVT with index i, build an end vertex | - | ||
| 251 | // if appropriate, and add that vertex to the event | - | ||
| - | 249 | /// | ||
| - | 250 | /// for particle in HEPEVT with index i, build an end vertex | ||
| - | 251 | /// if appropriate, and add that vertex to the event | ||
| 252 | // Identical steps as for build_production_vertex | 252 | // Identical steps as for build_production_vertex | |
| 253 | GenParticle* p = hepevt_particle[i]; | 253 | GenParticle* p = hepevt_particle[i]; | |
| 254 | // a. | 254 | // a. | |
| 255 | int daughter = HEPEVT_Wrapper::first_child(i); | 255 | int daughter = HEPEVT_Wrapper::first_child(i); | |
| 256 | GenVertex* end_vtx = p->end_vertex(); | 256 | GenVertex* end_vtx = p->end_vertex(); | |
| Line 311... | Line 311... | |||
| 311 | build_production_vertex( i, hepevt_particle, evt ); | 311 | build_production_vertex( i, hepevt_particle, evt ); | |
| 312 | } | 312 | } | |
| 313 | } | 313 | } | |
| 314 | 314 | |||
| 315 | GenParticle* IO_HEPEVT::build_particle( int index ) { | 315 | GenParticle* IO_HEPEVT::build_particle( int index ) { | |
| 316 | // Builds a particle object corresponding to index in HEPEVT | - | ||
| - | 316 | /// Builds a particle object corresponding to index in HEPEVT | ||
| 317 | // | 317 | // | |
| 318 | GenParticle* p | 318 | GenParticle* p | |
| 319 | = new GenParticle( FourVector( HEPEVT_Wrapper::px(index), | 319 | = new GenParticle( FourVector( HEPEVT_Wrapper::px(index), | |
| 320 | HEPEVT_Wrapper::py(index), | 320 | HEPEVT_Wrapper::py(index), | |
| 321 | HEPEVT_Wrapper::pz(index), | 321 | HEPEVT_Wrapper::pz(index), | |
