NuMu2020_BasicPIDPlots_header.h
Go to the documentation of this file.
1 #include "CAFAna/Core/Binning.h"
3 
7 
8 #include "CAFAna/Vars/HistAxes.h"
9 
11 
12 namespace ana {
13 
14  // ---- Define some of my own cuts very quickly....
15  const Cut kTestSuperLoose_PTP([](const caf::SRProxy* sr) {
16  return (kNumuQuality(sr) && kNumuContainFD2017(sr) && sr->sel.remid.pid > 0.2 && sr->sel.cvnloosepreselptp.numuid > 0.2);
17  });
18  const Cut kTestSuperLoose_Old([](const caf::SRProxy* sr) {
19  return (kNumuQuality(sr) && kNumuContainFD2017(sr) && sr->sel.remid.pid > 0.2 && sr->sel.cvnoldpresel .numuid > 0.2);
20  });
21 
22  const Cut kTestLoose_PTP([](const caf::SRProxy* sr) {
23  return (kNumuQuality(sr) && kNumuContainFD2017(sr) && sr->sel.remid.pid > 0.4 && sr->sel.cvnloosepreselptp.numuid > 0.4);
24  });
25  const Cut kTestLoose_Old([](const caf::SRProxy* sr) {
26  return (kNumuQuality(sr) && kNumuContainFD2017(sr) && sr->sel.remid.pid > 0.4 && sr->sel.cvnoldpresel .numuid > 0.4);
27  });
28 
29  const Cut kTestRelax_PTP([](const caf::SRProxy* sr) {
30  return (kNumuQuality(sr) && kNumuContainFD2017(sr) && sr->sel.remid.pid > 0.6 && sr->sel.cvnloosepreselptp.numuid > 0.6 && sr->sel.cosrej.numucontpid2020 > 0.45 );
31  });
32  const Cut kTestRelax_Old([](const caf::SRProxy* sr) {
33  return (kNumuQuality(sr) && kNumuContainFD2017(sr) && sr->sel.remid.pid > 0.6 && sr->sel.cvnoldpresel .numuid > 0.6 && sr->sel.cosrej.numucontpid2020 > 0.45 );
34  });
35 
36  const Cut kNumu2020LoosePTP([](const caf::SRProxy* sr) {
37  return (sr->sel.remid.pid > 0.4 && sr->sel.cvnloosepreselptp.numuid > 0.80);
38  });
39  const Cut kNumu2020OldPresel([](const caf::SRProxy* sr) {
40  return (sr->sel.remid.pid > 0.4 && sr->sel.cvnoldpresel.numuid > 0.84);
41  });
42 
43 
44  // -----------------------------------
45  // Make my PID Plot Cut vector -- 2020
46  std::vector<std::pair<Cut, std::string> > BasicPIDPlots_Cuts( bool isFHC, bool isFD, bool isData ) {
47  // --- Delcare the vector
48  std::vector<std::pair<Cut, std::string> > TrueCuts, SelCuts, MyCuts;
49  TrueCuts.clear(); SelCuts.clear(); MyCuts.clear();
50 
51  // --- Declare the Selection Cuts first.
52  //SelCuts.push_back( std::make_pair( kNoCut, "_NoCut" ) );
53  // Am I looking at the FD or the ND?
54  if (isFD) {
55  SelCuts.push_back( std::make_pair( kNumuQuality&&kNumuContainFD2017, "_QualCont" ) );
56  SelCuts.push_back( std::make_pair( kNumuQuality&&kNumuContainFD2017&&kNumu2020LoosePTP &&kNumu2020CosRej, "_FullLoosePtp" ) );
57  SelCuts.push_back( std::make_pair( kNumuQuality&&kNumuContainFD2017&&kNumu2020OldPresel&&kNumu2020CosRej, "_FullOldPresel" ) );
58 
59  SelCuts.push_back( std::make_pair( kTestSuperLoose_PTP, "_TestSuperLoose_PTP" ) );
60  SelCuts.push_back( std::make_pair( kTestLoose_PTP , "_TestLoose_PTP" ) );
61  SelCuts.push_back( std::make_pair( kTestRelax_PTP , "_TestRelax_PTP" ) );
62  SelCuts.push_back( std::make_pair( kTestSuperLoose_Old, "_TestSuperLoose_Old" ) );
63  SelCuts.push_back( std::make_pair( kTestLoose_Old , "_TestLoose_Old" ) );
64  SelCuts.push_back( std::make_pair( kTestRelax_Old , "_TestRelax_Old" ) );
65 
66  } else {
67  SelCuts.push_back( std::make_pair( kNumuQuality&&kNumuContainND2017, "_QualCont" ) );
68  SelCuts.push_back( std::make_pair( kNumu2020ND , "_FullLoosePtp" ) );
69  SelCuts.push_back( std::make_pair( kNumu2020ND , "_FullOldPresel" ) );
70  }
71  // --- Declare the True Cuts.
72  TrueCuts .push_back( std::make_pair( kNoCut , "_NoTrue" ) );
73  if (!isData) {
74  TrueCuts.push_back( std::make_pair( kHasNeutrino , "_TrueNu" ) );
75  TrueCuts.push_back( std::make_pair( kIsNumuCC && kIsNu , "_TrueNuMu" ) );
76  TrueCuts.push_back( std::make_pair( kIsNumuCC && kIsAntiNu, "_TrueAntiNuMu" ) );
77  }
78  // --- Put them together...
79  for (size_t sel=0; sel<SelCuts.size(); ++sel) {
80  for (size_t tr=0; tr<TrueCuts.size(); ++tr) {
81  Cut kThisCut = SelCuts[sel].first && TrueCuts[tr].first;
82  std::string kThisName = SelCuts[sel].second + TrueCuts[tr].second;
83  MyCuts.push_back( std::make_pair( kThisCut, kThisName ) );
84  }
85  }
86  // --- Write out my list of cuts...
87  //for (size_t cc=0; cc<MyCuts.size(); ++cc) { std::cout << "\t Cut " << cc << " is on " << MyCuts[cc].second << std::endl; }
88 
89  // --- Return the cuts.
90  return MyCuts;
91  }
92 
93  // -----------------------------------
94  // Make my PID Plot Cut vector -- 2019
95  std::vector<std::pair<Cut, std::string> > BasicPIDPlots2019_Cuts( bool isFHC, bool isFD, bool isData ) {
96  // --- Delcare the vector
97  std::vector<std::pair<Cut, std::string> > TrueCuts, SelCuts, MyCuts;
98  TrueCuts.clear(); SelCuts.clear(); MyCuts.clear();
99 
100  // --- Create my true cuts...
101  TrueCuts. push_back( std::make_pair( kNoCut , "_NoTrue" ) );
102  if (!isData) {
103  TrueCuts.push_back( std::make_pair( kHasNeutrino , "_TrueNu" ) );
104  TrueCuts.push_back( std::make_pair( kIsNumuCC && kIsNu , "_TrueNuMu" ) );
105  TrueCuts.push_back( std::make_pair( kIsNumuCC && kIsAntiNu, "_TrueAntiNuMu" ) );
106  }
107  // --- Create my selection cuts...
108  SelCuts.push_back( std::make_pair( kNumuQuality&&kNumuContainND2017, "_QualCont" ) );
109  SelCuts.push_back( std::make_pair( kNumuCutND2018 , "_FullCut" ) );
110  // --- Put them together...
111  for (size_t sel=0; sel<SelCuts.size(); ++sel) {
112  for (size_t tr=0; tr<TrueCuts.size(); ++tr) {
113  Cut kThisCut = SelCuts[sel].first && TrueCuts[tr].first;
114  std::string kThisName = SelCuts[sel].second + TrueCuts[tr].second;
115  MyCuts.push_back( std::make_pair( kThisCut, kThisName ) );
116  }
117  }
118 
119  // --- Write out my list of cuts...
120  //for (size_t cc=0; cc<MyCuts.size(); ++cc) { std::cout << "\t Cut " << cc << " is on " << MyCuts[cc].second << std::endl; }
121 
122  // --- Return the cuts.
123  return MyCuts;
124  }
125 
126  // ----------------------
127  // Declare some binnings.
129  const Binning kSimpBins = Binning::Simple(102, -0.01, 1.01 );
130 
131 } // namespace
caf::Proxy< caf::SRCVNResult > cvnloosepreselptp
Definition: SRProxy.h:1254
const Cut kIsNumuCC(CCFlavSel(14, 14))
Select CC .
const Cut kTestRelax_Old([](const caf::SRProxy *sr){return(kNumuQuality(sr)&&kNumuContainFD2017(sr)&&sr->sel.remid.pid > 0.6 &&sr->sel.cvnoldpresel .numuid > 0.6 &&sr->sel.cosrej.numucontpid2020 > 0.45);})
Represent the binning of a Spectrum&#39;s x-axis.
Definition: Binning.h:16
Cuts and Vars for the 2020 FD DiF Study.
Definition: vars.h:6
const Cut kNumuContainND2017([](const caf::SRProxy *sr){if(!sr->vtx.elastic.IsValid) return false;for(unsigned int i=0;i< sr->vtx.elastic.fuzzyk.nshwlid;++i){TVector3 start=sr->vtx.elastic.fuzzyk.png[i].shwlid.start;TVector3 stop=sr->vtx.elastic.fuzzyk.png[i].shwlid.stop;if(std::min(start.X(), stop.X())< -180.0) return false;if(std::max(start.X(), stop.X()) > 180.0) return false;if(std::min(start.Y(), stop.Y())< -180.0) return false;if(std::max(start.Y(), stop.Y()) > 180.0) return false;if(std::min(start.Z(), stop.Z())< 20.0) return false;if(std::max(start.Z(), stop.Z()) > 1525.0) return false;}if(sr->trk.kalman.ntracks< 1) return false;for(unsigned int i=0;i< sr->trk.kalman.ntracks;++i){if(i==sr->trk.kalman.idxremid) continue;else if(sr->trk.kalman.tracks[i].start.Z() > 1275||sr->trk.kalman.tracks[i].stop.Z() > 1275) return false;}return(sr->trk.kalman.ntracks > sr->trk.kalman.idxremid &&sr->slc.firstplane > 1 &&sr->slc.lastplane< 212 &&sr->trk.kalman.tracks[0].start.Z()< 1100 &&(sr->trk.kalman.tracks[0].stop.Z()< 1275 ||sr->sel.contain.kalyposattrans< 55) &&sr->sel.contain.kalfwdcellnd > 5 &&sr->sel.contain.kalbakcellnd > 10);})
Definition: NumuCuts2017.h:11
const Cut kNumuCutND2018
Definition: NumuCuts2018.h:41
Proxy for caf::StandardRecord.
Definition: SRProxy.h:2126
std::vector< std::pair< Cut, std::string > > BasicPIDPlots_Cuts(bool isFHC, bool isFD, bool isData)
const Cut kNumu2020ND
Definition: NumuCuts2020.h:57
caf::Proxy< float > pid
Definition: SRProxy.h:1136
const Cut kIsAntiNu([](const caf::SRProxy *sr){if(sr->mc.nnu==0) return false;assert(sr->mc.nnu==1);return sr->mc.nu[0].pdg< 0;})
Is this truly an antineutrino?
Definition: TruthCuts.h:53
const Cut kNumu2020LoosePTP([](const caf::SRProxy *sr){return(sr->sel.remid.pid > 0.4 &&sr->sel.cvnloosepreselptp.numuid > 0.80);})
std::pair< Spectrum *, CheatDecomp * > make_pair(SpectrumLoaderBase &loader_data, SpectrumLoaderBase &loader_mc, HistAxis *axis, Cut *cut, const SystShifts &shift, const Var &wei)
Definition: DataMCLoad.C:336
const Cut kTestSuperLoose_PTP([](const caf::SRProxy *sr){return(kNumuQuality(sr)&&kNumuContainFD2017(sr)&&sr->sel.remid.pid > 0.2 &&sr->sel.cvnloosepreselptp.numuid > 0.2);})
const Cut kTestLoose_Old([](const caf::SRProxy *sr){return(kNumuQuality(sr)&&kNumuContainFD2017(sr)&&sr->sel.remid.pid > 0.4 &&sr->sel.cvnoldpresel .numuid > 0.4);})
const Cut kIsNu([](const caf::SRProxy *sr){if(sr->mc.nnu==0) return false;assert(sr->mc.nnu==1);return sr->mc.nu[0].pdg > 0;})
Definition: TruthCuts.h:54
caf::Proxy< caf::SRCosRej > cosrej
Definition: SRProxy.h:1252
const Cut kNumuContainFD2017
Definition: NumuCuts2017.h:21
caf::Proxy< caf::SRCVNResult > cvnoldpresel
Definition: SRProxy.h:1258
const Cut kTestLoose_PTP([](const caf::SRProxy *sr){return(kNumuQuality(sr)&&kNumuContainFD2017(sr)&&sr->sel.remid.pid > 0.4 &&sr->sel.cvnloosepreselptp.numuid > 0.4);})
const Cut kTestRelax_PTP([](const caf::SRProxy *sr){return(kNumuQuality(sr)&&kNumuContainFD2017(sr)&&sr->sel.remid.pid > 0.6 &&sr->sel.cvnloosepreselptp.numuid > 0.6 &&sr->sel.cosrej.numucontpid2020 > 0.45);})
base_types push_back(int_type())
const Binning kSimpBins
_Cut< caf::SRProxy > Cut
Representation of a cut (selection) to be applied to a caf::StandardRecord object.
Definition: Cut.h:96
caf::StandardRecord * sr
caf::Proxy< caf::SRRemid > remid
Definition: SRProxy.h:1269
const Cut kNumu2020CosRej([](const caf::SRProxy *sr){return(sr->sel.cosrej.numucontpid2020 > 0.45);})
Definition: NumuCuts2020.h:22
caf::Proxy< float > numucontpid2020
Definition: SRProxy.h:884
static bool isFHC
const Cut kHasNeutrino([](const caf::SRProxy *sr){return(sr->mc.nnu!=0);})
Check if MC slice has neutrino information (useful for in-and-out tests)
Definition: TruthCuts.h:61
const Binning kOptEnBins
const Binning kNumuCCEOptimisedBinning
Optimised binning for numuCCE from L. Vinton. See docdb 16332. This was close to &#39;custC&#39; in that talk...
Definition: Binnings.cxx:28
const Cut kTestSuperLoose_Old([](const caf::SRProxy *sr){return(kNumuQuality(sr)&&kNumuContainFD2017(sr)&&sr->sel.remid.pid > 0.2 &&sr->sel.cvnoldpresel .numuid > 0.2);})
caf::Proxy< caf::SRIDBranch > sel
Definition: SRProxy.h:2141
const Cut kNumu2020OldPresel([](const caf::SRProxy *sr){return(sr->sel.remid.pid > 0.4 &&sr->sel.cvnoldpresel.numuid > 0.84);})
Template for Cut and SpillCut.
Definition: Cut.h:15
const Cut kNumuQuality
Definition: NumuCuts.h:18
static Binning Simple(int n, double lo, double hi, const std::vector< std::string > &labels={})
Definition: Binning.cxx:107
caf::Proxy< float > numuid
Definition: SRProxy.h:907
const Cut kNoCut
The simplest possible cut: pass everything, used as a default.
Definition: Cut.h:109
std::vector< std::pair< Cut, std::string > > BasicPIDPlots2019_Cuts(bool isFHC, bool isFD, bool isData)
enum BeamMode string