NeutronOscUtils.cxx
Go to the documentation of this file.
1 //____________________________________________________________________________
2 /*
3  Copyright (c) 2003-2017, GENIE Neutrino MC Generator Collaboration
4  For the full text of the license visit http://copyright.genie-mc.org
5  or see $GENIE/LICENSE
6 
7  Author: Costas Andreopoulos <costas.andreopoulos \at stfc.ac.uk>
8  University of Liverpool & STFC Rutherford Appleton Lab
9 
10  For documentation see the corresponding header file.
11 
12  Important revisions after version 2.0.0 :
13  @ Nov 03, 2008 - CA
14  First added in v2.7.1
15 
16 */
17 //____________________________________________________________________________
18 
19 #include "Messenger/Messenger.h"
20 #include "GHEP/GHepParticle.h"
21 #include "PDG/PDGCodes.h"
22 #include "PDG/PDGUtils.h"
23 #include "PDG/PDGLibrary.h"
24 #include "Utils/NuclearUtils.h"
25 #include "Utils/PrintUtils.h"
27 
28 using namespace genie;
29 //using namespace genie::utils::neutron_osc;
30 
31 //____________________________________________________________________________
33 {
34  // this just maps the decay mode integers to string descriptors. replaced. -j
35  switch(ndm) {
36  case (kNORandom) : return "Random mode";
37  break;
38  case (kNOpto1pip1pi0) : return "p + nbar --> pi+ pi0";
39  break;
40  case (kNOpto1pip2pi0) : return "p + nbar --> pi+ 2pi0";
41  break;
42  case (kNOpto1pip3pi0) : return "p + nbar --> pi+ 3pi0";
43  break;
44  case (kNOpto2pip1pim1pi0) : return "p + nbar --> 2pi+ pi- pi0";
45  break;
46  case (kNOpto2pip1pim2pi0) : return "p + nbar --> 2pi+ pi- 2pi0";
47  break;
48  case (kNOpto2pip1pim2o) : return "p + nbar --> 2pi+ pi- 2omega";
49  break;
50  case (kNOpto3pip2pim1pi0) : return "p + nbar --> 3pi+ 2pi- pi0";
51  break;
52  case (kNOnto1pip1pim) : return "n + nbar --> pi+ pi-";
53  break;
54  case (kNOnto2pi0) : return "n + nbar --> 2pi0";
55  break;
56  case (kNOnto1pip1pim1pi0) : return "n + nbar --> pi+ pi- pi0";
57  break;
58  case (kNOnto1pip1pim2pi0) : return "n + nbar --> pi+ pi- 2pi0";
59  break;
60  case (kNOnto1pip1pim3pi0) : return "n + nbar --> pi+ pi- 3pi0";
61  break;
62  case (kNOnto2pip2pim) : return "n + nbar --> 2pi+ 2pi-";
63  break;
64  case (kNOnto2pip2pim1pi0) : return "n + nbar --> 2pi+ 2pi- pi0";
65  break;
66  case (kNOnto1pip1pim1o) : return "n + nbar --> pi+ pi- omega";
67  break;
68  case (kNOnto2pip2pim2pi0) : return "n + nbar --> 2pi+ 2pi- 2pi0";
69  break;
70  default : return "?";
71  break;
72  }
73  return "??";
74 }
75 //____________________________________________________________________________
77 {
78  // checks if a mode is valid. just straight replaced. -j
79  switch(ndm) {
80  case (kNORandom) :
81  case (kNOpto1pip1pi0) :
82  case (kNOpto1pip2pi0) :
83  case (kNOpto1pip3pi0) :
84  case (kNOpto2pip1pim1pi0) :
85  case (kNOpto2pip1pim2pi0) :
86  case (kNOpto2pip1pim2o) :
87  case (kNOpto3pip2pim1pi0) :
88  case (kNOnto1pip1pim) :
89  case (kNOnto2pi0) :
90  case (kNOnto1pip1pim1pi0) :
91  case (kNOnto1pip1pim2pi0) :
92  case (kNOnto1pip1pim3pi0) :
93  case (kNOnto2pip2pim) :
94  case (kNOnto2pip2pim1pi0) :
95  case (kNOnto1pip1pim1o) :
96  case (kNOnto2pip2pim2pi0) :
97  return true;
98  break;
99  default :
100  return false;
101  break;
102  }
103  return false;
104 }
105 //____________________________________________________________________________
107 {
108  // name isn't really accurate any more. instead of decayed nucleon, function
109  // returns what particle the oscillated neutron annihilated with -j
110  switch(ndm) {
111  case (kNOpto1pip1pi0) : return kPdgProton; break;
112  case (kNOpto1pip2pi0) : return kPdgProton; break;
113  case (kNOpto1pip3pi0) : return kPdgProton; break;
114  case (kNOpto2pip1pim1pi0) : return kPdgProton; break;
115  case (kNOpto2pip1pim2pi0) : return kPdgProton; break;
116  case (kNOpto2pip1pim2o) : return kPdgProton; break;
117  case (kNOpto3pip2pim1pi0) : return kPdgProton; break;
118  case (kNOnto1pip1pim) : return kPdgNeutron; break;
119  case (kNOnto2pi0) : return kPdgNeutron; break;
120  case (kNOnto1pip1pim1pi0) : return kPdgNeutron; break;
121  case (kNOnto1pip1pim2pi0) : return kPdgNeutron; break;
122  case (kNOnto1pip1pim3pi0) : return kPdgNeutron; break;
123  case (kNOnto2pip2pim) : return kPdgNeutron; break;
124  case (kNOnto2pip2pim1pi0) : return kPdgNeutron; break;
125  case (kNOnto1pip1pim1o) : return kPdgNeutron; break;
126  case (kNOnto2pip2pim2pi0) : return kPdgNeutron; break;
127  default : return 0; break;
128  }
129  return 0;
130 }
131 //____________________________________________________________________________
133  NeutronOscMode_t ndm)
134 {
135  // ok so i think this is the first function where a straight replacement
136  // isn't gonna cut it. all the nucleon decay modes are two-body, but that is
137  // painfully untrue for nnbar. i just threw aaaaaaallll of the final state
138  // particles into the vector, so let's just hope for the best -j
139 
140  // need to implement a lorentz boost into rest frame of two nucleons -j
141 
142  bool allow_duplicate = true;
143  PDGCodeList decay_products(allow_duplicate);
144 
145  switch(ndm) {
146  case (kNOpto1pip1pi0) :
147  decay_products.push_back(kPdgPiP);
148  decay_products.push_back(kPdgPi0);
149  break;
150  case (kNOpto1pip2pi0) :
151  decay_products.push_back(kPdgPiP);
152  decay_products.push_back(kPdgPi0);
153  decay_products.push_back(kPdgPi0);
154  break;
155  case (kNOpto1pip3pi0) :
156  decay_products.push_back(kPdgPiP);
157  decay_products.push_back(kPdgPi0);
158  decay_products.push_back(kPdgPi0);
159  decay_products.push_back(kPdgPi0);
160  break;
161  case (kNOpto2pip1pim1pi0) :
162  decay_products.push_back(kPdgPiP);
163  decay_products.push_back(kPdgPiP);
164  decay_products.push_back(kPdgPiM);
165  decay_products.push_back(kPdgPi0);
166  break;
167  case (kNOpto2pip1pim2pi0) :
168  decay_products.push_back(kPdgPiP);
169  decay_products.push_back(kPdgPiP);
170  decay_products.push_back(kPdgPiM);
171  decay_products.push_back(kPdgPi0);
172  decay_products.push_back(kPdgPi0);
173  break;
174  case (kNOpto2pip1pim2o) :
175  decay_products.push_back(kPdgPiP);
176  decay_products.push_back(kPdgPiP);
177  decay_products.push_back(kPdgPiM);
178  decay_products.push_back(kPdgomega);
179  decay_products.push_back(kPdgomega);
180  break;
181  case (kNOpto3pip2pim1pi0) :
182  decay_products.push_back(kPdgPiP);
183  decay_products.push_back(kPdgPiP);
184  decay_products.push_back(kPdgPiP);
185  decay_products.push_back(kPdgPiM);
186  decay_products.push_back(kPdgPiM);
187  decay_products.push_back(kPdgPi0);
188  break;
189  case (kNOnto1pip1pim) :
190  decay_products.push_back(kPdgPiP);
191  decay_products.push_back(kPdgPiM);
192  break;
193  case (kNOnto2pi0) :
194  decay_products.push_back(kPdgPi0);
195  decay_products.push_back(kPdgPi0);
196  break;
197  case (kNOnto1pip1pim1pi0) :
198  decay_products.push_back(kPdgPiP);
199  decay_products.push_back(kPdgPiM);
200  decay_products.push_back(kPdgPi0);
201  break;
202  case (kNOnto1pip1pim2pi0) :
203  decay_products.push_back(kPdgPiP);
204  decay_products.push_back(kPdgPiM);
205  decay_products.push_back(kPdgPi0);
206  decay_products.push_back(kPdgPi0);
207  break;
208  case (kNOnto1pip1pim3pi0) :
209  decay_products.push_back(kPdgPiP);
210  decay_products.push_back(kPdgPiM);
211  decay_products.push_back(kPdgPi0);
212  decay_products.push_back(kPdgPi0);
213  decay_products.push_back(kPdgPi0);
214  break;
215  case (kNOnto2pip2pim) :
216  decay_products.push_back(kPdgPiP);
217  decay_products.push_back(kPdgPiP);
218  decay_products.push_back(kPdgPiM);
219  decay_products.push_back(kPdgPiM);
220  break;
221  case (kNOnto2pip2pim1pi0) :
222  decay_products.push_back(kPdgPiP);
223  decay_products.push_back(kPdgPiP);
224  decay_products.push_back(kPdgPiM);
225  decay_products.push_back(kPdgPiM);
226  decay_products.push_back(kPdgPi0);
227  break;
228  case (kNOnto1pip1pim1o) :
229  decay_products.push_back(kPdgPiP);
230  decay_products.push_back(kPdgPiM);
231  decay_products.push_back(kPdgomega);
232  break;
233  case (kNOnto2pip2pim2pi0) :
234  decay_products.push_back(kPdgPiP);
235  decay_products.push_back(kPdgPiP);
236  decay_products.push_back(kPdgPiM);
237  decay_products.push_back(kPdgPiM);
238  decay_products.push_back(kPdgPi0);
239  decay_products.push_back(kPdgPi0);
240  break;
241  default :
242  break;
243  }
244  return decay_products;
245 }
246 //____________________________________________________________________________
248  bool in_nucleus, int pdgc)
249 {
250  // took out all the irrelevant particles -j
251  if(in_nucleus) {
252  if( pdgc == kPdgPi0 ||
253  pdgc == kPdgPiM ||
254  pdgc == kPdgPiP ||
255  pdgc == kPdgomega)
256  {
257  return kIStHadronInTheNucleus;
258  }
259  }
260 
261  return kIStStableFinalState;
262 }
263 //____________________________________________________________________________
#include "Numerical/GSFunc.h"
Definition: AlgCmp.h:26
enum genie::EGHepStatus GHepStatus_t
A list of PDG codes.
Definition: PDGCodeList.h:33
const int kPdgomega
Definition: PDGCodes.h:142
bool IsValidMode(NeutronOscMode_t ndm)
PDGCodeList DecayProductList(NeutronOscMode_t ndm)
const int kPdgPiP
Definition: PDGCodes.h:132
const int kPdgPi0
Definition: PDGCodes.h:134
string AsString(NeutronOscMode_t ndm)
GHepStatus_t DecayProductStatus(bool in_nucleus, int pdgc)
int AnnihilatingNucleonPdgCode(NeutronOscMode_t ndm)
const int kPdgPiM
Definition: PDGCodes.h:133
const int kPdgProton
Definition: PDGCodes.h:62
enum genie::ENeutronOscMode NeutronOscMode_t
const int kPdgNeutron
Definition: PDGCodes.h:64
Most commonly used PDG codes. A set of utility functions to handle PDG codes is provided in PDGUtils...