Main Page
Related Pages
Modules
Namespaces
Classes
Files
Examples
File List
File Members
Generator
src
Physics
NuclearState
NuclearData.cxx
Go to the documentation of this file.
1
//____________________________________________________________________________
2
/*
3
Copyright (C) 2003-2015, GENIE Neutrino MC Generator Collaboration
4
For the full text of the license visit http://copyright.genie-mc.org
5
6
7
Costas Andreopoulos <constantinos.andreopoulos \at cern.ch>
8
9
For the class documentation see the corresponding header file.
10
11
Important revisions after version 2.0.0 :
12
@ Nov 30, 2009 - CA
13
Was first added in v2.5.1
14
@ May 01, 2012 - CA
15
Pick-up data from new location ($GENIE/data/evgen/nucl/)
16
*/
17
//____________________________________________________________________________
18
19
#include <cassert>
20
#include <iostream>
21
22
#include <TSystem.h>
23
#include <TNtupleD.h>
24
#include <TTree.h>
25
26
#include "
Framework/Messenger/Messenger.h
"
27
#include "
Physics/NuclearState/NuclearData.h
"
28
#include "
Framework/Numerical/Spline.h
"
29
#include "
Framework/ParticleData/PDGCodes.h
"
30
31
using
std::cout;
32
using
std::endl
;
33
34
using namespace
genie
;
35
36
//____________________________________________________________________________
37
NuclearData
*
NuclearData::fInstance
= 0;
38
//____________________________________________________________________________
39
NuclearData::NuclearData
()
40
{
41
this->
Load
();
42
fInstance
= 0;
43
}
44
//____________________________________________________________________________
45
NuclearData::~NuclearData
()
46
{
47
if
(!
gAbortingInErr
) {
48
cout <<
"NuclearData singleton dtor: Deleting inputs... "
<<
endl
;
49
}
50
51
delete
fNuclSupprD2
;
52
}
53
//____________________________________________________________________________
54
NuclearData
*
NuclearData::Instance
()
55
{
56
if
(
fInstance
== 0) {
57
LOG
(
"NuclData"
,
pINFO
) <<
"NuclearData late initialization"
;
58
static
NuclearData::Cleaner
cleaner;
59
cleaner.
DummyMethodAndSilentCompiler
();
60
fInstance
=
new
NuclearData
;
61
}
62
return
fInstance
;
63
}
64
//____________________________________________________________________________
65
double
NuclearData::DeuteriumSuppressionFactor
(
double
Q2
)
66
{
67
if
(Q2 > 0.20)
return
1.;
// no suppression
68
69
if
(Q2 < 3
E
-5) { Q2 = 3
E
-5; }
70
71
double
R
=
fNuclSupprD2
->
Evaluate
(Q2);
72
return
R
;
73
}
74
//____________________________________________________________________________
75
void
NuclearData::Load
(
void
)
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
}
97
//____________________________________________________________________________
genie::NuclearData
Definition:
NuclearData.h:26
genie::NuclearData::Cleaner
Definition:
NuclearData.h:46
genie::NuclearData::Instance
static NuclearData * Instance(void)
Definition:
NuclearData.cxx:54
genie
THE MAIN GENIE PROJECT NAMESPACE
Definition:
AlgCmp.h:25
ValidateOpDetReco.R
R
Definition:
ValidateOpDetReco.py:311
genie::utils::kinematics::Q2
double Q2(const Interaction *const i)
Definition:
KineUtils.cxx:1064
string
std::string string
Definition:
nybbler.cc:12
genie::NuclearData::fNuclSupprD2
Spline * fNuclSupprD2
Definition:
NuclearData.h:43
NuclearData.h
genie::Spline
A numeric analysis tool class for interpolating 1-D functions.
Definition:
Spline.h:46
genie::Spline::Evaluate
double Evaluate(double x) const
Definition:
Spline.cxx:361
genie::NuclearData::fInstance
static NuclearData * fInstance
Definition:
NuclearData.h:40
generate_CCQE_events.data_dir
string data_dir
Definition:
generate_CCQE_events.py:25
genie::NuclearData::NuclearData
NuclearData()
Definition:
NuclearData.cxx:39
LOG
#define LOG(stream, priority)
A macro that returns the requested log4cpp::Category appending a string (using the FILE...
Definition:
Messenger.h:96
genie::NuclearData::Cleaner::DummyMethodAndSilentCompiler
void DummyMethodAndSilentCompiler()
Definition:
NuclearData.h:47
pINFO
#define pINFO
Definition:
Messenger.h:62
genie::NuclearData::Load
void Load(void)
Definition:
NuclearData.cxx:75
Messenger.h
E
Definition:
pointersEqual_t.cc:12
genie::NuclearData::DeuteriumSuppressionFactor
double DeuteriumSuppressionFactor(double Q2)
Definition:
NuclearData.cxx:65
Spline.h
genie::NuclearData::~NuclearData
~NuclearData()
Definition:
NuclearData.cxx:45
genie::gAbortingInErr
bool gAbortingInErr
Definition:
Messenger.cxx:34
PDGCodes.h
Most commonly used PDG codes. A set of utility functions to handle PDG codes is provided in PDGUtils...
endl
QTextStream & endl(QTextStream &s)
Definition:
qtextstream.cpp:2030
Generated by
1.8.11