Changeset 367 in svn for trunk/src/HepMCConverter.cc
- Timestamp:
- May 10, 2009, 8:08:45 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/HepMCConverter.cc
r362 r367 27 27 ** Copyright (C) 2008-2009, ** 28 28 ** All rights reserved. ** 29 //30 29 ** ** 31 30 ***********************************************************************/ … … 115 114 if ( index_to_particle[j]->production_vertex() ) 116 115 { 117 //HepLorentzVector p = index_to_particle[j]->production_vertex()->position();118 119 116 int num_mothers = index_to_particle[j]->production_vertex()->particles_in_size(); 120 int first_mother = find_in_map( particle_to_index,*(index_to_particle[j]->production_vertex()->particles_in_const_begin())); 121 int last_mother = first_mother + num_mothers - 1; 122 if ( first_mother == 0 ) last_mother = 0; 123 mo1=first_mother; 124 mo2=last_mother; 117 if (num_mothers ==0) { 118 mo1 = 0; 119 mo2 = 0; 120 } 121 else { 122 int first_mother = find_in_map( particle_to_index,*(index_to_particle[j]->production_vertex()->particles_in_const_begin())); 123 int last_mother = first_mother + num_mothers - 1; 124 if ( first_mother == 0 ) last_mother = 0; 125 mo1=first_mother; 126 mo2=last_mother; 127 } // if num_mothers !=0 125 128 } 126 else 129 else // no data on production_vertex 127 130 { 128 131 mo1 =0; … … 173 176 //--------------------------------------------------------------------------- 174 177 175 void HepMCConverter::AnalyseParticles(ExRootTreeBranch *branch, HepMC::GenEvent& evt)178 void HepMCConverter::AnalyseParticles(ExRootTreeBranch *branch, const HepMC::GenEvent& evt) 176 179 { 177 180 TRootC::GenParticle *element; … … 203 206 float PT = sqrt(pow(element->Px,2)+pow(element->Py,2)); 204 207 element->PT = PT; 208 205 209 momentum.SetPxPyPzE(element->Px, element->Py, element->Pz, element->E); 206 210 signPz = (element->Pz >= 0.0) ? 1.0 : -1.0; 207 element->Eta = element->PT == 0.0 ? signPz*999.9 : momentum.Eta(); 211 //element->Eta = element->PT == 0.0 ? signPz*999.9 : momentum.Eta(); to avoid a warning from ROOT, replace the "==0" by "< 1e-6" 212 element->Eta = element->PT < 1e-6 ? signPz*999.9 : momentum.Eta(); 208 213 element->Phi = index_to_particle[n]->momentum().phi(); 209 214
Note:
See TracChangeset
for help on using the changeset viewer.