demo4.py
Go to the documentation of this file.
1 # Do a proper prediction, with all the components included
2 
3 import cafana
4 
5 fname = 'prod_sumdecaf_R17-03-01-prod3reco.k_fd_genie_nonswap_fhc_nova_v08_full_nue_or_numu_or_nus_contain_v1'
6 fnameSwap = 'prod_sumdecaf_R17-03-01-prod3reco.k_fd_genie_fluxswap_fhc_nova_v08_period1_nue_or_numu_or_nus_contain_v1'
7 
8 loader = cafana.SpectrumLoader(fname)
9 loaderSwap = cafana.SpectrumLoader(fnameSwap)
10 
11 bins = cafana.Binning.Simple(100, 0, 1000)
12 
13 # All interaction types
14 pred = cafana.PredictionNoExtrap(loader, loaderSwap, 'Number of hits in slice', bins, cafana.kNHit, cafana.kNoCut)
15 
16 # Do it!
17 loader.Go()
18 loaderSwap.Go()
19 
20 pot = 18e20
21 
22 # Get a reasonable calculator
23 calc = cafana.DefaultOscCalc()
24 
25 # What does it predict at these oscillation parameters?
26 spred = pred.Predict(calc)
27 #Add some poisson fluctuations, for fun
28 mock = spred.MockData(pot)
29 # See all the components
30 cafana.DataMCComparisonComponents(mock, pred, calc)
31 
32 # What did it look like unoscillated?
33 pred.PredictUnoscillated().ToTH1(pot).Draw('hist same')
34 
tree Draw("slc.nhit")