5 #include "CAFAna/Core/HistAxis.h" 8 #include "CAFAna/Core/Binning.h" 9 #include "CAFAna/Core/Cut.h" 12 #include "CAFAna/Cuts/NueCutsSecondAna.h" 27 #include "TEfficiency.h" 33 #include "Utilities/func/MathUtil.h" 41 if (sr->
mc.
nnu == 0)
return false;
47 if ((planesA.first != planesB.first) || (planesA.second != planesB.second))
49 if ((planesA.second - planesA.first + 1)/64 < 14)
return false;
50 if (sr->
mc.
nu[0].vtx.x < - 100)
return false;
51 if (sr->
mc.
nu[0].vtx.x > 100)
return false;
52 if (sr->
mc.
nu[0].vtx.y < - 100)
return false;
53 if (sr->
mc.
nu[0].vtx.y > 100)
return false;
54 if (sr->
mc.
nu[0].vtx.z < 1000)
return false;
55 if (sr->
mc.
nu[0].vtx.z > 3500)
return false;
62 if (sr->
mc.
nnu == 0)
return false;
63 if (sr->
mc.
nu[0].vtx.x < - 762)
return false;
64 if (sr->
mc.
nu[0].vtx.x > 763)
return false;
65 if (sr->
mc.
nu[0].vtx.y < - 762)
return false;
66 if (sr->
mc.
nu[0].vtx.y > 763)
return false;
72 if ((planesA.first != planesB.first) || (planesA.second != planesB.second))
74 if ((planesA.second - planesA.first + 1)/64 < 4)
return false;
75 int first = planesA.first/64;
76 int last = (planesA.second +1)/64;
77 if (sr->
mc.
nu[0].vtx.z < ((first)*426.0))
return false;
78 if (sr->
mc.
nu[0].vtx.z > ((last)*426.0))
return false;
90 if ((planesA.first != planesB.first) || (planesA.second != planesB.second))
92 size = (planesA.second - planesA.first + 1)/64;
98 TH1::SetDefaultSumw2();
99 TH2::SetDefaultSumw2();
105 hSig->SetLineColor(
kRed-10);
112 TH1D* hN =
new TH1D(
"hN_"+title,
"Nue CC selection efficiency;diblocks;efficiency",11,3.5,14.5);
113 TH1D* hD =
new TH1D(
"hD_"+title,
"Nue CC selection efficiency;diblocks;efficiency",11,3.5,14.5);
114 for(
unsigned int i=5;
i<16;++
i){
115 for(
unsigned int j=0;
j<hSigSel->GetBinContent(
i);++
j){
118 for(
unsigned int j=0;
j<hSig->GetBinContent(
i);++
j){
130 TH1::SetDefaultSumw2();
131 TH2::SetDefaultSumw2();
140 loader_fdmc.
SetLoaderPath(
"prod_caf_R17-03-01-prod3reco.l_fd_genie_fluxswap_fhc_nova_v08_full_v1",
177 TFile
file(
"fd_fiducial_mass_efficiency.root",
"RECREATE");
185 GetExtrap(predAll,predSel, &calc,
"FidMass");
187 GetExtrap(predIdealAll,predIdealSel, &calc,
"SmallWindow");
Far Detector at Ash River.
Cuts and Vars for the 2020 FD DiF Study.
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.
Collection of SpectrumLoaders for many configurations.
General interface to oscillation calculators.
caf::Proxy< std::vector< caf::SRNeutrino > > nu
caf::Proxy< short int > nnu
void Go()
Call Go() on all the loaders.
void SetSpillCut(const SpillCut &cut)
Charged-current interactions.
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;})
Simple oscillation probability calculator that has no solar term or mass hierarchy or delta so it's s...
caf::Proxy< unsigned int > lastplane
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.
void fiducial_accounting()
caf::Proxy< caf::SRTruthBranch > mc
caf::Proxy< caf::SRSlice > slc
void GetExtrap(PredictionNoExtrap *all, PredictionNoExtrap *sel, osc::IOscCalc *calc, TString title)
std::pair< int, int > calcFirstLastLivePlane(int plane, std::bitset< 14 > binary, caf::Det_t det)
const Cut kNue2017CorePresel
Full preselection for 2017 "core" sample with Cut-based CosRej.
Both neutrinos and antineutrinos.
caf::Proxy< unsigned int > firstplane
const SpillCut kStandardSpillCuts
Apply this unless you're doing something special.
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;})
void SetLoaderPath(const std::string &path, caf::Det_t det, DataMC datamc, DataSource src=kBeam, SwappingConfig swap=kNonSwap)
Configure loader via wildcard path.
static Binning Simple(int n, double lo, double hi, const std::vector< std::string > &labels={})