GENIEGenerator
Loading...
Searching...
No Matches
contrib
test
gtestPREM.cxx
Go to the documentation of this file.
1
//____________________________________________________________________________
2
/*!
3
4
\program gtestPREM
5
6
\brief Test tehe PREM model
7
8
\author Costas Andreopoulos <c.andreopoulos \at cern.ch>
9
University of Liverpool
10
11
\created Aug 25, 2009
12
13
\cpright Copyright (c) 2003-2025, The GENIE Collaboration
14
For the full text of the license visit http://copyright.genie-mc.org
15
16
*/
17
//____________________________________________________________________________
18
19
#include <TFile.h>
20
#include <TNtuple.h>
21
22
#include "
Framework/Conventions/Constants.h
"
23
#include "
Framework/Conventions/Units.h
"
24
#include "
Framework/Utils/PREM.h
"
25
26
using namespace
genie
;
27
28
//____________________________________________________________________________
29
int
main
(
int
/*argc*/
,
char
**
/*argv*/
)
30
{
31
TNtuple * earth_density =
new
TNtuple(
"earth_density"
,
""
,
"r:rho"
);
32
33
const
double
dr = 1. *
units::km
;
34
const
double
rmax =
constants::kREarth
;
35
36
double
r = 0;
37
while
(r < rmax) {
38
double
rho =
utils::prem::Density
(r);
39
earth_density->Fill(r/
units::km
, rho/
units::g_cm3
);
40
r += dr;
41
}
42
43
TFile f(
"./prem.root"
,
"recreate"
);
44
earth_density->Write();
45
f.Close();
46
47
return
0;
48
}
49
//____________________________________________________________________________
Constants.h
PREM.h
Units.h
main
int main()
Definition
Validation.cpp:290
genie::constants::kREarth
static const double kREarth
Definition
Framework/Conventions/Constants.h:110
genie::units::km
static constexpr double km
Definition
Units.h:64
genie::units::g_cm3
static constexpr double g_cm3
Definition
Units.h:153
genie::utils::prem::Density
double Density(double r)
Definition
PREM.cxx:18
genie
THE MAIN GENIE PROJECT NAMESPACE
Definition
AlgCmp.h:25
Generated on
for GENIEGenerator by
1.14.0