signal.cc
1 #include "signal.hh"
2 #include "vector.hh"
3 #include "TF1.h"
4 #include "vector.hh"
5 #include "position.hh"
6 
7 
8 
9 #include "Constants.h"
10 
11 using std::cout;
12 
13 
14 const double Signal::N_AIR(1.); // index of refraction of air
15 const double Signal::NICE(1.79); // index of refraction of ice
16 const double Signal::CHANGLE_ICE(acos(1/NICE)); // index of refraction of ice
17 const double Signal::NSALT(2.45); // index of refracton for salt
18 //const double RHOSALT=2165; // density of salt (kg/m**3)
19 const double Signal::RHOSALT(2050.); // density of salt (kg/m**3)
20 const double Signal::RHOICE(917); // density of ice (kg/m**3)
21 const double Signal::RHOH20(1000); // density of water (kg/m**3)
22 const double Signal::RHOAIR(1.25); // density of air (kg/m**3)
23 const double Signal::RM_ICE(10.35); // moliere radius, in g/cm^2
24 const double Signal::RM_SALT(12.09); // moliere radius, in g/cm^2
25 const double Signal::KR_SALT(1.33); // constant in jaime's parameterization
26 const double Signal::KR_ICE(1.42); // constant in jaime's parameterization
27 //const double Signal::X0SALT=0.1024; // radiation length of salt (meters)
28 const double Signal::X0SALT(0.1081); // radiation length of salt (meters)
29 //const double Signal::ECSALT=40.; // critical energy in salt (MeV)
30 const double Signal::ECSALT(38.5); // critical energy in salt (MeV)
31 const double Signal::X0ICE(0.403);
32 // //const double Signal::X0ICE=0.392; // radiation length of ice (meters)
33 const double Signal::ECICE(63.7); // critical energy in ice (MeV)
34 // //const double Signal::ECICE=73.0; // critical energy in ice (MeV)
35 const double Signal::AEX_ICE(1.); //efficiency for producing charge asymmetry relative to ice. 1 by definition
36 
37 const double Signal::ALPHAICE(1.32); // exponent that goes into cutting off the spectrum at high frequencies
38 const double Signal::AEX_SALT(0.684); // efficiency for producing charge asymmetry relative to ice
39 const double Signal::ALPHASALT(1.27); // exponent that goes into cutting off the spectrum at high frequencies
40 const double Signal::KE_SALT(3.2E-16); // constant in jaime's parameterization, in V/cm/MHz
41 const double Signal::KL_SALT(21.12); //constant in jaime's parameterization
42 const double Signal::KDELTA_SALT(14.95); // constant in jaime's parameterization
43 const double Signal::KE_ICE(4.79E-16); // constant in jaime's parameterization, in V/cm/MHz
44 const double Signal::KL_ICE(23.80); //constant in jaime's parameterization
45 const double Signal::KDELTA_ICE(18.33); // constant in jaime's parameterization
46 
47 const double Signal::KELVINS_ICE(250.+150.); // temperature in Kelvin (ice+system)
48 const double Signal::KELVINS_SALT(500.); // temperature in salt (350) + receiver temp (150)
49 const double Signal::BETAICE(2.25); // exponent, in jaime's parameterization
50 // double Signal::NU0_MODIFIED=0.; // nu_0 modified for a specific medium
51 // double Signal::NU_R;// parameter for signal parameterization
52 const double Signal::BETASALT(2.60); // exponent, in jaime's parameterization
53 const double Signal::VIEWANGLE_CUT(sqrt(5.)); // require viewangle is no more than 5 delta away from the cerenkov angle where
54 
55 
56 Signal::Signal() : N_DEPTH(1.79) {
57 
58  JAIME_FACTOR=1.0; // factor to multiply Jaime's parameterization for error analysis
59 // Initialize(); // CD: You can't initialize it before setting the interaction mode... that's insanity!
60 }
61  void Signal::InitializeMedium() {
62  if (MEDIUM==1) {
63  SetKelvins(KELVINS_SALT);
64 
65  SetRhoMedium(RHOSALT);
66  SetNDepth(NSALT);
67  // changle=changle_salt;
68  SetNMediumReceiver(NSALT);
69  SetX0Medium(X0SALT);
70  SetEcMedium(ECSALT);
71  SetAexMedium(AEX_SALT);
72  SetAlphaMedium(ALPHASALT);
73  SetRmMedium(RM_SALT);
74  SetKeMedium(KE_SALT); // constant in jaime's parameterization, in V/cm/MHz
75  SetKlMedium(KL_SALT); //constant in jaime's parameterization
76  SetKdelta_Medium(KDELTA_SALT); // constant in jaime's parameterization
77  SetKrMedium(KR_SALT); // constant in jaime's parameterization
78  SetBetaMedium(BETASALT); // exponent, in jaime's parameterization
79 
80  } //if (MEDIUM==1)
81  else if (MEDIUM==0) {
82  SetKelvins(KELVINS_ICE);
83  SetNDepth(NICE);
84  //changle=CHANGLE_ICE;
85  SetRhoMedium(RHOICE);
86 
87  SetNMediumReceiver(N_AIR);
88  SetX0Medium(X0ICE);
89  SetEcMedium(ECICE);
90  SetAexMedium(AEX_ICE);
91  SetAlphaMedium(ALPHAICE);
92  SetRmMedium(RM_ICE);
93  SetKeMedium(KE_ICE); // constant in jaime's parameterization, in V/cm/MHz
94  SetKlMedium(KL_ICE); //constant in jaime's parameterization
95  SetKdelta_Medium(KDELTA_ICE); // constant in jaime's parameterization
96  SetKrMedium(KR_ICE); // constant in jaime's parameterization
97  SetBetaMedium(BETAICE); // exponent, in jaime's parameterization
98  } //if (MEDIUM==0)
99 
100 }
101 
102  void Signal::Initialize() {
103 
104  logscalefactor_taper=0.;
105 
106  x0ice=0.403;
107  //X0ICE=0.392; // radiation length of ice (meters)
108  ecice=63.7; // critical energy in ice (MeV)
109  //const static ECICE=73.0; // critical energy in ice (MeV)
110  nice=1.79; // index of refraction of ice
111  nfirn=1.3250; // index of refraction at the very surface - Peter
112  invnfirn=1/nfirn;
113  invnice=1/nice;
114  rhoice=917; // density of ice (kg/m**3)
115  kelvins_ice=250.+150.; // temperature in Kelvin (ice+system)
116  changle_ice=acos(1./nice);
117  aex_ice=1.; //efficiency for producing charge asymmetry relative to ice. 1 by definition
118 
119  alphaice=1.32; // exponent that goes into cutting off the spectrum at high frequencies
120  rm_ice=10.35; // moliere radius, in g/cm^2
121  ke_ice=4.79E-16; // const staticant in jaime's parameterization, in V/cm/MHz
122  kl_ice=23.80; //const staticant in jaime's parameterization
123  kdelta_ice=18.33; // const staticant in jaime's parameterization
124  kr_ice=1.42; // const staticant in jaime's parameterization
125  betaice=2.25; // exponent, in jaime's parameterization
126  nu0_modified=0.; // nu_0 modified for a specific medium
127 
128  freq_reference=1.E6; // reference frequency in MHz
129  pnu_reference=1.E18; // reference energy in MHz
130 
131 
132 
133  if (WHICHPARAMETERIZATION==1) {
134  nu_r=(RHOMEDIUM/1000.)
135  //NU_R=(RHOMEDIUM/1000.) // density in g/cm^3
136  /KR_MEDIUM/RM_MEDIUM*
137  CLIGHT*100./N_DEPTH/sin(acos(1/N_DEPTH));
138 
139  vmmhz1m_reference=KE_MEDIUM/ECMEDIUM* // KE in V/cm/MHz^2, Ec in MeV
140  (X0MEDIUM*100.) // radiation length in cm
141  *freq_reference/1.E6 // frequency in MHz
142  *sqrt(N_DEPTH*N_DEPTH-1)/N_DEPTH // sin(theta_c)
143  *pnu_reference/1.E6 // energy in MeV
144  *1./sin(changle);
145 
146  cout << "multiplying by 1/changle which is " << 1./sin(changle) << "\n";
147 
148  // vmmhz1m*=1./(1.+pow(freq/NU_R,ALPHAMEDIUM));
149  vmmhz1m_reference*=1./(1.+pow(freq_reference/nu_r,ALPHAMEDIUM));
150 
151  }
152 
153 
154 
155 
156 }
157 void Signal::GetVmMHz(double vmmhz_max,double vmmhz1m_max,double pnu,double *freq,double notch_min,double notch_max,double *vmmhz,int nfreq) {
158 
159  // parametrization from Jaime Alvarez Munhiz
160  // here using astro-ph/0003315
161 
162  for (int i=0;i<nfreq;i++) {
163 
164  vmmhz[i]=vmmhz_max
165  //*1./FREQ_LOW*freq[i];
166 
167 
168  *GetVmMHz1m(pnu,freq[i])/vmmhz1m_max;
169  //if (WHICHPARAMETERIZATION==0)
170  //vmmhz[i]*=(1./(1.+pow(freq[i]/NU0_MODIFIED,ALPHAMEDIUM)));
171  //if (WHICHPARAMETERIZATION==1)
172  //vmmhz[i]*=1./(1.+pow(freq[i]/NU_R,ALPHAMEDIUM));
173 
174 
175  if (notch_min!=0 && notch_max!=0 && freq[i]>notch_min && freq[i]<notch_max)
176  vmmhz[i]=0.;
177  } //for
178 
179 // double sum[5]={0.};
180 // if (WHICHPATH==4) {
181 // for (int j=0;j<5;j++) {
182 // for (int i=0;i<NFREQ;i++) {
183 // if (bwslice_min[j]<=freq[i] && bwslice_max[j]>freq[i]) {
184 // sum[j]+=GetVmMHz1m(pnu,freq[i],x0ice,ecice,N_DEPTH,AEXMEDIUM,WHICHPARAMETERIZATION)*(freq[i+1]-freq[i])/1.E6;
185 // }
186 // }
187 // cout << "j, sum is " << j << " " << sum[j] << "\n";
188 // }
189 
190 // }
191 
192 } //GetVmMHz
193 
194  double Signal::GetELPM() {
195 
196  // LPM
197  // elpm =7.7 TeV/cm * rho * X0 in PDG, but our x0 is in meters
198  // so use elpm = 7.7TeV/cm*X0
199  // X0 is radiation lengths in cm
200 
201  //double elpm=7.7E12*(X0ICE*100.);
202 
203  double elpm=2.E15*(X0MEDIUM/x0ice); // this is what Jaime uses. see caption under figure 4 of 0003315.
204  return elpm;
205 } //GetELPM
206  int Signal::GetLPM() {
207 
208 
209  return LPM;
210 } //GetLPM
211 void Signal::GetSpread(double pnu,
212  double emfrac,
213  double hadfrac,
214  double freq,
215  // double n_depth,
216  //double X0DEPTH,
217 
218  double& deltheta_em_max,
219  double& deltheta_had_max) {
220 
221  // cout << KR_MEDIUM << " " << RM_MEDIUM << " " << KL_MEDIUM << " " << KE_MEDIUM << " " << ECMEDIUM << " " << X0MEDIUM << " " << ALPHAMEDIUM << " " << AEXMEDIUM << " " << KDELTA_MEDIUM << " " << BETAMEDIUM << " " << KELVINS << " " << JAIME_FACTOR << "\n";
222  //cout << RHOSALT << " " << RHOICE << " " << RM_ICE << " " << RM_SALT << " " << KR_SALT << " " << KR_ICE << " " << X0SALT << " " << ECSALT << " " << X0ICE << " " << ECICE << " " << AEX_ICE << "\n";
223  // cout << ALPHAICE << " " << AEX_SALT << " " << ALPHASALT << " " << KE_SALT << " " << KL_SALT << " " << KDELTA_SALT << " " << KE_ICE << " " << KL_ICE << " " << KDELTA_ICE << " " << KELVINS_SALT << " " << BETAICE << " " << BETASALT << "\n";
224 
225  // scale by how far off Cherenkov angle this viewing antenna is
226  // c.f. A-MZ astro-ph/9706064 and astro-ph/0003315
227  // and for non-LPM (non-EM) showers from
228  // Phys.Lett.B434,396 (1998) (astro-ph/9806098)
229  // The lengths are different hence the angular thickness of
230  // the shower is different. Get the angular thickness for
231  // both the EM and hadroic parts.
232 
233 // cout << KR_MEDIUM << " " << RM_MEDIUM << " " << KL_MEDIUM << " " << KE_MEDIUM << " " << ECMEDIUM << " " << X0MEDIUM << " " << ALPHAMEDIUM << " " << AEXMEDIUM << " " << KDELTA_MEDIUM << " " << BETAMEDIUM << " " << KELVINS << " " << JAIME_FACTOR << "\n";
234 // cout << RHOSALT << " " << RHOICE << " " << RM_ICE << " " << RM_SALT << " " << KR_SALT << " " << KR_ICE << " " << X0SALT << " " << ECSALT << " " << X0ICE << " " << ECICE << " " << AEX_ICE << "\n";
235 // cout << ALPHAICE << " " << AEX_SALT << " " << ALPHASALT << " " << KE_SALT << " " << KL_SALT << " " << KDELTA_SALT << " " << KE_ICE << " " << KL_ICE << " " << KDELTA_ICE << " " << KELVINS_SALT << " " << BETAICE << " " << BETASALT << "\n";
236 
237  //double elpm=GetLPM();
238  double elpm=GetELPM();
239 
240  // cout << "elpm is " << elpm << "\n";
241 
242 
243  // cout << "elpm is " << elpm << "\n";
244  freq=freq/1.E6; // frequency in MHz
245  double showerlength=3.1; //shower length in meters-gets a modification
246  //for em showers due to lpm effect.
247  // this shower length is chosen somewhat arbitrarily, but is
248  // approximately the length of a shower in ice.
249  // Then, the coefficient out front of the equations for
250  // deltheta_em_max and deltheta_had_max are set so that
251  // for ice, we get the equations in astro-ph/9706064
252  // with the coefficient in front being 2.7 degrees.
253  // I wanted to make the dependence on the shower length
254  // and index of refraction explicit, so I pulled those variables
255  // out of the equations for deltheta_em_max and deltheta_had_max.
256 
257  double em_eshower; // em shower energy
258  double had_eshower; // had shower energy
259  double nu0; // reference frequency
260 
261  em_eshower=emfrac*pnu; // first, consider the electromagnetic shower.
262  had_eshower=hadfrac*pnu; // just the energy of the hadronic component of the shower
263 
264  // lengthen the shower to account for the lpm effect.
265  // from astro-ph/9706064
266  if (em_eshower<1.E15 || !LPM)
267  showerlength/=pow((em_eshower/1.e15),-0.03);
268  else
269  showerlength/=pow(elpm/(0.14*(em_eshower)+elpm),0.3);
270 
271  // cout << "showerlength is " << showerlength << "\n";
272 
273 
274  if (WHICHPARAMETERIZATION==0) {
275 
276  nu0=500.E6/1.E6*x0ice/X0MEDIUM; // for rego (astro-ph/9706064)
277 
278  // decoherence frequency scales with radiation length
279  // when X0MEDIUM=X0ICE, nu0=500 MHz as in astro-ph/9706064
280 
281 
282  // these equations are in astro-ph/9706064, but we have pulled
283  // out the dependence on index of refraction and shower length.
284  // note that 12.32/sqrt(pow(n_depth,2)-1)*RADDEG/showerlength=2.7 degrees.
285  // remember that Jaime has a factor of ln2 in the exponential here which we'll have to correct for further down
286  deltheta_em_max=12.32/sqrt(pow(N_DEPTH,2)-1)*(nu0/freq)*RADDEG/showerlength;
287 
288  if (hadfrac>0.00001) { // if there is a hadronic component
289 
290 
291  // these equations are in astro-ph/9806098, but we have pulled
292  // out the dependence on index of refraction and shower length.
293  // remember that in this paper he includes a factor of ln2 in
294  // the exponential, which we account for further down
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);
302  else {
303  // beyond param, just use value at 10 EeV since slow variation
304  // and parameterization might diverge
305  // so scale from 10 EeV at 7.5% per decade (30/4=7.5)
306  //deltheta_had_max=1.473/sqrt(pow(N_DEPTH,2)-1)*nu0/freq*RADDEG*(4.23-0.785*7.+5.5e-2*49.); // the last part in parenthesis if the previous equation evaluated at epsilon=7.
307  //deltheta_had_max=deltheta_had_max*(1.+(epsilon-7.)*0.075);
308  // It doesn't increase deltheta_had_max by 7.5% per decade anymore. Now it decreases the energy factor by 0.07 per decade.
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);
310  } //else : beyond paramatrization
311  deltheta_had_max/=sqrt(log(2.)); // in astro-ph/9706064, Jaime uses exp(-0.5* (theta-theta_c)^2/delta_had^2)
312 
313  // we adjust the delta's so that we can use the same form for both parameterizations: exp(-(theta-theta_c)^2/delta^2)
314 
315  }
316  else
317  deltheta_had_max=1.E-10;
318 
319  deltheta_em_max/=sqrt(log(2.)); // in astro-ph/9706064, Jaime uses exp(-0.5 (theta-theta_c)^2/delta_had^2)
320 
321  }
322  else if (WHICHPARAMETERIZATION==1) {
323 
324  // cout << "I'm here inside GetSpread.\n";
325  // we use the old parameterization for em showers
326  nu0=500.E6/1.E6; // for rego (astro-ph/9706064)
327 
328  deltheta_em_max=12.32/sqrt(nice*nice-1)*(nu0/freq)*RADDEG/showerlength;
329 
330 
331  // and then scale it according to astro-ph/0512337
332  // Eq. 9
333  deltheta_em_max*=RHOMEDIUM/rhoice
334  /KDELTA_MEDIUM*kdelta_ice
335  /X0MEDIUM*x0ice
336  /sqrt(N_DEPTH*N_DEPTH-1)*sqrt(nice*nice-1);
337 
338  if (hadfrac>0.00001) { // if there is a hadronic component
339  // for had showers, just use the one from astro-ph/0512337
340  // Eq. 9
341  // straight away
342  deltheta_had_max=CLIGHT*100.// speed of light in cm/s
343  /(freq*1.E6)
344  *1/KDELTA_MEDIUM
345  /(X0MEDIUM*100.) // radiation length in cm
346  /sqrt(N_DEPTH*N_DEPTH-1.);
347 
348  } //if (hadronic component)
349  else
350  deltheta_had_max=1.E-10;
351 
352  } // if more recent parameterization
353 
354 
355 
356 
357 
358 } //GetSpread
359 
360 
361  double Signal::GetVmMHz1m(double pnu,double freq) { // constructor
362 
363  if (WHICHPARAMETERIZATION==0) {
364  // parametrization from Jaime Alvarez Munhiz
365  // here using astro-ph/0003315
366  double nu0=1150.E6/1.E6;
367  //NU0_MODIFIED=nu0
368  double nu0_modified=nu0
369  *(x0ice/ecice)/(X0MEDIUM/ECMEDIUM)
370  *(1/sqrt(N_DEPTH*N_DEPTH-1.))/(1/sqrt(nice*nice-1.));
371 
372  freq=freq/1.E6; // frequency in MHz
373 
374  double factor=
375  //1/sin(changle) // should be cerenkov angle for ice
376  1/sqrt(1-1/(nice*nice)) // sin(changle) for ice
377  *1/nu0 //
378  *X0MEDIUM/x0ice // track length *** use dE/dX rho instead
379  *ecice/ECMEDIUM
380  *AEXMEDIUM/aex_ice; // to account for critical energy
381  // to account for cerenkov threshold // maybe should be "a" instead
382 
383  vmmhz1m_max=factor*(2.53E-7)*(pnu/1.E12)*freq
384  // *(1./(1.+pow(freq/NU0_MODIFIED,ALPHAMEDIUM)))
385  *(1./(1.+pow(freq/nu0_modified,1.44)));
386  }
387  else if (WHICHPARAMETERIZATION==1) {
388 
389 
390  vmmhz1m_max=vmmhz1m_reference
391  *freq/freq_reference
392  *pnu/pnu_reference
393  *1./(1.+pow(freq/nu_r,ALPHAMEDIUM))
394  *(1.+pow(freq_reference/nu_r,ALPHAMEDIUM));
395 
396  }
397 
398 
399  vmmhz1m_max=vmmhz1m_max/2.; // This factor of 2 is to account for the 2 in the definition of the fourier transform in Equation 8 of the Halzen, Stanev and Zas paper. The same factor of 2 seems to have propagated through subsequent Jaime papers.
400  vmmhz1m_max=vmmhz1m_max*sqrt(2.); // This is to account for the fact that the E fields quoted in the theory papers are double-sided in frequency (they extend from -F to F) whereas we are using it as a single-sided E-field (only from 0 to F).
401 
402  // cout << "jaime_factor is " << JAIME_FACTOR << "\n";
403  return vmmhz1m_max*JAIME_FACTOR;
404 
405 
406  // vmmhz1m=vmmhz1m/sqrt(1.E6/(BW/(double)NFREQ)); //THIS IS NEEDED TO CONSERVE ENERGY FOR DIFFERENT BIN WIDTHS.
407 
408 
409 
410 
411 // // this is the old version
412 // double factor=
413 // X0MEDIUM/X0ICE // track length
414 // *(1-1/(N_DEPTH*N_DEPTH))/(1-1/(NICE*NICE)) // cerenkov index of refraction factor
415 // *N_DEPTH/NICE // to account for cerenkov threshold
416 // *ECICE/ECMEDIUM; // to account for critical energy
417 
418 // double vmmhz1m=factor*(2.53E-7)*(pnu/1.E12)*(freq/nu0)*(1./(1.+pow(freq/nu0_modified,1.44)))*JAIME_FACTOR;
419 
420 } //Signal constructor
421 
422 
423  void Signal::SetParameterization(int whichparameterization) {
424 
425  WHICHPARAMETERIZATION=whichparameterization;
426 }
427 
428 
429 void Signal::TaperVmMHz(double viewangle,
430  double deltheta_em,
431  double deltheta_had,
432  double emfrac,
433  double hadfrac,
434 
435  double& vmmhz1m,
436  double& vmmhz1m_em_obs) {
437 
438  //--EM
439 
440 
441  double vmmhz1m_em=0; // V/m/MHz at 1m due to EM component of shower
442 double vmmhz1m_had=0; // V/m/MHz at 1m due to HAD component of shower
443 
444  // this is the number that get exponentiated
445  // double rtemp=0.5*(viewangle-changle)*(viewangle-changle)/(deltheta_em*deltheta_em);
446  double rtemp=(viewangle-changle)*(viewangle-changle)/(deltheta_em*deltheta_em);
447 
448 
449  //cout << "dangle, deltheta_em is " << viewangle-changle << " " << deltheta_em << "\n";
450  //cout << "rtemp (em) is " << rtemp << "\n";
451  // the power goes like exp(-(theta_v-theta_c)^2/Delta^2)
452  // so the e-field is the same with a 1/2 in the exponential
453 
454  if (emfrac>pow(10.,-10.)) { // if there is an em component
455  if (rtemp<=20) { // if the viewing angle is less than 20 sigma away from the cerankov angle
456  // this is the effect of the em width on the signal
457  vmmhz1m_em=vmmhz1m*exp(-rtemp);
458  }
459  else // if it's more than 20 sigma just set it to zero
460  vmmhz1m_em=0.;
461  }
462  else // if the em component is essentially zero than set this to zero
463  vmmhz1m_em=0;
464 
465  //--HAD
466  // this is the quantity that gets exponentiated
467 
468  rtemp=(viewangle-changle)*(viewangle-changle)/(deltheta_had*deltheta_had);
469 
470  //cout << "rtemp (had) is " << rtemp << "\n";
471 
472  if (hadfrac!=0) { // if there is a hadronic fraction
473  if (rtemp<20) { // if we are less than 20 sigma from cerenkov angle
474  vmmhz1m_had=vmmhz1m*exp(-rtemp); // this is the effect of the hadronic width of the signal
475 
476  }
477  else // if we're more than 20 sigma from cerenkov angle
478  vmmhz1m_had=0.; // just set it to zero
479  }
480  else
481  vmmhz1m_had=0.;
482 
483 
484  logscalefactor_taper=log10((emfrac*vmmhz1m_em+hadfrac*vmmhz1m_had)/vmmhz1m);
485 
486 
487  //cout << "emfrac, vmmhz1m_em, hadfrac, vmmhz1m_had are " << emfrac << " " << vmmhz1m_em << " " << hadfrac << " " << vmmhz1m_had << "\n";
488  vmmhz1m=sin(viewangle)*(emfrac*vmmhz1m_em+hadfrac*vmmhz1m_had);
489 
490  if (vmmhz1m==0)
491  vmmhz1m_em_obs=0.;
492  else
493  vmmhz1m_em_obs=sin(viewangle)*emfrac*vmmhz1m_em/vmmhz1m;
494 
495 
496 
497 } //TaperVmMHz