test
CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes
EPOS::IO_EPOS Class Reference

#include <IO_EPOS.h>

Inheritance diagram for EPOS::IO_EPOS:

Public Member Functions

bool fill_next_event (HepMC::GenEvent *)
 
 IO_EPOS ()
 
void print (std::ostream &ostr=std::cout) const
 
bool print_inconsistency_errors () const
 
void set_print_inconsistency_errors (bool b=true)
 
void set_skip_nuclear_fragments (bool b=true)
 !!MODIFICATION More...
 
void set_trust_beam_particles (bool b=true)
 
void set_trust_both_mothers_and_daughters (bool b=false)
 
void set_trust_mothers_before_daughters (bool b=true)
 
bool trust_beam_particles () const
 
bool trust_both_mothers_and_daughters () const
 
bool trust_mothers_before_daughters () const
 
void write_event (const HepMC::GenEvent *)
 
virtual ~IO_EPOS ()
 

Protected Member Functions

void build_end_vertex (int i, std::vector< HepMC::GenParticle * > &hepevt_particle, HepMC::GenEvent *evt)
 
HepMC::GenParticle * build_particle (int index)
 
void build_production_vertex (int i, std::vector< HepMC::GenParticle * > &hepevt_particle, HepMC::GenEvent *evt)
 
int find_in_map (const std::map< HepMC::GenParticle *, int > &m, HepMC::GenParticle *p) const
 

Private Member Functions

 IO_EPOS (const IO_EPOS &)
 

Private Attributes

bool m_print_inconsistency_errors
 
bool m_skip_nucl_frag
 
bool m_trust_beam_particles
 
bool m_trust_both_mothers_and_daughters
 
bool m_trust_mothers_before_daughters
 

Detailed Description

Definition at line 20 of file IO_EPOS.h.

Constructor & Destructor Documentation

EPOS::IO_EPOS::IO_EPOS ( )

Definition at line 16 of file IO_EPOS.cc.

20  m_skip_nucl_frag(false)
21  {}
bool m_skip_nucl_frag
Definition: IO_EPOS.h:57
bool m_trust_beam_particles
Definition: IO_EPOS.h:56
bool m_print_inconsistency_errors
Definition: IO_EPOS.h:55
bool m_trust_mothers_before_daughters
Definition: IO_EPOS.h:53
bool m_trust_both_mothers_and_daughters
Definition: IO_EPOS.h:54
EPOS::IO_EPOS::~IO_EPOS ( )
virtual

Definition at line 23 of file IO_EPOS.cc.

23 {}
EPOS::IO_EPOS::IO_EPOS ( const IO_EPOS )
inlineprivate

Definition at line 49 of file IO_EPOS.h.

49 : HepMC::IO_BaseClass() {}

Member Function Documentation

void EPOS::IO_EPOS::build_end_vertex ( int  i,
std::vector< HepMC::GenParticle * > &  hepevt_particle,
HepMC::GenEvent *  evt 
)
protected

Definition at line 251 of file IO_EPOS.cc.

References ecal_dqm_sourceclient-live_cfg::cerr, EPOS::EPOS_Wrapper::event_number(), EPOS::EPOS_Wrapper::first_child(), GenParticle::GenParticle, i, EPOS::EPOS_Wrapper::last_child(), EPOS::EPOS_Wrapper::number_children(), AlCaHLTBitMon_ParallelJobs::p, EPOS::EPOS_Wrapper::t(), EPOS::EPOS_Wrapper::x(), EPOS::EPOS_Wrapper::y(), and EPOS::EPOS_Wrapper::z().

Referenced by fill_next_event().

252  {
253  // Identical steps as for build_production_vertex
254  HepMC::GenParticle* p = hepevt_particle[i];
255  // a.
256  int daughter = EPOS_Wrapper::first_child(i);
257  HepMC::GenVertex* end_vtx = p->end_vertex();
258  while ( !end_vtx && daughter > 0 ) {
259  end_vtx = hepevt_particle[daughter]->production_vertex();
260  if ( end_vtx ) end_vtx->add_particle_in( p );
261  if ( ++daughter > EPOS_Wrapper::last_child(i) ) daughter = 0;
262  }
263  // b. (different from 3c. because EPOS particle can not know its
264  // decay position )
265  if ( !end_vtx && EPOS_Wrapper::number_children(i)>0 ) {
266  end_vtx = new GenVertex();
267  end_vtx->add_particle_in( p );
268  evt->add_vertex( end_vtx );
269  }
270  // c+d. loop over daughters to make sure their production vertices
271  // point back to the current vertex.
272  // We get the vertex position from the daughter as well.
273  daughter = EPOS_Wrapper::first_child(i);
274  while ( end_vtx && daughter > 0 ) {
275  if ( !hepevt_particle[daughter]->production_vertex() ) {
276  // if end vertex of the mother isn't specified, do it now
277  end_vtx->add_particle_out( hepevt_particle[daughter] );
278  //
279  // 2001-03-29 M.Dobbs, fill vertex the position.
280  if ( end_vtx->position()==FourVector(0,0,0,0) ) {
281  // again mm to cm conversion
282  FourVector prod_pos( EPOS_Wrapper::x(daughter),
283  EPOS_Wrapper::y(daughter),
284  EPOS_Wrapper::z(daughter),
285  EPOS_Wrapper::t(daughter)
286  );
287  if ( prod_pos != FourVector(0,0,0,0) ) {
288  end_vtx->set_position( prod_pos );
289  }
290  }
291  } else if (hepevt_particle[daughter]->production_vertex()
292  != end_vtx){
293  // problem scenario --- the daughter already has a prod
294  // vertex which differs from the mother's end
295  // vertex. This means there is internal
296  // inconsistency in the EPOS event record. Print an
297  // error
299  << "HepMC::IO_EPOS: inconsistent mother/daugher "
300  << "information in EPOS event "
302  << ". \n I recommend you try "
303  << "inspecting the event first with "
304  << "\n\tEPOS_Wrapper::check_hepevt_consistency()"
305  << "\n This warning can be turned off with the "
306  << "IO_EPOS::print_inconsistency_errors switch."
307  << std::endl;
308  }
309  if ( ++daughter > EPOS_Wrapper::last_child(i) ) daughter = 0;
310  }
311  if ( !p->end_vertex() && !p->production_vertex() ) {
312  // Added 2001-11-04, to try and handle Isajet problems.
313  build_production_vertex( i, hepevt_particle, evt );
314  }
315  }
int i
Definition: DBlmapReader.cc:9
static double t(int index)
production time
Definition: EPOS_Wrapper.h:469
static int first_child(int index)
index of 1st daughter
Definition: EPOS_Wrapper.h:384
void build_production_vertex(int i, std::vector< HepMC::GenParticle * > &hepevt_particle, HepMC::GenEvent *evt)
Definition: IO_EPOS.cc:188
bool m_print_inconsistency_errors
Definition: IO_EPOS.h:55
static double y(int index)
Y Production vertex.
Definition: EPOS_Wrapper.h:455
static int event_number()
event number
Definition: EPOS_Wrapper.h:333
static double z(int index)
Z Production vertex.
Definition: EPOS_Wrapper.h:462
static int number_children(int index)
number of children
Definition: EPOS_Wrapper.h:410
static int last_child(int index)
index of last daughter
Definition: EPOS_Wrapper.h:392
static double x(int index)
X Production vertex.
Definition: EPOS_Wrapper.h:448
HepMC::GenParticle * EPOS::IO_EPOS::build_particle ( int  index)
protected

Definition at line 317 of file IO_EPOS.cc.

References EPOS::EPOS_Wrapper::e(), GenParticle::GenParticle, EPOS::EPOS_Wrapper::id(), EPOS::EPOS_Wrapper::m(), AlCaHLTBitMon_ParallelJobs::p, EPOS::EPOS_Wrapper::px(), EPOS::EPOS_Wrapper::py(), EPOS::EPOS_Wrapper::pz(), and EPOS::EPOS_Wrapper::status().

Referenced by fill_next_event().

317  {
318  //
320  = new GenParticle( FourVector( EPOS_Wrapper::px(index),
326  p->setGeneratedMass( EPOS_Wrapper::m(index) );
327  p->suggest_barcode( index );
328  return p;
329  }
static double m(int index)
generated mass
Definition: EPOS_Wrapper.h:442
static double e(int index)
Energy.
Definition: EPOS_Wrapper.h:436
static double py(int index)
Y momentum.
Definition: EPOS_Wrapper.h:423
static int status(int index)
status code
Definition: EPOS_Wrapper.h:343
static double pz(int index)
Z momentum.
Definition: EPOS_Wrapper.h:430
static int id(int index)
PDG particle id.
Definition: EPOS_Wrapper.h:346
static double px(int index)
X momentum.
Definition: EPOS_Wrapper.h:417
void EPOS::IO_EPOS::build_production_vertex ( int  i,
std::vector< HepMC::GenParticle * > &  hepevt_particle,
HepMC::GenEvent *  evt 
)
protected

Definition at line 188 of file IO_EPOS.cc.

References ecal_dqm_sourceclient-live_cfg::cerr, EPOS::EPOS_Wrapper::event_number(), EPOS::EPOS_Wrapper::first_parent(), GenParticle::GenParticle, i, EPOS::EPOS_Wrapper::last_parent(), m_print_inconsistency_errors, EPOS::EPOS_Wrapper::number_parents(), AlCaHLTBitMon_ParallelJobs::p, EPOS::EPOS_Wrapper::t(), EPOS::EPOS_Wrapper::x(), EPOS::EPOS_Wrapper::y(), and EPOS::EPOS_Wrapper::z().

Referenced by fill_next_event().

191  {
192  HepMC::GenParticle* p = hepevt_particle[i];
193  // a. search to see if a production vertex already exists
194  int mother = EPOS_Wrapper::first_parent(i);
195  HepMC::GenVertex* prod_vtx = p->production_vertex();
196  while ( !prod_vtx && mother > 0 ) {
197  prod_vtx = hepevt_particle[mother]->end_vertex();
198  if ( prod_vtx ) prod_vtx->add_particle_out( p );
199  // increment mother for next iteration
200  if ( ++mother > EPOS_Wrapper::last_parent(i) ) mother = 0;
201  }
202  // b. if no suitable production vertex exists - and the particle
203  // has atleast one mother or position information to store -
204  // make one
205  HepMC::FourVector prod_pos( EPOS_Wrapper::x(i), EPOS_Wrapper::y(i),
207  );
208  if ( !prod_vtx && (EPOS_Wrapper::number_parents(i)>0
209  || prod_pos!=FourVector(0,0,0,0)) )
210  {
211  prod_vtx = new HepMC::GenVertex();
212  prod_vtx->add_particle_out( p );
213  evt->add_vertex( prod_vtx );
214  }
215  // c. if prod_vtx doesn't already have position specified, fill it
216  if ( prod_vtx && prod_vtx->position()==FourVector(0,0,0,0) ) {
217  prod_vtx->set_position( prod_pos );
218  }
219  // d. loop over mothers to make sure their end_vertices are
220  // consistent
221  mother = EPOS_Wrapper::first_parent(i);
222  while ( prod_vtx && mother > 0 ) {
223  if ( !hepevt_particle[mother]->end_vertex() ) {
224  // if end vertex of the mother isn't specified, do it now
225  prod_vtx->add_particle_in( hepevt_particle[mother] );
226  } else if (hepevt_particle[mother]->end_vertex() != prod_vtx ) {
227  // problem scenario --- the mother already has a decay
228  // vertex which differs from the daughter's produciton
229  // vertex. This means there is internal
230  // inconsistency in the EPOS event record. Print an
231  // error
232  // Note: we could provide a fix by joining the two
233  // vertices with a dummy particle if the problem
234  // arrises often with any particular generator.
236  << "HepMC::IO_EPOS: inconsistent mother/daugher "
237  << "information in EPOS event "
239  << ". \n I recommend you try "
240  << "inspecting the event first with "
241  << "\n\tEPOS_Wrapper::check_hepevt_consistency()"
242  << "\n This warning can be turned off with the "
243  << "IO_EPOS::print_inconsistency_errors switch."
244  << std::endl;
245  }
246  if ( ++mother > EPOS_Wrapper::last_parent(i) ) mother = 0;
247  }
248  }
int i
Definition: DBlmapReader.cc:9
static double t(int index)
production time
Definition: EPOS_Wrapper.h:469
static int number_parents(int index)
number of parents
Definition: EPOS_Wrapper.h:378
static int first_parent(int index)
index of 1st mother
Definition: EPOS_Wrapper.h:352
bool m_print_inconsistency_errors
Definition: IO_EPOS.h:55
static double y(int index)
Y Production vertex.
Definition: EPOS_Wrapper.h:455
static int event_number()
event number
Definition: EPOS_Wrapper.h:333
static double z(int index)
Z Production vertex.
Definition: EPOS_Wrapper.h:462
static int last_parent(int index)
index of last mother
Definition: EPOS_Wrapper.h:360
static double x(int index)
X Production vertex.
Definition: EPOS_Wrapper.h:448
bool EPOS::IO_EPOS::fill_next_event ( HepMC::GenEvent *  evt)

Definition at line 36 of file IO_EPOS.cc.

References funct::abs(), build_end_vertex(), build_particle(), build_production_vertex(), ecal_dqm_sourceclient-live_cfg::cerr, EPOS::EPOS_Wrapper::event_number(), i, m_skip_nucl_frag, m_trust_both_mothers_and_daughters, m_trust_mothers_before_daughters, EPOS::EPOS_Wrapper::number_entries(), HLT_25ns10e33_v2_cff::primaryVertex, and trust_beam_particles().

36  {
37  //
38  // 1. test that evt pointer is not null and set event number
39  if ( !evt ) {
40  std::cerr
41  << "IO_EPOS::fill_next_event error - passed null event."
42  << std::endl;
43  return false;
44  }
45  evt->set_event_number( EPOS_Wrapper::event_number() );
46  //
47  // 2. create a particle instance for each EPOS entry and fill a map
48  // create a vector which maps from the EPOS particle index to the
49  // GenParticle address
50  // (+1 in size accounts for hepevt_particle[0] which is unfilled)
51  std::vector<HepMC::GenParticle*> hepevt_particle(
53  hepevt_particle[0] = 0;
54  for ( int i1 = 1; i1 <= EPOS_Wrapper::number_entries(); ++i1 ) {
55  hepevt_particle[i1] = build_particle(i1);
56  }
57 
58  HepMC::GenVertex* primaryVertex = new HepMC::GenVertex(HepMC::FourVector(0,0,0,0),0);
59  evt->add_vertex(primaryVertex);
60  if(!evt->signal_process_vertex()) evt->set_signal_process_vertex(primaryVertex);
61 
62  std::set<HepMC::GenVertex*> new_vertices;
63  //
64  // Here we assume that the first two particles in the list
65  // are the incoming beam particles.
66  if( trust_beam_particles() ) {
67  evt->set_beam_particles( hepevt_particle[1], hepevt_particle[2] );
68  }
69  //
70  // 3.+4. loop over EPOS particles AGAIN, this time creating vertices
71  //MODIFICATION FROM HEPMC!! skipping nuclear fragments in event if option is set
72  for ( int i = 1; i <= EPOS_Wrapper::number_entries(); ++i ) {
73  if (m_skip_nucl_frag && abs(hepevt_particle[i]->pdg_id())>=1000000000)
74  continue;
75  // We go through and build EITHER the production or decay
76  // vertex for each entry in hepevt, depending on the switch
77  // m_trust_mothers_before_daughters (new 2001-02-28)
78  // Note: since the EPOS pointers are bi-directional, it is
79  //
80  // 3. Build the production_vertex (if necessary)
83  build_production_vertex( i, hepevt_particle, evt );
84  }
85  //
86  // 4. Build the end_vertex (if necessary)
87  // Identical steps as for production vertex
90  build_end_vertex( i, hepevt_particle, evt );
91  }
92  }
93  // 5. 01.02.2000
94  // handle the case of particles in EPOS which come from nowhere -
95  // i.e. particles without mothers or daughters.
96  // These particles need to be attached to a vertex, or else they
97  // will never become part of the event. check for this situation
98  //MODIFICATION FROM HEPMC!! skipping nuclear fragments in event if option is set
99  for ( int i3 = 1; i3 <= EPOS_Wrapper::number_entries(); ++i3 ) {
100  if (m_skip_nucl_frag && abs(hepevt_particle[i3]->pdg_id())>=1000000000)
101  continue;
102  if ( !hepevt_particle[i3]->end_vertex() &&
103  !hepevt_particle[i3]->production_vertex() ) {
104  HepMC::GenVertex* prod_vtx = new GenVertex();
105  prod_vtx->add_particle_out( hepevt_particle[i3] );
106  evt->add_vertex( prod_vtx );
107  }
108  }
109  return true;
110  }
bool m_skip_nucl_frag
Definition: IO_EPOS.h:57
HepMC::GenParticle * build_particle(int index)
Definition: IO_EPOS.cc:317
int i
Definition: DBlmapReader.cc:9
void build_end_vertex(int i, std::vector< HepMC::GenParticle * > &hepevt_particle, HepMC::GenEvent *evt)
Definition: IO_EPOS.cc:251
void build_production_vertex(int i, std::vector< HepMC::GenParticle * > &hepevt_particle, HepMC::GenEvent *evt)
Definition: IO_EPOS.cc:188
bool m_trust_mothers_before_daughters
Definition: IO_EPOS.h:53
bool m_trust_both_mothers_and_daughters
Definition: IO_EPOS.h:54
bool trust_beam_particles() const
Definition: IO_EPOS.h:79
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
static int event_number()
event number
Definition: EPOS_Wrapper.h:333
static int number_entries()
num entries in current evt
Definition: EPOS_Wrapper.h:336
int EPOS::IO_EPOS::find_in_map ( const std::map< HepMC::GenParticle *, int > &  m,
HepMC::GenParticle *  p 
) const
protected

Definition at line 331 of file IO_EPOS.cc.

Referenced by write_event().

332  {
333  std::map<HepMC::GenParticle*,int>::const_iterator iter = m.find(p);
334  if ( iter == m.end() ) return 0;
335  return iter->second;
336  }
void EPOS::IO_EPOS::print ( std::ostream &  ostr = std::cout) const

Definition at line 25 of file IO_EPOS.cc.

References m_print_inconsistency_errors, m_trust_both_mothers_and_daughters, and m_trust_mothers_before_daughters.

25  {
26  ostr << "IO_EPOS: reads an event from the FORTRAN EPOS g "
27  << "common block. \n"
28  << " trust_mothers_before_daughters = "
30  << " trust_both_mothers_and_daughters = "
32  << ", print_inconsistency_errors = "
33  << m_print_inconsistency_errors << std::endl;
34  }
bool m_print_inconsistency_errors
Definition: IO_EPOS.h:55
bool m_trust_mothers_before_daughters
Definition: IO_EPOS.h:53
bool m_trust_both_mothers_and_daughters
Definition: IO_EPOS.h:54
bool EPOS::IO_EPOS::print_inconsistency_errors ( ) const
inline

Definition at line 67 of file IO_EPOS.h.

References m_print_inconsistency_errors.

bool m_print_inconsistency_errors
Definition: IO_EPOS.h:55
void EPOS::IO_EPOS::set_print_inconsistency_errors ( bool  b = true)
inline

Definition at line 76 of file IO_EPOS.h.

References b, and m_print_inconsistency_errors.

bool m_print_inconsistency_errors
Definition: IO_EPOS.h:55
double b
Definition: hdecay.h:120
void EPOS::IO_EPOS::set_skip_nuclear_fragments ( bool  b = true)
inline

!!MODIFICATION

Definition at line 86 of file IO_EPOS.h.

References b, and m_skip_nucl_frag.

87  { m_skip_nucl_frag = b; }
bool m_skip_nucl_frag
Definition: IO_EPOS.h:57
double b
Definition: hdecay.h:120
void EPOS::IO_EPOS::set_trust_beam_particles ( bool  b = true)
inline

Definition at line 82 of file IO_EPOS.h.

References b, and m_trust_beam_particles.

bool m_trust_beam_particles
Definition: IO_EPOS.h:56
double b
Definition: hdecay.h:120
void EPOS::IO_EPOS::set_trust_both_mothers_and_daughters ( bool  b = false)
inline

Definition at line 70 of file IO_EPOS.h.

References b, and m_trust_both_mothers_and_daughters.

bool m_trust_both_mothers_and_daughters
Definition: IO_EPOS.h:54
double b
Definition: hdecay.h:120
void EPOS::IO_EPOS::set_trust_mothers_before_daughters ( bool  b = true)
inline

Definition at line 73 of file IO_EPOS.h.

References b, and m_trust_mothers_before_daughters.

bool m_trust_mothers_before_daughters
Definition: IO_EPOS.h:53
double b
Definition: hdecay.h:120
bool EPOS::IO_EPOS::trust_beam_particles ( ) const
inline

Definition at line 79 of file IO_EPOS.h.

References m_trust_beam_particles.

Referenced by fill_next_event().

80  { return m_trust_beam_particles; }
bool m_trust_beam_particles
Definition: IO_EPOS.h:56
bool EPOS::IO_EPOS::trust_both_mothers_and_daughters ( ) const
inline

Definition at line 61 of file IO_EPOS.h.

References m_trust_both_mothers_and_daughters.

bool m_trust_both_mothers_and_daughters
Definition: IO_EPOS.h:54
bool EPOS::IO_EPOS::trust_mothers_before_daughters ( ) const
inline

Definition at line 64 of file IO_EPOS.h.

References m_trust_mothers_before_daughters.

bool m_trust_mothers_before_daughters
Definition: IO_EPOS.h:53
void EPOS::IO_EPOS::write_event ( const HepMC::GenEvent *  )

Definition at line 112 of file IO_EPOS.cc.

References find_in_map(), i, visualization-live-secondInstance_cfg::m, EPOS::EPOS_Wrapper::max_number_entries(), AlCaHLTBitMon_ParallelJobs::p, p1, p2, EPOS::EPOS_Wrapper::set_children(), EPOS::EPOS_Wrapper::set_event_number(), EPOS::EPOS_Wrapper::set_id(), EPOS::EPOS_Wrapper::set_mass(), EPOS::EPOS_Wrapper::set_momentum(), EPOS::EPOS_Wrapper::set_number_entries(), EPOS::EPOS_Wrapper::set_parents(), EPOS::EPOS_Wrapper::set_position(), EPOS::EPOS_Wrapper::set_status(), mps_update::status, and findQualityFiles::v.

112  {
113  //
114  if ( !evt ) return;
115  //
116  // map all particles onto a unique index
117  std::vector<HepMC::GenParticle*> index_to_particle(
119  index_to_particle[0]=0;
120  std::map<HepMC::GenParticle*,int> particle_to_index;
121  int particle_counter=0;
122  for ( HepMC::GenEvent::vertex_const_iterator v = evt->vertices_begin();
123  v != evt->vertices_end(); ++v ) {
124  // all "mothers" or particles_in are kept adjacent in the list
125  // so that the mother indices in hepevt can be filled properly
126  for ( HepMC::GenVertex::particles_in_const_iterator p1
127  = (*v)->particles_in_const_begin();
128  p1 != (*v)->particles_in_const_end(); ++p1 ) {
129  ++particle_counter;
130  if ( particle_counter >
132  index_to_particle[particle_counter] = *p1;
133  particle_to_index[*p1] = particle_counter;
134  }
135  // daughters are entered only if they aren't a mother of
136  // another vtx
137  for ( HepMC::GenVertex::particles_out_const_iterator p2
138  = (*v)->particles_out_const_begin();
139  p2 != (*v)->particles_out_const_end(); ++p2 ) {
140  if ( !(*p2)->end_vertex() ) {
141  ++particle_counter;
142  if ( particle_counter >
144  break;
145  }
146  index_to_particle[particle_counter] = *p2;
147  particle_to_index[*p2] = particle_counter;
148  }
149  }
150  }
151  if ( particle_counter > EPOS_Wrapper::max_number_entries() ) {
152  particle_counter = EPOS_Wrapper::max_number_entries();
153  }
154  //
155  // fill the EPOS event record
156  EPOS_Wrapper::set_event_number( evt->event_number() );
157  EPOS_Wrapper::set_number_entries( particle_counter );
158  for ( int i = 1; i <= particle_counter; ++i ) {
159  EPOS_Wrapper::set_status( i, index_to_particle[i]->status() );
160  EPOS_Wrapper::set_id( i, index_to_particle[i]->pdg_id() );
161  FourVector m = index_to_particle[i]->momentum();
162  EPOS_Wrapper::set_momentum( i, m.px(), m.py(), m.pz(), m.e() );
163  EPOS_Wrapper::set_mass( i, index_to_particle[i]->generatedMass() );
164  // there should ALWAYS be particles in any vertex, but some generators
165  // are making non-kosher HepMC events
166  if ( index_to_particle[i]->production_vertex() &&
167  index_to_particle[i]->production_vertex()->particles_in_size()) {
168  FourVector p = index_to_particle[i]->
169  production_vertex()->position();
170  EPOS_Wrapper::set_position( i, p.x(), p.y(), p.z(), p.t() );
171  int num_mothers = index_to_particle[i]->production_vertex()->
172  particles_in_size();
173  int first_mother = find_in_map( particle_to_index,
174  *(index_to_particle[i]->
175  production_vertex()->
176  particles_in_const_begin()));
177  int last_mother = first_mother + num_mothers - 1;
178  if ( first_mother == 0 ) last_mother = 0;
179  EPOS_Wrapper::set_parents( i, first_mother, last_mother );
180  } else {
181  EPOS_Wrapper::set_position( i, 0, 0, 0, 0 );
182  EPOS_Wrapper::set_parents( i, 0, 0 );
183  }
184  EPOS_Wrapper::set_children( i, 0, 0 );
185  }
186  }
static void set_children(int index, int firstchild, int lastchild)
define children of a particle
Definition: EPOS_Wrapper.h:504
static void set_mass(int index, double mass)
set particle mass
Definition: EPOS_Wrapper.h:528
int i
Definition: DBlmapReader.cc:9
static void set_status(int index, int status)
set particle status
Definition: EPOS_Wrapper.h:482
static void set_id(int index, int id)
set particle ID
Definition: EPOS_Wrapper.h:488
static void set_number_entries(int noentries)
set number of entries in EPOS
Definition: EPOS_Wrapper.h:479
static void set_event_number(int evtno)
set event number
Definition: EPOS_Wrapper.h:476
static void set_momentum(int index, double px, double py, double pz, double e)
set particle momentum
Definition: EPOS_Wrapper.h:514
double p2[4]
Definition: TauolaWrapper.h:90
static void set_position(int index, double x, double y, double z, double t)
set particle production vertex
Definition: EPOS_Wrapper.h:535
static int max_number_entries()
size of common block
Definition: EPOS_Wrapper.h:225
double p1[4]
Definition: TauolaWrapper.h:89
int find_in_map(const std::map< HepMC::GenParticle *, int > &m, HepMC::GenParticle *p) const
Definition: IO_EPOS.cc:331
static void set_parents(int index, int firstparent, int lastparent)
define parents of a particle
Definition: EPOS_Wrapper.h:494
tuple status
Definition: mps_update.py:57

Member Data Documentation

bool EPOS::IO_EPOS::m_print_inconsistency_errors
private
bool EPOS::IO_EPOS::m_skip_nucl_frag
private

Definition at line 57 of file IO_EPOS.h.

Referenced by fill_next_event(), and set_skip_nuclear_fragments().

bool EPOS::IO_EPOS::m_trust_beam_particles
private

Definition at line 56 of file IO_EPOS.h.

Referenced by set_trust_beam_particles(), and trust_beam_particles().

bool EPOS::IO_EPOS::m_trust_both_mothers_and_daughters
private
bool EPOS::IO_EPOS::m_trust_mothers_before_daughters
private