8 #include "CAFAna/Core/HistAxis.h" 11 #include "CAFAna/Core/Binning.h" 12 #include "CAFAna/Core/Cut.h" 24 #include "TEfficiency.h" 33 if(sr->
mc.
nnu == 0)
return false;
39 if((planesA.first != planesB.first) || (planesA.second != planesB.second))
41 if((planesA.second - planesA.first + 1)/64 < 14)
return false;
42 if(sr->
mc.
nu[0].vtx.X() < -100)
return false;
43 if(sr->
mc.
nu[0].vtx.X() > 100)
return false;
44 if(sr->
mc.
nu[0].vtx.Y() < -100)
return false;
45 if(sr->
mc.
nu[0].vtx.Y() > 100)
return false;
46 if(sr->
mc.
nu[0].vtx.Z() < 1000)
return false;
47 if(sr->
mc.
nu[0].vtx.Z() > 3500)
return false;
55 if(sr->
mc.
nnu == 0)
return false;
56 if(sr->
mc.
nu[0].vtx.X() < -762)
return false;
57 if(sr->
mc.
nu[0].vtx.X() > 763)
return false;
58 if(sr->
mc.
nu[0].vtx.Y() < -762)
return false;
59 if(sr->
mc.
nu[0].vtx.Y() > 763)
return false;
65 if((planesA.first != planesB.first) || (planesA.second != planesB.second))
67 if((planesA.second - planesA.first + 1)/64 < 4)
return false;
68 int first = planesA.first/64;
69 int last = (planesA.second +1)/64;
70 if(sr->
mc.
nu[0].vtx.Z() < ((first)*426.0))
return false;
71 if(sr->
mc.
nu[0].vtx.Z() > ((last)*426.0))
return false;
84 if((planesA.first != planesB.first) || (planesA.second != planesB.second))
86 size = (planesA.second - planesA.first + 1)/64;
95 TH1::SetDefaultSumw2();
96 TH2::SetDefaultSumw2();
103 hSig->SetLineColor(
kRed-10);
111 TH1D* hSigEff =
new TH1D(
"hSigEff_"+title,
112 "Nus NC Selection Efficiency;Diblocks;Efficiency", 11, 3.5, 14.5);
113 TH1D* hN =
new TH1D(
"hN_"+title,
114 "Nus NC Selection Efficiency;Diblocks;Efficiency", 11, 3.5, 14.5);
115 TH1D* hD =
new TH1D(
"hD_"+title,
116 "Nus NC Selection Efficiency;Diblocks;Efficiency", 11, 3.5, 14.5);
117 for(
unsigned int i = 5;
i < 16; ++
i){
118 for(
unsigned int j = 0;
j < hSigSel->GetBinContent(
i); ++
j){
121 for(
unsigned int j = 0;
j < hSig->GetBinContent(
i); ++
j){
127 hSigEff->Divide(hN, hD, 1.0, 1.0,
"b");
130 for(
unsigned int i = 1;
i < 12; ++
i){
131 float sigN = hN->GetBinContent(
i);
132 float sigD = hD->GetBinContent(
i);
133 float sigE = hSigEff->GetBinContent(
i);
135 <<
" Selected: " << sigN
145 TH1::SetDefaultSumw2();
146 TH2::SetDefaultSumw2();
148 SpectrumLoader loaderFDSwap(
"prod_caf_R17-03-01-prod3reco.l_fd_genie_fluxswap_fhc_nova_v08_full_v1");
150 SpectrumLoader loaderFDNonSwap(
"prod_caf_R17-03-01-prod3reco.l_fd_genie_nonswap_fhc_nova_v08_full_v1");
158 loaderFDNonSwap, loaderFDSwap,
164 loaderFDNonSwap, loaderFDSwap,
170 loaderFDNonSwap, loaderFDSwap,
176 loaderFDNonSwap, loaderFDSwap,
184 loaderFDNonSwap.
Go();
188 TFile
file(outfile.c_str(),
"RECREATE");
193 GetExtrap(predAll, predSel, &calc,
"FidMass");
195 GetExtrap(predIdealAll, predIdealSel, &calc,
"SmallWindow");
Cuts and Vars for the 2020 FD DiF Study.
const std::vector< T > & GetVars() const
TH1D * ToTH1(double exposure, Color_t col=kBlack, Style_t style=kSolid, EExposureType expotype=kPOT, EBinType bintype=kBinContent) const
Histogram made from this Spectrum, scaled to some exposure.
caf::Proxy< caf::SRHeader > hdr
Proxy for caf::StandardRecord.
General interface to oscillation calculators.
caf::Proxy< std::vector< caf::SRNeutrino > > nu
caf::Proxy< short int > nnu
void SetSpillCut(const SpillCut &cut)
void nus17_fiducial_accounting(std::string outfile)
const Cut kBoxCut([](const caf::SRProxy *sr){if(sr->mc.nnu==0) return false;if(sr->mc.nu[0].vtx.x< -762) return false;if(sr->mc.nu[0].vtx.x > 763) return false;if(sr->mc.nu[0].vtx.y< -762) return false;if(sr->mc.nu[0].vtx.y > 763) return false;std::bitset< 14 > binary(sr->hdr.dibmask);std::pair< int, int > planesA=calcFirstLastLivePlane(sr->slc.firstplane, binary);std::pair< int, int > planesB=calcFirstLastLivePlane(sr->slc.lastplane, binary);if((planesA.first!=planesB.first)||(planesA.second!=planesB.second)) return false;if((planesA.second-planesA.first+1)/64< 4) return false;int first=planesA.first/64;int last=(planesA.second+1)/64;if(sr->mc.nu[0].vtx.z< ((first)*426.0)) return false;if(sr->mc.nu[0].vtx.z >((last)*426.0)) return false;return true;})
void GetExtrap(PredictionNoExtrap *all, PredictionNoExtrap *sel, osc::IOscCalc *calc, TString title)
Simple oscillation probability calculator that has no solar term or mass hierarchy or delta so it's s...
virtual void Go() override
Load all the registered spectra.
caf::Proxy< unsigned int > lastplane
const Var kBlock([](const caf::SRProxy *sr){int size=-1;std::bitset< 14 > binary(sr->hdr.dibmask);std::pair< int, int > planesA=calcFirstLastLivePlane(sr->slc.firstplane, binary);std::pair< int, int > planesB=calcFirstLastLivePlane(sr->slc.lastplane, binary);if((planesA.first!=planesB.first)||(planesA.second!=planesB.second)) return size;size=(planesA.second-planesA.first+1)/64;return size;})
const Cut kBoxCutIdeal([](const caf::SRProxy *sr){if(sr->mc.nnu==0) return false;std::bitset< 14 > binary(sr->hdr.dibmask);std::pair< int, int > planesA=calcFirstLastLivePlane(sr->slc.firstplane, binary);std::pair< int, int > planesB=calcFirstLastLivePlane(sr->slc.lastplane, binary);if((planesA.first!=planesB.first)||(planesA.second!=planesB.second)) return false;if((planesA.second-planesA.first+1)/64< 14) return false;if(sr->mc.nu[0].vtx.x< -100) return false;if(sr->mc.nu[0].vtx.x > 100) return false;if(sr->mc.nu[0].vtx.y< -100) return false;if(sr->mc.nu[0].vtx.y > 100) return false;if(sr->mc.nu[0].vtx.z< 1000) return false;if(sr->mc.nu[0].vtx.z > 3500) return false;return true;})
A cut to select only events in a very small central region of the detector.
caf::Proxy< caf::SRTruthBranch > mc
const std::vector< Binning > & GetBinnings() const
caf::Proxy< caf::SRSlice > slc
Collaborates with Spectrum and OscillatableSpectrum to fill spectra from CAF files.
std::pair< int, int > calcFirstLastLivePlane(int plane, std::bitset< 14 > binary, caf::Det_t det)
Neutral-current interactions.
Both neutrinos and antineutrinos.
caf::Proxy< unsigned int > firstplane
const SpillCut kStandardSpillCuts
Apply this unless you're doing something special.
All neutrinos, any flavor.
const Cut kNus17FDPresel
The Nus17 preselection cuts for the Far Detector from docdb 21113.
static Binning Simple(int n, double lo, double hi, const std::vector< std::string > &labels={})
const std::vector< std::string > & GetLabels() const