demo3.py
Go to the documentation of this file.
1 # Oscillate the spectrum (numu CC component only)
2 
3 import cafana
4 
5 import math
6 
7 import ROOT
8 
9 
10 fname = 'prod_sumdecaf_R17-03-01-prod3reco.k_fd_genie_nonswap_fhc_nova_v08_full_nue_or_numu_or_nus_contain_v1'
11 
12 loader = cafana.SpectrumLoader(fname)
13 
14 bins = cafana.Binning.Simple(100, 0, 1000)
15 
16 
17 nhit = cafana.Spectrum('Number of hits in slice', bins, loader, cafana.kNHit, cafana.kIsNumuCC)
18 
19 sosc = cafana.OscillatableSpectrum('Number of hits in slice', bins, loader, cafana.kNHit, cafana.kIsNumuCC)
20 
21 loader.Go()
22 
23 pot = 18e20
24 
25 sosc.ToTH2(pot).Draw('colz');
26 
27 # Make a calculator. This is the fastest variant
28 calc = cafana.osc.OscCalcPMNSOpt()
29 
30 calc.SetL(810)
31 calc.SetRho(2.75)
32 calc.SetDmsq21(7.6e-5)
33 calc.SetDmsq32(2.35e-3)
34 calc.SetTh12(math.asin(math.sqrt(.87))/2)
35 calc.SetTh13(math.asin(math.sqrt(.10))/2)
36 calc.SetTh23(ROOT.TMath.Pi()/4)
37 calc.SetdCP(0)
38 
39 # Can oscillate a spectrum (numu->numu)
40 soscd = sosc.Oscillated(calc, 14, 14)
41 h = soscd.ToTH1(pot)
42 h.SetLineColor(ROOT.kRed)
43 canv = ROOT.TCanvas()
44 nhit.ToTH1(pot).Draw('hist')
45 h.Draw('hist same')
46 
tree Draw("slc.nhit")