GENIEGenerator
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
NNBarOscUtils.cxx
Go to the documentation of this file.
1 //____________________________________________________________________________
2 /*
3  Copyright (c) 2003-2024, The GENIE Collaboration
4  For the full text of the license visit http://copyright.genie-mc.org
5 
6  Jeremy Hewes, Georgia Karagiorgi
7  University of Manchester
8 */
9 //____________________________________________________________________________
10 
19 
20 using namespace genie;
21 
22 //____________________________________________________________________________
24 {
25  // this just maps the decay mode integers to string descriptors. replaced. -j
26  switch(ndm) {
27  case (kNORandom) : return "Random mode";
28  break;
29  case (kNOpto1pip1pi0) : return "p + nbar --> pi+ pi0";
30  break;
31  case (kNOpto1pip2pi0) : return "p + nbar --> pi+ 2pi0";
32  break;
33  case (kNOpto1pip3pi0) : return "p + nbar --> pi+ 3pi0";
34  break;
35  case (kNOpto2pip1pim1pi0) : return "p + nbar --> 2pi+ pi- pi0";
36  break;
37  case (kNOpto2pip1pim2pi0) : return "p + nbar --> 2pi+ pi- 2pi0";
38  break;
39  case (kNOpto2pip1pim2o) : return "p + nbar --> 2pi+ pi- 2omega";
40  break;
41  case (kNOpto3pip2pim1pi0) : return "p + nbar --> 3pi+ 2pi- pi0";
42  break;
43  case (kNOnto1pip1pim) : return "n + nbar --> pi+ pi-";
44  break;
45  case (kNOnto2pi0) : return "n + nbar --> 2pi0";
46  break;
47  case (kNOnto1pip1pim1pi0) : return "n + nbar --> pi+ pi- pi0";
48  break;
49  case (kNOnto1pip1pim2pi0) : return "n + nbar --> pi+ pi- 2pi0";
50  break;
51  case (kNOnto1pip1pim3pi0) : return "n + nbar --> pi+ pi- 3pi0";
52  break;
53  case (kNOnto2pip2pim) : return "n + nbar --> 2pi+ 2pi-";
54  break;
55  case (kNOnto2pip2pim1pi0) : return "n + nbar --> 2pi+ 2pi- pi0";
56  break;
57  case (kNOnto1pip1pim1o) : return "n + nbar --> pi+ pi- omega";
58  break;
59  case (kNOnto2pip2pim2pi0) : return "n + nbar --> 2pi+ 2pi- 2pi0";
60  break;
61  default : return "?";
62  break;
63  }
64  return "??";
65 }
66 //____________________________________________________________________________
68 {
69  // checks if a mode is valid. just straight replaced. -j
70  switch(ndm) {
71  case (kNORandom) :
72  case (kNOpto1pip1pi0) :
73  case (kNOpto1pip2pi0) :
74  case (kNOpto1pip3pi0) :
75  case (kNOpto2pip1pim1pi0) :
76  case (kNOpto2pip1pim2pi0) :
77  case (kNOpto2pip1pim2o) :
78  case (kNOpto3pip2pim1pi0) :
79  case (kNOnto1pip1pim) :
80  case (kNOnto2pi0) :
81  case (kNOnto1pip1pim1pi0) :
82  case (kNOnto1pip1pim2pi0) :
83  case (kNOnto1pip1pim3pi0) :
84  case (kNOnto2pip2pim) :
85  case (kNOnto2pip2pim1pi0) :
86  case (kNOnto1pip1pim1o) :
87  case (kNOnto2pip2pim2pi0) :
88  return true;
89  break;
90  default :
91  return false;
92  break;
93  }
94  return false;
95 }
96 //____________________________________________________________________________
98 {
99  // name isn't really accurate any more. instead of decayed nucleon, function
100  // returns what particle the oscillated neutron annihilated with -j
101  switch(ndm) {
102  case (kNOpto1pip1pi0) : return kPdgProton; break;
103  case (kNOpto1pip2pi0) : return kPdgProton; break;
104  case (kNOpto1pip3pi0) : return kPdgProton; break;
105  case (kNOpto2pip1pim1pi0) : return kPdgProton; break;
106  case (kNOpto2pip1pim2pi0) : return kPdgProton; break;
107  case (kNOpto2pip1pim2o) : return kPdgProton; break;
108  case (kNOpto3pip2pim1pi0) : return kPdgProton; break;
109  case (kNOnto1pip1pim) : return kPdgNeutron; break;
110  case (kNOnto2pi0) : return kPdgNeutron; break;
111  case (kNOnto1pip1pim1pi0) : return kPdgNeutron; break;
112  case (kNOnto1pip1pim2pi0) : return kPdgNeutron; break;
113  case (kNOnto1pip1pim3pi0) : return kPdgNeutron; break;
114  case (kNOnto2pip2pim) : return kPdgNeutron; break;
115  case (kNOnto2pip2pim1pi0) : return kPdgNeutron; break;
116  case (kNOnto1pip1pim1o) : return kPdgNeutron; break;
117  case (kNOnto2pip2pim2pi0) : return kPdgNeutron; break;
118  default : return 0; break;
119  }
120  return 0;
121 }
122 //____________________________________________________________________________
124  NNBarOscMode_t ndm)
125 {
126  // ok so i think this is the first function where a straight replacement
127  // isn't gonna cut it. all the nucleon decay modes are two-body, but that is
128  // painfully untrue for nnbar. i just threw aaaaaaallll of the final state
129  // particles into the vector, so let's just hope for the best -j
130 
131  // need to implement a lorentz boost into rest frame of two nucleons -j
132 
133  bool allow_duplicate = true;
134  PDGCodeList decay_products(allow_duplicate);
135 
136  switch(ndm) {
137  case (kNOpto1pip1pi0) :
138  decay_products.push_back(kPdgPiP);
139  decay_products.push_back(kPdgPi0);
140  break;
141  case (kNOpto1pip2pi0) :
142  decay_products.push_back(kPdgPiP);
143  decay_products.push_back(kPdgPi0);
144  decay_products.push_back(kPdgPi0);
145  break;
146  case (kNOpto1pip3pi0) :
147  decay_products.push_back(kPdgPiP);
148  decay_products.push_back(kPdgPi0);
149  decay_products.push_back(kPdgPi0);
150  decay_products.push_back(kPdgPi0);
151  break;
152  case (kNOpto2pip1pim1pi0) :
153  decay_products.push_back(kPdgPiP);
154  decay_products.push_back(kPdgPiP);
155  decay_products.push_back(kPdgPiM);
156  decay_products.push_back(kPdgPi0);
157  break;
158  case (kNOpto2pip1pim2pi0) :
159  decay_products.push_back(kPdgPiP);
160  decay_products.push_back(kPdgPiP);
161  decay_products.push_back(kPdgPiM);
162  decay_products.push_back(kPdgPi0);
163  decay_products.push_back(kPdgPi0);
164  break;
165  case (kNOpto2pip1pim2o) :
166  decay_products.push_back(kPdgPiP);
167  decay_products.push_back(kPdgPiP);
168  decay_products.push_back(kPdgPiM);
169  decay_products.push_back(kPdgomega);
170  decay_products.push_back(kPdgomega);
171  break;
172  case (kNOpto3pip2pim1pi0) :
173  decay_products.push_back(kPdgPiP);
174  decay_products.push_back(kPdgPiP);
175  decay_products.push_back(kPdgPiP);
176  decay_products.push_back(kPdgPiM);
177  decay_products.push_back(kPdgPiM);
178  decay_products.push_back(kPdgPi0);
179  break;
180  case (kNOnto1pip1pim) :
181  decay_products.push_back(kPdgPiP);
182  decay_products.push_back(kPdgPiM);
183  break;
184  case (kNOnto2pi0) :
185  decay_products.push_back(kPdgPi0);
186  decay_products.push_back(kPdgPi0);
187  break;
188  case (kNOnto1pip1pim1pi0) :
189  decay_products.push_back(kPdgPiP);
190  decay_products.push_back(kPdgPiM);
191  decay_products.push_back(kPdgPi0);
192  break;
193  case (kNOnto1pip1pim2pi0) :
194  decay_products.push_back(kPdgPiP);
195  decay_products.push_back(kPdgPiM);
196  decay_products.push_back(kPdgPi0);
197  decay_products.push_back(kPdgPi0);
198  break;
199  case (kNOnto1pip1pim3pi0) :
200  decay_products.push_back(kPdgPiP);
201  decay_products.push_back(kPdgPiM);
202  decay_products.push_back(kPdgPi0);
203  decay_products.push_back(kPdgPi0);
204  decay_products.push_back(kPdgPi0);
205  break;
206  case (kNOnto2pip2pim) :
207  decay_products.push_back(kPdgPiP);
208  decay_products.push_back(kPdgPiP);
209  decay_products.push_back(kPdgPiM);
210  decay_products.push_back(kPdgPiM);
211  break;
212  case (kNOnto2pip2pim1pi0) :
213  decay_products.push_back(kPdgPiP);
214  decay_products.push_back(kPdgPiP);
215  decay_products.push_back(kPdgPiM);
216  decay_products.push_back(kPdgPiM);
217  decay_products.push_back(kPdgPi0);
218  break;
219  case (kNOnto1pip1pim1o) :
220  decay_products.push_back(kPdgPiP);
221  decay_products.push_back(kPdgPiM);
222  decay_products.push_back(kPdgomega);
223  break;
224  case (kNOnto2pip2pim2pi0) :
225  decay_products.push_back(kPdgPiP);
226  decay_products.push_back(kPdgPiP);
227  decay_products.push_back(kPdgPiM);
228  decay_products.push_back(kPdgPiM);
229  decay_products.push_back(kPdgPi0);
230  decay_products.push_back(kPdgPi0);
231  break;
232  default :
233  break;
234  }
235  return decay_products;
236 }
237 //____________________________________________________________________________
239  bool in_nucleus, int pdgc)
240 {
241  // took out all the irrelevant particles -j
242  if(in_nucleus) {
243  if( pdgc == kPdgPi0 ||
244  pdgc == kPdgPiM ||
245  pdgc == kPdgPiP ||
246  pdgc == kPdgomega)
247  {
248  return kIStHadronInTheNucleus;
249  }
250  }
251 
252  return kIStStableFinalState;
253 }
254 //____________________________________________________________________________
int AnnihilatingNucleonPdgCode(NNBarOscMode_t ndm)
GHepStatus_t DecayProductStatus(bool in_nucleus, int pdgc)
A list of PDG codes.
Definition: PDGCodeList.h:32
const int kPdgomega
Definition: PDGCodes.h:168
enum genie::ENNBarOscMode NNBarOscMode_t
const int kPdgPiP
Definition: PDGCodes.h:158
const int kPdgPi0
Definition: PDGCodes.h:160
string AsString(NNBarOscMode_t ndm)
PDGCodeList DecayProductList(NNBarOscMode_t ndm)
const int kPdgPiM
Definition: PDGCodes.h:159
bool IsValidMode(NNBarOscMode_t ndm)
const int kPdgProton
Definition: PDGCodes.h:81
const int kPdgNeutron
Definition: PDGCodes.h:83
Most commonly used PDG codes. A set of utility functions to handle PDG codes is provided in PDGUtils...
void push_back(int pdg_code)
Definition: PDGCodeList.cxx:58
enum genie::EGHepStatus GHepStatus_t