GENIEGenerator
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
InteractionType.h
Go to the documentation of this file.
1 //____________________________________________________________________________
2 /*!
3 
4 \class genie::InteractionType
5 
6 \brief Enumeration of interaction types: e/m, weak cc, weak nc
7 
8 \author Costas Andreopoulos <c.andreopoulos \at cern.ch>
9  University of Liverpool
10 
11  Changes required to implement the GENIE Boosted Dark Matter module
12  were installed by Josh Berger (Univ. of Wisconsin)
13 
14 \created May 06, 2004
15 
16 \cpright Copyright (c) 2003-2024, The GENIE Collaboration
17  For the full text of the license visit http://copyright.genie-mc.org
18 */
19 //____________________________________________________________________________
20 
21 #ifndef _INTERACTION_TYPE_H_
22 #define _INTERACTION_TYPE_H_
23 
24 #include <cassert>
25 #include <string>
26 #include <cstring>
27 
28 using std::string;
29 
30 namespace genie {
31 
32 
33 typedef enum EInteractionType {
34 
35  kIntNull = 0,
36  kIntEM, //
39  kIntWeakMix, // CC + NC + interference
45 
47 
48 
50 {
51 public:
52 
53  //__________________________________________________________________________
54  static string AsString(InteractionType_t type)
55  {
56  switch (type) {
57 
58  case(kIntEM) : return "EM"; break;
59  case(kIntWeakCC) : return "Weak[CC]"; break;
60  case(kIntWeakNC) : return "Weak[NC]"; break;
61  case(kIntWeakMix) : return "Weak[CC+NC+interference]"; break;
62  case(kIntDarkMatter) : return "DarkMatter"; break;
63  case(kIntNDecay) : return "NucleonDecay"; break;
64  case(kIntNOsc) : return "NeutronOsc"; break;
65  case(kIntDarkNC) : return "Dark[NC]"; break;
66  case(kIntHNL) : return "HNLDecay"; break;
67  default : return "Unknown"; break;
68  }
69  return "Unknown";
70  }
71  //__________________________________________________________________________
72  static InteractionType_t FromString(string type)
73  {
74  //-- Make uppercase/lowercase irrelevant
75 
76  for(unsigned int i=0; i<type.size(); i++) type[i] = toupper(type[i]);
77 
78  //-- Figure out the ScatteringType_t from the input string
79 
80  const char * t = type.c_str();
81 
82  if ( strcmp(t,"EM") == 0 ||
83  strcmp(t,"E-M") == 0 ||
84  strcmp(t,"E/M") == 0 ||
85  strcmp(t,"ELECTROMAGNETIC") == 0 ||
86  strcmp(t,"ELECTRO-MAGNETIC") == 0 ) return kIntEM;
87 
88  else if ( strcmp(t,"WEAK-CC") == 0 ||
89  strcmp(t,"CHARGED-CURRENT") == 0 ||
90  strcmp(t,"CHARGED CURRENT") == 0 ||
91  strcmp(t,"WEAK-CHARGED-CURRENT") == 0 ||
92  strcmp(t,"WEAK CHARGED CURRENT") == 0 ||
93  strcmp(t,"CC") == 0 ) return kIntWeakCC;
94 
95  else if ( strcmp(t,"WEAK-NC") == 0 ||
96  strcmp(t,"NEUTRAL-CURRENT") == 0 ||
97  strcmp(t,"NEUTRAL CURRENT") == 0 ||
98  strcmp(t,"WEAK-NEUTRAL-CURRENT") == 0 ||
99  strcmp(t,"WEAK NEUTRAL CURRENT") == 0 ||
100  strcmp(t,"NC") == 0 ) return kIntWeakNC;
101 
102  else if ( strcmp(t,"NDECAY") == 0 ) return kIntNDecay;
103 
104  else if ( strcmp(t,"NOSC") == 0 ) return kIntNOsc;
105 
106  else if ( strcmp(t,"DARK-NC") == 0 ) return kIntDarkNC;
107 
108  else if ( strcmp(t,"HNL") == 0 ) return kIntHNL;
109 
110  else return kIntNull;
111  }
112  //__________________________________________________________________________
113 };
114 
115 } // genie namespace
116 
117 #endif // _INTERACTION_TYPE_H_
static InteractionType_t FromString(string type)
static string AsString(InteractionType_t type)
Enumeration of interaction types: e/m, weak cc, weak nc.
enum genie::EInteractionType InteractionType_t