Functions
gtestPREM.cxx File Reference
#include <TFile.h>
#include <TNtuple.h>
#include "Framework/Conventions/Constants.h"
#include "Framework/Conventions/Units.h"
#include "Framework/Utils/PREM.h"

Go to the source code of this file.

Functions

int main (int, char **)
 

Function Documentation

int main ( int  ,
char **   
)

Definition at line 29 of file gtestPREM.cxx.

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 }
static constexpr double km
Definition: Units.h:64
static constexpr double g_cm3
Definition: Units.h:153
static const double kREarth
Definition: Constants.h:110
double Density(double r)
Definition: PREM.cxx:18