Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix HG4BertCascIntranuke #310

Closed
wants to merge 6 commits into from

Conversation

idkakorin
Copy link
Contributor

@idkakorin idkakorin commented Jul 29, 2023

It seems that I found some mistakes in HG4BertCascIntranuke.cxx related to Issue #305. Anyway I had to add isotope O11 in genie_pdg_table.txt. Although this is a rare event, when there is O11 in the final state, but sometimes it happens. GEANT knows about this isotope. Therefore, there is a need to add in genie_pdg_table.txt rare isotope to avoid errors in the future. Maybe someone knows where does GEANT keep it isotopes data table? We could copy all elements from it to genie_pdg_table.txt.
When I run the comand gevgen -n 179120 -p 11 -e 2.261 -t 1000060120 --tune G18_10d_00_000 --cross-sections xsec_splines.xml --event-generator-list EM --seed 65539 I have found one a single "problematic" event:
1690591989 NOTICE gevgen : [n] <gEvGen.cxx::GenerateEventsAtFixedInitState (336)> : *** Generating event............ 179118
1690591989 NOTICE HG4BertCascIntranuke : [n] <HG4BertCascIntranuke.cxx::SetTrackingRadius (354)> : Setting tracking radius to R = 9.6156
1690591989 NOTICE gevgen : [n] <gEvGen.cxx::GenerateEventsAtFixedInitState (348)> : Generated Event GHEP Record:

|------------------------------------------------------------------------------------------------------------------|
|GENIE GHEP Event Record [print level:   3]                                                                        |
|------------------------------------------------------------------------------------------------------------------|
| Idx |          Name | Ist |        PDG |   Mother  | Daughter  |      Px |      Py |      Pz |       E |      m  | 
|------------------------------------------------------------------------------------------------------------------|
|   0 |            e- |   0 |         11 |  -1 |  -1 |   4 |   4 |   0.000 |   0.000 |   2.261 |   2.261 |   0.001 | 
|   1 |           C12 |   0 | 1000060120 |  -1 |  -1 |   2 |   3 |   0.000 |   0.000 |   0.000 |  11.175 |  11.175 | 
|   2 |       neutron |  11 |       2112 |   1 |  -1 |   5 |   5 |   0.071 |   0.184 |  -0.146 |   0.918 | **0.940 | M = 0.885 
|   3 |           C11 |   2 | 1000060110 |   1 |  -1 |  10 |  10 |  -0.071 |  -0.184 |   0.146 |  10.257 |  10.254 | 
|   4 |            e- |   1 |         11 |   0 |  -1 |  -1 |  -1 |  -0.212 |   0.045 |   1.837 |   1.850 |   0.001 | P = (0.115,-0.024,-0.993)
|   5 |        Delta0 |   3 |       2114 |   2 |  -1 |   6 |   7 |   0.283 |   0.139 |   0.278 |   1.329 | **1.233 | M = 1.261 
|   6 |        proton |  14 |       2212 |   5 |  -1 |   8 |   9 |   0.349 |   0.161 |   0.004 |   1.014 |   0.938 | 
|   7 |           pi- |  14 |       -211 |   5 |  -1 |  -1 |  -1 |  -0.065 |  -0.022 |   0.274 |   0.315 |   0.140 | 
|   8 |           pi- |   1 |       -211 |   6 |  -1 |  -1 |  -1 |  -0.064 |  -0.022 |   0.267 |   0.308 |   0.140 | 
|   9 |       neutron |   1 |       2112 |   6 |  -1 |  -1 |  -1 |   0.192 |  -0.048 |  -0.024 |   0.960 |   0.940 | 
|  10 |           O11 |  15 | 1000080110 |   3 |  -1 |  -1 |  -1 |   0.084 |   0.025 |   0.181 |  10.314 |  10.311 | 
|------------------------------------------------------------------------------------------------------------------|
|       Fin-Init:                                                |  -0.000 |  -0.000 |  -0.000 |  -0.003 |         | 
|------------------------------------------------------------------------------------------------------------------|
|       Vertex:             e- @ (x =     0.00000 m, y =     0.00000 m, z =     0.00000 m, t =    0.000000e+00 s)  |
|------------------------------------------------------------------------------------------------------------------|
| Err flag [bits:15->0] : 0000000000000000    |  1st set:                                                     none | 
| Err mask [bits:15->0] : 1111111111111111    |  Is unphysical:    NO |   Accepted:   YES                          |
|------------------------------------------------------------------------------------------------------------------|
| sig(Ev) =       3.81380e-30 cm^2  | d2sig(W,Q2;E)/dWdQ2 =     8.61302e-29 cm^2/GeV^3 | Weight =          1.00000 |
|------------------------------------------------------------------------------------------------------------------|

--------------------------------------------------------------------------------------------------------------
GENIE Interaction Summary
--------------------------------------------------------------------------------------------------------------
[-] [Init-State] 
 |--> probe        : PDG-code = 11 (e-)
 |--> nucl. target : Z = 6, A = 12, PDG-Code = 1000060120 (C12)
 |--> hit nucleon  : PDC-Code = 2112 (neutron)
 |--> hit quark    : no set
 |--> probe 4P     : (E =     2.261000, Px =     0.000000, Py =     0.000000, Pz =     2.261000)
 |--> target 4P    : (E =    11.174863, Px =     0.000000, Py =     0.000000, Pz =     0.000000)
 |--> nucleon 4P   : (E =     0.917918, Px =     0.071164, Py =     0.183568, Pz =    -0.145778)
[-] [Process-Info]  
 |--> Interaction : EM
 |--> Scattering  : RES
[-] [Kinematics]
 |--> *Selected* Bjorken x = 0.066757
 |--> *Selected* Inelasticity y = 0.179844
 |--> *Selected* Momentum transfer Q2 (>0) = 0.057748
 |--> *Selected* Hadronic invariant mass W = 1.260899
[-] [Exclusive Process Info] 
 |--> charm prod.  : false |--> strange prod.  : false
 |--> f/s nucleons : N(p) = 0 N(n) = 0
 |--> f/s pions    : N(pi^0) = 0 N(pi^+) = 0 N(pi^-) = 0
 |--> f/s Other    : N(gamma) = 0 N(Rho^0) = 0 N(Rho^+) = 0 N(Rho^-) = 0
 |--> resonance    : P33(1232)
 |--> final quark prod.  : false
 |--> final lepton prod.  : false
--------------------------------------------------------------------------------------------------------------

Now it seems reasonable, but with one exception: what it does this event special:
two particles: proton and pi- should be scattered by GEANT. However, pi- remains unscattered.
I hope we will discuss it at next Core meeting on the 14 August.

@idkakorin idkakorin added the bug Something isn't working label Jul 29, 2023
@idkakorin
Copy link
Contributor Author

Another interesting event, because original list consists of 2 secondaries, which should produced 2 cascade.

Output: 
 Outgoing Particles: 1
 px -0.206235 py -0.166582 pz 0.27794 pmod 0.3841 E 2.1441 creator model 1
 Particle: neutron type 2 mass 2.10942 ekin 0.0346849
 Outgoing Nuclei: 1
 px 0 py 0 pz 0 pmod 0 E 9.32444 creator model 0
 Nucleus: B10 A 10 Z 5 mass 9.32444 Eex (MeV) 0
Charge = 5
BaryonN = 11
Strangeness = 0

1690722231 NOTICE gevgen : [n] <gEvGen.cxx::GenerateEventsAtFixedInitState (348)> : Generated Event GHEP Record: 

|------------------------------------------------------------------------------------------------------------------|
|GENIE GHEP Event Record [print level:   3]                                                                        |
|------------------------------------------------------------------------------------------------------------------|
| Idx |          Name | Ist |        PDG |   Mother  | Daughter  |      Px |      Py |      Pz |       E |      m  | 
|------------------------------------------------------------------------------------------------------------------|
|   0 |            e- |   0 |         11 |  -1 |  -1 |   4 |   4 |   0.000 |   0.000 |   2.261 |   2.261 |   0.001 | 
|   1 |           C12 |   0 | 1000060120 |  -1 |  -1 |   2 |   3 |   0.000 |   0.000 |   0.000 |  11.175 |  11.175 | 
|   2 |           n+p |  11 | 2000000201 |   1 |  -1 |   5 |   5 |   0.106 |   0.168 |  -0.030 |   1.888 |   1.878 | 
|   3 |           B10 |   2 | 1000050100 |   1 |  -1 |   9 |   9 |  -0.106 |  -0.168 |   0.030 |   9.286 | **9.324 | M = 9.284 
|   4 |            e- |   1 |         11 |   0 |  -1 |  -1 |  -1 |   0.312 |   0.334 |   1.953 |   2.005 |   0.001 | P = (-0.155,-0.167,-0.974)
|   5 |           n+p |   3 | 2000000201 |   2 |  -1 |   6 |   7 |  -0.206 |  -0.167 |   0.278 |   2.144 | **1.878 | M = 2.109 
|   6 |       neutron |  14 |       2112 |   5 |  -1 |   8 |   8 |   0.171 |  -0.254 |   0.496 |   1.106 |   0.940 | 
|   7 |        proton |  14 |       2212 |   5 |  -1 |  -1 |  -1 |  -0.377 |   0.088 |  -0.218 |   1.038 |   0.938 | 
|   8 |       neutron |   1 |       2112 |   6 |  -1 |  -1 |  -1 |  -0.206 |  -0.167 |   0.278 |   2.144 | **0.940 | M = 2.109 
|   9 |           B10 |  15 | 1000050100 |   3 |  -1 |  -1 |  -1 |  -0.106 |  -0.168 |   0.030 |   9.324 | **9.324 | M = 9.322 
|------------------------------------------------------------------------------------------------------------------|
|       Fin-Init:                                                |  -0.000 |  -0.000 |   0.000 |   0.038 |         | 
|------------------------------------------------------------------------------------------------------------------|
|       Vertex:             e- @ (x =     0.00000 m, y =     0.00000 m, z =     0.00000 m, t =    0.000000e+00 s)  |
|------------------------------------------------------------------------------------------------------------------|
| Err flag [bits:15->0] : 0000000000000000    |  1st set:                                                     none | 
| Err mask [bits:15->0] : 1111111111111111    |  Is unphysical:    NO |   Accepted:   YES                          |
|------------------------------------------------------------------------------------------------------------------|
| sig(Ev) =       7.10242e-31 cm^2  | dsig(Ev;{K_s})/dK   =     0.00000e+00 cm^2/{K}   | Weight =          1.00000 |
|------------------------------------------------------------------------------------------------------------------|

--------------------------------------------------------------------------------------------------------------
GENIE Interaction Summary
--------------------------------------------------------------------------------------------------------------
[-] [Init-State] 
 |--> probe        : PDG-code = 11 (e-)
 |--> nucl. target : Z = 6, A = 12, PDG-Code = 1000060120 (C12)
 |--> hit nucleon  : no set
 |--> hit quark    : no set
 |--> probe 4P     : (E =     2.261000, Px =     0.000000, Py =     0.000000, Pz =     2.261000)
 |--> target 4P    : (E =    11.174863, Px =     0.000000, Py =     0.000000, Pz =     0.000000)

[-] [Process-Info]  
 |--> Interaction : EM
 |--> Scattering  : MEC
[-] [Kinematics]
 |--> *Selected* Bjorken x = 0.205477
 |--> *Selected* Inelasticity y = 0.133946
 |--> *Selected* Momentum transfer Q2 (>0) = 0.238833
 |--> *Selected* Hadronic invariant mass W = 2.109416
[-] [Exclusive Process Info] 
 |--> charm prod.  : false |--> strange prod.  : false
 |--> f/s nucleons : N(p) = 0 N(n) = 0
 |--> f/s pions    : N(pi^0) = 0 N(pi^+) = 0 N(pi^-) = 0
 |--> f/s Other    : N(gamma) = 0 N(Rho^0) = 0 N(Rho^+) = 0 N(Rho^-) = 0
 |--> resonance    : [not set]
 |--> final quark prod.  : false
 |--> final lepton prod.  : false
--------------------------------------------------------------------------------------------------------------

@idkakorin
Copy link
Contributor Author

idkakorin commented Jul 31, 2023

Taking into account the MEC-event in the previous comment, my suggestion is that in fact there is no problem with $^{11}O$, it is a quite legal event. Because, the following scattering could take place: $^{11}C+p \rightarrow ^{11}O + \pi^- + n$ which leaving intact $\pi^-$ which exists before GEANT4 rescattering. It will exists after rescattering and the summary reaction is: $e^- + ^{12}C \rightarrow e^- + ^{11}O + 2\pi^- + n$.

@mroda88
Copy link
Member

mroda88 commented Aug 1, 2023

I agree, the problem is not the presence of $^{11}O$ but still your interpretation of the event is wrong.

There is only one $\pi^{-}$ in the final state, not 2 as you reported. One of the pions has status 14, so it should not be counted and the nucleus should be $^{11}N$ instead.

The same goes for the second event you reported. The proton with id 7 does not rescatter and looks like it disappears. Also, the total charge of the system is not correct. You have +5 in the initial state (6 protons in the carbon and one electron) and in the final state the total charge is +4 (5 protons in the Boron and one electron) because somehow the proton is lost.

It seems that when more than one particle needs to be propagated, the system will fail giving all sorts of wrong results.
Your code makes the situation better because at least one particle has the right relation between mother and daughter, but it's not enough.

@idkakorin
Copy link
Contributor Author

I agree with you that when more than one particle needs to be propagated, the system will sometimes fail giving all sorts of wrong results. @mroda88, could you suggest an expert in GEANT4, who could give me a consult what is going wrong?

@idkakorin
Copy link
Contributor Author

This commit resolves the problem with $^{11}O$. I delete the isotope $^{11}O$ from genie_pdg_table.txt, because now there is no need for it. @jtenavidal, could you, please, run tests again with this fix?

@idkakorin
Copy link
Contributor Author

I made a test by running the following command gevgen -n 400000 -p 11 -e 2.261 -t 1000060120 --tune G18_10d_00_000 --cross-sections xsec_splines.xml --event-generator-list EM --seed 65539
No one problem event was generated.
The results could be found at: https://disk.jinr.ru/index.php/s/Zc7HeRzWZ7w8nHi

@mroda88
Copy link
Member

mroda88 commented Aug 9, 2023

Can you post two events: one with one particle propagated via G4 and one with 2 particles propagated via G4? I think this might give an idea if the mother-daughter relations works now.

@idkakorin
Copy link
Contributor Author

Yes, I will post it a bit later. Right now, could you, please, clarify what do you mean by mother-daughter relation? I am afraid, that the understanding does it work or not depends on the definition.

@idkakorin
Copy link
Contributor Author

idkakorin commented Aug 9, 2023

One particle propagated:

|------------------------------------------------------------------------------------------------------------------|
|GENIE GHEP Event Record [print level:   3]                                                                        |
|------------------------------------------------------------------------------------------------------------------|
| Idx |          Name | Ist |        PDG |   Mother  | Daughter  |      Px |      Py |      Pz |       E |      m  | 
|------------------------------------------------------------------------------------------------------------------|
|   0 |            e- |   0 |         11 |  -1 |  -1 |   4 |   4 |   0.000 |   0.000 |   2.261 |   2.261 |   0.001 | 
|   1 |           C12 |   0 | 1000060120 |  -1 |  -1 |   2 |   3 |   0.000 |   0.000 |   0.000 |  11.175 |  11.175 | 
|   2 |        proton |  11 |       2212 |   1 |  -1 |   5 |   5 |  -0.016 |   0.010 |   0.121 |   0.922 | **0.938 | M = 0.913 
|   3 |           B11 |   2 | 1000050110 |   1 |  -1 |   9 |  11 |   0.016 |  -0.010 |  -0.121 |  10.253 |  10.253 | 
|   4 |            e- |   1 |         11 |   0 |  -1 |  -1 |  -1 |   0.008 |   0.172 |   2.207 |   2.214 |   0.001 | P = (-0.004,-0.078,-0.997)
|   5 |        proton |  14 |       2212 |   2 |  -1 |   6 |   8 |  -0.025 |  -0.162 |   0.175 |   0.968 |   0.938 | 
|   6 |       neutron |   1 |       2112 |   5 |  -1 |  -1 |  -1 |  -0.012 |  -0.003 |  -0.035 |   0.940 |   0.940 | 
|   7 |         gamma |   1 |         22 |   5 |  -1 |  -1 |  -1 |  -0.000 |   0.000 |  -0.000 |   0.000 |   0.000 | 
|   8 |         gamma |   1 |         22 |   5 |  -1 |  -1 |  -1 |   0.000 |  -0.000 |   0.000 |   0.000 |   0.000 | 
|   9 |           He3 |  15 | 1000020030 |   3 |   0 |  -1 |  -1 |   0.023 |  -0.063 |  -0.050 |   2.810 |   2.808 | 
|  10 |           He4 |  15 | 1000020040 |   3 |   0 |  -1 |  -1 |  -0.212 |  -0.071 |   0.161 |   3.738 |   3.727 | 
|  11 |           He4 |  15 | 1000020040 |   3 |  -1 |  -1 |  -1 |   0.192 |  -0.036 |  -0.022 |   3.733 |   3.727 | 
|------------------------------------------------------------------------------------------------------------------|
|       Fin-Init:                                                |  -0.000 |   0.000 |   0.000 |  -0.001 |         | 
|------------------------------------------------------------------------------------------------------------------|
|       Vertex:             e- @ (x =     0.00000 m, y =     0.00000 m, z =     0.00000 m, t =    0.000000e+00 s)  |
|------------------------------------------------------------------------------------------------------------------|
| Err flag [bits:15->0] : 0000000000000000    |  1st set:                                                     none | 
| Err mask [bits:15->0] : 1111111111111111    |  Is unphysical:    NO |   Accepted:   YES                          |
|------------------------------------------------------------------------------------------------------------------|
| sig(Ev) =       3.35942e-29 cm^2  | dsig(Q2;E)/dQ2 =          2.40601e-28 cm^2/GeV^2 | Weight =          1.00000 |
|------------------------------------------------------------------------------------------------------------------|

--------------------------------------------------------------------------------------------------------------
GENIE Interaction Summary
--------------------------------------------------------------------------------------------------------------
[-] [Init-State] 
 |--> probe        : PDG-code = 11 (e-)
 |--> nucl. target : Z = 6, A = 12, PDG-Code = 1000060120 (C12)
 |--> hit nucleon  : PDC-Code = 2212 (proton)
 |--> hit quark    : no set
 |--> probe 4P     : (E =     2.261000, Px =     0.000000, Py =     0.000000, Pz =     2.261000)
 |--> target 4P    : (E =    11.174863, Px =     0.000000, Py =     0.000000, Pz =     0.000000)
 |--> nucleon 4P   : (E =     0.921578, Px =    -0.016493, Py =     0.010173, Pz =     0.121388)
[-] [Process-Info]  
 |--> Interaction : EM
 |--> Scattering  : QES
[-] [Kinematics]
 |--> *Selected* Bjorken x = 0.397573
 |--> *Selected* Inelasticity y = 0.021175
 |--> *Selected* Momentum transfer Q2 (>0) = 0.030462
 |--> *Selected* Hadronic invariant mass W = 0.938272
[-] [Exclusive Process Info] 
 |--> charm prod.  : false |--> strange prod.  : false
 |--> f/s nucleons : N(p) = 0 N(n) = 0
 |--> f/s pions    : N(pi^0) = 0 N(pi^+) = 0 N(pi^-) = 0
 |--> f/s Other    : N(gamma) = 0 N(Rho^0) = 0 N(Rho^+) = 0 N(Rho^-) = 0
 |--> resonance    : [not set]
 |--> final quark prod.  : false
 |--> final lepton prod.  : false
--------------------------------------------------------------------------------------------------------------

@idkakorin
Copy link
Contributor Author

Two particle propagated:

|------------------------------------------------------------------------------------------------------------------|
|GENIE GHEP Event Record [print level:   3]                                                                        |
|------------------------------------------------------------------------------------------------------------------|
| Idx |          Name | Ist |        PDG |   Mother  | Daughter  |      Px |      Py |      Pz |       E |      m  | 
|------------------------------------------------------------------------------------------------------------------|
|   0 |            e- |   0 |         11 |  -1 |  -1 |   4 |   4 |   0.000 |   0.000 |   2.261 |   2.261 |   0.001 | 
|   1 |           C12 |   0 | 1000060120 |  -1 |  -1 |   2 |   3 |   0.000 |   0.000 |   0.000 |  11.175 |  11.175 | 
|   2 |        proton |  11 |       2212 |   1 |  -1 |   5 |   5 |   0.199 |   0.075 |   0.076 |   0.920 | **0.938 | M = 0.892 
|   3 |           B11 |   2 | 1000050110 |   1 |  -1 |  15 |  16 |  -0.199 |  -0.075 |  -0.076 |  10.255 |  10.253 | 
|   4 |            e- |   1 |         11 |   0 |  -1 |  -1 |  -1 |   0.137 |  -0.246 |   1.107 |   1.143 |   0.001 | P = (-0.120,0.216,-0.969)
|   5 |      N+(1535) |   3 |     102212 |   2 |  -1 |   6 |   7 |   0.063 |   0.322 |   1.229 |   2.038 | **1.535 | M = 1.592 
|   6 |        proton |  14 |       2212 |   5 |  -1 |   8 |  14 |   0.224 |   0.701 |   0.894 |   1.490 |   0.938 | 
|   7 |           pi0 |  14 |        111 |   5 |  -1 |  -1 |  -1 |  -0.161 |  -0.379 |   0.335 |   0.548 |   0.135 | 
|   8 |           pi0 |   1 |        111 |   6 |  -1 |  -1 |  -1 |  -0.159 |  -0.374 |   0.331 |   0.541 |   0.135 | 
|   9 |        proton |   1 |       2212 |   6 |  -1 |  -1 |  -1 |  -0.120 |  -0.077 |   0.778 |   1.227 |   0.938 | 
|  10 |        proton |   1 |       2212 |   6 |  -1 |  -1 |  -1 |   0.188 |   0.626 |   0.128 |   1.150 |   0.938 | 
|  11 |       neutron |   1 |       2112 |   6 |  -1 |  -1 |  -1 |   0.010 |   0.015 |  -0.103 |   0.945 |   0.940 | 
|  12 |       neutron |   1 |       2112 |   6 |  -1 |  -1 |  -1 |  -0.030 |  -0.138 |   0.027 |   0.950 |   0.940 | 
|  13 |         gamma |   1 |         22 |   6 |  -1 |  -1 |  -1 |   0.006 |  -0.002 |  -0.003 |   0.007 |   0.000 | 
|  14 |         gamma |   1 |         22 |   6 |  -1 |  -1 |  -1 |  -0.001 |  -0.001 |  -0.003 |   0.003 |   0.000 | 
|  15 |           He4 |  15 | 1000020040 |   3 |   0 |  -1 |  -1 |   0.189 |   0.097 |   0.116 |   3.735 |   3.727 | 
|  16 |           He4 |  15 | 1000020040 |   3 |  -1 |  -1 |  -1 |  -0.221 |   0.100 |  -0.117 |   3.732 | **3.727 | M = 3.722 
|------------------------------------------------------------------------------------------------------------------|
|       Fin-Init:                                                |  -0.000 |   0.000 |  -0.000 |  -0.003 |         | 
|------------------------------------------------------------------------------------------------------------------|
|       Vertex:             e- @ (x =     0.00000 m, y =     0.00000 m, z =     0.00000 m, t =    0.000000e+00 s)  |
|------------------------------------------------------------------------------------------------------------------|
| Err flag [bits:15->0] : 0000000000000000    |  1st set:                                                     none | 
| Err mask [bits:15->0] : 1111111111111111    |  Is unphysical:    NO |   Accepted:   YES                          |
|------------------------------------------------------------------------------------------------------------------|
| sig(Ev) =       1.00397e-30 cm^2  | d2sig(W,Q2;E)/dWdQ2 =     4.58734e-30 cm^2/GeV^3 | Weight =          1.00000 |
|------------------------------------------------------------------------------------------------------------------|

--------------------------------------------------------------------------------------------------------------
GENIE Interaction Summary
--------------------------------------------------------------------------------------------------------------
[-] [Init-State] 
 |--> probe        : PDG-code = 11 (e-)
 |--> nucl. target : Z = 6, A = 12, PDG-Code = 1000060120 (C12)
 |--> hit nucleon  : PDC-Code = 2212 (proton)
 |--> hit quark    : no set
 |--> probe 4P     : (E =     2.261000, Px =     0.000000, Py =     0.000000, Pz =     2.261000)
 |--> target 4P    : (E =    11.174863, Px =     0.000000, Py =     0.000000, Pz =     0.000000)
 |--> nucleon 4P   : (E =     0.919819, Px =     0.199460, Py =     0.075445, Pz =     0.075615)
[-] [Process-Info]  
 |--> Interaction : EM
 |--> Scattering  : RES
[-] [Kinematics]
 |--> *Selected* Bjorken x = 0.083935
 |--> *Selected* Inelasticity y = 0.497802
 |--> *Selected* Momentum transfer Q2 (>0) = 0.159506
 |--> *Selected* Hadronic invariant mass W = 1.592395
[-] [Exclusive Process Info] 
 |--> charm prod.  : false |--> strange prod.  : false
 |--> f/s nucleons : N(p) = 0 N(n) = 0
 |--> f/s pions    : N(pi^0) = 0 N(pi^+) = 0 N(pi^-) = 0
 |--> f/s Other    : N(gamma) = 0 N(Rho^0) = 0 N(Rho^+) = 0 N(Rho^-) = 0
 |--> resonance    : S11(1535)
 |--> final quark prod.  : false
 |--> final lepton prod.  : false
--------------------------------------------------------------------------------------------------------------

@mroda88
Copy link
Member

mroda88 commented Aug 9, 2023

It's perfect, thanks!

@idkakorin
Copy link
Contributor Author

idkakorin commented Aug 10, 2023

You are welcome, @mroda88!

@mroda88
Copy link
Member

mroda88 commented Aug 14, 2023

Following today's Core developer meeting, we are now convinced that this PR does the right thing. Mark input is desired as a cross check. We also identified some additional changes:

  • The second mother should be used to identify the relations between all the inputs to the cascade and all the outputs. With respect to the last event posted by Igor, the desired output should be:
|------------------------------------------------------------------------------------------------------------------|
|GENIE GHEP Event Record [print level:   3]                                                                        |
|------------------------------------------------------------------------------------------------------------------|
| Idx |          Name | Ist |        PDG |   Mother  | Daughter  |      Px |      Py |      Pz |       E |      m  | 
|------------------------------------------------------------------------------------------------------------------|
|   0 |            e- |   0 |         11 |  -1 |  -1 |   4 |   4 |   0.000 |   0.000 |   2.261 |   2.261 |   0.001 | 
|   1 |           C12 |   0 | 1000060120 |  -1 |  -1 |   2 |   3 |   0.000 |   0.000 |   0.000 |  11.175 |  11.175 | 
|   2 |        proton |  11 |       2212 |   1 |  -1 |   5 |   5 |   0.199 |   0.075 |   0.076 |   0.920 | **0.938 | M = 0.892 
|   3 |           B11 |   2 | 1000050110 |   1 |  -1 |  15 |  16 |  -0.199 |  -0.075 |  -0.076 |  10.255 |  10.253 | 
|   4 |            e- |   1 |         11 |   0 |  -1 |  -1 |  -1 |   0.137 |  -0.246 |   1.107 |   1.143 |   0.001 | P = (-0.120,0.216,-0.969)
|   5 |      N+(1535) |   3 |     102212 |   2 |  -1 |   6 |   7 |   0.063 |   0.322 |   1.229 |   2.038 | **1.535 | M = 1.592 
|   6 |        proton |  14 |       2212 |   5 |  -1 |   8 |  14 |   0.224 |   0.701 |   0.894 |   1.490 |   0.938 | 
|   7 |           pi0 |  14 |        111 |   5 |  -1 |   8 |  14 |  -0.161 |  -0.379 |   0.335 |   0.548 |   0.135 | 
|   8 |           pi0 |   1 |        111 |   6 |   7 |  -1 |  -1 |  -0.159 |  -0.374 |   0.331 |   0.541 |   0.135 | 
|   9 |        proton |   1 |       2212 |   6 |   7 |  -1 |  -1 |  -0.120 |  -0.077 |   0.778 |   1.227 |   0.938 | 
|  10 |        proton |   1 |       2212 |   6 |   7 |  -1 |  -1 |   0.188 |   0.626 |   0.128 |   1.150 |   0.938 | 
|  11 |       neutron |   1 |       2112 |   6 |   7 |  -1 |  -1 |   0.010 |   0.015 |  -0.103 |   0.945 |   0.940 | 
|  12 |       neutron |   1 |       2112 |   6 |   7 |  -1 |  -1 |  -0.030 |  -0.138 |   0.027 |   0.950 |   0.940 | 
|  13 |         gamma |   1 |         22 |   6 |   7 |  -1 |  -1 |   0.006 |  -0.002 |  -0.003 |   0.007 |   0.000 | 
|  14 |         gamma |   1 |         22 |   6 |   7 |  -1 |  -1 |  -0.001 |  -0.001 |  -0.003 |   0.003 |   0.000 | 
|  15 |           He4 |  15 | 1000020040 |   3 |  -1 |  -1 |  -1 |   0.189 |   0.097 |   0.116 |   3.735 |   3.727 | 
|  16 |           He4 |  15 | 1000020040 |   3 |  -1 |  -1 |  -1 |  -0.221 |   0.100 |  -0.117 |   3.732 | **3.727 | M = 3.722 
|------------------------------------------------------------------------------------------------------------------|
|       Fin-Init:                                                |  -0.000 |   0.000 |  -0.000 |  -0.003 |         | 
|------------------------------------------------------------------------------------------------------------------|
|       Vertex:             e- @ (x =     0.00000 m, y =     0.00000 m, z =     0.00000 m, t =    0.000000e+00 s)  |
|------------------------------------------------------------------------------------------------------------------|
| Err flag [bits:15->0] : 0000000000000000    |  1st set:                                                     none | 
| Err mask [bits:15->0] : 1111111111111111    |  Is unphysical:    NO |   Accepted:   YES                          |
|------------------------------------------------------------------------------------------------------------------|
| sig(Ev) =       1.00397e-30 cm^2  | d2sig(W,Q2;E)/dWdQ2 =     4.58734e-30 cm^2/GeV^3 | Weight =          1.00000 |
|------------------------------------------------------------------------------------------------------------------|
  • Checks should be added to verify that Geant4 PDG codes are present in our PDGLibrary when it comes to nuclear remants. If the PDG is present, the particle should be added with status 1 (not 15) in accordance to cases where recoiling nuclei are indeed known, like the coherent scattering. If the PDG is not present, we should add the particle with status id 15 and it's PDG should be changed too, into kPdgHadronicBlob as we do in hA. In this way, downstream code can decide to propagate the known nuclei should they desire to do so.

@mroda88 mroda88 mentioned this pull request Aug 24, 2023
@idkakorin
Copy link
Contributor Author

After the fix, the problematic events now look like:

|------------------------------------------------------------------------------------------------------------------|
|GENIE GHEP Event Record [print level:   3]                                                                        |
|------------------------------------------------------------------------------------------------------------------|
| Idx |          Name | Ist |        PDG |   Mother  | Daughter  |      Px |      Py |      Pz |       E |      m  | 
|------------------------------------------------------------------------------------------------------------------|
|   0 |            e- |   0 |         11 |  -1 |  -1 |   4 |   4 |   0.000 |   0.000 |   3.000 |   3.000 |   0.001 | 
|   1 |           C12 |   0 | 1000060120 |  -1 |  -1 |   2 |   3 |   0.000 |   0.000 |   0.000 |  11.175 |  11.175 | 
|   2 |           n+p |  11 | 2000000201 |   1 |  -1 |   5 |   5 |   0.106 |   0.168 |  -0.030 |   1.888 |   1.878 | 
|   3 |           B10 |   2 | 1000050100 |   1 |  -1 |  17 |  18 |  -0.106 |  -0.168 |   0.030 |   9.286 | **9.324 | M = 9.284 
|   4 |            e- |   1 |         11 |   0 |  -1 |  -1 |  -1 |   0.318 |   0.340 |   2.705 |   2.745 |   0.001 | P = (-0.116,-0.124,-0.985)
|   5 |           n+p |   3 | 2000000201 |   2 |  -1 |   6 |   7 |  -0.212 |  -0.173 |   0.264 |   2.143 | **1.878 | M = 2.109 
|   6 |       neutron |  14 |       2112 |   5 |  -1 |   8 |  16 |   0.168 |  -0.257 |   0.489 |   1.103 |   0.940 | 
|   7 |        proton |  14 |       2212 |   5 |  -1 |  -1 |  -1 |  -0.380 |   0.085 |  -0.225 |   1.041 |   0.938 | 
|   8 |       neutron |   1 |       2112 |   6 |  -1 |  -1 |  -1 |  -0.153 |   0.013 |   0.451 |   1.054 |   0.940 | 
|   9 |        proton |   1 |       2212 |   6 |  -1 |  -1 |  -1 |   0.162 |   0.073 |  -0.191 |   0.974 |   0.938 | 
|  10 |        proton |   1 |       2212 |   6 |  -1 |  -1 |  -1 |  -0.094 |  -0.005 |   0.148 |   0.955 |   0.938 | 
|  11 |       neutron |   1 |       2112 |   6 |  -1 |  -1 |  -1 |   0.053 |   0.045 |   0.052 |   0.944 |   0.940 | 
|  12 |        proton |   1 |       2212 |   6 |  -1 |  -1 |  -1 |  -0.089 |  -0.126 |  -0.066 |   0.953 |   0.938 | 
|  13 |       neutron |   1 |       2112 |   6 |  -1 |  -1 |  -1 |   0.040 |  -0.072 |   0.018 |   0.943 |   0.940 | 
|  14 |       neutron |   1 |       2112 |   6 |  -1 |  -1 |  -1 |   0.040 |   0.023 |  -0.090 |   0.945 |   0.940 | 
|  15 |         gamma |   1 |         22 |   6 |  -1 |  -1 |  -1 |  -0.002 |  -0.001 |  -0.001 |   0.002 |   0.000 | 
|  16 |         gamma |   1 |         22 |   6 |  -1 |  -1 |  -1 |  -0.000 |  -0.000 |  -0.000 |   0.000 |   0.000 | 
|  17 |            H2 |  15 | 1000010020 |   3 |   0 |  -1 |  -1 |  -0.148 |   0.049 |  -0.099 |   1.885 |   1.876 | 
|  18 |           He3 |  15 | 1000020030 |   3 |  -1 |  -1 |  -1 |  -0.128 |  -0.338 |   0.071 |   2.814 | **2.808 | M = 2.790 
|------------------------------------------------------------------------------------------------------------------|
|       Fin-Init:                                                |   0.000 |   0.000 |  -0.000 |   0.038 |         | 
|------------------------------------------------------------------------------------------------------------------|
|       Vertex:             e- @ (x =     0.00000 m, y =     0.00000 m, z =     0.00000 m, t =    0.000000e+00 s)  |
|------------------------------------------------------------------------------------------------------------------|
| Err flag [bits:15->0] : 0000000000000000    |  1st set:                                                     none | 
| Err mask [bits:15->0] : 1111111111111111    |  Is unphysical:    NO |   Accepted:   YES                          |
|------------------------------------------------------------------------------------------------------------------|
| sig(Ev) =       7.13715e-31 cm^2  | dsig(Ev;{K_s})/dK   =     0.00000e+00 cm^2/{K}   | Weight =          1.00000 |
|------------------------------------------------------------------------------------------------------------------|

--------------------------------------------------------------------------------------------------------------
GENIE Interaction Summary
--------------------------------------------------------------------------------------------------------------
[-] [Init-State] 
 |--> probe        : PDG-code = 11 (e-)
 |--> nucl. target : Z = 6, A = 12, PDG-Code = 1000060120 (C12)
 |--> hit nucleon  : no set
 |--> hit quark    : no set
 |--> probe 4P     : (E =     3.000000, Px =     0.000000, Py =     0.000000, Pz =     3.000000)
 |--> target 4P    : (E =    11.174863, Px =     0.000000, Py =     0.000000, Pz =     0.000000)

[-] [Process-Info]  
 |--> Interaction : EM
 |--> Scattering  : MEC
[-] [Kinematics]
 |--> *Selected* Bjorken x = 0.205477
 |--> *Selected* Inelasticity y = 0.100951
 |--> *Selected* Momentum transfer Q2 (>0) = 0.238833
 |--> *Selected* Hadronic invariant mass W = 2.109416
[-] [Exclusive Process Info] 
 |--> charm prod.  : false |--> strange prod.  : false
 |--> f/s nucleons : N(p) = 0 N(n) = 0
 |--> f/s pions    : N(pi^0) = 0 N(pi^+) = 0 N(pi^-) = 0
 |--> f/s Other    : N(gamma) = 0 N(Rho^0) = 0 N(Rho^+) = 0 N(Rho^-) = 0
 |--> resonance    : [not set]
 |--> final quark prod.  : false
 |--> final lepton prod.  : false
--------------------------------------------------------------------------------------------------------------

@mroda88
Copy link
Member

mroda88 commented Nov 9, 2023

Closing this in favour of #360

@mroda88 mroda88 closed this Nov 9, 2023
@idkakorin idkakorin deleted the fix_HG4BertCascIntranuke branch December 11, 2023 15:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants