geoneutrinos / reactors

Port/cleanup of the reactor page as an independent repo
2 stars 1 forks source link

IBD/ES tab- Neutrino Cross Section pane- Implement Scattered Lepton T_max slider #336

Closed stdye closed 2 years ago

stdye commented 2 years ago

Scattered lepton T_min and T_max values define the signal and background spectrums at a given detector location.

Scattered lepton T_min and T_max should replace Antineutrino Energy Minimum and Antineutrino Energy Maximum on the Output Calculator.

Detectors measure the kinetic energy of the scattered lepton.

stdye commented 2 years ago

Step 1 of implementation could be for 8B solar neutrinos only.

To get NIU (T_min < T_e < T_max) using the single slider for T_min users need to subtract the result with the slider set to T_max from the result with the slider set to T_min.

My Fortran code below performs the calculation in one pass by simply setting the appropriate upper limit to the numerical integration- Eq 13 in https://arxiv.org/pdf/1510.05633.pdf

c seconds per solar year
      secpsoly=365.24219340277d0*24.d0*3600.d0
c seconds per mean calendar year
      secpcaly=365.25d0*24.d0*3600.d0
      telo=2.5d0
      tehi=16.d0
      sumra=0.d0
      do j=1,155
         ymin=telo/ener(j)
         ymax=1.d0/(1.d0+0.5d0*emass/ener(j))
         if(ymax.gt.tehi/ener(j)) ymax=tehi/ener(j)
         if(ymin.lt.ymax)then
            termin=cl*cl*ymin
            termin=termin+cr*cr/3.d0*(1.d0-(1.d0-ymin)**3)
            termin=termin-cl*cr*0.5d0*emass*ymin*ymin/ener(j)
            termax=cl*cl*ymax
            termax=termax+cr*cr/3.d0*(1.d0-(1.d0-ymax)**3)
            termax=termax-cl*cr*0.5d0*emass*ymax*ymax/ener(j)
            rate(j)=spec(j)*pref*ener(j)*(termax-termin)
            sumra=sumra+rate(j)
c            print *,j,ener(j),spec(j),sumnu,term,rate(j),sumra
            snus=rate(j)*flux*dble(nsecpy)*1.d32
         end if
      end do
c      print *,'sumnu',sumnu,'sumra',sumra
c for elastic scattering per kT-y use:
c 1.056e-4 = e-44 (from gterm) x 3.3456e32 (e-/kT_H2O)
      print *,sumra*flux/sumnu*3.343e32*secpcaly,
     +' events/kT(H2O)/y ',telo,'< T_e <',tehi
      print *,sumra*flux/sumnu*1.e32*secpcaly,
     +' NIUcal ',telo,'< T_e <',tehi
      print *,sumra*flux/sumnu*1.e32*secpsoly,
     +' NIUsol ',telo,'< T_e <',tehi 

The result for T_min = 2.5 MeV and T_max = 16 MeV is:

   284.68165301527773       NIUcal    2.5000000000000000      < T_e <   16.000000000000000     
   284.67557284967160       NIUsol    2.5000000000000000      < T_e <   16.000000000000000

The result for T_min = 2.5 MeV and T_max = 6 MeV is:

   188.16314211010291       NIUcal    2.5000000000000000      < T_e <   6.0000000000000000     
   188.15912336476796       NIUsol    2.5000000000000000      < T_e <   6.0000000000000000
stdye commented 2 years ago

Well, the GitHub comment box uses the Fortran multiply symbol * for formatting

DocOtak commented 2 years ago

Check out code block formatting https://docs.github.com/en/github/writing-on-github/working-with-advanced-formatting/creating-and-highlighting-code-blocks (I've edited your comment to use these)

stdye commented 2 years ago

Thanks. That's cool.

stdye commented 2 years ago

I found an example online of someone's code for a double slider (T_min and T_max on a single slider bar) using react-bootstrap. It's kinda cool but not necessary

stdye commented 2 years ago

The new slider needs to communicate with reactors/src/physics/neutrino-cross-section.ts

and the new code in reactors/src/ui/detector-physics.jsx

basically reproduces

const TMinRange = (

Elastic Scattering Tmin:{" "} {crossSection.elasticScatteringTMin.toFixed(1)} MeV { crossSectionDispatch({ arg: "elasticScatteringTMin", value: parseFloat(event.target.value), }); }} > ); with "min" changed to "max" I was hoping you would self assign this one