NHLDecayUtils.cxx
Go to the documentation of this file.
1 //____________________________________________________________________________
2 /*
3  Copyright (c) 2003-2020, The GENIE Collaboration
4  For the full text of the license visit http://copyright.genie-mc.org
5 
6 */
7 //____________________________________________________________________________
8 
15 
16 using namespace genie;
17 
18 //____________________________________________________________________________
20 {
21  switch(nhldm) {
22 
23  case (kNHLDcyNull):
24  return "Invalid NHL decay mode!";
25  break;
26 
27 // add all other cases and specify a string for the decay channel
28 //
29 //
30  case(kNHLDcyTEST):
31  return "N -> e+e-";
32 
33  }
34  return "Invalid HL decay mode!";
35 }
36 //____________________________________________________________________________
38 {
39 // Check the input mass of the NHL (M) against the sum of the masses of the
40 // particles to be produced in the input decay
41 
42  PDGCodeList decay_products = DecayProductList(nhldm);
43 
44  PDGLibrary * pdglib = PDGLibrary::Instance();
45 
46  double Msum = 0.;
47  PDGCodeList::const_iterator it = decay_products.begin();
48  for ( ; it != decay_products.end(); ++it)
49  {
50  int pdg_code = *it;
51  TParticlePDG * p = pdglib->Find(pdg_code);
52  if(p) {
53  Msum += p->Mass();
54  } else {
55  LOG("NHL", pERROR)
56  << "Decay list includes particle with unrecognised PDG code: "
57  << pdg_code;
58  }
59  }
60 
61  return (M > Msum);
62 }
63 //____________________________________________________________________________
65 {
66  bool allow_duplicate = true;
67  PDGCodeList decay_products(allow_duplicate);
68 
69  switch(nhldm) {
70 
71  // Specify the final state particles in each NHL decay channel,
72  // adding sections that look like
73  //
74  // case (kNHLDcy...):
75  // decay_products.push_back(kPdgPositron);
76  // decay_products.push_back(kPdgElectron);
77  // decay_products.push_back(... some other particle PDG code);
78  // break;
79  //
80  case(kNHLDcyTEST):
81  decay_products.push_back(kPdgPositron);
82  decay_products.push_back(kPdgElectron);
83  break;
84 
85  default :
86  break;
87  }
88 
89  return decay_products;
90 }
91 //____________________________________________________________________________
THE MAIN GENIE PROJECT NAMESPACE
Definition: AlgCmp.h:25
#define pERROR
Definition: Messenger.h:59
intermediate_table::const_iterator const_iterator
const int kPdgElectron
Definition: PDGCodes.h:35
PDGCodeList DecayProductList(NHLDecayMode_t nhldm)
A list of PDG codes.
Definition: PDGCodeList.h:32
#define LOG(stream, priority)
A macro that returns the requested log4cpp::Category appending a string (using the FILE...
Definition: Messenger.h:96
p
Definition: test.py:223
static PDGLibrary * Instance(void)
Definition: PDGLibrary.cxx:57
Singleton class to load & serve a TDatabasePDG.
Definition: PDGLibrary.h:32
TParticlePDG * Find(int pdgc, bool must_exist=true)
Definition: PDGLibrary.cxx:75
const int kPdgPositron
Definition: PDGCodes.h:36
string AsString(NHLDecayMode_t nhldm)
Most commonly used PDG codes. A set of utility functions to handle PDG codes is provided in PDGUtils...
enum genie::ENHLDecayMode NHLDecayMode_t
void push_back(int pdg_code)
Definition: PDGCodeList.cxx:58
bool IsKinematicallyAllowed(NHLDecayMode_t nhldm, double Mnhl)