EnergyCont_macro.C
Go to the documentation of this file.
1 #include "CAFAna/Cuts/Cuts.h"
7 
8 #include "CAFAna/Core/Binning.h"
9 #include "CAFAna/Core/Spectrum.h"
11 
12 #include "CAFAna/Vars/HistAxes.h"
15 #include "CAFAna/Vars/Vars.h"
16 
19 
20 #include "Utilities/rootlogon.C"
21 // A file containing some Vars which I made myself.
23 
24 #include "TCanvas.h"
25 #include "TH2.h"
26 #include "TProfile.h"
27 #include "TSystem.h"
28 
29 using namespace ana;
30 
31 
32 void EnergyCont_macro( bool IsFHC = false, bool IsFarDet = true)
33 {
34 
35  std::string sFHC_RHC = ( IsFHC == true ? "fhc" : "rhc" );
36  std::string sFD_ND = ( IsFarDet == true ? "FD" : "ND" );
37 
38  // --- Define my loader, and the file / dataset which it will load...
39  std::string fname = "";
40  if ( IsFHC ) {
41  if (IsFarDet) {
42  fname = "prod_caf_R17-11-14-prod4reco.d_fd_genie_nonswap_fhc_nova_v08_full_v1"; // full cafs
43 // fname = "prod_sumdecaf_R17-11-14-prod4reco.d_fd_genie_nonswap_fhc_nova_v08_full_v1_numu2018"; // decafs
44  } else {
45  fname = "prod_caf_R17-11-14-prod4reco.d_nd_genie_nonswap_fhc_nova_v08_full_v1";
46 // fname = "prod_sumdecaf_R17-11-14-prod4reco.d_nd_genie_nonswap_fhc_nova_v08_full_v1_numu2018"; // decafs
47  }
48  } else {
49  if (IsFarDet) {
50  fname = "prod_caf_R17-11-14-prod4reco.e_fd_genie_nonswap_rhc_nova_v08_full_v1"; // full cafs
51 // fname = "prod_sumdecaf_R17-11-14-prod4reco.e_fd_genie_nonswap_rhc_nova_v08_full_v1_numu2018"; // decafs
52  } else {
53  fname = "prod_caf_R17-11-14-prod4reco.e_nd_genie_nonswap_rhc_nova_v08_full_v1"; // full cafs
54 // fname = "prod_sumdecaf_R17-11-14-prod4reco.e_nd_genie_nonswap_rhc_nova_v08_full_v1_numu2018"; // decafs
55  }
56  }
57  SpectrumLoader loader(fname);
59 
60  // weights
62  const SystShifts shift = kNoShift;
63 
64  // --- Define my output directory.
65  std::string sOutFile = "SpectrumFiles_"+sFD_ND+"_"+sFHC_RHC+"_Full_finerbinning.root";
66 
67  // --- Define the number of GENIE interaction types I'm looking at....
68  const std::vector<Cut> GENIECuts = { kNoCut };
69  const std::vector<std::string> GENIEStr = { "All" };
70  //const std::vector<Cut> GENIECuts = { kNoCut, kIsDytmanMEC, kIsDIS, kIsRes, kIsCoh, kIsQE };
71  //const std::vector<std::string> GENIEStr = { "All", "MEC", "DIS", "Resonance", "Coherent", "QuasiElactic" };
72  const unsigned int NumGENIE = GENIECuts.size();
73 
74  // --- Define my broad cuts
75  std::vector<std::string> CutNames; std::vector<Cut> kDetCuts;
76  if (IsFarDet) {
77  CutNames.push_back( "FD_Contain" ); kDetCuts.push_back( kNumuQuality && kNumuContainFD2017 );
78  CutNames.push_back( "FD_PID2018" ); kDetCuts.push_back( kNumuQuality && kNumuContainFD2017 && kNumuPID2018 );
79  CutNames.push_back( "FD_CosRej" ); kDetCuts.push_back( kNumuQuality && kNumuContainFD2017 && kNumuPID2018 && kNumuCosmicRej2018 );
80  } else {
81  CutNames.push_back( "ND_Contain" ); kDetCuts.push_back( kNumuQuality && kNumuContainND2017 );
82  CutNames.push_back( "ND_PID2018" ); kDetCuts.push_back( kNumuQuality && kNumuContainND2017 && kNumuPID2018 );
83  }
84  unsigned int nDetCuts = kDetCuts.size();
85 
86  // --- Give some output before I really get started...
87  std::cout << "\n\nLots of input parameters, so I'm going to write them out now....;"
88  << "\n\t IsFHC " << (IsFHC ==true ? "true --> Run in FHC " :"false --> Run in RHC" ) << " ==> sFHC_RHC is " << sFHC_RHC
89  << "\n\t IsFarDet " << (IsFarDet ==true ? "true --> Look at FD " :"false --> Look at ND" ) << " ==> sFD_ND is " << sFD_ND
90  << "\n\n Will load quantile boundaries from " << fname
91  << "\n Will run over " << nDetCuts << " cut tiers."
92  << "\n Will run over " << NumGENIE << " GENIE interaction types."
93  << "\n Will write things to " << sOutFile
94  << "\n\n" << std::endl;
95 
96  // --- Load quantile boundaries.
97  std::string fdspecfile = "/pnfs/nova/persistent/analysis/numu/Ana2018/provisional/quantiles/quantiles__" + sFHC_RHC + "_full__numu2018.root";
98  TFile* inFile = TFile::Open( pnfs2xrootd(fdspecfile.c_str()).c_str() );
99  TH2 *FDSpec2D = (TH2*)inFile->FindObjectAny( "FDSpec2D" );
100  // How many quantiles?
101  const int NHadEFracQuantiles = 4; // defines how many divisions of hadEFrac are used
102  // Make my cuts.
103  std::vector<Cut> HadEFracQuantCuts = QuantileCutsFromTH2(FDSpec2D, kNumuCCOptimisedAxis, kHadEFracAxis, NHadEFracQuantiles);
104  HadEFracQuantCuts.push_back( kNoCut );
105  std::vector<std::string> QuantNames = { "Quant1", "Quant2", "Quant3", "Quant4", "AllQuant" };
106  const unsigned int nQuants = QuantNames.size();
107 
108  // --- Define some bin sets which I want to use....
109  const unsigned int NumEBins = 100;
110  const Binning LepBins = Binning::Simple(NumEBins, 0., 5. );
111  const Binning HadBins = Binning::Simple(NumEBins, 0., 1. );
112  const Binning NumBins = Binning::Simple(11 , -0.5, 10.5);
113  const Binning FracBins = Binning::Simple(200, 0., 1.);
114  const Binning PosBins = Binning::Simple(300, -750, 750);
115 
116  // A cut to remove events with no neutrino truth
117  const Cut kRemoveNoTruth([](const caf::SRProxy* sr) {
118  if (sr->mc.nnu == 0) return false; //if (sr->mc.nu.size() == 0) return false;
119  return true;
120  });
121 
122  // --- Initialize spectra
123  // Multiplicity
124  Spectrum *NumOfNeut[NumGENIE][nDetCuts][nQuants];
125  Spectrum *NumOfProt[NumGENIE][nDetCuts][nQuants];
126  Spectrum *NumOfPion[NumGENIE][nDetCuts][nQuants];
127  Spectrum *NumOfPi0s[NumGENIE][nDetCuts][nQuants];
128 
129  // Energy
130  Spectrum *NeutrinoE[NumGENIE][nDetCuts][nQuants];
131  Spectrum *MuonE [NumGENIE][nDetCuts][nQuants];
132  Spectrum *NeutronE [NumGENIE][nDetCuts][nQuants];
133  Spectrum *ProtonE [NumGENIE][nDetCuts][nQuants];
134  Spectrum *PionE [NumGENIE][nDetCuts][nQuants];
135  Spectrum *Pi0E [NumGENIE][nDetCuts][nQuants];
136  Spectrum *PhotonE [NumGENIE][nDetCuts][nQuants];
137  Spectrum *KaonE [NumGENIE][nDetCuts][nQuants];
138  Spectrum *ElectronE[NumGENIE][nDetCuts][nQuants];
139  Spectrum *MiscE [NumGENIE][nDetCuts][nQuants];
140 
141  // Uncontained energy
142  Spectrum *UncontEn [NumGENIE][nDetCuts][nQuants];
143  Spectrum *UncontMu [NumGENIE][nDetCuts][nQuants];
144  Spectrum *UncontNeu[NumGENIE][nDetCuts][nQuants];
145  Spectrum *UncontPro[NumGENIE][nDetCuts][nQuants];
146  Spectrum *UncontPi [NumGENIE][nDetCuts][nQuants];
147  Spectrum *UncontPi0[NumGENIE][nDetCuts][nQuants];
148  Spectrum *UncontPho[NumGENIE][nDetCuts][nQuants];
149  Spectrum *UncontKa [NumGENIE][nDetCuts][nQuants];
150  Spectrum *UncontEle[NumGENIE][nDetCuts][nQuants];
151  Spectrum *UncontMis[NumGENIE][nDetCuts][nQuants];
152 
153  // Energy fraction
154  Spectrum *MuonEFrac [NumGENIE][nDetCuts][nQuants];
155  Spectrum *NeutronEFrac [NumGENIE][nDetCuts][nQuants];
156  Spectrum *ProtonEFrac [NumGENIE][nDetCuts][nQuants];
157  Spectrum *PionEFrac [NumGENIE][nDetCuts][nQuants];
158  Spectrum *Pi0EFrac [NumGENIE][nDetCuts][nQuants];
159  Spectrum *PhotonEFrac [NumGENIE][nDetCuts][nQuants];
160  Spectrum *KaonEFrac [NumGENIE][nDetCuts][nQuants];
161  Spectrum *ElectronEFrac[NumGENIE][nDetCuts][nQuants];
162 
163  // Uncont. E / total uncont. E
164  Spectrum *UncontMuonEF[NumGENIE][nDetCuts][nQuants];
165  Spectrum *UncontNeutEF[NumGENIE][nDetCuts][nQuants];
166  Spectrum *UncontProtEF[NumGENIE][nDetCuts][nQuants];
167  Spectrum *UncontPionEF[NumGENIE][nDetCuts][nQuants];
168  Spectrum *UncontPi0sEF[NumGENIE][nDetCuts][nQuants];
169  Spectrum *UncontPhotEF[NumGENIE][nDetCuts][nQuants];
170  Spectrum *UncontKaonEF[NumGENIE][nDetCuts][nQuants];
171  Spectrum *UncontElecEF[NumGENIE][nDetCuts][nQuants];
172 
173  // Uncontained E / true nu E
174  Spectrum *UncontTotEFT [NumGENIE][nDetCuts][nQuants];
175  Spectrum *UncontMuonEFT[NumGENIE][nDetCuts][nQuants];
176  Spectrum *UncontNeutEFT[NumGENIE][nDetCuts][nQuants];
177  Spectrum *UncontProtEFT[NumGENIE][nDetCuts][nQuants];
178  Spectrum *UncontPionEFT[NumGENIE][nDetCuts][nQuants];
179  Spectrum *UncontPi0sEFT[NumGENIE][nDetCuts][nQuants];
180  Spectrum *UncontPhotEFT[NumGENIE][nDetCuts][nQuants];
181  Spectrum *UncontKaonEFT[NumGENIE][nDetCuts][nQuants];
182  Spectrum *UncontElecEFT[NumGENIE][nDetCuts][nQuants];
183 
184 
185  // Uncontained energy vs. vertex x, vertex y
186  Spectrum *UncontTotEvsX[NumGENIE][nDetCuts][nQuants];
187  Spectrum *UncontTotEvsY[NumGENIE][nDetCuts][nQuants];
188 
189  // energy fraction vs. true nu E
190  Spectrum *MuonEFracvsTrueE [NumGENIE][nDetCuts][nQuants];
191  Spectrum *NeutronEFracvsTrueE [NumGENIE][nDetCuts][nQuants];
192  Spectrum *ProtonEFracvsTrueE [NumGENIE][nDetCuts][nQuants];
193  Spectrum *PionEFracvsTrueE [NumGENIE][nDetCuts][nQuants];
194  Spectrum *Pi0EFracvsTrueE [NumGENIE][nDetCuts][nQuants];
195  Spectrum *PhotonEFracvsTrueE [NumGENIE][nDetCuts][nQuants];
196  Spectrum *KaonEFracvsTrueE [NumGENIE][nDetCuts][nQuants];
197  Spectrum *ElectronEFracvsTrueE[NumGENIE][nDetCuts][nQuants];
198 
199  // uncont. E / tot. uncont. E vs. true nu E
200  Spectrum *UncontMuonEFvsTrueE[NumGENIE][nDetCuts][nQuants];
201  Spectrum *UncontNeutEFvsTrueE[NumGENIE][nDetCuts][nQuants];
202  Spectrum *UncontProtEFvsTrueE[NumGENIE][nDetCuts][nQuants];
203  Spectrum *UncontPionEFvsTrueE[NumGENIE][nDetCuts][nQuants];
204  Spectrum *UncontPi0sEFvsTrueE[NumGENIE][nDetCuts][nQuants];
205  Spectrum *UncontPhotEFvsTrueE[NumGENIE][nDetCuts][nQuants];
206  Spectrum *UncontKaonEFvsTrueE[NumGENIE][nDetCuts][nQuants];
207  Spectrum *UncontElecEFvsTrueE[NumGENIE][nDetCuts][nQuants];
208 
209  // uncont. E / true nu E vs. true nu E
210  Spectrum *UncontTotEFTvsTrueE [NumGENIE][nDetCuts][nQuants];
211  Spectrum *UncontMuonEFTvsTrueE[NumGENIE][nDetCuts][nQuants];
212  Spectrum *UncontNeutEFTvsTrueE[NumGENIE][nDetCuts][nQuants];
213  Spectrum *UncontProtEFTvsTrueE[NumGENIE][nDetCuts][nQuants];
214  Spectrum *UncontPionEFTvsTrueE[NumGENIE][nDetCuts][nQuants];
215  Spectrum *UncontPi0sEFTvsTrueE[NumGENIE][nDetCuts][nQuants];
216  Spectrum *UncontPhotEFTvsTrueE[NumGENIE][nDetCuts][nQuants];
217  Spectrum *UncontKaonEFTvsTrueE[NumGENIE][nDetCuts][nQuants];
218  Spectrum *UncontElecEFTvsTrueE[NumGENIE][nDetCuts][nQuants];
219 
220  // --- Define my Spectra which are to be filled from the loader
221  for (unsigned int gen=0; gen<NumGENIE; ++gen) {
222  for (unsigned int det=0; det<nDetCuts; ++det) {
223  for (unsigned int quant=0; quant<nQuants; ++quant) {
224  // Define my new cut.
225  Cut GENIECut = kRemoveNoTruth && GENIECuts[gen] && kDetCuts[det] && HadEFracQuantCuts[quant];
226  std::string MyStr = " for GENIE Int. "+GENIEStr[gen]+", Cut "+CutNames[det]+", "+QuantNames[quant];
227 
228  // Multiplicity
229  NumOfNeut[gen][det][quant] = new Spectrum( "Number of neutron" + MyStr, NumBins , loader, kNNeutrons , GENIECut, kNoShift, weight);
230  NumOfProt[gen][det][quant] = new Spectrum( "Number of protons" + MyStr, NumBins , loader, kNProtons , GENIECut, kNoShift, weight);
231  NumOfPion[gen][det][quant] = new Spectrum( "Number of pions" + MyStr, NumBins , loader, kNPions , GENIECut, kNoShift, weight);
232  NumOfPi0s[gen][det][quant] = new Spectrum( "Number of pi0s" + MyStr, NumBins , loader, kNPi0s , GENIECut, kNoShift, weight);
233 
234  // Energy
235  NeutrinoE[gen][det][quant] = new Spectrum( "Neutrino energy (GeV)" + MyStr, LepBins , loader, kNeutrinoEn , GENIECut, kNoShift, weight);
236  MuonE [gen][det][quant] = new Spectrum( "Muon energy (GeV)" + MyStr, LepBins , loader, kMuonEn , GENIECut, kNoShift, weight);
237  NeutronE [gen][det][quant] = new Spectrum( "Neutron energy (GeV)" + MyStr, HadBins , loader, kNeutronEn , GENIECut, kNoShift, weight);
238  ProtonE [gen][det][quant] = new Spectrum( "Proton energy (GeV)" + MyStr, HadBins , loader, kProtonEn , GENIECut, kNoShift, weight);
239  PionE [gen][det][quant] = new Spectrum( "Pion energy (GeV)" + MyStr, HadBins , loader, kPionEn , GENIECut, kNoShift, weight);
240  Pi0E [gen][det][quant] = new Spectrum( "Pi0 energy (GeV)" + MyStr, HadBins , loader, kPi0En , GENIECut, kNoShift, weight);
241  PhotonE [gen][det][quant] = new Spectrum( "Photon energy (GeV)" + MyStr, HadBins , loader, kPhotonEn , GENIECut, kNoShift, weight);
242  KaonE [gen][det][quant] = new Spectrum( "Kaon energy (GeV)" + MyStr, HadBins , loader, kKaonEn , GENIECut, kNoShift, weight);
243  ElectronE[gen][det][quant] = new Spectrum( "Electron energy (GeV)" + MyStr, HadBins , loader, kElectronEn , GENIECut, kNoShift, weight);
244  MiscE [gen][det][quant] = new Spectrum( "Misc energy (GeV)" + MyStr, HadBins , loader, kNuMinusAll , GENIECut, kNoShift, weight);
245 
246  // Uncontained energy
247  UncontEn [gen][det][quant] = new Spectrum( "All uncont energy (GeV)" + MyStr, HadBins , loader, kTotUncontEn , GENIECut, kNoShift, weight);
248  UncontMu [gen][det][quant] = new Spectrum( "Muon uncont energy (GeV)" + MyStr, HadBins , loader, kUncontMuonEn , GENIECut, kNoShift, weight);
249  UncontNeu[gen][det][quant] = new Spectrum( "Neutron uncont energy (GeV)" + MyStr, HadBins , loader, kUncontNeutronEn , GENIECut, kNoShift, weight);
250  UncontPro[gen][det][quant] = new Spectrum( "Proton uncont energy (GeV)" + MyStr, HadBins , loader, kUncontProtonEn , GENIECut, kNoShift, weight);
251  UncontPi [gen][det][quant] = new Spectrum( "Pion uncont energy (GeV)" + MyStr, HadBins , loader, kUncontPionEn , GENIECut, kNoShift, weight);
252  UncontPi0[gen][det][quant] = new Spectrum( "Pi0 uncont energy (GeV)" + MyStr, HadBins , loader, kUncontPi0En , GENIECut, kNoShift, weight);
253  UncontPho[gen][det][quant] = new Spectrum( "Photon uncont energy (GeV)" + MyStr, HadBins , loader, kUncontPhotonEn , GENIECut, kNoShift, weight);
254  UncontKa [gen][det][quant] = new Spectrum( "Kaon uncont energy (GeV)" + MyStr, HadBins , loader, kUncontKaonEn , GENIECut, kNoShift, weight);
255  UncontEle[gen][det][quant] = new Spectrum( "Electron uncont energy (GeV)" + MyStr, HadBins , loader, kUncontElectronEn, GENIECut, kNoShift, weight);
256  UncontMis[gen][det][quant] = new Spectrum( "Misc uncont energy (GeV)" + MyStr, HadBins , loader, kUncontMiscEn , GENIECut, kNoShift, weight);
257 
258  // Energy fraction
259  MuonEFrac [gen][det][quant] = new Spectrum( "Muon energy fraction" + MyStr, FracBins , loader, kMuonEnFrac , GENIECut, kNoShift, weight);
260  NeutronEFrac [gen][det][quant] = new Spectrum( "Neutron energy fraction" + MyStr, FracBins , loader, kNeutronEnFrac , GENIECut, kNoShift, weight);
261  ProtonEFrac [gen][det][quant] = new Spectrum( "Proton energy fraction" + MyStr, FracBins , loader, kProtonEnFrac , GENIECut, kNoShift, weight);
262  PionEFrac [gen][det][quant] = new Spectrum( "Pion energy fraction" + MyStr, FracBins , loader, kPionEnFrac , GENIECut, kNoShift, weight);
263  Pi0EFrac [gen][det][quant] = new Spectrum( "Pi0 energy fraction" + MyStr, FracBins , loader, kPi0EnFrac , GENIECut, kNoShift, weight);
264  PhotonEFrac [gen][det][quant] = new Spectrum( "Photon energy fraction" + MyStr, FracBins , loader, kPhotonEnFrac , GENIECut, kNoShift, weight);
265  KaonEFrac [gen][det][quant] = new Spectrum( "Kaon energy fraction" + MyStr, FracBins , loader, kKaonEnFrac , GENIECut, kNoShift, weight);
266  ElectronEFrac[gen][det][quant] = new Spectrum( "Electron energy fraction" + MyStr, FracBins , loader, kElectronEnFrac , GENIECut, kNoShift, weight);
267 
268  // Uncont. E / tot. uncont. E
269  UncontMuonEF[gen][det][quant] = new Spectrum( "Muon uncont energy fraction" + MyStr, FracBins , loader, kUncontMuonEnFrac , GENIECut, kNoShift, weight);
270  UncontNeutEF[gen][det][quant] = new Spectrum( "Neutron uncont energy fraction" + MyStr, FracBins , loader, kUncontNeutronEnFrac , GENIECut, kNoShift, weight);
271  UncontProtEF[gen][det][quant] = new Spectrum( "Proton uncont energy fraction" + MyStr, FracBins , loader, kUncontProtonEnFrac , GENIECut, kNoShift, weight);
272  UncontPionEF[gen][det][quant] = new Spectrum( "Pion uncont energy fraction" + MyStr, FracBins , loader, kUncontPionEnFrac , GENIECut, kNoShift, weight);
273  UncontPi0sEF[gen][det][quant] = new Spectrum( "Pi0 uncont energy fraction" + MyStr, FracBins , loader, kUncontPi0EnFrac , GENIECut, kNoShift, weight);
274  UncontPhotEF[gen][det][quant] = new Spectrum( "Photon uncont energy fraction" + MyStr, FracBins , loader, kUncontPhotonEnFrac , GENIECut, kNoShift, weight);
275  UncontKaonEF[gen][det][quant] = new Spectrum( "Kaon uncont energy fraction" + MyStr, FracBins , loader, kUncontKaonEnFrac , GENIECut, kNoShift, weight);
276  UncontElecEF[gen][det][quant] = new Spectrum( "Electron uncont energy fraction" + MyStr, FracBins , loader, kUncontElectronEnFrac, GENIECut, kNoShift, weight);
277 
278  // Uncont. E / true nu E
279  UncontTotEFT[gen][det][quant] = new Spectrum( "Total uncont energy fraction of total E" + MyStr, FracBins , loader, kTotUncontEnFrac , GENIECut, kNoShift, weight);
280  UncontMuonEFT[gen][det][quant] = new Spectrum( "Muon uncont energy fraction of total E" + MyStr, FracBins , loader, kUncontMuonEnFracTot , GENIECut, kNoShift, weight);
281  UncontNeutEFT[gen][det][quant] = new Spectrum( "Neutron uncont energy fraction of total E" + MyStr, FracBins , loader, kUncontNeutronEnFracTot , GENIECut, kNoShift, weight);
282  UncontProtEFT[gen][det][quant] = new Spectrum( "Proton uncont energy fraction of total E" + MyStr, FracBins , loader, kUncontProtonEnFracTot , GENIECut, kNoShift, weight);
283  UncontPionEFT[gen][det][quant] = new Spectrum( "Pion uncont energy fraction of total E" + MyStr, FracBins , loader, kUncontPionEnFracTot , GENIECut, kNoShift, weight);
284  UncontPi0sEFT[gen][det][quant] = new Spectrum( "Pi0 uncont energy fraction of total E" + MyStr, FracBins , loader, kUncontPi0EnFracTot , GENIECut, kNoShift, weight);
285  UncontPhotEFT[gen][det][quant] = new Spectrum( "Photon uncont energy fraction of total E" + MyStr, FracBins , loader, kUncontPhotonEnFracTot , GENIECut, kNoShift, weight);
286  UncontKaonEFT[gen][det][quant] = new Spectrum( "Kaon uncont energy fraction of total E" + MyStr, FracBins , loader, kUncontKaonEnFracTot , GENIECut, kNoShift, weight);
287  UncontElecEFT[gen][det][quant] = new Spectrum( "Electron uncont energy fraction of total E" + MyStr, FracBins , loader, kUncontElectronEnFracTot, GENIECut, kNoShift, weight);
288 
289  // Average uncontained energy vs. x, y
290  UncontTotEvsX[gen][det][quant] = new Spectrum("Uncontained total energy vs. x" +MyStr, loader, PosBins, SIMPLEVAR(mc.nu[0].vtx.x), LepBins, kTotUncontEn, GENIECut, kNoShift, weight);
291  UncontTotEvsY[gen][det][quant] = new Spectrum("Uncontained total energy vs. y" +MyStr, loader, PosBins, SIMPLEVAR(mc.nu[0].vtx.y), LepBins, kTotUncontEn, GENIECut , kNoShift, weight);
292 
293  // energy fraction vs. true nu E
294  MuonEFracvsTrueE [gen][det][quant] = new Spectrum("Muon energy fraction vs. true E" +MyStr, loader, LepBins, kNeutrinoEn, FracBins, kMuonEnFrac, GENIECut , kNoShift, weight);
295  NeutronEFracvsTrueE [gen][det][quant] = new Spectrum("Neutron energy fraction vs. true E" +MyStr, loader, LepBins, kNeutrinoEn, FracBins, kNeutronEnFrac, GENIECut , kNoShift, weight);
296  ProtonEFracvsTrueE [gen][det][quant] = new Spectrum("Proton energy fraction vs. true E" +MyStr, loader, LepBins, kNeutrinoEn, FracBins, kProtonEnFrac, GENIECut , kNoShift, weight);
297  PionEFracvsTrueE [gen][det][quant] = new Spectrum("Pion energy fraction vs. true E" +MyStr, loader, LepBins, kNeutrinoEn, FracBins, kPionEnFrac, GENIECut , kNoShift, weight);
298  Pi0EFracvsTrueE [gen][det][quant] = new Spectrum("Pi0 energy fraction vs. true E" +MyStr, loader, LepBins, kNeutrinoEn, FracBins, kPi0EnFrac, GENIECut , kNoShift, weight);
299  PhotonEFracvsTrueE [gen][det][quant] = new Spectrum("Photon energy fraction vs. true E" +MyStr, loader, LepBins, kNeutrinoEn, FracBins, kPhotonEnFrac, GENIECut , kNoShift, weight);
300  KaonEFracvsTrueE [gen][det][quant] = new Spectrum("Kaon energy fraction vs. true E" +MyStr, loader, LepBins, kNeutrinoEn, FracBins, kKaonEnFrac, GENIECut , kNoShift, weight);
301  ElectronEFracvsTrueE[gen][det][quant] = new Spectrum("Electron energy fraction vs. true E"+MyStr, loader, LepBins, kNeutrinoEn, FracBins, kElectronEnFrac, GENIECut , kNoShift, weight);
302 
303  // uncont. E / tot. uncont. E vs. true nu E
304  UncontMuonEFvsTrueE[gen][det][quant] = new Spectrum("Muon uncont energy fraction vs. true E" +MyStr, loader, LepBins, kNeutrinoEn, FracBins, kUncontMuonEnFrac, GENIECut , kNoShift, weight);
305  UncontNeutEFvsTrueE[gen][det][quant] = new Spectrum("Neutron uncont energy fraction vs. true E" +MyStr, loader, LepBins, kNeutrinoEn, FracBins, kUncontNeutronEnFrac, GENIECut , kNoShift, weight);
306  UncontProtEFvsTrueE[gen][det][quant] = new Spectrum("Proton uncont energy fraction vs. true E" +MyStr, loader, LepBins, kNeutrinoEn, FracBins, kUncontProtonEnFrac, GENIECut , kNoShift, weight);
307  UncontPionEFvsTrueE[gen][det][quant] = new Spectrum("Pion uncont energy fraction vs. true E" +MyStr, loader, LepBins, kNeutrinoEn, FracBins, kUncontPionEnFrac, GENIECut , kNoShift, weight);
308  UncontPi0sEFvsTrueE[gen][det][quant] = new Spectrum("Pi0 uncont energy fraction vs. true E" +MyStr, loader, LepBins, kNeutrinoEn, FracBins, kUncontPi0EnFrac, GENIECut , kNoShift, weight);
309  UncontPhotEFvsTrueE[gen][det][quant] = new Spectrum("Photon uncont energy fraction vs. true E" +MyStr, loader, LepBins, kNeutrinoEn, FracBins, kUncontPhotonEnFrac, GENIECut , kNoShift, weight);
310  UncontKaonEFvsTrueE[gen][det][quant] = new Spectrum("Kaon uncont energy fraction vs. true E" +MyStr, loader, LepBins, kNeutrinoEn, FracBins, kUncontKaonEnFrac, GENIECut , kNoShift, weight);
311  UncontElecEFvsTrueE[gen][det][quant] = new Spectrum("Electron uncont energy fraction vs. true E"+MyStr, loader, LepBins, kNeutrinoEn, FracBins, kUncontElectronEnFrac, GENIECut , kNoShift, weight);
312 
313  // uncont E. / true nu E vs. true nu E
314  UncontTotEFTvsTrueE [gen][det][quant] = new Spectrum("Total uncont energy fraction of total E vs. true E"+MyStr, loader, LepBins, kNeutrinoEn, FracBins, kTotUncontEnFrac, GENIECut , kNoShift, weight);
315  UncontMuonEFTvsTrueE[gen][det][quant] = new Spectrum("Muon uncont energy fraction of total E vs. true E" +MyStr, loader, LepBins, kNeutrinoEn, FracBins, kUncontMuonEnFracTot, GENIECut , kNoShift, weight);
316  UncontNeutEFTvsTrueE[gen][det][quant] = new Spectrum("Neutron uncont energy fraction of total E vs. true E" +MyStr, loader, LepBins, kNeutrinoEn, FracBins, kUncontNeutronEnFracTot, GENIECut , kNoShift, weight);
317  UncontProtEFTvsTrueE[gen][det][quant] = new Spectrum("Proton uncont energy fraction of total E vs. true E" +MyStr, loader, LepBins, kNeutrinoEn, FracBins, kUncontProtonEnFracTot, GENIECut , kNoShift, weight);
318  UncontPionEFTvsTrueE[gen][det][quant] = new Spectrum("Pion uncont energy fraction of total E vs. true E" +MyStr, loader, LepBins, kNeutrinoEn, FracBins, kUncontPionEnFracTot, GENIECut , kNoShift, weight);
319  UncontPi0sEFTvsTrueE[gen][det][quant] = new Spectrum("Pi0 uncont energy fraction of total E vs. true E" +MyStr, loader, LepBins, kNeutrinoEn, FracBins, kUncontPi0EnFracTot, GENIECut , kNoShift, weight);
320  UncontPhotEFTvsTrueE[gen][det][quant] = new Spectrum("Photon uncont energy fraction of total E vs. true E" +MyStr, loader, LepBins, kNeutrinoEn, FracBins, kUncontPhotonEnFracTot, GENIECut , kNoShift, weight);
321  UncontKaonEFTvsTrueE[gen][det][quant] = new Spectrum("Kaon uncont energy fraction of total E vs. true E" +MyStr, loader, LepBins, kNeutrinoEn, FracBins, kUncontKaonEnFracTot, GENIECut , kNoShift, weight);
322  UncontElecEFTvsTrueE[gen][det][quant] = new Spectrum("Electron uncont energy fraction of total E vs. true E"+MyStr, loader, LepBins, kNeutrinoEn, FracBins, kUncontElectronEnFracTot, GENIECut , kNoShift, weight);
323  } // Loop through my Spectrum arrays.
324  }
325  }
326 
327  // --- Do it!
328  loader.Go();
329 
330  // --- Open my outfile so that I save my histograms!
331  TFile *OutFile = new TFile(sOutFile.c_str(),"RECREATE");
332 
333  // --- And finally, lets make my plots a little nicer and save them*!
334  // *(who would've thought I'd be the one censoring bad language in commits? -- ES)
335  for (unsigned int gen=0; gen<NumGENIE; ++gen) {
336  for (unsigned int det=0; det<nDetCuts; ++det) {
337  for (unsigned int quant=0; quant<nQuants; ++quant) {
338  std::string MyStr = GENIEStr[gen]+"_"+CutNames[det]+"_"+QuantNames[quant];;
339  // Multiplicity
340  NumOfNeut[gen][det][quant] -> SaveTo( OutFile, TString("NumOfNeut_") + TString(MyStr) ) ;
341  NumOfProt[gen][det][quant] -> SaveTo( OutFile, TString("NumOfProt_") + TString(MyStr) ) ;
342  NumOfPion[gen][det][quant] -> SaveTo( OutFile, TString("NumOfPion_") + TString(MyStr) ) ;
343  NumOfPi0s[gen][det][quant] -> SaveTo( OutFile, TString("NumOfPi0s_") + TString(MyStr) ) ;
344 
345  // Energy
346  NeutrinoE[gen][det][quant] -> SaveTo( OutFile, TString("NeutrinoE_") + TString(MyStr) ) ;
347  MuonE [gen][det][quant] -> SaveTo( OutFile, TString("MuonE_" ) + TString(MyStr) ) ;
348  NeutronE [gen][det][quant] -> SaveTo( OutFile, TString("NeutronE_" ) + TString(MyStr) ) ;
349  ProtonE [gen][det][quant] -> SaveTo( OutFile, TString("ProtonE_" ) + TString(MyStr) ) ;
350  PionE [gen][det][quant] -> SaveTo( OutFile, TString("PionE_" ) + TString(MyStr) ) ;
351  Pi0E [gen][det][quant] -> SaveTo( OutFile, TString("Pi0E_" ) + TString(MyStr) ) ;
352  PhotonE [gen][det][quant] -> SaveTo( OutFile, TString("PhotonE_" ) + TString(MyStr) ) ;
353  KaonE [gen][det][quant] -> SaveTo( OutFile, TString("KaonE_" ) + TString(MyStr) ) ;
354  ElectronE[gen][det][quant] -> SaveTo( OutFile, TString("ElectronE_") + TString(MyStr) ) ;
355  MiscE [gen][det][quant] -> SaveTo( OutFile, TString("MiscE_" ) + TString(MyStr) ) ;
356 
357  // Uncontained energy
358  UncontEn [gen][det][quant] -> SaveTo( OutFile, TString("UncontEn_") + TString(MyStr) ) ;
359  UncontMu [gen][det][quant] -> SaveTo( OutFile, TString("UncontMu_") + TString(MyStr) ) ;
360  UncontNeu[gen][det][quant] -> SaveTo( OutFile, TString("UncontNeu_") + TString(MyStr) ) ;
361  UncontPro[gen][det][quant] -> SaveTo( OutFile, TString("UncontPro_") + TString(MyStr) ) ;
362  UncontPi [gen][det][quant] -> SaveTo( OutFile, TString("UncontPi_") + TString(MyStr) ) ;
363  UncontPi0[gen][det][quant] -> SaveTo( OutFile, TString("UncontPi0_") + TString(MyStr) ) ;
364  UncontPho[gen][det][quant] -> SaveTo( OutFile, TString("UncontPho_") + TString(MyStr) ) ;
365  UncontKa [gen][det][quant] -> SaveTo( OutFile, TString("UncontKa_") + TString(MyStr) ) ;
366  UncontEle[gen][det][quant] -> SaveTo( OutFile, TString("UncontEle_") + TString(MyStr) ) ;
367  UncontMis[gen][det][quant] -> SaveTo( OutFile, TString("UncontMis_") + TString(MyStr) ) ;
368 
369  // Energy fraction
370  MuonEFrac [gen][det][quant] -> SaveTo( OutFile, TString("MuonEFrac_") + TString(MyStr) ) ;
371  NeutronEFrac [gen][det][quant] -> SaveTo( OutFile, TString("NeutronEFrac_") + TString(MyStr) ) ;
372  ProtonEFrac [gen][det][quant] -> SaveTo( OutFile, TString("ProtonEFrac_") + TString(MyStr) ) ;
373  PionEFrac [gen][det][quant] -> SaveTo( OutFile, TString("PionEFrac_") + TString(MyStr) ) ;
374  Pi0EFrac [gen][det][quant] -> SaveTo( OutFile, TString("Pi0EFrac_") + TString(MyStr) ) ;
375  PhotonEFrac [gen][det][quant] -> SaveTo( OutFile, TString("PhotonEFrac_") + TString(MyStr) ) ;
376  KaonEFrac [gen][det][quant] -> SaveTo( OutFile, TString("KaonEFrac_") + TString(MyStr) ) ;
377  ElectronEFrac[gen][det][quant] -> SaveTo( OutFile, TString("ElectronEFrac_") + TString(MyStr) ) ;
378 
379  // Uncont. E / tot. uncont. E
380  UncontMuonEF[gen][det][quant] -> SaveTo( OutFile, TString("UncontMuonEF_") + TString(MyStr) ) ;
381  UncontNeutEF[gen][det][quant] -> SaveTo( OutFile, TString("UncontNeutEF_") + TString(MyStr) ) ;
382  UncontProtEF[gen][det][quant] -> SaveTo( OutFile, TString("UncontProtEF_") + TString(MyStr) ) ;
383  UncontPionEF[gen][det][quant] -> SaveTo( OutFile, TString("UncontPionEF_") + TString(MyStr) ) ;
384  UncontPi0sEF[gen][det][quant] -> SaveTo( OutFile, TString("UncontPi0sEF_") + TString(MyStr) ) ;
385  UncontPhotEF[gen][det][quant] -> SaveTo( OutFile, TString("UncontPhotEF_") + TString(MyStr) ) ;
386  UncontKaonEF[gen][det][quant] -> SaveTo( OutFile, TString("UncontKaonEF_") + TString(MyStr) ) ;
387  UncontElecEF[gen][det][quant] -> SaveTo( OutFile, TString("UncontElecEF_") + TString(MyStr) ) ;
388 
389  // Uncont. E / true nu E
390  UncontTotEFT[gen][det][quant] -> SaveTo( OutFile, TString("UncontTotEFT_") + TString(MyStr) ) ;
391  UncontMuonEFT[gen][det][quant] -> SaveTo( OutFile, TString("UncontMuonEFT_") + TString(MyStr) ) ;
392  UncontNeutEFT[gen][det][quant] -> SaveTo( OutFile, TString("UncontNeutEFT_") + TString(MyStr) ) ;
393  UncontProtEFT[gen][det][quant] -> SaveTo( OutFile, TString("UncontProtEFT_") + TString(MyStr) ) ;
394  UncontPionEFT[gen][det][quant] -> SaveTo( OutFile, TString("UncontPionEFT_") + TString(MyStr) ) ;
395  UncontPi0sEFT[gen][det][quant] -> SaveTo( OutFile, TString("UncontPi0sEFT_") + TString(MyStr) ) ;
396  UncontPhotEFT[gen][det][quant] -> SaveTo( OutFile, TString("UncontPhotEFT_") + TString(MyStr) ) ;
397  UncontKaonEFT[gen][det][quant] -> SaveTo( OutFile, TString("UncontKaonEFT_") + TString(MyStr) ) ;
398  UncontElecEFT[gen][det][quant] -> SaveTo( OutFile, TString("UncontElecEFT_") + TString(MyStr) ) ;
399 
400  // uncont E vs. vertex x, y
401  UncontTotEvsX[gen][det][quant] -> SaveTo( OutFile, TString("UncontTotEvsX_") + TString(MyStr) ) ;
402  UncontTotEvsY[gen][det][quant] -> SaveTo( OutFile, TString("UncontTotEvsY_") + TString(MyStr) ) ;
403 
404  // energy fraction vs. true nu E
405  MuonEFracvsTrueE [gen][det][quant] -> SaveTo( OutFile, TString("MuonEFracvsTrueE_") + TString(MyStr) ) ;
406  NeutronEFracvsTrueE [gen][det][quant] -> SaveTo( OutFile, TString("NeutronEFracvsTrueE_") + TString(MyStr) ) ;
407  ProtonEFracvsTrueE [gen][det][quant] -> SaveTo( OutFile, TString("ProtonEFracvsTrueE_") + TString(MyStr) ) ;
408  PionEFracvsTrueE [gen][det][quant] -> SaveTo( OutFile, TString("PionEFracvsTrueE_") + TString(MyStr) ) ;
409  Pi0EFracvsTrueE [gen][det][quant] -> SaveTo( OutFile, TString("Pi0EFracvsTrueE_") + TString(MyStr) ) ;
410  PhotonEFracvsTrueE [gen][det][quant] -> SaveTo( OutFile, TString("PhotonEFracvsTrueE_") + TString(MyStr) ) ;
411  KaonEFracvsTrueE [gen][det][quant] -> SaveTo( OutFile, TString("KaonEFracvsTrueE_") + TString(MyStr) ) ;
412  ElectronEFracvsTrueE[gen][det][quant] -> SaveTo( OutFile, TString("ElectronEFracvsTrueE_") + TString(MyStr) ) ;
413 
414  // uncont. E / tot. uncont. E vs. true nu E
415  UncontMuonEFvsTrueE[gen][det][quant] -> SaveTo( OutFile, TString("UncontMuonEFvsTrueE_") + TString(MyStr) ) ;
416  UncontNeutEFvsTrueE[gen][det][quant] -> SaveTo( OutFile, TString("UncontNeutEFvsTrueE_") + TString(MyStr) ) ;
417  UncontProtEFvsTrueE[gen][det][quant] -> SaveTo( OutFile, TString("UncontProtEFvsTrueE_") + TString(MyStr) ) ;
418  UncontPionEFvsTrueE[gen][det][quant] -> SaveTo( OutFile, TString("UncontPionEFvsTrueE_") + TString(MyStr) ) ;
419  UncontPi0sEFvsTrueE[gen][det][quant] -> SaveTo( OutFile, TString("UncontPi0sEFvsTrueE_") + TString(MyStr) ) ;
420  UncontPhotEFvsTrueE[gen][det][quant] -> SaveTo( OutFile, TString("UncontPhotEFvsTrueE_") + TString(MyStr) ) ;
421  UncontKaonEFvsTrueE[gen][det][quant] -> SaveTo( OutFile, TString("UncontKaonEFvsTrueE_") + TString(MyStr) ) ;
422  UncontElecEFvsTrueE[gen][det][quant] -> SaveTo( OutFile, TString("UncontElecEFvsTrueE_") + TString(MyStr) ) ;
423 
424  // uncont. E / true nu E vs. true nu E
425  UncontTotEFTvsTrueE [gen][det][quant] -> SaveTo( OutFile, TString("UncontTotEFTvsTrueE_") + TString(MyStr) ) ;
426  UncontMuonEFTvsTrueE[gen][det][quant] -> SaveTo( OutFile, TString("UncontMuonEFTvsTrueE_") + TString(MyStr) ) ;
427  UncontNeutEFTvsTrueE[gen][det][quant] -> SaveTo( OutFile, TString("UncontNeutEFTvsTrueE_") + TString(MyStr) ) ;
428  UncontProtEFTvsTrueE[gen][det][quant] -> SaveTo( OutFile, TString("UncontProtEFTvsTrueE_") + TString(MyStr) ) ;
429  UncontPionEFTvsTrueE[gen][det][quant] -> SaveTo( OutFile, TString("UncontPionEFTvsTrueE_") + TString(MyStr) ) ;
430  UncontPi0sEFTvsTrueE[gen][det][quant] -> SaveTo( OutFile, TString("UncontPi0sEFTvsTrueE_") + TString(MyStr) ) ;
431  UncontPhotEFTvsTrueE[gen][det][quant] -> SaveTo( OutFile, TString("UncontPhotEFTvsTrueE_") + TString(MyStr) ) ;
432  UncontKaonEFTvsTrueE[gen][det][quant] -> SaveTo( OutFile, TString("UncontKaonEFTvsTrueE_") + TString(MyStr) ) ;
433  UncontElecEFTvsTrueE[gen][det][quant] -> SaveTo( OutFile, TString("UncontElecEFTvsTrueE_") + TString(MyStr) ) ;
434 
435  }
436  }
437  }
438 }
const Var kProtonEnFrac([](const caf::SRProxy *sr){return CalcFracE(sr, 2212, false);})
const Var kPi0EnFrac([](const caf::SRProxy *sr){return CalcFracE(sr, 111, false);})
const Var kTotUncontEn([](const caf::SRProxy *sr){float TotEn=0.0;for(unsigned int PrimL=0;PrimL< sr->mc.nu[0].prim.size();++PrimL){TotEn+=sr->mc.nu[0].prim[PrimL].totEscE;} std::cout<< "Energy "<< TotEn<< " Run "<< sr->hdr.run<< ", SubRun "<< sr->hdr.subrun<< ", Cycle "<< sr->hdr.cycle<< ", Batch "<< sr->hdr.batch<< ", Event "<< sr->hdr.evt<< ", Slice "<< sr->hdr.subevt<< std::endl;return TotEn;})
const Var kElectronEn([](const caf::SRProxy *sr){float ThisEn=0.;ThisEn=CalcPrimE(sr, 11, false);return ThisEn;})
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
void SaveTo(const osc::IOscCalc &x, TDirectory *dir, const std::string &name)
const Var kUncontPi0EnFracTot([](const caf::SRProxy *sr){return CalcFracE(sr, 111, true, true);})
const Var kPPFXFluxCVWgt
Definition: PPFXWeights.h:16
const Var kTotUncontEnFrac([](const caf::SRProxy *sr){if(sr->mc.nu[0].E<=0.0) return-5.0;else return(kTotUncontEn(sr)/sr->mc.nu[0].E);})
const Var weight
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
bool IsFHC
Simple record of shifts applied to systematic parameters.
Definition: SystShifts.h:20
const Var kUncontMiscEn([](const caf::SRProxy *sr){return kTotUncontEn(sr)-kUncontMuonEn(sr)-kUncontNeutronEn(sr)-kUncontProtonEn(sr)-kUncontPionEn(sr)-kUncontPi0En(sr)-kUncontPhotonEn(sr)-kUncontKaonEn(sr)-kUncontElectronEn(sr);})
const Var kElectronEnFrac([](const caf::SRProxy *sr){return CalcFracE(sr, 11, false);})
Proxy for caf::StandardRecord.
Definition: SRProxy.h:2126
const HistAxis kHadEFracAxis("E_{had.} / E_{#nu}", Binning::Simple(200, 0, 1), kHadEFrac)
HistAxis that implements Hadronic Energy fraction binning used by L.Vinton to derive Hadronic Energy ...
Definition: HistAxes.h:30
const Var kUncontPhotonEn([](const caf::SRProxy *sr){float ThisEn=0.;ThisEn=CalcPrimE(sr, 22, true);return ThisEn;})
const Var kUncontPionEnFrac([](const caf::SRProxy *sr){return CalcFracE(sr, 211, true);})
void EnergyCont_macro(bool IsFHC=false, bool IsFarDet=true)
const Var kUncontKaonEnFrac([](const caf::SRProxy *sr){return CalcFracE(sr, 321, true);})
caf::Proxy< short int > nnu
Definition: SRProxy.h:617
void SetSpillCut(const SpillCut &cut)
std::string pnfs2xrootd(std::string loc, bool unauth)
Definition: UtilsExt.cxx:237
const Var kUncontProtonEnFrac([](const caf::SRProxy *sr){return CalcFracE(sr, 2212, true);})
const Var kUncontElectronEn([](const caf::SRProxy *sr){float ThisEn=0.;ThisEn=CalcPrimE(sr, 11, true);return ThisEn;})
const Var kKaonEn([](const caf::SRProxy *sr){float ThisEn=0.;ThisEn=CalcPrimE(sr, 321, false);return ThisEn;})
const Var kKaonEnFrac([](const caf::SRProxy *sr){return CalcFracE(sr, 321, false);})
Representation of a spectrum in any variable, with associated POT.
Definition: Spectrum.h:40
const Var kUncontNeutronEnFrac([](const caf::SRProxy *sr){return CalcFracE(sr, 2112, true);})
const Var kUncontProtonEn([](const caf::SRProxy *sr){float ThisEn=0.;ThisEn=CalcPrimE(sr, 2212, true);return ThisEn;})
const Var kNPions
const Cut kNumuCosmicRej2018([](const caf::SRProxy *sr){return(sr->sel.cosrej.anglekal > 0.5 && sr->sel.cosrej.numucontpid2019 > 0.53 && sr->slc.nhit< 400 && sr->sel.nuecosrej.pngptp< 0.9 );})
Definition: NumuCuts2018.h:19
const Var kUncontNeutronEnFracTot([](const caf::SRProxy *sr){return CalcFracE(sr, 2112, true, true);})
ifstream inFile
Definition: AnaPlotMaker.h:34
const Var kNPi0s([](const caf::SRProxy *sr){float NPar=0.;NPar=sr->mc.nu[0].npizero;return NPar;})
const Cut kNumuContainFD2017
Definition: NumuCuts2017.h:21
const Var kUncontProtonEnFracTot([](const caf::SRProxy *sr){return CalcFracE(sr, 2212, true, true);})
const SpillCut kStandardDQCuts([](const caf::SRSpillProxy *spill){if(spill->dcmedgematchfrac==0 &&spill->fracdcm3hits==0 &&spill->nmissingdcmslg==0) return bool(spill->isgoodspill); if(spill->det==caf::kNEARDET && (spill->fracdcm3hits > 0.45|| spill->nmissingdcms > 0)) return false; if(spill->eventincomplete) return false; if(spill->det==caf::kFARDET && spill->nmissingdcmslg > 0) return false; if(spill->det==caf::kFARDET && !spill->ismc && spill->dcmedgematchfrac<=0.2) return false;return true;})
Cut out events with a noisy detector or with parts missing.
Definition: SpillCuts.h:16
const Var kUncontMuonEnFracTot([](const caf::SRProxy *sr){return CalcFracE(sr, 13, true, true);})
const Var kUncontMuonEn([](const caf::SRProxy *sr){float ThisEn=0.;ThisEn=CalcPrimE(sr, 13, true);return ThisEn;})
caf::StandardRecord * sr
virtual void Go() override
Load all the registered spectra.
const std::string QuantNames[NumQuant]
Definition: DoThePlots.C:207
loader
Definition: demo0.py:10
const Var kUncontElectronEnFracTot([](const caf::SRProxy *sr){return CalcFracE(sr, 11, true, true);})
const Var kNNeutrons([](const caf::SRProxy *sr){float NPar=0.;if(DEBUGGING){std::cout<< "\nLooking at event "<< sr->hdr.evt<< ", there are "<< sr->mc.nu.size()<< ", the 0th neutrino is a "<< sr->mc.nu[0].pdg<< ", with Energy "<< sr->mc.nu[0].E<< ". There were a total of "<< sr->mc.nu[0].prim.size()<< " other primaries associated with that neutrino, "<< sr->mc.nu[0].nneutron<< " were neutrons."<< std::endl;if(kIsDytmanMEC(sr)) std::cout<< " The neutrino was a MEC"<< std::endl;else if(kIsDIS(sr)) std::cout<< " The neutrino was a DIS"<< std::endl;else if(kIsRes(sr)) std::cout<< " The neutrino was a Resonance"<< std::endl;else if(kIsCoh(sr)) std::cout<< " The neutrino was a Coherent"<< std::endl;float TotEn=0.0;for(unsigned int PrimL=0;PrimL< sr->mc.nu[0].prim.size();++PrimL){std::cout<< "\t\tLooking at Prim "<< PrimL<< " of "<< sr->mc.nu[0].prim.size()<< ", it was a "<< sr->mc.nu[0].prim[PrimL].pdg<< ", VisE "<< sr->mc.nu[0].prim[PrimL].visE<< ", VisEInslc "<< sr->mc.nu[0].prim[PrimL].visEinslc<< ", E0 "<< sr->mc.nu[0].prim[PrimL].p.E<< ", enteringE "<< sr->mc.nu[0].prim[PrimL].enteringE<< ", totEscE "<< sr->mc.nu[0].prim[PrimL].totEscE<< std::endl;TotEn+=sr->mc.nu[0].prim[PrimL].totEscE;}std::cout<< "\tThe total uncontained energy was "<< TotEn<< std::endl;NPar=sr->mc.nu[0].nneutron;}return NPar;})
std::vector< float > Spectrum
Definition: Constants.h:610
const HistAxis kNumuCCOptimisedAxis("Reconstructed Neutrino Energy (GeV)", kNumuCCEOptimisedBinning, kCCE)
HistAxis that implements optimised numuCCE from L. Vinton. See docdb 16332. This was close to &#39;custC&#39;...
Definition: HistAxes.h:24
const Var kUncontPionEn([](const caf::SRProxy *sr){float ThisEn=0.;ThisEn=CalcPrimE(sr, 211, true);return ThisEn;})
const Var kMuonEnFrac([](const caf::SRProxy *sr){return CalcFracE(sr, 13, false);})
const Var kPionEn([](const caf::SRProxy *sr){float ThisEn=0.;ThisEn=CalcPrimE(sr, 211, false);return ThisEn;})
const Var kPi0En([](const caf::SRProxy *sr){float ThisEn=0.;ThisEn=CalcPrimE(sr, 111, false);return ThisEn;})
const SystShifts kNoShift
Definition: SystShifts.cxx:21
OStream cout
Definition: OStream.cxx:6
const Var kUncontPi0En([](const caf::SRProxy *sr){float ThisEn=0.;ThisEn=CalcPrimE(sr, 111, true);return ThisEn;})
caf::Proxy< caf::SRTruthBranch > mc
Definition: SRProxy.h:2138
const Var kUncontNeutronEn([](const caf::SRProxy *sr){float ThisEn=0.;ThisEn=CalcPrimE(sr, 2112, true);return ThisEn;})
const Var kPhotonEn([](const caf::SRProxy *sr){float ThisEn=0.;ThisEn=CalcPrimE(sr, 22, false);return ThisEn;})
const Var kMuonEn([](const caf::SRProxy *sr){float ThisEn=0.;ThisEn=CalcPrimE(sr, 13, false);return ThisEn;})
const Var kUncontElectronEnFrac([](const caf::SRProxy *sr){return CalcFracE(sr, 11, true);})
Collaborates with Spectrum and OscillatableSpectrum to fill spectra from CAF files.
const Cut kNumuPID2018([](const caf::SRProxy *sr){std::cout<< "ERROR::kNumuPID2018, cutting on both cvnProd3Train and cvn2017."<< " Neither branch exists anymore. Returning False."<< std::endl;abort();return false;})
Definition: NumuCuts2018.h:22
const Var kNProtons
const Var kNeutronEn([](const caf::SRProxy *sr){float ThisEn=0.;ThisEn=CalcPrimE(sr, 2112, false);return ThisEn;})
const Var kProtonEn([](const caf::SRProxy *sr){float ThisEn=0.;ThisEn=CalcPrimE(sr, 2212, false);return ThisEn;})
const Var kNuMinusAll([](const caf::SRProxy *sr){return kNeutrinoEn(sr)-kMuonEn(sr)-kNeutronEn(sr)-kProtonEn(sr)-kPionEn(sr)-kPi0En(sr)-kPhotonEn(sr)-kKaonEn(sr)-kElectronEn(sr);})
const Var kXSecCVWgt2018
Definition: XsecTunes.h:49
#define SIMPLEVAR(CAFNAME)
For Vars where literally all you need is a single CAF variable.
Definition: Var.h:88
const Var kUncontMuonEnFrac([](const caf::SRProxy *sr){return CalcFracE(sr, 13, true);})
const std::vector< std::string > GENIEStr
std::vector< Cut > QuantileCutsFromTH2(TH2 *quantileHist, const HistAxis &independentAxis, const HistAxis &quantileAxis, const unsigned int &numQuantiles, const bool verbose)
: Do the same as the QuantileCuts function but taking in the TH2 instead of making it...
const Var kUncontKaonEnFracTot([](const caf::SRProxy *sr){return CalcFracE(sr, 321, true, true);})
const Var kUncontPi0EnFrac([](const caf::SRProxy *sr){return CalcFracE(sr, 111, true);})
const unsigned int NumBins
const Var kNeutrinoEn([](const caf::SRProxy *sr){float ThisEn=0.;ThisEn=sr->mc.nu[0].E;return ThisEn;})
TFile * OutFile
const Var kPionEnFrac([](const caf::SRProxy *sr){return CalcFracE(sr, 211, false);})
const Cut kNumuQuality
Definition: NumuCuts.h:18
const Var kNeutronEnFrac([](const caf::SRProxy *sr){return CalcFracE(sr, 2112, false);})
const Var kUncontKaonEn([](const caf::SRProxy *sr){float ThisEn=0.;ThisEn=CalcPrimE(sr, 321, true);return ThisEn;})
const Var kUncontPhotonEnFracTot([](const caf::SRProxy *sr){return CalcFracE(sr, 22, true, true);})
static Binning Simple(int n, double lo, double hi, const std::vector< std::string > &labels={})
Definition: Binning.cxx:107
const Var kUncontPionEnFracTot([](const caf::SRProxy *sr){return CalcFracE(sr, 211, true, true);})
const Var kUncontPhotonEnFrac([](const caf::SRProxy *sr){return CalcFracE(sr, 22, true);})
const Cut kNoCut
The simplest possible cut: pass everything, used as a default.
Definition: Cut.h:109
const Var kPhotonEnFrac([](const caf::SRProxy *sr){return CalcFracE(sr, 22, false);})
std::vector< std::string > CutNames
Definition: MakeCutFlow.C:49
enum BeamMode string