slaclab / lcsim

LCSim Java Library
Other
1 stars 5 forks source link

LCIOWriter through SIOMCParticle rewrites particle endpoint vertexes. #43

Closed mholtrop closed 1 year ago

mholtrop commented 1 year ago

This is really damaging. The SIOMCParticle driver overwrites the GEANT4 particle tree endpoints of vertexes. There are a lot of physics processes where a particle will emit a daughter particle without this ending that particle, so the endpoint of this particle should not be set to the vertex of the daughters

Fix: Leave the content of MCParticles alone when writing out MCParticle collections. You are not smarter than GEANT4.

Example case:

--------------- print out of MCParticle collection --------------- 

  flag:  0xe0000000
 parameter _weight [float]: 0.00e+00, 
  simulator status bits: [sbvtcls]  s: created in simulation b: backscatter v: vertex is not endpoint of parent t: decayed in tracker c: decayed in calorimeter l: has left detector s: stopped o: overlay

[   id   ]index|      PDG |    px,     py,        pz    | px_ep,   py_ep , pz_ep      | energy  |gen|[simstat ]| vertex x,     y   ,   z     | endpoint x,    y  ,   z     |    mass |  charge |            spin             | colorflow | [parents] - [daughters]

[00000255]    0|        11| 5.58e-01, 9.63e-02, 2.95e+00| 0.00e+00, 0.00e+00, 0.00e+00| 3.00e+00| 1 |[    c s ]| 0.00e+00, 0.00e+00, 0.00e+00| 1.95e+02, 4.04e+01, 1.49e+03| 5.11e-04|-1.00e+00| 0.00e+00, 0.00e+00, 0.00e+00|  (0, 0)   | [] - [1] 
[00000256]    1|        22| 1.07e-03, 2.57e-04, 8.30e-03| 0.00e+00, 0.00e+00, 0.00e+00| 8.37e-03| 0 |[s   c s ]| 1.10e+02, 2.18e+01, 6.93e+02| 2.09e+02, 4.56e+01, 1.46e+03| 0.00e+00| 0.00e+00| 0.00e+00, 0.00e+00, 0.00e+00|  (0, 0)   | [0] - [] 

-------------------------------------------------------------------------------- 

Is changed to:


--------------- print out of MCParticle collection --------------- 

  flag:  0xe0000000
 parameter _weight [float]: 0.00e+00, 
  simulator status bits: [sbvtcls]  s: created in simulation b: backscatter v: vertex is not endpoint of parent t: decayed in tracker c: decayed in calorimeter l: has left detector s: stopped o: overlay

[   id   ]index|      PDG |    px,     py,        pz    | px_ep,   py_ep , pz_ep      | energy  |gen|[simstat ]| vertex x,     y   ,   z     | endpoint x,    y  ,   z     |    mass |  charge |            spin             | colorflow | [parents] - [daughters]

[00002052]    0|        11| 5.58e-01, 9.63e-02, 2.95e+00| 0.00e+00, 0.00e+00, 0.00e+00| 3.00e+00| 1 |[    c s ]| 0.00e+00, 0.00e+00, 0.00e+00| 1.10e+02, 2.18e+01, 6.93e+02| 5.11e-04|-1.00e+00| 0.00e+00, 0.00e+00, 0.00e+00|  (0, 0)   | [] - [1] 
[00002053]    1|        22| 1.07e-03, 2.57e-04, 8.30e-03| 0.00e+00, 0.00e+00, 0.00e+00| 8.37e-03| 0 |[s   c s ]| 1.10e+02, 2.18e+01, 6.93e+02| 2.09e+02, 4.56e+01, 1.46e+03| 0.00e+00| 0.00e+00| 0.00e+00, 0.00e+00, 0.00e+00|  (0, 0)   | [0] - [] 

-------------------------------------------------------------------------------- 
JeremyMcCormick commented 1 year ago

Resolved by PR #44