GENIEGenerator
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Classes | Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes | Static Private Attributes | Friends | List of all members
genie::NuclearData Class Reference

#include <NuclearData.h>

Collaboration diagram for genie::NuclearData:
Collaboration graph
[legend]

Classes

struct  Cleaner
 

Public Member Functions

double DeuteriumSuppressionFactor (double Q2)
 

Static Public Member Functions

static NuclearDataInstance (void)
 

Private Member Functions

 NuclearData ()
 
 NuclearData (const NuclearData &nd)
 
 ~NuclearData ()
 
void Load (void)
 

Private Attributes

SplinefNuclSupprD2
 

Static Private Attributes

static NuclearDatafInstance = 0
 

Friends

struct Cleaner
 

Detailed Description

Author
Costas Andreopoulos <c.andreopoulos cern.ch> University of Liverpool
Created:
Nov 20, 2009
License:
Copyright (c) 2003-2024, The GENIE Collaboration For the full text of the license visit http://copyright.genie-mc.org

Definition at line 26 of file NuclearData.h.

Constructor & Destructor Documentation

NuclearData::NuclearData ( )
private

Definition at line 39 of file NuclearData.cxx.

References fInstance, and Load().

Referenced by Instance().

40 {
41  this->Load();
42  fInstance = 0;
43 }
static NuclearData * fInstance
Definition: NuclearData.h:40
genie::NuclearData::NuclearData ( const NuclearData nd)
private
NuclearData::~NuclearData ( )
private

Definition at line 45 of file NuclearData.cxx.

References fNuclSupprD2, and genie::gAbortingInErr.

46 {
47  if(!gAbortingInErr) {
48  cout << "NuclearData singleton dtor: Deleting inputs... " << endl;
49  }
50 
51  delete fNuclSupprD2;
52 }
Spline * fNuclSupprD2
Definition: NuclearData.h:43
bool gAbortingInErr
Definition: Messenger.cxx:34

Member Function Documentation

double NuclearData::DeuteriumSuppressionFactor ( double  Q2)

Definition at line 65 of file NuclearData.cxx.

References genie::Spline::Evaluate(), and fNuclSupprD2.

Referenced by genie::utils::nuclear::NuclQELXSecSuppression().

66 {
67  if(Q2 > 0.20) return 1.; // no suppression
68 
69  if(Q2 < 3E-5) { Q2 = 3E-5; }
70 
71  double R = fNuclSupprD2->Evaluate(Q2);
72  return R;
73 }
double Q2(const Interaction *const i)
Definition: KineUtils.cxx:1077
Spline * fNuclSupprD2
Definition: NuclearData.h:43
double Evaluate(double x) const
Definition: Spline.cxx:363
NuclearData * NuclearData::Instance ( void  )
static

Definition at line 54 of file NuclearData.cxx.

References genie::NuclearData::Cleaner::DummyMethodAndSilentCompiler(), fInstance, LOG, NuclearData(), and pINFO.

Referenced by genie::utils::nuclear::NuclQELXSecSuppression().

55 {
56  if(fInstance == 0) {
57  LOG("NuclData", pINFO) << "NuclearData late initialization";
58  static NuclearData::Cleaner cleaner;
60  fInstance = new NuclearData;
61  }
62  return fInstance;
63 }
static NuclearData * fInstance
Definition: NuclearData.h:40
#define LOG(stream, priority)
A macro that returns the requested log4cpp::Category appending a string (using the FILE...
Definition: Messenger.h:96
#define pINFO
Definition: Messenger.h:62
void NuclearData::Load ( void  )
private

Definition at line 75 of file NuclearData.cxx.

References fNuclSupprD2, LOG, and pINFO.

Referenced by NuclearData().

76 {
77  fNuclSupprD2 = 0;
78 
79  string data_dir =
80  string(gSystem->Getenv("GENIE")) +
81  string("/data/evgen/nucl");
82  LOG("NuclData", pINFO)
83  << "Loading nuclear data from: " << data_dir;
84 
85  // Load D2 nuclear suppression factor
86 
87  string nuclsupprd2_file = data_dir + "/D2sup.data";
88  assert( ! gSystem->AccessPathName(nuclsupprd2_file.c_str()) );
89 
90  TTree nuclsupprd2_tree;
91  nuclsupprd2_tree.ReadFile(nuclsupprd2_file.c_str(), "Q2/D:R/D");
92 
93  fNuclSupprD2 = new Spline(&nuclsupprd2_tree, "Q2:R");
94 
95  LOG("NuclData", pINFO) << "Done loading all data";
96 }
Spline * fNuclSupprD2
Definition: NuclearData.h:43
A numeric analysis tool class for interpolating 1-D functions.
Definition: Spline.h:58
#define LOG(stream, priority)
A macro that returns the requested log4cpp::Category appending a string (using the FILE...
Definition: Messenger.h:96
#define pINFO
Definition: Messenger.h:62

Friends And Related Function Documentation

friend struct Cleaner
friend

Definition at line 55 of file NuclearData.h.

Member Data Documentation

NuclearData * NuclearData::fInstance = 0
staticprivate

Definition at line 40 of file NuclearData.h.

Referenced by Instance(), NuclearData(), and genie::NuclearData::Cleaner::~Cleaner().

Spline* genie::NuclearData::fNuclSupprD2
private

Definition at line 43 of file NuclearData.h.

Referenced by DeuteriumSuppressionFactor(), Load(), and ~NuclearData().


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