10 #include "earthmodel.hh" 11 #include "icemodel.hh" 12 #include "Primaries.h" 14 #include "counting.hh" 15 #include "icemc_random.h" 65 string sbase=
"fsigma";
66 for(
int i=0; i<=1;i++){
67 for(
int j=0; j<=1; j++){
68 sprintf(ch,
"%d%d",i,j);
70 m_fsigma[i][j]=
new TF1((sbase+stmp).c_str(),
"pow(10, [1]+[2]*log(x-[0])+[3]*pow(log(x-[0]),2)+[4]/log(x-[0]))", 4., 21.);
72 m_fsigma[i][j]->SetParameters(
c0[i][j],
c1[i][j],
c2[i][j],
c3[i][j],
c4[i][j]);
79 m_csigma=
new TCanvas(
"m_csigma",
"m_csigma title",1000, 700);
80 m_hsigma=
new TH2D(
"hsigma",
"title hsigma", 600, 7., 12., 600, -40., -30.);
82 m_hsigma->SetTitle(
"log10 (pnu) vs.log10 Cross Section Sigma");
83 m_hsigma->GetXaxis()->SetTitle(
"Log10(Ev/ GeV)");
84 m_hsigma->GetYaxis()->SetTitle(
"log10(Cross Section/ m^2)");
86 m_hsigma->Draw(
"scat");
87 m_hsigma->SetMarkerStyle(7);
88 m_hsigma->SetMarkerSize(3);
137 return m_myY->
Getyweight(pnu,y,nu_nubar,currentint);
142 return m_myY->
pickY(settings1,pnu,nu_nubar,currentint);
147 m_hsigma->Draw(
"same");
148 m_csigma->Print(
"sigmaCrossSection.pdf");
151 for(
int i=0; i<=1;i++){
152 for(
int j=0; j<=1; j++){
153 delete m_fsigma[i][j];
161 if (pnu<
mine[settings1->SIGMAPARAM] || pnu>
maxe[settings1->SIGMAPARAM]) {
162 cout <<
"Need a parameterization for this energy region.\n";
168 if(nu_nubar!=0 && nu_nubar!=1){
169 cout<<
"nu_nubar is not defined correctly!\n";
172 if (currentint!=Interaction::kcc && currentint!=Interaction::knc){
173 cout<<
"Current is not cc or nc!\n";
174 return Interaction::kcc;
177 if(settings1->SIGMAPARAM==0){
179 sigma=(2.501E-39)*pow(pnu/1.E9,0.3076)*settings1->SIGMA_FACTOR;
182 else if (settings1->SIGMAPARAM==1) {
183 double pnuGeV=pnu/1.E9;
184 double epsilon=log10(pnuGeV);
185 sigma=settings1->SIGMA_FACTOR*(m_fsigma[nu_nubar][currentint]->Eval(epsilon))/1.E4;
187 if(m_hsigma->GetEntries()<2000){
188 m_hsigma->Fill(epsilon, log10(sigma));
194 len_int_kgm2=M_NUCL/sigma;
203 double rnd=getRNG(RNG_INTERACTION)->Rndm();
208 else if(rnd<=(2./3.)) {
215 cout <<
"unable to pick nu flavor\n";
220 Interaction::Interaction(
string inttype,
Primaries *primary1,
Settings *settings1,
int whichray,
Counting *count1) : banana_flavor(
"numu"), banana_current(
"nc"), nu_banana(
Position(theta_nu_banana,phi_nu_banana)) {
223 wheredoesitleave_err=0;
226 wheredoesitenterice_err=0;
233 dtryingdirection = 1.;
240 if (inttype==
"banana") {
245 nnu_banana =
Vector(nu_banana_theta_angle + PI,nu_banana_phi_angle);
246 nnu_banana = nnu_banana.ChangeCoord(nu_banana);
248 current = banana_current;
250 nuflavor = banana_flavor;
255 setNuFlavor(primary1,settings1,whichray,count1);
264 getRNG(RNG_DIRECTION)->RndmArray(2,rndlist);
274 double sinthetanu=sin(thetanu);
289 if (settings1->MINRAY==whichray) {
296 counting1->nnu_tau++;
299 if (settings1->FORSECKEL==1)
308 cout<<
"nuflavor is "<<
nuflavor<<
"\n";
315 double rnd=getRNG(RNG_INTERACTION)->Rndm();
324 void Interaction::setCurrent() {
343 ffrac=
new TF1(
"ffrac",
"[0]*sin([1]*(x-[2]))",7.,12.);
345 ffrac->FixParameter(0,0.128);
346 ffrac->FixParameter(1,-0.197);
347 ffrac->FixParameter(2,21.8);
349 string sbase=
"C1_high";
351 for (
int i=0;i<2;i++) {
352 for (
int j=0;j<2;j++) {
353 sprintf(which,
"%d%d",i,j);
354 string sname=sbase+which;
355 fC1_high[i][j]=
new TF1(sname.c_str(),
"[0]-[1]*(exp(-(x-[2])/[3]))",7.,12.);
359 int kcc = Interaction::kcc;
360 int knc = Interaction::knc;
363 fC1_high[1][kcc]->FixParameter(0,-0.0026);
364 fC1_high[0][kcc]->FixParameter(0,-0.008);
365 fC1_high[1][knc]->FixParameter(0,-0.005);
366 fC1_high[0][knc]->FixParameter(0,-0.005);
369 fC1_high[1][kcc]->FixParameter(1,0.085);
370 fC1_high[0][kcc]->FixParameter(1,0.26);
371 fC1_high[1][knc]->FixParameter(1,0.23);
372 fC1_high[0][knc]->FixParameter(1,0.23);
376 fC1_high[1][kcc]->FixParameter(2,4.1);
377 fC1_high[0][kcc]->FixParameter(2,3.0);
378 fC1_high[1][knc]->FixParameter(2,3.0);
379 fC1_high[0][knc]->FixParameter(2,3.0);
382 for (
int i=0;i<2;i++) {
383 for (
int j=0;j<2;j++) {
384 fC1_high[i][j]->FixParameter(3,1.7);
388 fC1_low=
new TF1(
"C1_low",
"[0]-[1]*(exp(-(x-[2])/[3]))",7.,12.);
391 fC1_low->FixParameter(0,0.);
392 fC1_low->FixParameter(1,0.0941);
393 fC1_low->FixParameter(2,4.72);
394 fC1_low->FixParameter(3,0.456);
396 fC2=
new TF1(
"C2",
"[0]+[1]*x",7.,12.);
398 fC2->FixParameter(0,2.55);
399 fC2->FixParameter(1,-9.49E-2);
402 fy0_low=
new TF3(
"fy0_low",
"x+(z*([1]-x)^(-1./y+1)+(1-z)*([0]-x)^(-1./y+1))^(y/(y-1))");
403 fy0_low->SetParameter(0,ymin_low);
404 fy0_low->SetParameter(1,ymax_low);
407 fy0_high=
new TF2(
"fy0_high",
"([1]-x)^y/([0]-x)^(y-1.)+x");
408 fy0_high->SetParameter(0,ymin_high);
409 fy0_high->SetParameter(1,ymax_high);
415 if(settings1->YPARAM==0){
416 return pickYGandhietal();
420 double elast_y=pickYConnollyetal2011(nu_nubar,currentint,pnu);
427 double Y::pickYGandhietal() {
434 rnd = getRNG(RNG_INTERACTION)->Rndm(1);
436 x=pow(-log(R1+rnd*R2),2.5);
441 double Y::pickYConnollyetal2011(
int NU,
int CURRENT,
double pnu) {
444 double epsilon=log10(pnu/1.E9);
447 double r1=getRNG(RNG_INTERACTION)->Rndm();
450 if (r1<ffrac->Eval(epsilon))
455 C1_this=fC1_high[NU][CURRENT]->Eval(epsilon);
457 C1_this=fC1_low->Eval(epsilon);
459 double C2_this=fC2->Eval(epsilon);
462 double r2=getRNG(RNG_INTERACTION)->Rndm();
466 y0=fy0_high->Eval(C1_this,r2);
467 else if (iyregion==1)
468 y0=fy0_low->Eval(C1_this,C2_this,r2);
479 double C0_highbar, C0_lowbar,C0_high, C0_low;
482 double C1_low, C2, C1_high;
484 double epsilon=log10(pnu/1.E9);
486 C2=fC2->Eval(epsilon);
487 C1_low=fC1_low->Eval(epsilon);
489 C1_high=fC1_high[nu_nubar][currentint]->Eval(epsilon);
494 W=fabs( (ymax_high-C1_high)/(ymin_high-C1_high));
495 B=(pow(ymax_low-C1_low, 1/C2)/(ymax_low-C1_high));
496 T=B*((pow(ymax_low-C1_low, U)-pow(ymin_low-C1_low, U) )/U)+log(W);
498 C0_low=C0_high*(pow(ymax_low-C1_low, 1/C2))/(ymax_low-C1_high);
502 dNdy=C0_low/pow(y-C1_low, 1/C2);
504 else if(y>=ymax_low && y<1.){
506 dNdy=C0_high/(y-C1_high);
510 cout<<
"y value is outside of the domain of y.\n";
513 else if(nu_nubar==1){
515 W=fabs( (ymax_high-C1_high)/(ymin_high-C1_high));
516 B=(pow(ymax_low-C1_low, 1/C2)/(ymax_low-C1_high));
517 T=B*((pow(ymax_low-C1_low, U)-pow(ymin_low-C1_low, U) )/U)+log(W);
519 C0_lowbar=C0_highbar*(pow(ymax_low-C1_low, 1/C2))/(ymax_low-C1_high);
523 dNdy=C0_lowbar/pow(y-C1_low, 1/C2);
525 else if(y>=ymax_low && y<1.){
527 dNdy=C0_highbar/(y-C1_high);
531 cout<<
"y value is outside of the domain of y.\n";
535 cout<<
"Nu_nubar is not defined!\n";
double c4[2][2]
Table V of Connolly et al. for Eq. 7.
int currentint
Ditto - Stephen.
double c2[2][2]
Table V of Connolly et al. for Eq. 7.
double A_low[4]
Table V of Connolly et al. for use in Eq. 16. Same for any nu_nubar and current type.
int GetSigma(double pnu, double &sigma, double &len_int_kgm2, Settings *settings1, int nu_nubar, int currentint)
Neutrino-nucleon cross-sections using model chosen.
double A0_high[2][2]
Table V of Connolly et al. for use in Eq. 16.
double costheta_nutraject
theta of nnu with earth center to balloon as z axis
string GetCurrent()
choose CC or NC: get from ratios in Ghandi etal paper, updated for the CTEQ6-DIS parton distribution ...
~Primaries()
*primary1 must be manually deleted in icemc for deconstructor to actually be called.
Reads in and stores input settings for the run.
double b1
Eq. 17 of Connolly et al.
double mine[NSIGMAS]
minimum energy for cross section parametrizations, in eV
Functions you need to generate a primary interaction including cross sections and picking charged cur...
This class is a 3-vector that represents a position on the Earth's surface.
double pickY(Settings *settings1, double pnu, int nu_nubar, int currentint)
pick inelasticity y according to chosen model
double b0
Eq. 17 of Connolly et al.
double c3[2][2]
Table V of Connolly et al. for Eq. 7.
double Getyweight(double pnu, double y, int nu_nubar, int currentint)
in case you choose y from a flat distribution, this is the weight you should give it according to Con...
int nuflavorint
Added by Stephen for output purposes.
double phi_nutraject
phi of nnu with earth center to balloon as z axis
Inelasticity distributions: stores parametrizations and picks inelasticities.
void PickAnyDirection()
Constructor.
double pickY(Settings *settings1, double pnu, int nu_nubar, int currentint)
pick inelasticity y according to chosen model
string nuflavor
neutrino flavor
double c1[2][2]
Table V of Connolly et al. for Eq. 7.
This class represents a three-vector. Operators are overloaded to provide for the familiar operations...
double A3_high[2][2]
Table V of Connolly et al. for use in Eq. 16.
string GetNuFlavor()
pick a neutrino type, flavor ratio 1:1:1
double maxe[NSIGMAS]
minimum energy for cross section parametrizations, in eV
Handles event counting as cuts are made.
double Getyweight(double pnu, double y, int nu_nubar, int currentint)
If you want to choose y from a flat distribution this is the weight it should have according to Conno...
double A1_high[2][2]
Table V of Connolly et al. for use in Eq. 16.
double c0[2][2]
Table V of Connolly et al. for Eq. 7.
double A2_high[2][2]
Table V of Connolly et al. for use in Eq. 16.
Vector nnu
direction of neutrino (+z in south pole direction)