GFlavorMap.h
Go to the documentation of this file.
1 //____________________________________________________________________________
2 /*!
3 
4 \class genie::flux::GFlavorMap
5 
6 \brief GENIE interface for flavor modification
7 
8  Concrete instance of GFlavorMixerI that maps from
9  one flavor to another independent of energy or distance.
10  Users specify the transition probability from one flavor
11  to any of the PDG codes { 0, 12, 14, 16, -12, -14, -16 }
12  where 0 represents the complete disappearance (decay, sterile, ...).
13 
14  Probability is expected to be normalized (that is, the sum
15  of all possible outcomes, including 0, must be 1).
16 
17  Supported config string formats:
18  1) " swap pdg1:pdg2 pdg3:pdg4 "
19  Map all neutrinos of flavor "pdg1" to "pdg2", "pdg3" to "pdg4"
20  Use PDG values { 0, 12, 14, 16, -12, -14, -16 }
21  for { sterile, nu_e, nu_mu, nu_tau, nu_e_bar, ...}
22  Unnamed initial flavors are left unmodified.
23  Use numeric values with spaces only between pairs.
24  Must start with the literal "swap"
25  (FMWK note: param must be surrounded by explicit "'s)
26  2) " fixedfrac {pdg1:f0,f12,f14,f16,f-12,f-14,f-16} ..."
27  For each group delineated by {}'s the map the "pdg1"
28  by each pdg by the fraction given [0-1, sum=1].
29  So {12:0.5,0.5,0,0,0,0,0} means nu_e => 50/50% nu_e/nu_mu.
30  Each list *must* have an int + 7 fractions.
31 
32 \author Robert Hatcher <rhatcher \at fnal.gov>
33  Fermi National Accelerator Laboratory
34 
35 \created 2010-10-31
36 
37 \cpright Copyright (c) 2003-2020, The GENIE Collaboration
38  for the full text of the license visit http://copyright.genie-mc.org
39 */
40 //____________________________________________________________________________
41 
42 #ifndef GENIE_FLUX_GFLAVORSWAP_H
43 #define GENIE_FLUX_GFLAVORSWAP_H
44 
45 #include <string>
47 
48 namespace genie {
49 namespace flux {
50 
51  class GFlavorMap : public GFlavorMixerI {
52 
53  public:
54 
55  GFlavorMap();
56  ~GFlavorMap();
57 
58  //
59  // implement the GFlavorMixerI interface:
60  //
61 
62  /// each schema must take a string that configures it
63  /// it is up to the individual model to parse said string
64  /// and extract parameters (e.g. sin2th23, deltam12, etc)
66 
67  /// for any pair of PDG codes the model must calculate
68  /// the transition probability. This can also depend on
69  /// neutrino energy (in GeV) and distance (in meters) from
70  /// the neutrino origin.
71  double Probability(int pdg_initial, int pdg_final,
72  double energy, double dist);
73 
74  /// provide a means of printing the configuration
75  void PrintConfig(bool verbose=true);
76 
77  private:
78 
79  void ParseMapString(std::string config);
80  void ParseFixedfracString(std::string config);
81 
82  int PDG2Indx(int pdg);
83  int Indx2PDG(int indx);
84  const char* IndxName(int indx);
85  const char* NuName(int pdg) { return IndxName(PDG2Indx(pdg)); }
86 
87  double fProb[7][7];
88 
89  };
90 
91 } // namespace flux
92 } // namespace genie
93 
94 //
95 // Name PDG Indx
96 // sterile 0 0
97 // nu_e 12 1
98 // nu_mu 14 2
99 // nu_tau 16 3
100 // nu_e_bar -12 4
101 // nu_mu_bar -14 5
102 // nu_tau_bar -16 6
103 //
105 {
106  switch ( pdg ) {
107  case 12: return 1; break;
108  case 14: return 2; break;
109  case 16: return 3; break;
110  case -12: return 4; break;
111  case -14: return 5; break;
112  case -16: return 6; break;
113  default: return 0; break;
114  }
115  return 0;
116 }
118 {
119  switch ( indx ) {
120  case 1: return 12; break;
121  case 2: return 14; break;
122  case 3: return 16; break;
123  case 4: return -12; break;
124  case 5: return -14; break;
125  case 6: return -16; break;
126  default: return 0; break;
127  }
128  return 0;
129 }
130 
131 #endif //GENIE_FLUX_GFLAVORSWAP_H
const char * NuName(int pdg)
Definition: GFlavorMap.h:85
THE MAIN GENIE PROJECT NAMESPACE
Definition: AlgCmp.h:25
double Probability(int pdg_initial, int pdg_final, double energy, double dist)
Definition: GFlavorMap.cxx:141
int PDG2Indx(int pdg)
Definition: GFlavorMap.h:104
std::string string
Definition: nybbler.cc:12
GENIE interface for flavor modification.
Definition: GFlavorMap.h:51
static Config * config
Definition: config.cpp:1054
const char * IndxName(int indx)
Definition: GFlavorMap.cxx:180
GENIE interface for flavor modification.
Definition: GFlavorMixerI.h:42
void ParseMapString(std::string config)
Definition: GFlavorMap.cxx:69
void Config(std::string config)
Definition: GFlavorMap.cxx:45
double fProb[7][7]
Definition: GFlavorMap.h:87
verbose
Definition: train.py:477
void ParseFixedfracString(std::string config)
Definition: GFlavorMap.cxx:99
int Indx2PDG(int indx)
Definition: GFlavorMap.h:117
constexpr double dist(const TReal *x, const TReal *y, const unsigned int dimension)
void PrintConfig(bool verbose=true)
provide a means of printing the configuration
Definition: GFlavorMap.cxx:154