Exemple #1
0
static double calcSpectrum0(char *name1,char*name2, int forSun,   double *Spectranu, double *SpectraNu)
{
  int i,k;
  double vcsSum=0; 
  int ntot,err;
  double * v_cs;
  
  char name1L[10],name2L[10], lib[20],process[400];
  numout * libPtr;
  
  for(i=0;i<NZ;i++) Spectranu[i]=SpectraNu[i]=0;  

  pname2lib(name1,name1L);
  pname2lib(name2,name2L);
  sprintf(lib,"omg_%s%s",name1L,name2L);
  sprintf(process,"%s,%s->AllEven,1*x{%s",name1,name2,EvenParticles());
// Warning!!   in should be done in the same manner as annihilation libraries for Omega
  libPtr=getMEcode(0,ForceUG,process,NULL,NULL,lib);
  
  
  if(!libPtr) return 0;
  passParameters(libPtr);
  procInfo1(libPtr,&ntot,NULL,NULL); 

  
  v_cs=malloc(sizeof(double)*ntot);
  (*libPtr->interface->twidth)=0;
  
  for(k=0;k<ntot;k++)
  { double m[4];
    char *N[4];
    procInfo2(libPtr,k+1,N,m);
    if((m[2]+m[3])/(m[0]+m[1])<1)
    { 
#ifdef V0    
      v_cs[k]=V0*cs22(libPtr,k+1,V0*m[0]/2,-1.,1.,&err);
#else 
      v_cs[k]= vcs22(libPtr,k+1,&err);
#endif 
      if(v_cs[k]<0) v_cs[k]=0; 
      vcsSum+=v_cs[k];
    } else v_cs[k]=-1;
  }
   
  for(k=0;k<ntot ;k++) if(v_cs[k]>=0)
  { char * N[4];
    double m[4];
    int l, charge3[2],spin2[2],cdim[2],pdg[2];
    int PlusAok=0;

    procInfo2(libPtr,k+1,N,m);
    for(l=0;l<2;l++)  pdg[l]=qNumbers(N[2+l],spin2+l,charge3+l,NULL);

            
    if(v_cs[k]>1.E-3*vcsSum) 
    {  double tab2[NZ]; 
#ifdef PRINT
       { char txt[100];
         sprintf(txt,"%s,%s -> %s %s", N[0],N[1],N[2],N[3]);
         printf("  %-20.20s  %.2E\n",txt,v_cs[k]*2.9979E-26);
       }
#endif       
       for(l=0;l<2;l++) switch(abs(pdg[l]))  
       {  
         case 12: case 14: case 16:
         if(pdg[l]>0)
         {
           basicNuSpectra(forSun,pdg[l],1,tab2);   
           for(i=0;i<NZ;i++) Spectranu[i]+=tab2[i]*v_cs[k]/vcsSum;
         } else 
         {      
           basicNuSpectra(forSun,pdg[l],-1,tab2);
           for(i=0;i<NZ;i++) SpectraNu[i]+=tab2[i]*v_cs[k]/vcsSum;
         }  
         break;
         default:   
         basicNuSpectra(forSun,pdg[l],1,tab2);
          for(i=0;i<NZ;i++) Spectranu[i]+=0.5*tab2[i]*v_cs[k]/vcsSum;
         basicNuSpectra(forSun,pdg[l],-1,tab2);
          for(i=0;i<NZ;i++) SpectraNu[i]+=0.5*tab2[i]*v_cs[k]/vcsSum;    
       }
    } 
  }
  
  free(v_cs);
  return  vcsSum*2.9979E-26;
}
Exemple #2
0
int main(int argc,char** argv)
{  int err;
   char cdmName[10];
   int spin2, charge3,cdim;

  ForceUG=0;  /* to Force Unitary Gauge assign 1 */
  
  if(argc< 2)
  { 
      printf(" Correct usage:  ./main  <file with parameters>    \n");
      printf("Example: ./main data1.par \n");
      exit(1);
  }
                               
  err=readVar(argv[1]);
  
   
  if(err==-1)     {printf("Can not open the file\n"); exit(1);}
  else if(err>0)  { printf("Wrong file contents at line %d\n",err);exit(1);}
           
  err=sortOddParticles(cdmName);
  if(err) { printf("Can't calculate %s\n",cdmName); return 1;}
  
   qNumbers(cdmName, &spin2, &charge3, &cdim);
   printf("\nDark matter candidate is '%s' with spin=%d/2\n",
    cdmName,       spin2); 
   if(charge3) { printf("Dark Matter has electric charge %d*3\n",charge3); exit(1);}
   if(cdim!=1) { printf("Dark Matter ia a color particle\n"); exit(1);}
#ifdef MASSES_INFO
{
  printf("\n=== MASSES OF HIGG AND ODD PARTICLES: ===\n");
  printHiggs(stdout);
  printMasses(stdout,1);
}
#endif

#ifdef OMEGA
{ int fast=1;
  double Beps=1.E-5, cut=0.0001;
  double Omega,Xf;   
//  deltaY=4.4E-13;

// to exclude processes with virtual W/Z in DM   annihilation      
     VZdecay=0; VWdecay=0; cleanDecayTable(); 

// to include processes with virtual W/Z  also  in co-annihilation 
//   VZdecay=2; VWdecay=2; cleanDecayTable(); 

  printf("\n==== Calculation of relic density =====\n");  
  Omega=darkOmega(&Xf,fast,Beps);
  printf("Xf=%.2e Omega=%.2e\n",Xf,Omega);
  printChannels(Xf,cut,Beps,1,stdout);   
  
  VZdecay=1; VWdecay=1; cleanDecayTable();  // restore default
}
#endif

#ifdef INDIRECT_DETECTION
{ 
  int err,i;
  double Emin=1,/* Energy cut  in GeV   */  sigmaV;
  double vcs_gz,vcs_gg;
  char txt[100];
  double SpA[NZ],SpE[NZ],SpP[NZ];
  double FluxA[NZ],FluxE[NZ],FluxP[NZ];
  double * SpNe=NULL,*SpNm=NULL,*SpNl=NULL;
  double Etest=Mcdm/2;
  
printf("\n==== Indirect detection =======\n");  

  sigmaV=calcSpectrum(4,SpA,SpE,SpP,SpNe,SpNm,SpNl ,&err);
    /* Returns sigma*v in cm^3/sec.     SpX - calculated spectra of annihilation.
       Use SpectdNdE(E, SpX) to calculate energy distribution in  1/GeV units.
       
       First parameter 1-includes W/Z polarization
                       2-includes gammas for 2->2+gamma
                       4-print cross sections             
    */
  printf("sigmav=%.2E[cm^3/s] = %.2E[pb] \n", sigmaV, sigmaV/2.9979E-26);  


  if(SpA)
  { 
     double fi=0.1,dfi=0.05; /* angle of sight and 1/2 of cone angle in [rad] */ 

     gammaFluxTab(fi,dfi, sigmaV, SpA,  FluxA);     
     printf("Photon flux  for angle of sight f=%.2f[rad]\n"
     "and spherical region described by cone with angle %.2f[rad]\n",fi,2*dfi);
#ifdef SHOWPLOTS
     sprintf(txt,"Photon flux[cm^2 s GeV]^{1} at f=%.2f[rad], cone angle %.2f[rad]",fi,2*dfi);
     displaySpectrum(FluxA,txt,Emin,Mcdm);
#endif
     printf("Photon flux = %.2E[cm^2 s GeV]^{-1} for E=%.1f[GeV]\n",SpectdNdE(Etest, FluxA), Etest);       
  }

  if(SpE)
  { 
    posiFluxTab(Emin, sigmaV, SpE,  FluxE);
#ifdef SHOWPLOTS     
    displaySpectrum(FluxE,"positron flux [cm^2 s sr GeV]^{-1}" ,Emin,Mcdm);
#endif
    printf("Positron flux  =  %.2E[cm^2 sr s GeV]^{-1} for E=%.1f[GeV] \n",
    SpectdNdE(Etest, FluxE),  Etest);           
  }
  
  if(SpP)
  { 
    pbarFluxTab(Emin, sigmaV, SpP,  FluxP  ); 
#ifdef SHOWPLOTS    
     displaySpectrum(FluxP,"antiproton flux [cm^2 s sr GeV]^{-1}" ,Emin, Mcdm);
#endif
    printf("Antiproton flux  =  %.2E[cm^2 sr s GeV]^{-1} for E=%.1f[GeV] \n",
    SpectdNdE(Etest, FluxP),  Etest);             
  }
}  
#endif

#ifdef RESET_FORMFACTORS
{
/* 
   The user has approach to form factors  which specifies quark contents 
   of  proton and nucleon via global parametes like
      <Type>FF<Nucleon><q>
   where <Type> can be "Scalar", "pVector", and "Sigma"; 
         <Nucleon>     "P" or "N" for proton and neutron
         <q>            "d", "u","s"

   calcScalarQuarkFF( Mu/Md, Ms/Md, sigmaPiN[MeV], sigmaS[MeV])  
   calculates and rewrites Scalar form factors
*/
  printf("\n======== RESET_FORMFACTORS ======\n");
 
  printf("protonFF (default) d %.2E, u %.2E, s %.2E\n",ScalarFFPd, ScalarFFPu,ScalarFFPs);                               
  printf("neutronFF(default) d %.2E, u %.2E, s %.2E\n",ScalarFFNd, ScalarFFNu,ScalarFFNs);

  calcScalarQuarkFF(0.46,27.5,34.,42.);

//  To restore default form factors of  version 2  call 
//  calcScalarQuarkFF(0.553,18.9,55.,243.5);
 
  printf("protonFF (new)     d %.2E, u %.2E, s %.2E\n",ScalarFFPd, ScalarFFPu,ScalarFFPs);                               
  printf("neutronFF(new)     d %.2E, u %.2E, s %.2E\n",ScalarFFNd, ScalarFFNu,ScalarFFNs);
}
#endif

#ifdef CDM_NUCLEON
{ double pA0[2],pA5[2],nA0[2],nA5[2];
  double Nmass=0.939; /*nucleon mass*/
  double SCcoeff;        

printf("\n==== Calculation of CDM-nucleons amplitudes  =====\n");   

    nucleonAmplitudes(CDM1,NULL, pA0,pA5,nA0,nA5);
    printf("CDM[antiCDM]-nucleon micrOMEGAs amplitudes:\n");
    printf("proton:  SI  %.3E [%.3E]  SD  %.3E [%.3E]\n",pA0[0], pA0[1],  pA5[0], pA5[1] );
    printf("neutron: SI  %.3E [%.3E]  SD  %.3E [%.3E]\n",nA0[0], nA0[1],  nA5[0], nA5[1] ); 

  SCcoeff=4/M_PI*3.8937966E8*pow(Nmass*Mcdm/(Nmass+ Mcdm),2.);
    printf("CDM[antiCDM]-nucleon cross sections[pb]:\n");
    printf(" proton  SI %.3E [%.3E] SD %.3E [%.3E]\n",
       SCcoeff*pA0[0]*pA0[0],SCcoeff*pA0[1]*pA0[1],3*SCcoeff*pA5[0]*pA5[0],3*SCcoeff*pA5[1]*pA5[1]);
    printf(" neutron SI %.3E [%.3E] SD %.3E [%.3E]\n",
       SCcoeff*nA0[0]*nA0[0],SCcoeff*nA0[1]*nA0[1],3*SCcoeff*nA5[0]*nA5[0],3*SCcoeff*nA5[1]*nA5[1]);

}
#endif
  
#ifdef CDM_NUCLEUS
{ double dNdE[300];
  double nEvents;

printf("\n======== Direct Detection ========\n");    

  nEvents=nucleusRecoil(Maxwell,73,Z_Ge,J_Ge73,SxxGe73,NULL,dNdE);

  printf("73Ge: Total number of events=%.2E /day/kg\n",nEvents);
  printf("Number of events in 10 - 50 KeV region=%.2E /day/kg\n",
                                   cutRecoilResult(dNdE,10,50));
                                                                                                         
#ifdef SHOWPLOTS
    displayRecoilPlot(dNdE,"Distribution of recoil energy of 73Ge",0,199);
#endif

  nEvents=nucleusRecoil(Maxwell,131,Z_Xe,J_Xe131,SxxXe131,NULL,dNdE);

  printf("131Xe: Total number of events=%.2E /day/kg\n",nEvents);
  printf("Number of events in 10 - 50 KeV region=%.2E /day/kg\n",
                                   cutRecoilResult(dNdE,10,50));                                   
#ifdef SHOWPLOTS
    displayRecoilPlot(dNdE,"Distribution of recoil energy of 131Xe",0,199);
#endif

  nEvents=nucleusRecoil(Maxwell,23,Z_Na,J_Na23,SxxNa23,NULL,dNdE);

  printf("23Na: Total number of events=%.2E /day/kg\n",nEvents);
  printf("Number of events in 10 - 50 KeV region=%.2E /day/kg\n",
                                   cutRecoilResult(dNdE,10,50));                                   
#ifdef SHOWPLOTS
    displayRecoilPlot(dNdE,"Distribution of recoil energy of 23Na",0,199);
#endif

  nEvents=nucleusRecoil(Maxwell,127,Z_I,J_I127,SxxI127,NULL,dNdE);

  printf("I127: Total number of events=%.2E /day/kg\n",nEvents);
  printf("Number of events in 10 - 50 KeV region=%.2E /day/kg\n",
                                   cutRecoilResult(dNdE,10,50));                                   
#ifdef SHOWPLOTS
    displayRecoilPlot(dNdE,"Distribution of recoil energy of 127I",0,199);
#endif
  
}
#endif 

#ifdef NEUTRINO
{ double nu[NZ], nu_bar[NZ],mu[NZ];
  double Ntot;
  int forSun=1;
  double Emin=0.01;

  printf("\n===============Neutrino Telescope=======  for  ");
  if(forSun) printf("Sun\n"); else printf("Earth\n");
  
  err=neutrinoFlux(Maxwell,forSun, nu,nu_bar);
#ifdef SHOWPLOTS
  displaySpectrum(nu,"nu flux from Sun [1/Year/km^2/GeV]",Emin,Mcdm);
  displaySpectrum(nu_bar,"nu-bar from Sun [1/Year/km^2/GeV]",Emin,Mcdm);
#endif
{ double Ntot;
  double Emin=10; //GeV
  spectrInfo(Emin/Mcdm,nu, &Ntot,NULL);
    printf(" E>%.1E GeV neutrino flux       %.3E [1/Year/km^2] \n",Emin,Ntot);
  spectrInfo(Emin/Mcdm,nu_bar, &Ntot,NULL);
    printf(" E>%.1E GeV anti-neutrino flux  %.3E [1/Year/km^2]\n",Emin,Ntot);
}

/* Upward events */

  muonUpward(nu,nu_bar, mu);
#ifdef SHOWPLOTS  
  displaySpectrum(mu,"Upward muons[1/Year/km^2/GeV]",1,Mcdm/2);
#endif
  { double Ntot;
    double Emin=1; //GeV
    spectrInfo(Emin/Mcdm,mu, &Ntot,NULL);
    printf(" E>%.1E GeV Upward muon flux    %.3E [1/Year/km^2]\n",Emin,Ntot);
  }

/* Contained events */
  muonContained(nu,nu_bar,1., mu);
#ifdef SHOWPLOTS  
  displaySpectrum(mu,"Contained  muons[1/Year/km^3/GeV]",Emin,Mcdm);
#endif
  { double Ntot;
    double Emin=1; //GeV
    spectrInfo(Emin/Mcdm,mu, &Ntot,NULL);
    printf(" E>%.1E GeV Contained muon flux %.3E [1/Year/km^3]\n",Emin,Ntot);
  }
}
#endif

#ifdef DECAYS
{  
  txtList L;
   double width,br;
   char * pname;   
   printf("\n================= Decays ==============\n");

   pname = "h";
   width=pWidth(pname,&L);
   printf("\n%s :   total width=%.3E \n and Branchings:\n",pname,width);
   printTxtList(L,stdout);

   pname = "~L";
   width=pWidth(pname,&L);
   printf("\n%s :   total width=%.3E \n and Branchings:\n",pname,width);
   printTxtList(L,stdout);
}
#endif


#ifdef CROSS_SECTIONS
{ double v0=0.001, Pcm=Mcdm*v0/2,cs;
  int err;
  numout*cc;

  cc=newProcess("~n,~N->W+,W-");
  passParameters(cc);
  cs=v0*cs22(cc,1,0.001*Mcdm/2,-1.,1.,&err);
  printf("cs=%e\n",cs);
}
#endif
  killPlots();
  return 0;
}
Exemple #3
0
double vSigmaCC(double T,numout* cc)
{
  int i,err,n,n0,m,w;
  char*s, *pname[6];
  int pdg[6];
  double msum;
  double a=0,factor,dMax=0;
  int spin2,cdim,neutral1,neutral2;
  double oldQ;
  
  double bEps=1.E-4;
  double dI;
      
  CI=cc->interface; 
  T_=T;

  if(passParameters(cc)) return -1;
  if(Qaddress && CI->nout==2) 
  {  oldQ=*Qaddress;
     for(i=0;i<2;i++) pname[i]=CI->pinf(1,i+1,pmass+i,pdg+i);
     *Qaddress=pmass[0]+pmass[1];
     calcMainFunc();
     if(passParameters(cc)) return -1;
  }
  
  for(i=0;i<2+CI->nout;i++) pname[i]=CI->pinf(1,i+1,pmass+i,pdg+i);  
 
  M1=pmass[0];
  M2=pmass[1];
  for(i=2,msum=0;i<CI->nout;i++) msum+=pmass[i];
  
  sqrtSmin=M1+M2;
  
  if(msum > sqrtSmin)
  { if(T==0) return 0; else sqrtSmin=msum; }
  sqrtSmax=sqrtSmin-T*log(bEps); 

  n0=0; 
  if(CI->nout>2) for(n=1;(s=CI->den_info(1,n,&m,&w));n++)
  { double d=sing2(s,CI->nout,CI->va[m],CI->va[w]); 
    if(!isfinite(d)) { printf("non-integrable pole\n"); return 0;}
    if(d>dMax){ dMax=d; n0=n;} 
  }

  switch(CI->nout)
  { 
     case 2:
       if(T==0) a=vcs22(cc,1,&err); else
       {  double eps=1.E-3;
          sqme22=CI->sqme;
          nsub22=1;    
          a=simpson(u_integrand_,0.,1.,eps)*3.8937966E8;
       }   
       break;
     case 3:
     {  
        if(n0)
        {  s=CI->den_info(1,n0,&m,&w);
           for(i3=2;i3<5;i3++) if(i3!=s[0]-1 && i3!=s[1]-1) break;
           for(i4=2;i4<4;i4++) if(i4!=i3) break;   
           for(i5=i4+1;i5<=4;i5++) if(i5!=i3) break;    
        } else {i3=2;i4=3;i5=4;}
        printf("i3,i4,i5=%d %d %d\n",i3,i4,i5);
        
        if(T==0) a=vegas_chain(3, vsigma23integrand0 ,2000,1., 0.03,&dI);
        else     a=vegas_chain(5, vsigma23integrandT ,2000,1., 0.03,&dI);
        break;
     }
     case 4:
         if(n0) 
         {  s=CI->den_info(1,n0,&m,&w);
            i3=s[0]-1;
            i4=s[1]-1;
            for(i5=2;i5<5;i5++)  if(i5!=i3 && i5!=i4) break;
            for(i6=i5+1;i6<=5;i6++) if(i6!=i3 && i6!=i4) break;
         }else { i3=2;i4=3;i5=4;i6=5;} 
         printf("i3,i4,i5,i6= %d %d %d %d\n", i3,i4,i5,i6); 
         if(T==0) a=vegas_chain(6, vsigma24integrand0 ,4000,1., 0.03,&dI);
         else     a=vegas_chain(8, vsigma24integrandT ,5000,1., 0.03,&dI);
                                
     break;
     default:
        printf("Too many outgoing particles\n");
        a=0;  
   }  
//   WIDTH_FOR_OMEGA=0;
   if(Qaddress && CI->nout==2) { *Qaddress=oldQ; calcMainFunc();}
  
   return a;
}