hepmc - Diff between revs 103 and 105

Subversion Repositories:
Rev:
Show entire file - Ignore whitespace
Rev 103 Rev 105
Line 20... Line 20...
20                         const WeightContainer& weights, 20                         const WeightContainer& weights,
21                         const std::vector<long int>& random_states ) : 21                         const std::vector<long int>& random_states ) :
22         m_signal_process_id(signal_process_id), m_event_number(event_number), 22         m_signal_process_id(signal_process_id), m_event_number(event_number),
23         m_mpi(-1), 23         m_mpi(-1),
24         m_event_scale(-1), m_alphaQCD(-1), m_alphaQED(-1), 24         m_event_scale(-1), m_alphaQCD(-1), m_alphaQED(-1),
25         m_signal_process_vertex(signal_vertex), m_weights(weights), -  
-   25         m_signal_process_vertex(signal_vertex),
-   26         m_beam_particle_1(0),m_beam_particle_2(0),
-   27         m_weights(weights),
26         m_random_states(random_states), 28         m_random_states(random_states),
27         m_heavy_ion(0), 29         m_heavy_ion(0),
28         m_pdf_info(0) 30         m_pdf_info(0)
29     { 31     {
30         /// This constructor only allows null pointers to HeavyIon and PdfInfo 32         /// This constructor only allows null pointers to HeavyIon and PdfInfo
Line 41... Line 43...
41                         const HeavyIon& ion, 43                         const HeavyIon& ion,
42                         const PdfInfo& pdf ) : 44                         const PdfInfo& pdf ) :
43         m_signal_process_id(signal_process_id), m_event_number(event_number), 45         m_signal_process_id(signal_process_id), m_event_number(event_number),
44         m_mpi(-1), 46         m_mpi(-1),
45         m_event_scale(-1), m_alphaQCD(-1), m_alphaQED(-1), 47         m_event_scale(-1), m_alphaQCD(-1), m_alphaQED(-1),
46         m_signal_process_vertex(signal_vertex), m_weights(weights), -  
-   48         m_signal_process_vertex(signal_vertex),
-   49         m_beam_particle_1(0),m_beam_particle_2(0),
-   50         m_weights(weights),
47         m_random_states(random_states), 51         m_random_states(random_states),
48         m_heavy_ion( new HeavyIon(ion) ), 52         m_heavy_ion( new HeavyIon(ion) ),
49         m_pdf_info( new PdfInfo(pdf) ) 53         m_pdf_info( new PdfInfo(pdf) )
50     { 54     {
51         /// GenEvent makes its own copy of HeavyIon and PdfInfo 55         /// GenEvent makes its own copy of HeavyIon and PdfInfo
Line 123... Line 127...
123         set_event_scale( inevent.event_scale() ); 127         set_event_scale( inevent.event_scale() );
124         set_alphaQCD( inevent.alphaQCD() ); 128         set_alphaQCD( inevent.alphaQCD() );
125         set_alphaQED( inevent.alphaQED() ); 129         set_alphaQED( inevent.alphaQED() );
126         set_random_states( inevent.random_states() ); 130         set_random_states( inevent.random_states() );
127         weights() = inevent.weights(); 131         weights() = inevent.weights();
-   132         set_beam_particles( inevent.beam_particles() );
128         // 133         //
129         // 5. copy these only if they are not null 134         // 5. copy these only if they are not null
130         if( inevent.heavy_ion() ) set_heavy_ion( *inevent.heavy_ion() ); 135         if( inevent.heavy_ion() ) set_heavy_ion( *inevent.heavy_ion() );
131         if( inevent.pdf_info() ) set_pdf_info( *inevent.pdf_info() ); 136         if( inevent.pdf_info() ) set_pdf_info( *inevent.pdf_info() );
132         return *this; 137         return *this;
Line 149... Line 154...
149              << GenEvent::counter() << " events, " 154              << GenEvent::counter() << " events, "
150              << GenVertex::counter() << " vertices, " 155              << GenVertex::counter() << " vertices, "
151              << GenParticle::counter() << " particles.\n"; 156              << GenParticle::counter() << " particles.\n";
152         ostr << " Entries this event: " << vertices_size() << " vertices, " 157         ostr << " Entries this event: " << vertices_size() << " vertices, "
153              << particles_size() << " particles.\n"; 158              << particles_size() << " particles.\n";
-   159         if( m_beam_particle_1 && m_beam_particle_2 ) {
-   160           ostr << " Beam Particle barcodes: " << beam_particles().first->barcode() << " "
-   161                << beam_particles().second->barcode() << " \n";
-   162         } else {
-   163           ostr << " Beam Particles are not defined.\n";
-   164         }
154         // Random State 165         // Random State
155         ostr << " RndmState(" << m_random_states.size() << ")="; 166         ostr << " RndmState(" << m_random_states.size() << ")=";
156         for ( std::vector<long int>::const_iterator rs 167         for ( std::vector<long int>::const_iterator rs
157                   = m_random_states.begin(); 168                   = m_random_states.begin();
158               rs != m_random_states.end(); rs++ ) { ostr << *rs << " "; } 169               rs != m_random_states.end(); rs++ ) { ostr << *rs << " "; }
Line 219... Line 230...
219         /// 230         ///
220         delete_all_vertices(); 231         delete_all_vertices();
221         delete m_heavy_ion; 232         delete m_heavy_ion;
222         delete m_pdf_info; 233         delete m_pdf_info;
223         m_signal_process_id = 0; 234         m_signal_process_id = 0;
-   235         m_beam_particle_1 = 0;
-   236         m_beam_particle_2 = 0;
224         m_event_number = 0; 237         m_event_number = 0;
225         m_event_scale = -1; 238         m_event_scale = -1;
226         m_alphaQCD = -1; 239         m_alphaQCD = -1;
227         m_alphaQED = -1; 240         m_alphaQED = -1;
228         m_weights = std::vector<double>(); 241         m_weights = std::vector<double>();
Line 407... Line 420...
407                       << std::endl; 420                       << std::endl;
408         } 421         }
409         m_vertex_barcodes[suggested_barcode] = v; 422         m_vertex_barcodes[suggested_barcode] = v;
410         v->set_barcode_( suggested_barcode ); 423         v->set_barcode_( suggested_barcode );
411         return insert_success; 424         return insert_success;
-   425     }
-   426
-   427     /// test to see if we have two valid beam particles
-   428     bool  GenEvent::valid_beam_particles() const {
-   429         bool have1 = false;
-   430         bool have2 = false;
-   431         // first check that both are defined
-   432         if(m_beam_particle_1 && m_beam_particle_2) {
-   433             // now look for a match with the particle "list"
-   434             for ( particle_const_iterator p = particles_begin();
-   435                   p != particles_end(); p++ ) {
-   436                 if( m_beam_particle_1 == *p ) have1 = true;
-   437                 if( m_beam_particle_2 == *p ) have2 = true;
-   438             }
-   439         }
-   440         if( have1 && have2 ) return true;
-   441         return false;
-   442     }
-   443    
-   444     /// construct the beam particle information using pointers to GenParticle
-   445     /// returns false if either GenParticle* is null
-   446     bool  GenEvent::set_beam_particles(GenParticle* bp1, GenParticle* bp2) {
-   447         m_beam_particle_1 = bp1;
-   448         m_beam_particle_2 = bp2;
-   449         if( m_beam_particle_1 && m_beam_particle_2 ) return true;
-   450         return false;
-   451     }
-   452
-   453     /// construct the beam particle information using a std::pair of pointers to GenParticle
-   454     /// returns false if either GenParticle* is null
-   455     bool  GenEvent::set_beam_particles(std::pair<GenParticle*, GenParticle*> const & bp) {
-   456         return set_beam_particles(bp.first,bp.second);
412     } 457     }
413 458
414     ///////////// 459     /////////////
415     // Static  // 460     // Static  //
416     ///////////// 461     /////////////