14 const double Signal::N_AIR(1.);
15 const double Signal::NICE(1.79);
16 const double Signal::CHANGLE_ICE(acos(1/NICE));
17 const double Signal::NSALT(2.45);
19 const double Signal::RHOSALT(2050.);
20 const double Signal::RHOICE(917);
21 const double Signal::RHOH20(1000);
22 const double Signal::RHOAIR(1.25);
23 const double Signal::RM_ICE(10.35);
24 const double Signal::RM_SALT(12.09);
25 const double Signal::KR_SALT(1.33);
26 const double Signal::KR_ICE(1.42);
28 const double Signal::X0SALT(0.1081);
30 const double Signal::ECSALT(38.5);
31 const double Signal::X0ICE(0.403);
33 const double Signal::ECICE(63.7);
35 const double Signal::AEX_ICE(1.);
37 const double Signal::ALPHAICE(1.32);
38 const double Signal::AEX_SALT(0.684);
39 const double Signal::ALPHASALT(1.27);
40 const double Signal::KE_SALT(3.2E-16);
41 const double Signal::KL_SALT(21.12);
42 const double Signal::KDELTA_SALT(14.95);
43 const double Signal::KE_ICE(4.79E-16);
44 const double Signal::KL_ICE(23.80);
45 const double Signal::KDELTA_ICE(18.33);
47 const double Signal::KELVINS_ICE(250.+150.);
48 const double Signal::KELVINS_SALT(500.);
49 const double Signal::BETAICE(2.25);
52 const double Signal::BETASALT(2.60);
53 const double Signal::VIEWANGLE_CUT(sqrt(5.));
56 Signal::Signal() : N_DEPTH(1.79) {
61 void Signal::InitializeMedium() {
63 SetKelvins(KELVINS_SALT);
65 SetRhoMedium(RHOSALT);
68 SetNMediumReceiver(NSALT);
71 SetAexMedium(AEX_SALT);
72 SetAlphaMedium(ALPHASALT);
76 SetKdelta_Medium(KDELTA_SALT);
78 SetBetaMedium(BETASALT);
82 SetKelvins(KELVINS_ICE);
87 SetNMediumReceiver(N_AIR);
90 SetAexMedium(AEX_ICE);
91 SetAlphaMedium(ALPHAICE);
95 SetKdelta_Medium(KDELTA_ICE);
97 SetBetaMedium(BETAICE);
102 void Signal::Initialize() {
104 logscalefactor_taper=0.;
115 kelvins_ice=250.+150.;
116 changle_ice=acos(1./nice);
133 if (WHICHPARAMETERIZATION==1) {
134 nu_r=(RHOMEDIUM/1000.)
136 /KR_MEDIUM/RM_MEDIUM*
137 CLIGHT*100./N_DEPTH/sin(acos(1/N_DEPTH));
139 vmmhz1m_reference=KE_MEDIUM/ECMEDIUM*
142 *sqrt(N_DEPTH*N_DEPTH-1)/N_DEPTH
146 cout <<
"multiplying by 1/changle which is " << 1./sin(changle) <<
"\n";
149 vmmhz1m_reference*=1./(1.+pow(freq_reference/nu_r,ALPHAMEDIUM));
157 void Signal::GetVmMHz(
double vmmhz_max,
double vmmhz1m_max,
double pnu,
double *freq,
double notch_min,
double notch_max,
double *vmmhz,
int nfreq) {
162 for (
int i=0;i<nfreq;i++) {
168 *GetVmMHz1m(pnu,freq[i])/vmmhz1m_max;
175 if (notch_min!=0 && notch_max!=0 && freq[i]>notch_min && freq[i]<notch_max)
194 double Signal::GetELPM() {
203 double elpm=2.E15*(X0MEDIUM/x0ice);
206 int Signal::GetLPM() {
211 void Signal::GetSpread(
double pnu,
218 double& deltheta_em_max,
219 double& deltheta_had_max) {
238 double elpm=GetELPM();
245 double showerlength=3.1;
261 em_eshower=emfrac*pnu;
262 had_eshower=hadfrac*pnu;
266 if (em_eshower<1.E15 || !LPM)
267 showerlength/=pow((em_eshower/1.e15),-0.03);
269 showerlength/=pow(elpm/(0.14*(em_eshower)+elpm),0.3);
274 if (WHICHPARAMETERIZATION==0) {
276 nu0=500.E6/1.E6*x0ice/X0MEDIUM;
286 deltheta_em_max=12.32/sqrt(pow(N_DEPTH,2)-1)*(nu0/freq)*RADDEG/showerlength;
288 if (hadfrac>0.00001) {
295 double epsilon=log10(had_eshower/1.E12);
296 if (had_eshower>=1E12 && had_eshower<100.E12)
297 deltheta_had_max=1.473/sqrt(pow(N_DEPTH,2)-1)*nu0/freq*RADDEG*(2.07-0.33*epsilon+(7.5e-2)*epsilon*epsilon);
298 else if (had_eshower<100.E15)
299 deltheta_had_max=1.473/sqrt(pow(N_DEPTH,2)-1)*nu0/freq*RADDEG*(1.744-(1.21e-2)*epsilon);
300 else if (had_eshower<10.E18)
301 deltheta_had_max=1.473/sqrt(pow(N_DEPTH,2)-1)*nu0/freq*RADDEG*(4.23-0.785*epsilon+(5.5e-2)*epsilon*epsilon);
309 deltheta_had_max=1.473/sqrt(pow(N_DEPTH,2)-1)*nu0/freq*RADDEG*(4.23-0.785*7.+5.5e-2*49. - (epsilon-7.)*0.07);
311 deltheta_had_max/=sqrt(log(2.));
317 deltheta_had_max=1.E-10;
319 deltheta_em_max/=sqrt(log(2.));
322 else if (WHICHPARAMETERIZATION==1) {
328 deltheta_em_max=12.32/sqrt(nice*nice-1)*(nu0/freq)*RADDEG/showerlength;
333 deltheta_em_max*=RHOMEDIUM/rhoice
334 /KDELTA_MEDIUM*kdelta_ice
336 /sqrt(N_DEPTH*N_DEPTH-1)*sqrt(nice*nice-1);
338 if (hadfrac>0.00001) {
342 deltheta_had_max=CLIGHT*100.
346 /sqrt(N_DEPTH*N_DEPTH-1.);
350 deltheta_had_max=1.E-10;
361 double Signal::GetVmMHz1m(
double pnu,
double freq) {
363 if (WHICHPARAMETERIZATION==0) {
366 double nu0=1150.E6/1.E6;
368 double nu0_modified=nu0
369 *(x0ice/ecice)/(X0MEDIUM/ECMEDIUM)
370 *(1/sqrt(N_DEPTH*N_DEPTH-1.))/(1/sqrt(nice*nice-1.));
376 1/sqrt(1-1/(nice*nice))
383 vmmhz1m_max=factor*(2.53E-7)*(pnu/1.E12)*freq
385 *(1./(1.+pow(freq/nu0_modified,1.44)));
387 else if (WHICHPARAMETERIZATION==1) {
390 vmmhz1m_max=vmmhz1m_reference
393 *1./(1.+pow(freq/nu_r,ALPHAMEDIUM))
394 *(1.+pow(freq_reference/nu_r,ALPHAMEDIUM));
399 vmmhz1m_max=vmmhz1m_max/2.;
400 vmmhz1m_max=vmmhz1m_max*sqrt(2.);
403 return vmmhz1m_max*JAIME_FACTOR;
423 void Signal::SetParameterization(
int whichparameterization) {
425 WHICHPARAMETERIZATION=whichparameterization;
429 void Signal::TaperVmMHz(
double viewangle,
436 double& vmmhz1m_em_obs) {
442 double vmmhz1m_had=0;
446 double rtemp=(viewangle-changle)*(viewangle-changle)/(deltheta_em*deltheta_em);
454 if (emfrac>pow(10.,-10.)) {
457 vmmhz1m_em=vmmhz1m*exp(-rtemp);
468 rtemp=(viewangle-changle)*(viewangle-changle)/(deltheta_had*deltheta_had);
474 vmmhz1m_had=vmmhz1m*exp(-rtemp);
484 logscalefactor_taper=log10((emfrac*vmmhz1m_em+hadfrac*vmmhz1m_had)/vmmhz1m);
488 vmmhz1m=sin(viewangle)*(emfrac*vmmhz1m_em+hadfrac*vmmhz1m_had);
493 vmmhz1m_em_obs=sin(viewangle)*emfrac*vmmhz1m_em/vmmhz1m;