testSettings.cc
1 /* -*- C++ -*-.*********************************************************************************************
2  Author: Ben Strutt
3  Email: strutt@physics.ucla.edu
4 
5  Description:
6  This is a test program for the new input.yaml file format
7 ***********************************************************************************************************/
8 
9 #include <iostream>
10 
11 
12 #include "Constants.h"
13 #include "Settings.h"
14 #include "position.hh"
15 
16 #include "earthmodel.hh"
17 #include "Tools.h"
18 #include "vector.hh"
19 #include "roughness.hh"
20 #include "anita.hh"
21 #include "balloon.hh"
22 #include "icemodel.hh"
23 #include "Spectra.h"
24 #include "signal.hh"
25 #include "secondaries.hh"
26 #include "ray.hh"
27 #include "counting.hh"
28 #include "Primaries.h"
29 #include "Taumodel.hh"
30 
31 
32 int main(){
33 
34  Settings s;
35 
36 
37  std::ofstream outputsFile("/tmp/outputs.txt");
38 
39  Balloon *bn1=new Balloon(); // instance of the balloon
40  Anita *anita1=new Anita();// right now this constructor gets banding info
41  Secondaries *sec1=new Secondaries();
42  Signal *sig1=new Signal();
43  Ray *ray1=new Ray(); // create new instance of the ray class
44  // input parameters
45  int NNU;
46  double RANDOMISEPOL;
47 
48  s.ReadInputs("inputs.anita3.conf", outputsFile, NNU, RANDOMISEPOL);
49  s.ApplyInputs(anita1, sec1, sig1, bn1, ray1);
50 
51 
52 
53  // s.printAllKeyValuePairStrings();
54 
55  std::cout << std::endl << std::endl;
56 
57  const char* whichPayloadKey = "Which payload";
58  int whichPayload = 0;
59  s.getSetting(whichPayloadKey, whichPayload);
60  std::cout << whichPayloadKey << " -> " << whichPayload << std::endl;
61 
62 
63  const char* bandThresholdsKey = "Band thresholds";
64  std::vector<double> bandThresholds;
65  s.getSetting(bandThresholdsKey, bandThresholds);
66 
67  std::cout << bandThresholdsKey << " -> ";
68  for(unsigned int i=0; i < bandThresholds.size(); i++){
69  std::cout << bandThresholds.at(i) << " ";
70  }
71  std::cout << std::endl;
72 
73 
74  // std::cout << "Now about to try and get a setting that doesn't exist" << std::endl;
75  const char* nonExistentKey = "adsfasdfasdfasdf";
76  std::cout << "Now about to try and get a setting, called " << nonExistentKey << ", that doesn't exist..." << std::endl;
77  std::vector<double> shouldBeEmpty;
78  s.getSetting(nonExistentKey, shouldBeEmpty);
79  std::cout << std::endl;
80 
81  delete ray1;
82  delete sig1;
83  delete sec1;
84  delete anita1;
85  delete bn1;
86 
87 
88  return 0;
89 
90 
91 
92 }
Radiation from interaction.
Definition: signal.hh:13
Reads in and stores input settings for the run.
Definition: Settings.h:37
Secondary interactions.
Definition: secondaries.hh:28
Handles everything related to balloon positions, payload orientation over the course of a flight...
Definition: balloon.hh:30
Ray tracing.
Definition: ray.hh:20