icemc
 All Classes Namespaces Files Functions Variables Friends Macros Pages
Primaries.h
Go to the documentation of this file.
1 
2 //class Primaries:
4 
5 #ifndef PRIMARIES_H_
6 #define PRIMARIES_H_
7 
8 #include "TRandom3.h"
9 #include <iostream>
10 
11 #include "TH1.h"
12 #include "TH2.h"
13 #include "TF1.h"
14 #include "TF2.h"
15 #include "TCanvas.h"
16 #include "TF3.h"
17 #include "TH2D.h"
18 #include "vector.hh"
19 #include "position.hh"
20 
21 class Vector;
22 class Position;
23 class Interaction;
24 class Primaries;
25 class IceModel;
26 class Counting;
27 class Settings;
28 
29 //using namespace std;
30 using std::string;
31 //
32 using std::cout;
33 
34 
35 
36 
38 class Y {
39 
40 
41 
42 private:
43  TF1* ffrac;
44 
45 
46  TF1* fC1_high[2][2];
47 
48  TF1 *fC1_low;
49 
50  TF1 *fC2;
51 
52 
53  TF3* fy0_low;
54  TF2* fy0_high;
55  TRandom3 Rand3;
56 
57  double pickYConnollyetal2011(int NU,int CURRENT,double e);
58  // NU=0: nubar, NU=1: nu
59  // CURRENT=0: CC, CURRENT-1: NC
60 
61  static constexpr double ymin_low = 0.00002;
62  constexpr static double ymax_low=0.001;
63  constexpr static double ymin_high=0.001;
64  constexpr static double ymax_high=1.;
65  constexpr static double dy_low=0.00002;
66  constexpr static double dy_high=0.001;
67 
68  double pickYGandhietal();
69 
70 
71  constexpr static double R1=0.36787944;
72  constexpr static double R2=0.63212056;
73 
74 
75 public:
76  Y();
77  double pickY(Settings *settings1,double pnu,int nu_nubar,int currentint);
78  double Getyweight(double pnu,double y,int nu_nubar,int currentint);
80 
81 };//Y
83 class Primaries {
84 
85 private:
86  TRandom3 Rand3;
87 
88  TH2D *m_hsigma;
89  TCanvas *m_csigma;
90  Y *m_myY;
91  int run_old_code;
92 
93 public:
94  double pickY(Settings *settings1,double pnu,int nu_nubar,int currentint);
95  double Getyweight(double pnu,double y,int nu_nubar,int currentint);
96 
97 
98  double A_low[4];
99  double A0_high[2][2];
100  double A1_high[2][2];
101  double A2_high[2][2];
102  double A3_high[2][2];
103  double b0;
104  double b1;
105 
106  TF1* m_fy[2][2];
107  TF1* m_fsigma[2][2];
108 
109  double c0[2][2];
110  double c1[2][2];
111  double c2[2][2];
112  double c3[2][2];
113  double c4[2][2];
114 
115  static constexpr int NSIGMAS=2;
116 
117 
118  double mine[NSIGMAS];
119  double maxe[NSIGMAS];
120 
121  Primaries();
122  ~Primaries();
123 
124 
126  int GetSigma(double pnu,double& sigma,double &len_int_kgm2,Settings *settings1,int nu_nubar,int currentint);
127 
128 
129 
130  // string GetCurrent();
131  string GetNuFlavor();
132 protected:
133 };
134 
136 class Interaction {
137 
138 private:
139 
140 
141 
142  Vector tmp_banana;
143 
145 
147  static constexpr double nu_banana_theta_angle=-0.413 * 3.14159/180.;
148 
149 
150  static constexpr double altitude_nu_banana=-400.;
151 
152 
153  static constexpr double lat_nu_banana=0.;
154  static constexpr double lon_nu_banana=0.;
155 
156 
157  static constexpr double banana_slopey=0.;
158  static constexpr double nu_banana_phi_angle=0. * 3.14159/180.;
159 
160 
161 
162 public:
163 
164  static constexpr double phi_nu_banana=3.14159/4;
165 
166  static constexpr double banana_observation_distance=600000.;
167  static constexpr double theta_nu_banana=170.*3.14159/180.;
168 
169  static constexpr int kcc=0;
170  static constexpr int knc=1;
171 
174  Interaction(string inttype,Primaries *primary1,Settings *settings1,int whichray,Counting *count1);
175 
176  void PickAnyDirection();
177 
178  int noway;
182  int toohigh;
183  int toolow;
184 
186 
189  double phi_nutraject;
190 
191  double weight_nu;
192  double weight_nu_prob;
193 
198  double chord;
199  double logchord;
202  double chord_kgm2_ice;
203  double d1;
204  double d2;
205 
206 
207  static constexpr double pnu_banana=2.00E19;
208  static constexpr double banana_y=0.2;
211  double banana_volts;
212  static constexpr double banana_signal_fluct=0.;
213  static constexpr double banana_sigma=0.;
214 
215 
216  void setNuFlavor(Primaries *primary1,Settings *settings1,int whichray,Counting *count1);
217  string GetCurrent();
218  void setCurrent();
221  string nuflavor;
222  string current;
225 
226 
228 
229  string banana_flavor;
230  string banana_current;
231 
233 
236 
239  double dnutries;
240 
241  double altitude_int;
243 
244  double r_fromballoon[2];
245 
247  double r_exit2bn;
250 
251 
252 
253 protected:
254 };
255 #endif