runWimpSim.h
Go to the documentation of this file.
1 #ifndef RUN_WIMP_SIM_H
2 #define RUN_WIMP_SIM_H
3 
4 #include <iostream>
5 #include <ctime>
6 #include <sstream>
7 #include <cmath>
8 #include <cstdlib>
9 #include <set>
10 #include <string>
11 
12 #include "GENIE/Framework/Numerical/RandomGen.h"
13 #include "GENIE/Tools/Flux/GNuMIFlux.h"
14 #include "GENIE/Tools/Flux/GSimpleNtpFlux.h"
15 #include "GENIE/Framework/Utils/UnitUtils.h"
16 #include "GENIE/Framework/Utils/AppInit.h"
17 #include "TSystem.h"
18 #include "TStopwatch.h"
19 #include "TLorentzVector.h"
20 #include "TNtuple.h"
21 #include "TFile.h"
22 #include "TRandom3.h"
23 
24 const bool COMMAND_LINE_INPUT = false;
25 const double PI = M_PI;
26 
27 // clockwise angle from true North to NOvA +z axis
28 // taken from MoonShadowTrigger, which cites an email from Virgil Bocean
29 // to Alec Habig.
30 const double NOVA_AZIMUTH = 332.066111; // degrees
31 
32 struct complex{ double r, i; };
33 
34 const unsigned nFluxEntries = 100000;
35 //const unsigned nFluxEntries = 100;
36 const double enumin = 1.0; // GeV
37 const double T_MAX = 5.0e5, T_MIN = 0,
38  X_MAX = 16000, X_MIN = -16000,
39  Y_MAX = -9200, Y_MIN = -9200,
40  Z_MAX = 72000, Z_MIN = -48000;
41 
42 // wimpann defaults
43 const unsigned int ANN_CHAN = 11, // 5 -> b bbar
44  N_ANN = 1e7;
45 const double CM_ENERGY = 100, // 50 GeV WIMPs
46  THETA_12 = 33.58 * PI / 180.0,
47  THETA_13 = 9.12 * PI / 180.0,
48  THETA_23 = 40.40 * PI / 180.0,
49  DELTA_CP = 0,
50  DM2_21 = 7.58e-5,
51  DM2_31 = 2.35e-5;
52 const bool WIMPANN_OUTP = false,
53  USE_EARTH_ANN = false,
54  WIMPANN_SUM = false;
55 const std::string FILE_S = "wimpann_sun.out",
56  FILE_E = "wimpann_earth.out",
57  FILE_INFO = "wimpann.info",
58  FILE_SUM_S = "wimpann_sun.sum",
59  FILE_SUM_E = "wimpann_earth.sum";
60 
61 // wimpevent defaults
62 const double WELAT = 48.4171297,
63  WELONG = -92.7890442;
64 const unsigned int WETF = 2,
65  WE_INT = 3,
66  WE_MED = 1;
67 
68 extern"C" {
69  void dsinit_();
70  void wimpinit_();
71  void nusetup_();
72  void pygive_(char *, size_t);
73  void nuoscinit_();
74  void modpyt_();
75  void genevt_(unsigned int *channel, unsigned int *nev);
76  void weinit_();
77  double astxt2mjd_(char *);
78  void nupropsu_();
79  double pyr_(int *);
80 
81  struct {
82  double enumax;
83  bool output, earth;
84  double mwimp;
85  } neutrino_;
86 
87  struct {
88  complex nusc[700000][3];
89  double nusr[700000][3], nuer[700000];
90  unsigned int nusi[700000][7], nuei[700000][4], nnus, nnue, nuunierr;
91  } nus_;
92 
93  extern struct {
94  int kf1[14], kf2[14], ach, achmax;
95  } annich_;
96 
97  struct {
98  double th12, th13, th23, delta, dm212, dm312;
99  } nuosc_;
100 
101  struct {
102  unsigned int seed, nevfiles, nannperfile, fileno;
103  } wimppara_;
104 
105  extern struct {
106  double welat, welong, wet1, wet2, mjd1, mjd2;
107  unsigned int wemed, weint, wetf, wesunacc, weradec, weseed;
108  char wefile[128], wesumdir[128], d1txt[26], d2txt[26];
109  } wesim_;
110 
111  struct {
117  hadaz, hadel, dpsun[3], lst;
118  int nut, nui, iev, lcv;
119  } weevent_;
120 }
121 
122 inline unsigned int nutype(unsigned int u) { if (u==1||u==3||u==5) return 1;
123  else return 2;
124  }
125 
126 inline int signum(double d) { if (d<0) return -1;
127  else if (d>0) return 1;
128  else return 0;
129  }
130 inline double zamp(complex z) { return sqrt(z.i*z.i+z.r*z.r); }
131 inline double zarg(complex z) { if (z.r==0 && z.i==0) return 0;
132  else if (z.r==0) return PI/2*signum(z.i);
133  else return atan(z.i/z.r);
134  }
135 inline int get_pdg (unsigned wimpevent_nui) {
136  switch (wimpevent_nui) {
137  case 1:
138  return 11;// nu_e
139  case 2:
140  return -11;// ~nu_e
141  case 3:
142  return 14;// nu_mu
143  case 4:
144  return -14;// ~nu_mu
145  case 5:
146  return 15;// nu_tau
147  case 6:
148  return -15;// ~nu_tau
149  }
150  return 0;
151 }
152 
153 #endif
int iev
Definition: runWimpSim.h:118
void wimpinit_()
bool output
Definition: runWimpSim.h:83
const unsigned int N_ANN
Definition: runWimpSim.h:44
double hadel
Definition: runWimpSim.h:113
double nuaz
Definition: runWimpSim.h:113
const unsigned int WE_INT
Definition: runWimpSim.h:65
const double THETA_13
Definition: runWimpSim.h:47
double lepdec
Definition: runWimpSim.h:113
unsigned int nnus
Definition: runWimpSim.h:90
int achmax
Definition: runWimpSim.h:94
const double X_MIN
Definition: runWimpSim.h:38
void dsinit_()
const std::string FILE_SUM_E
Definition: runWimpSim.h:59
struct @20 nus_
double tev
Definition: runWimpSim.h:113
double th23
Definition: runWimpSim.h:98
double delta
Definition: runWimpSim.h:98
double langdet
Definition: runWimpSim.h:113
complex nustate[3]
Definition: runWimpSim.h:112
const double WELAT
Definition: runWimpSim.h:62
unsigned int weradec
Definition: runWimpSim.h:107
T sqrt(T number)
Definition: d0nt_math.hpp:156
const unsigned int WE_MED
Definition: runWimpSim.h:66
double r
Definition: runWimpSim.h:32
double mwimp
Definition: runWimpSim.h:84
unsigned int nnue
Definition: runWimpSim.h:90
double nuel
Definition: runWimpSim.h:113
const unsigned int ANN_CHAN
Definition: runWimpSim.h:43
const unsigned int WETF
Definition: runWimpSim.h:64
const double WELONG
Definition: runWimpSim.h:63
double lazdet
Definition: runWimpSim.h:113
const double DM2_31
Definition: runWimpSim.h:51
const std::string FILE_E
Definition: runWimpSim.h:56
const bool WIMPANN_OUTP
Definition: runWimpSim.h:52
double sunnadir
Definition: runWimpSim.h:113
double hadra
Definition: runWimpSim.h:113
double th12
Definition: runWimpSim.h:98
const double Y_MAX
Definition: runWimpSim.h:39
int nut
Definition: runWimpSim.h:118
double astxt2mjd_(char *)
#define M_PI
Definition: SbMath.h:34
const bool USE_EARTH_ANN
Definition: runWimpSim.h:53
const double Y_MIN
Definition: runWimpSim.h:39
const double NOVA_AZIMUTH
Definition: runWimpSim.h:30
double hadaz
Definition: runWimpSim.h:113
const double DM2_21
Definition: runWimpSim.h:50
struct @24 wesim_
double sunel
Definition: runWimpSim.h:113
double le
Definition: runWimpSim.h:113
const double THETA_23
Definition: runWimpSim.h:48
double dist
Definition: runWimpSim.h:113
void nusetup_()
unsigned int nusi[700000][7]
Definition: runWimpSim.h:90
T atan(T number)
Definition: d0nt_math.hpp:66
void weinit_()
unsigned int weseed
Definition: runWimpSim.h:107
unsigned int nutype(unsigned int u)
Definition: runWimpSim.h:122
double enu
Definition: runWimpSim.h:113
double mjdfr
Definition: runWimpSim.h:113
struct @21 annich_
double lepel
Definition: runWimpSim.h:113
void pygive_(char *, size_t)
const double X_MAX
Definition: runWimpSim.h:38
double wet2
Definition: runWimpSim.h:106
const double Z_MIN
Definition: runWimpSim.h:40
double lst
Definition: runWimpSim.h:113
double sunra
Definition: runWimpSim.h:113
double nudec
Definition: runWimpSim.h:113
double lang
Definition: runWimpSim.h:113
unsigned int seed
Definition: runWimpSim.h:102
double hang
Definition: runWimpSim.h:113
const double PI
Definition: runWimpSim.h:25
const unsigned nFluxEntries
Definition: runWimpSim.h:34
double nuer[700000]
Definition: runWimpSim.h:89
const double THETA_12
Definition: runWimpSim.h:46
char d2txt[26]
Definition: runWimpSim.h:108
void genevt_(unsigned int *channel, unsigned int *nev)
Float_t d
Definition: plot.C:236
double nusr[700000][3]
Definition: runWimpSim.h:89
char d1txt[26]
Definition: runWimpSim.h:108
double he
Definition: runWimpSim.h:113
double wet1
Definition: runWimpSim.h:106
struct @19 neutrino_
const double DELTA_CP
Definition: runWimpSim.h:49
double zamp(complex z)
Definition: runWimpSim.h:130
unsigned int nannperfile
Definition: runWimpSim.h:102
double sunaz
Definition: runWimpSim.h:113
unsigned int wemed
Definition: runWimpSim.h:107
struct @22 nuosc_
const double T_MAX
Definition: runWimpSim.h:37
z
Definition: test.py:28
double welong
Definition: runWimpSim.h:106
unsigned int nuunierr
Definition: runWimpSim.h:90
struct @23 wimppara_
const std::string FILE_SUM_S
Definition: runWimpSim.h:58
void nuoscinit_()
int nui
Definition: runWimpSim.h:118
double zarg(complex z)
Definition: runWimpSim.h:131
double laz
Definition: runWimpSim.h:113
int kf2[14]
Definition: runWimpSim.h:94
double enumax
Definition: runWimpSim.h:82
double lepra
Definition: runWimpSim.h:113
unsigned int wetf
Definition: runWimpSim.h:107
const double enumin
Definition: runWimpSim.h:36
complex nusc[700000][3]
Definition: runWimpSim.h:88
::xsd::cxx::tree::string< char, simple_type > string
Definition: Database.h:154
unsigned int weint
Definition: runWimpSim.h:107
const bool COMMAND_LINE_INPUT
Definition: runWimpSim.h:24
char wefile[128]
Definition: runWimpSim.h:108
int signum(double d)
Definition: runWimpSim.h:126
unsigned int nevfiles
Definition: runWimpSim.h:102
double haz
Definition: runWimpSim.h:113
struct @25 weevent_
double dfluxvert
Definition: runWimpSim.h:113
int get_pdg(unsigned wimpevent_nui)
Definition: runWimpSim.h:135
int ach
Definition: runWimpSim.h:94
double nuang
Definition: runWimpSim.h:113
double ledet
Definition: runWimpSim.h:113
const double CM_ENERGY
Definition: runWimpSim.h:45
double mjd1
Definition: runWimpSim.h:106
unsigned int nuei[700000][4]
Definition: runWimpSim.h:90
const std::string FILE_S
Definition: runWimpSim.h:55
unsigned int fileno
Definition: runWimpSim.h:102
bool earth
Definition: runWimpSim.h:83
int kf1[14]
Definition: runWimpSim.h:94
unsigned int wesunacc
Definition: runWimpSim.h:107
const bool WIMPANN_SUM
Definition: runWimpSim.h:54
double lepaz
Definition: runWimpSim.h:113
double pyr_(int *)
double i
Definition: runWimpSim.h:32
void modpyt_()
double sundec
Definition: runWimpSim.h:113
const double Z_MAX
Definition: runWimpSim.h:40
double dm212
Definition: runWimpSim.h:98
double dfluxnu
Definition: runWimpSim.h:113
int lcv
Definition: runWimpSim.h:118
const std::string FILE_INFO
Definition: runWimpSim.h:57
double dfluxdet
Definition: runWimpSim.h:113
char wesumdir[128]
Definition: runWimpSim.h:108
double th13
Definition: runWimpSim.h:98
double dm312
Definition: runWimpSim.h:98
double mjd2
Definition: runWimpSim.h:106
double nura
Definition: runWimpSim.h:113
const double T_MIN
Definition: runWimpSim.h:37
double welat
Definition: runWimpSim.h:106
void nupropsu_()
double dpsun[3]
Definition: runWimpSim.h:113
double mjd
Definition: runWimpSim.h:113
double haddec
Definition: runWimpSim.h:113