Public Member Functions | Private Member Functions | Private Attributes | Static Private Attributes | List of all members
evgen::GFlavorOsc Class Reference

#include "/cvmfs/nova-development.opensciencegrid.org/novasoft/releases/N20-11-25/EventGenerator/GENIE/GFlavorOsc.h"

Inheritance diagram for evgen::GFlavorOsc:
genie::flux::GFlavorMixerI

Public Member Functions

 GFlavorOsc ()
 
 ~GFlavorOsc ()
 
void Config (std::string config)
 
double Probability (int pdg_initial, int pdg_final, double energy, double dist)
 
void PrintConfig (bool verbose=true)
 provide a means of printing the configuration More...
 

Private Member Functions

void ParseConfig (std::string config)
 
void UnityProbMatrix ()
 
int PDG2Indx (int pdg)
 
int Indx2PDG (int indx)
 
const char * IndxName (int indx)
 
const char * NuName (int pdg)
 

Private Attributes

double fLastEnergy
 
double fLastDist
 
double fProbMatrix [kNFlavors][kNFlavors]
 

Static Private Attributes

static const int kNFlavors = 7
 

Detailed Description

Definition at line 26 of file GFlavorOsc.h.

Constructor & Destructor Documentation

evgen::GFlavorOsc::GFlavorOsc ( )

Definition at line 27 of file GFlavorOsc.cxx.

References UnityProbMatrix().

27  : fLastEnergy(-999), fLastDist(-999)
28 {
30 }
double fLastEnergy
Definition: GFlavorOsc.h:64
void UnityProbMatrix()
Definition: GFlavorOsc.cxx:43
evgen::GFlavorOsc::~GFlavorOsc ( )

Definition at line 32 of file GFlavorOsc.cxx.

32 { ; }

Member Function Documentation

void evgen::GFlavorOsc::Config ( std::string  config)
virtual

each schema must take a string that configures it it is up to the individual model to parse said string and extract parameters (e.g. sin2th23, deltam12, etc)

Implements genie::flux::GFlavorMixerI.

Definition at line 35 of file GFlavorOsc.cxx.

References allTimeWatchdog::endl.

36 {
37  mf::LogInfo("GFlavorOsc")
38  << "GFlavorOsc::Config \"" << config << "\"" << std::endl;
39 
40 }
MaybeLogger_< ELseverityLevel::ELsev_info, false > LogInfo
Definition: config.py:1
int evgen::GFlavorOsc::Indx2PDG ( int  indx)
inlineprivate

Definition at line 95 of file GFlavorOsc.h.

96 {
97  switch ( indx ) {
98  case 1: return 12; break;
99  case 2: return 14; break;
100  case 3: return 16; break;
101  case 4: return -12; break;
102  case 5: return -14; break;
103  case 6: return -16; break;
104  default: return 0; break;
105  }
106  return 0;
107 }
const char * evgen::GFlavorOsc::IndxName ( int  indx)
private

Definition at line 92 of file GFlavorOsc.cxx.

Referenced by NuName().

93 {
94  static const char* name[] = { "sterile",
95  "nu_e", "nu_mu", "nu_tau",
96  "nu_e_bar", "nu_mu_bar", "nu_tau_bar" };
97  return name[indx];
98 
99 }
const XML_Char * name
Definition: expat.h:151
const char* evgen::GFlavorOsc::NuName ( int  pdg)
inlineprivate

Definition at line 60 of file GFlavorOsc.h.

References IndxName(), and PDG2Indx().

60 { return IndxName(PDG2Indx(pdg)); }
int PDG2Indx(int pdg)
Definition: GFlavorOsc.h:82
const char * IndxName(int indx)
Definition: GFlavorOsc.cxx:92
void evgen::GFlavorOsc::ParseConfig ( std::string  config)
private
int evgen::GFlavorOsc::PDG2Indx ( int  pdg)
inlineprivate

Definition at line 82 of file GFlavorOsc.h.

Referenced by NuName(), and Probability().

83 {
84  switch ( pdg ) {
85  case 12: return 1; break;
86  case 14: return 2; break;
87  case 16: return 3; break;
88  case -12: return 4; break;
89  case -14: return 5; break;
90  case -16: return 6; break;
91  default: return 0; break;
92  }
93  return 0;
94 }
void evgen::GFlavorOsc::PrintConfig ( bool  verbose = true)
virtual

provide a means of printing the configuration

Implements genie::flux::GFlavorMixerI.

Definition at line 85 of file GFlavorOsc.cxx.

References allTimeWatchdog::endl.

86 {
87  mf::LogInfo("GFlavorOsc")
88  << "GFlavorOsc::PrintConfig():" << std::endl;
89 
90 }
MaybeLogger_< ELseverityLevel::ELsev_info, false > LogInfo
double evgen::GFlavorOsc::Probability ( int  pdg_initial,
int  pdg_final,
double  energy,
double  dist 
)
virtual

for any pair of PDG codes the model must calculate the transition probability. This can also depend on neutrino energy (in GeV) and distance (in meters) from the neutrino origin.

Implements genie::flux::GFlavorMixerI.

Definition at line 52 of file GFlavorOsc.cxx.

References dist, allTimeWatchdog::endl, energy, fLastDist, fLastEnergy, fProbMatrix, PDG2Indx(), and UnityProbMatrix().

54 {
55  // do a bit of caching if the oscillation code supports it efficiently
56  if ( fLastEnergy != energy && fLastDist != dist ) {
57  // need new values
59  fLastDist = dist;
60 
61  UnityProbMatrix(); // do this only if code below doesn't fill all elements
62 
63  // remove this printout after vetting the code
64  mf::LogInfo("GFlavorOsc")
65  << " new energy " << energy << " or distance " << dist;
66 
67  // fill the matrix, or reconfigure the calculator
68 
69  }
70 
71  // assuming we're using a cached matrix ... otherwise calculate the prob
72  double prob = fProbMatrix[PDG2Indx(pdg_initial)][PDG2Indx(pdg_final)];
73 
74  // remove this printout after vetting the code
75  mf::LogInfo("GFlavorOsc")
76  << "saw " << pdg_initial << " => " << pdg_final
77  << " E=" << energy << " dist=" << dist
78  << " prob=" << prob
79  << std::endl;
80 
81  return prob;
82 }
MaybeLogger_< ELseverityLevel::ELsev_info, false > LogInfo
double dist
Definition: runWimpSim.h:113
double energy
Definition: plottest35.C:25
double fLastEnergy
Definition: GFlavorOsc.h:64
double fProbMatrix[kNFlavors][kNFlavors]
Definition: GFlavorOsc.h:66
void UnityProbMatrix()
Definition: GFlavorOsc.cxx:43
int PDG2Indx(int pdg)
Definition: GFlavorOsc.h:82
void evgen::GFlavorOsc::UnityProbMatrix ( )
private

Definition at line 43 of file GFlavorOsc.cxx.

References fProbMatrix, MECModelEnuComparisons::i, calib::j, and kNFlavors.

Referenced by GFlavorOsc(), and Probability().

44 {
45  for (int i=0; i<kNFlavors; ++i) {
46  for (int j=0; j<kNFlavors; ++j) {
47  fProbMatrix[i][j] = ( (i==j) ? 1 : 0 );
48  }
49  }
50 }
const double j
Definition: BetheBloch.cxx:29
double fProbMatrix[kNFlavors][kNFlavors]
Definition: GFlavorOsc.h:66
static const int kNFlavors
Definition: GFlavorOsc.h:62

Member Data Documentation

double evgen::GFlavorOsc::fLastDist
private

Definition at line 65 of file GFlavorOsc.h.

Referenced by Probability().

double evgen::GFlavorOsc::fLastEnergy
private

Definition at line 64 of file GFlavorOsc.h.

Referenced by Probability().

double evgen::GFlavorOsc::fProbMatrix[kNFlavors][kNFlavors]
private

Definition at line 66 of file GFlavorOsc.h.

Referenced by Probability(), and UnityProbMatrix().

const int evgen::GFlavorOsc::kNFlavors = 7
staticprivate

Definition at line 62 of file GFlavorOsc.h.

Referenced by UnityProbMatrix().


The documentation for this class was generated from the following files: