ExtendedAxesLoad.C
Go to the documentation of this file.
1 // This macro creates spectra for OBSERVED
2 // and predicted event rates in analysis region
3 // This uses UNBLIND DATA. Proceed with extreme caution!
4 
8 #include "NuXAna/Cuts/NusCuts.h"
10 #include "CAFAna/Cuts/TimingCuts.h"
12 #include "CAFAna/Extrap/ExtrapSterile.h"
16 #include "CAFAna/Vars/HistAxes.h"
20 #include "NuXAna/Vars/HistAxes.h"
21 
22 #include <string>
23 #include <utility>
24 
25 using namespace ana;
26 
27 struct Sample {
30  Cut* nd;
31  Cut* fd;
32 };
33 
34 Sample MakeSample(const HistAxis& axnc, const HistAxis& axnm,
35  const Cut& nd, const Cut& fd);
36 
38 {
39  TH1::AddDirectory(0);
40 
41  // ND DATA + MC
42  SpectrumLoader loaderNDMC(fnamenear_concat);
44  loaderNDMC.SetSpillCut(kStandardSpillCuts);
45  loaderNDdata.SetSpillCut(kStandardSpillCuts);
46 
47  // PERIOD 1, 2 + EPOCH 3B
48  SpectrumLoader loaderFDMC_non(fFDMC_non);
49  SpectrumLoader loaderFDMC_swp(fFDMC_swp);
50  SpectrumLoader loaderFDMC_tau(fFDMC_tau);
51  loaderFDMC_non.SetSpillCut(kStandardSpillCuts);
52  loaderFDMC_swp.SetSpillCut(kStandardSpillCuts);
53  loaderFDMC_tau.SetSpillCut(kStandardSpillCuts);
54 
55  // PERIOD 3C (and implied 3D)
56  SpectrumLoader loaderFDMC_non_3c(fFDMC_non_3c);
57  SpectrumLoader loaderFDMC_swp_3c(fFDMC_swp_3c);
58  SpectrumLoader loaderFDMC_tau_3c(fFDMC_tau_3c);
59  loaderFDMC_non_3c.SetSpillCut(kStandardSpillCuts);
60  loaderFDMC_swp_3c.SetSpillCut(kStandardSpillCuts);
61  loaderFDMC_tau_3c.SetSpillCut(kStandardSpillCuts);
62 
63  // FD DATA
65  loaderFDdata.SetSpillCut(kStandardSpillCuts);
66 
67  std::string labelVtxX = "X Vertex Position (cm)";
68  std::string labelVtxY = "Y Vertex Position (cm)";
69  std::string labelVtxZ = "Z Vertex Position (cm)";
70  std::string labelHits = "Number of Hits";
71  std::string labelCVN = "CVN NCID";
72  std::string labelNCP = "NumucontPID";
73  std::string labelPTP = "p_{T}/p";
74  std::string labelEPerHit = "Average E/Hit (GeV)";
75  std::string labelTop = "Distance to Top of Detector (cm)";
76 
77  Binning kNCAllEBins = Binning::Simple(24, 0, 6);
78  Binning kXYBinsFD = Binning::Simple(64, -800., 800.);
79  Binning kZBinsFD = Binning::Simple(60, 0., 6000.);
80  Binning kNearEdgeBins = Binning::Simple(64, 0., 1600.);
81  Binning kFatPIDBins = Binning::Simple(25, 0., 1.);
82  Binning kFatNCPBins = Binning::Simple(24, 0.02, 0.98);
83  Binning kHitBins = Binning::Simple(50, 0., 200.);
84  Binning kEDepBins = Binning::Simple(24, 0.002, .098);
85 
86  const Var kRecoVtxX(
87  [](const caf::SRProxy* sr)
88  {
89  if(!sr->vtx.elastic.IsValid) { return 9000.; }
90  return sr->vtx.elastic.vtx.x;
91  });
92  const Var kRecoVtxY(
93  [](const caf::SRProxy* sr)
94  {
95  if(!sr->vtx.elastic.IsValid) { return 9000.; }
96  return sr->vtx.elastic.vtx.y;
97  });
98  const Var kRecoVtxZ(
99  [](const caf::SRProxy* sr)
100  {
101  if(!sr->vtx.elastic.IsValid) { return 9000.; }
102  return sr->vtx.elastic.vtx.z;
103  });
104 
105  const Var kNCP = SIMPLEVAR(sel.cosrej.numucontpid);
106  const Var kPartPTP(
107  [](const caf::SRProxy* sr)
108  {
109  if(std::isnan(sr->sel.nuecosrej.partptp)) { return -5.f; }
110  return sr->sel.nuecosrej.partptp;
111  });
112  const Var kEPerHit(
113  [](const caf::SRProxy* sr)
114  {
115  double nhit = (double)sr->slc.nhit;
116  if(nhit <= 0.) { return 0.; }
117  return sr->slc.calE/nhit;
118  });
119  const Var kDistTop(
120  [](const caf::SRProxy* sr)
121  {
123  });
124 
125  const HistAxis kNCAllEAxis("Calorimetric Energy (GeV)", kNCAllEBins, kCaloE);
126  const HistAxis kNumuCCAllEAxis("Reconstructed Neutrino Energy (GeV)", kNCAllEBins, kCCE);
127  const HistAxis kAxisVtxX(labelVtxX, kXYBinsFD, kRecoVtxX);
128  const HistAxis kAxisVtxY(labelVtxY, kXYBinsFD, kRecoVtxY);
129  const HistAxis kAxisVtxZ(labelVtxZ, kZBinsFD, kRecoVtxZ);
130  const HistAxis kAxisCVN( labelCVN, kFatPIDBins, kCVNnc);
131  const HistAxis kAxisNHit(labelHits, kHitBins, kNHit);
132  const HistAxis kAxisNCP( labelNCP, kFatNCPBins, kNCP);
133  const HistAxis kAxisPTP( labelPTP, kFatPIDBins, kPartPTP);
134  const HistAxis kAxisEpH( labelEPerHit, kEDepBins, kEPerHit);
135  const HistAxis kAxisTop( labelTop, kNearEdgeBins, kDistTop);
136 
139  const Cut kNM1NCSel = kNusFDPresel && kNusCosRej && kNCCalERange;
140  const Cut kNM1CosRej = kNusFDPresel && kNusNCSel && kNCCalERange;
141 
142  const Cut kFidMinusX(
143  [](const caf::SRProxy* sr)
144  {
145  if(!sr->vtx.elastic.IsValid) return false;
146 
147  const TVector3 vtx = sr->vtx.elastic.vtx;
148  if(vtx.Y() < -720.0) return false;
149  if(vtx.Y() > 600.0) return false;
150  if(vtx.Z() < 50.0) return false;
151  if(vtx.Z() > 5450.0) return false;
152  return true;
153  });
154  const Cut kFidMinusY(
155  [](const caf::SRProxy* sr)
156  {
157  if(!sr->vtx.elastic.IsValid) return false;
158 
159  const TVector3 vtx = sr->vtx.elastic.vtx;
160  if(vtx.X() < -680.0) return false;
161  if(vtx.X() > 650.0) return false;
162  if(vtx.Z() < 50.0) return false;
163  if(vtx.Z() > 5450.0) return false;
164  return true;
165  });
166  const Cut kFidMinusZ(
167  [](const caf::SRProxy* sr)
168  {
169  if(!sr->vtx.elastic.IsValid) return false;
170 
171  const TVector3 vtx = sr->vtx.elastic.vtx;
172  if(vtx.X() < -680.0) return false;
173  if(vtx.X() > 650.0) return false;
174  if(vtx.Y() < -720.0) return false;
175  if(vtx.Y() > 600.0) return false;
176  return true;
177  });
178 
179  const Cut kNCSelMinusHit(
180  [](const caf::SRProxy* sr)
181  {
182  if(sr->sel.cvn.ncid < 0.2) return false;
183  return true;
184  });
185  const Cut kNCSelMinusCVN(
186  [](const caf::SRProxy* sr)
187  {
188  if(sr->slc.nhit >= 200) return false;
189  if(sr->slc.nhit < 20) return false;
190  return true;
191  });
192 
193  const Cut kCosRejMinusNCP(
194  [](const caf::SRProxy* sr)
195  {
196  double partptp = sr->sel.nuecosrej.partptp;
197  if(sr->vtx.elastic.fuzzyk.nshwlid == 0) return false;
198  if(partptp >= 0.8) return false;
199  if(sr->vtx.elastic.fuzzyk.png[0].shwlid.lid.ismuon == 1) return false;
200  double nhit = (double)sr->slc.nhit;
201  if(nhit <= 0.) return false;
202  if(sr->slc.calE/nhit <= 0.018) return false;
203  if(std::min(sr->sel.nuecosrej.starttop, sr->sel.nuecosrej.stoptop) < 480) return false;
204  return true;
205  });
206  const Cut kCosRejMinusPTP(
207  [](const caf::SRProxy* sr)
208  {
209  double numucontpid = sr->sel.cosrej.numucontpid;
210  if(sr->vtx.elastic.fuzzyk.nshwlid == 0) return false;
211  if(numucontpid <= 0.5) return false;
212  if(sr->vtx.elastic.fuzzyk.png[0].shwlid.lid.ismuon == 1) return false;
213  double nhit = (double)sr->slc.nhit;
214  if(nhit <= 0.) return false;
215  if(sr->slc.calE/nhit <= 0.018) return false;
216  if(std::min(sr->sel.nuecosrej.starttop, sr->sel.nuecosrej.stoptop) < 480) return false;
217  return true;
218  });
219  const Cut kCosRejMinusEpH(
220  [](const caf::SRProxy* sr)
221  {
222  double numucontpid = sr->sel.cosrej.numucontpid;
223  double partptp = sr->sel.nuecosrej.partptp;
224  if(sr->vtx.elastic.fuzzyk.nshwlid == 0) return false;
225  if(numucontpid <= 0.5) return false;
226  if(partptp >= 0.8) return false;
227  if(sr->vtx.elastic.fuzzyk.png[0].shwlid.lid.ismuon == 1) return false;
228  if(std::min(sr->sel.nuecosrej.starttop, sr->sel.nuecosrej.stoptop) < 480) return false;
229  return true;
230  });
231  const Cut kCosRejMinusTop(
232  [](const caf::SRProxy* sr)
233  {
234  double numucontpid = sr->sel.cosrej.numucontpid;
235  double partptp = sr->sel.nuecosrej.partptp;
236  if(sr->vtx.elastic.fuzzyk.nshwlid == 0) return false;
237  if(numucontpid <= 0.5) return false;
238  if(partptp >= 0.8) return false;
239  if(sr->vtx.elastic.fuzzyk.png[0].shwlid.lid.ismuon == 1) return false;
240  double nhit = (double)sr->slc.nhit;
241  if(nhit <= 0.) return false;
242  if(sr->slc.calE/nhit <= 0.018) return false;
243  return true;
244  });
245 
246  const Cut kNM1NCSelND = kNusNDPresel && kNusCosRej && kNCCalERange;
247  const Cut kNM1CosRejMod = kNusNDPresel && kNusNCSel && kNCCalERange;
248 
249  const Cut kCosRejModMinusPTP(
250  [](const caf::SRProxy* sr)
251  {
252  if(sr->vtx.elastic.fuzzyk.nshwlid == 0) return false;
253  if(sr->vtx.elastic.fuzzyk.png[0].shwlid.lid.ismuon == 1) return false;
254  double nhit = (double)sr->slc.nhit;
255  if(nhit <= 0.) return false;
256  if(sr->slc.calE/nhit <= 0.009) return false;
257  return true;
258  });
259  const Cut kCosRejModMinusEpH(
260  [](const caf::SRProxy* sr)
261  {
262  double partptp = sr->sel.nuecosrej.partptp;
263  if(sr->vtx.elastic.fuzzyk.nshwlid == 0) return false;
264  if(partptp >= 0.8) return false;
265  if(sr->vtx.elastic.fuzzyk.png[0].shwlid.lid.ismuon == 1) return false;
266  double nhit = (double)sr->slc.nhit;
267  if(nhit <= 0.) return false;
268  return true;
269  });
270 
271  std::map<std::string, Sample> samples;
272  samples["CalE"] = MakeSample(
273  kNCAllEAxis, kNumuCCAllEAxis,
275  );
276  samples["VtxX"] = MakeSample(
277  kAxisVtxX, kNCBinsNumuCCAxis,
278  kNusND, kNM1Fid && kFidMinusX
279  );
280  samples["VtxY"] = MakeSample(
281  kAxisVtxY, kNCBinsNumuCCAxis,
282  kNusND, kNM1Fid && kFidMinusY
283  );
284  samples["VtxZ"] = MakeSample(
285  kAxisVtxZ, kNCBinsNumuCCAxis,
286  kNusND, kNM1Fid && kFidMinusZ
287  );
288  samples["CVN"] = MakeSample(
289  kAxisCVN, kNCBinsNumuCCAxis,
290  kNM1NCSelND && kNCSelMinusCVN,
291  kNM1NCSel && kNCSelMinusCVN
292  );
293  samples["CosBDT"] = MakeSample(
294  kAxisNCP, kNCBinsNumuCCAxis,
295  kNusND, kNM1CosRej && kCosRejMinusNCP
296  );
297  samples["PTP"] = MakeSample(
298  kAxisPTP, kNCBinsNumuCCAxis,
299  kNM1CosRejMod && kCosRejModMinusPTP,
300  kNM1CosRej && kCosRejMinusPTP
301  );
302  samples["EperHit"] = MakeSample(
303  kAxisEpH, kNCBinsNumuCCAxis,
304  kNM1CosRejMod && kCosRejModMinusEpH,
305  kNM1CosRej && kCosRejMinusEpH
306  );
307  samples["DistTop"] = MakeSample(
308  kAxisTop, kNCBinsNumuCCAxis,
309  kNusND, kNM1CosRej && kCosRejMinusTop
310  );
311 
312  std::map<std::string, IDecomp*> ncdecomps;
313  std::map<std::string, IDecomp*> numudecomps;
314  std::map<std::string, ModularExtrapSterile*> extrap123bs;
315  std::map<std::string, ModularExtrapSterile*> extrap3c3ds;
316  std::map<std::string, PredictionSterile*> predst123bs;
317  std::map<std::string, PredictionSterile*> predst3c3ds;
318  std::map<std::string, PredictionCombinePeriods*> preds;
319  std::map<std::string, Spectrum*> cosmics;
320  std::map<std::string, Spectrum*> dataspecs;
321 
322  for(const auto& sample : samples) {
323  std::string axlabel = sample.first;
324 
325  ncdecomps[axlabel] = new ProportionalDecomp(
326  loaderNDMC, loaderNDdata,
327  *sample.second.axnc, *sample.second.nd,
329  );
330 
331  numudecomps[axlabel] = new ProportionalDecomp(
332  loaderNDMC, loaderNDdata,
333  *sample.second.axnumu, kNumuND,
335  );
336 
337  extrap123bs[axlabel] = new ModularExtrapSterile(
339  loaderNDMC, loaderFDMC_swp, loaderFDMC_non, loaderFDMC_tau,
340  *ncdecomps[axlabel], *numudecomps[axlabel],
341  *sample.second.axnc, *sample.second.axnumu,
342  *sample.second.fd, *sample.second.nd, kNumuND,
344  )
345  );
346 
347  extrap3c3ds[axlabel] = new ModularExtrapSterile(
349  loaderNDMC, loaderFDMC_swp_3c, loaderFDMC_non_3c, loaderFDMC_tau_3c,
350  *ncdecomps[axlabel], *numudecomps[axlabel],
351  *sample.second.axnc, *sample.second.axnumu,
352  *sample.second.fd, *sample.second.nd, kNumuND,
354  )
355  );
356 
357  predst123bs[axlabel] = new PredictionSterile(extrap123bs[axlabel]);
358  predst3c3ds[axlabel] = new PredictionSterile(extrap3c3ds[axlabel]);
359 
360  cosmics[axlabel] = new Spectrum(loaderFDdata, *sample.second.axnc,
361  kInTimingSideband && *sample.second.fd,
362  kNoShift, kTimingSidebandWeight);
363 
364  dataspecs[axlabel] = new Spectrum(loaderFDdata, *sample.second.axnc,
365  kInBeamSpill && *sample.second.fd);
366  }
367 
368  // Fill the spectra!
369  loaderNDMC.Go();
370  loaderNDdata.Go();
371  loaderFDMC_non.Go();
372  loaderFDMC_swp.Go();
373  loaderFDMC_tau.Go();
374  loaderFDMC_non_3c.Go();
375  loaderFDMC_swp_3c.Go();
376  loaderFDMC_tau_3c.Go();
377  loaderFDdata.Go();
378 
379  // Two scale factors for scaling spectra, 1 data yr and 3 data yr
381  const double pot_e3ce3d = kSecondAnaEpoch3cPOT+kSecondAnaEpoch3dPOT;
382 
383  for(const auto& sample : samples) {
384  std::string axlabel = sample.first;
385 
386  preds[axlabel] = new PredictionCombinePeriods({
387  std::make_pair(predst123bs[axlabel], pot_p1p2e3b),
388  std::make_pair(predst3c3ds[axlabel], pot_e3ce3d)
389  });
390  }
391 
392  // Set up output filename
393  TFile* rootF = new TFile(outfile.c_str(), "RECREATE");
394 
395  // Save all of the objects
396  TDirectory* tmp = gDirectory;
397  TDirectory* saveDir = gDirectory;
399  std::string sep = "__";
400 
401  for(const auto& sample : samples) {
402  std::string axlabel = sample.first;
403 
404  dir = "ncdecomp" + sep + axlabel;
405  saveDir = rootF->mkdir(dir.c_str());
406  ncdecomps[axlabel]->SaveTo(saveDir);
407 
408  dir = "numudecomp" + sep + axlabel;
409  saveDir = rootF->mkdir(dir.c_str());
410  numudecomps[axlabel]->SaveTo(saveDir);
411 
412  dir = "extrap123b" + sep + axlabel;
413  saveDir = rootF->mkdir(dir.c_str());
414  extrap123bs[axlabel]->SaveTo(saveDir);
415 
416  dir = "extrap3c3d" + sep + axlabel;
417  saveDir = rootF->mkdir(dir.c_str());
418  extrap3c3ds[axlabel]->SaveTo(saveDir);
419 
420  dir = "predst123b" + sep + axlabel;
421  saveDir = rootF->mkdir(dir.c_str());
422  predst123bs[axlabel]->SaveTo(saveDir);
423 
424  dir = "predst3c3d" + sep + axlabel;
425  saveDir = rootF->mkdir(dir.c_str());
426  predst3c3ds[axlabel]->SaveTo(saveDir);
427 
428  dir = "pred" + sep + axlabel;
429  saveDir = rootF->mkdir(dir.c_str());
430  preds[axlabel]->SaveTo(saveDir);
431 
432  dir = "cosmic" + sep + axlabel;
433  saveDir = rootF->mkdir(dir.c_str());
434  cosmics[axlabel]->SaveTo(saveDir);
435 
436  dir = "dataspec" + sep + axlabel;
437  saveDir = rootF->mkdir(dir.c_str());
438  dataspecs[axlabel]->SaveTo(saveDir);
439  }
440 
441  tmp->cd();
442  rootF->Close(); // Close the file
443 }
444 
445 Sample MakeSample(const HistAxis& axnc, const HistAxis& axnm,
446  const Cut& nd, const Cut& fd)
447 {
448  Sample ret;
449  ret.axnc = new HistAxis(axnc.label, axnc.bins, axnc.var);
450  ret.axnumu = new HistAxis(axnm.label, axnm.bins, axnm.var);
451  ret.nd = new Cut(nd);
452  ret.fd = new Cut(fd);
453 
454  return ret;
455 }
caf::Proxy< unsigned int > nshwlid
Definition: SRProxy.h:1999
const Cut kNusFDFiducial([](const caf::SRProxy *sr){ if(!sr->vtx.elastic.IsValid) return false;const TVector3 vtx=sr->vtx.elastic.vtx;if(vtx.X()< -680.0) return false;if(vtx.X() > 650.0) return false;if(vtx.Y()< -720.0) return false;if(vtx.Y() > 500.0) return false;if(vtx.Z()< 50.0) return false;if(vtx.Z() > 5450.0) return false;return true;})
FD Fiducial volume from docdb 15285.
Definition: NusCuts.h:17
caf::Proxy< caf::SRFuzzyK > fuzzyk
Definition: SRProxy.h:2018
_HistAxis< Var > HistAxis
Definition: HistAxis.h:103
Represent the binning of a Spectrum&#39;s x-axis.
Definition: Binning.h:16
float partptp
Definition: NusVarsTemp.cxx:50
Cuts and Vars for the 2020 FD DiF Study.
Definition: vars.h:6
caf::Proxy< float > stoptop
Definition: SRProxy.h:1036
void ExtendedAxesLoad(std::string outfile)
const double kSecondAnaPeriod2POT
Definition: Exposures.h:74
Sample(std::string shortName, std::string longName, Cut cut)
Definition: numu_cut_flow.C:98
const Var kCVNnc
PID
Definition: Vars.cxx:44
const Cut kNusEventQuality([](const caf::SRProxy *sr){if(!sr->vtx.elastic.IsValid) return false;if(sr->sel.nuecosrej.hitsperplane >=8) return false;if(sr->vtx.elastic.fuzzyk.nshwlid==0) return false;if(sr->vtx.elastic.fuzzyk.png[0].shwlid.gap >=100.) return false;if(sr->slc.ncontplanes<=2) return false;return true;})
Data Quality cuts from docdb 14241.
Definition: NusCuts.h:14
const Var kDistTop([](const caf::SRProxy *sr){return std::min(sr->sel.nuecosrej.starttop, sr->sel.nuecosrej.stoptop);})
Definition: NusVars.h:76
caf::Proxy< float > ncid
Definition: SRProxy.h:860
Proxy for caf::StandardRecord.
Definition: SRProxy.h:2085
const double kSecondAnaEpoch3dPOT
Definition: Exposures.h:77
const double kSecondAnaEpoch3bPOT
Definition: Exposures.h:75
const Cut kNusFDAllE
Definition: NusCuts.h:45
const Cut kNusNDPresel
Definition: NusCuts.h:69
nhit
Definition: demo1.py:25
const std::vector< std::string > fFDMC_non
const Cut kNusFDContain([](const caf::SRProxy *sr){const caf::SRNueCosRejProxy &cr=sr->sel.nuecosrej;if(std::min(cr.starteast, cr.stopeast)< 10) return false;if(std::min(cr.startwest, cr.stopwest)< 10) return false;if(std::min(cr.starttop, cr.stoptop) < 10) return false;if(std::min(cr.startbottom, cr.stopbottom)< 10) return false;if(std::min(cr.startfront, cr.stopfront)< 10) return false;if(std::min(cr.startback, cr.stopback)< 10) return false;return true;})
Containment variable for NC events from docdb 14241.
Definition: NusCuts.h:24
Float_t tmp
Definition: plot.C:36
void SetSpillCut(const SpillCut &cut)
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 double kSecondAnaPeriod1POT
Definition: Exposures.h:73
const Var kEPerHit([](const caf::SRProxy *sr){if(sr->slc.nhit >0) return 1000.0 *(sr->slc.calE/sr->slc.nhit);else return-5.;})
Definition: NueVarsExtra.h:14
const Cut kNusNCSel([](const caf::SRProxy *sr){if(sr->slc.nhit >=200) return false;if(sr->slc.nhit< 20) return false;if(sr->sel.cvn.ncid< 0.2) return false;return true;})
Cut that is more CC rejection than NC selection from docdb 15285.
Definition: NusCuts.h:27
caf::Proxy< float > starttop
Definition: SRProxy.h:1030
caf::Proxy< caf::SRCosRej > cosrej
Definition: SRProxy.h:1208
int isnan(const stan::math::var &a)
Definition: std_isnan.hpp:18
const Cut kInTimingSideband([](const caf::SRProxy *sr){if(sr->spill.run > util::kLastBadTimingRun) return(kInTimingSideband_before(sr)|| kInTimingSideband_after(sr));else return(kInTimingSideband_before(sr)|| kInTimingSideband_afterA(sr)|| kInTimingSideband_afterB(sr));}, [](const caf::SRSpillProxy *spill){if(spill->run > util::kLastBadTimingRun) return(kInTimingSideband_before.Livetime(spill)+ kInTimingSideband_after.Livetime(spill));else return(kInTimingSideband_before.Livetime(spill)+ kInTimingSideband_afterA.Livetime(spill)+ kInTimingSideband_afterB.Livetime(spill));}, [](const caf::SRSpillProxy *spill){return 0;})
Definition: TimingCuts.h:12
caf::Proxy< caf::SRElastic > elastic
Definition: SRProxy.h:2077
caf::Proxy< caf::SRNueCosRej > nuecosrej
Definition: SRProxy.h:1221
caf::Proxy< std::vector< caf::SRFuzzyKProng > > png
Definition: SRProxy.h:2002
const std::string fnamenear_concat
const Cut kNusNDAllE
Definition: NusCuts.h:70
HistAxis * axnc
const Var kNCP
caf::Proxy< unsigned int > nhit
Definition: SRProxy.h:1271
const Binning kXYBinsFD
#define SIMPLEVAR(CAFNAME)
For Vars where literally all you need is a single CAF variable.
Definition: Var.h:88
caf::Proxy< float > z
Definition: SRProxy.h:107
const Cut kNCCalERange
Definition: NusCuts.h:35
const std::string fnameneardata_concat
const Binning kZBinsFD
const Var kCaloE
Summed calorimetric energy of all hits in slice, uncorrected.
Definition: Vars.cxx:52
const std::vector< std::string > fFDMC_swp
caf::Proxy< float > x
Definition: SRProxy.h:105
caf::Proxy< caf::SRCVNResult > cvn
Definition: SRProxy.h:1209
const Var kNHit
Definition: Vars.cxx:71
const std::string fFDMC_non_3c
const Cut kNumuND
Definition: NumuCuts.h:55
const Var kCCE
Definition: NumuVars.h:21
_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< float > partptp
Definition: SRProxy.h:1013
virtual void Go() override
Load all the registered spectra.
std::vector< float > Spectrum
Definition: Constants.h:570
const char sep
const SystShifts kNoShift
Definition: SystShifts.cxx:21
::xsd::cxx::tree::string< char, simple_type > string
Definition: Database.h:154
const std::string fFDMC_tau_3c
const HistAxis kNCBinsNumuCCAxis("Reconstructed Neutrino Energy (GeV)", kNCDisappearanceEnergyBinning, kCCE)
Definition: HistAxes.h:9
caf::Proxy< bool > IsValid
Definition: SRProxy.h:2017
caf::Proxy< caf::SRSlice > slc
Definition: SRProxy.h:2101
Splits Data proportionally according to MC.
const Var kTuftsWeightCC
Definition: XsecTunes.h:31
Collaborates with Spectrum and OscillatableSpectrum to fill spectra from CAF files.
caf::Proxy< float > y
Definition: SRProxy.h:106
TDirectory * dir
Definition: macro.C:5
caf::Proxy< float > calE
Definition: SRProxy.h:1248
const std::vector< std::string > fFDMC_tau
caf::Proxy< caf::SRVector3D > vtx
Definition: SRProxy.h:2032
const std::string fFDMC_swp_3c
const Cut kInBeamSpill([](const caf::SRProxy *sr){if(sr->spill.run > util::kLastBadTimingRun) return kInBeamSpill_main(sr);else return kInBeamSpill_main(sr)||kInBeamSpill_shifted(sr);}, [](const caf::SRSpillProxy *spill){if(spill->run > util::kLastBadTimingRun) return kInBeamSpill_main.Livetime(spill);else return kInBeamSpill_main.Livetime(spill)+kInBeamSpill_shifted.Livetime(spill);}, [](const caf::SRSpillProxy *spill) -> double{return spill->spillpot;})
Does the event fall inside the window we call the beam spill?
Definition: TimingCuts.h:8
const Cut kNusFDPresel
Definition: NusCuts.h:38
A prediction object compatible with sterile oscillations.
const double kSecondAnaEpoch3cPOT
Definition: Exposures.h:76
const SpillCut kStandardSpillCuts
Apply this unless you&#39;re doing something special.
Definition: SpillCuts.h:49
Sum MC predictions from different periods scaled according to data POT targets.
HistAxis * axnumu
caf::Proxy< caf::SRIDBranch > sel
Definition: SRProxy.h:2100
T min(const caf::Proxy< T > &a, T b)
caf::Proxy< caf::SRVertexBranch > vtx
Definition: SRProxy.h:2105
static ModularExtrapSterile NCDisappearance(Loaders &loaders, const IDecomp &NCSurvDecomp, const IDecomp &NumuOscDecomp, const HistAxis &axis, const HistAxis &axisNumuND, const Cut &fdcut, const Cut &NCNDcut, const Cut &NumuNDcut, const SystShifts &shiftMC=kNoShift, const Var &weight=kUnweighted)
Creates a NC disappearance extrapolation.
static Binning Simple(int n, double lo, double hi, const std::vector< std::string > &labels={})
Definition: Binning.cxx:114
Sample MakeSample(const HistAxis &axnc, const HistAxis &axnm, const Cut &nd, const Cut &fd)
const Cut kNusND
Definition: NusCuts.h:71
FILE * outfile
Definition: dump_event.C:13
const Cut kNusCosRej([](const caf::SRProxy *sr){double numucontpid2019=sr->sel.cosrej.numucontpid2019;double partptp=sr->sel.nuecosrej.partptp;if(sr->vtx.elastic.fuzzyk.nshwlid==0) return false;if(numucontpid2019<=0.5) return false;if(partptp >=0.8) return false;if(sr->vtx.elastic.fuzzyk.png[0].shwlid.lid.ismuon==1) return false;double nhit=(double) sr->slc.nhit;if(nhit<=0.) return false;if(sr->slc.calE/nhit<=0.018) return false;if(std::min(sr->sel.nuecosrej.starttop, sr->sel.nuecosrej.stoptop)< 480) return false;return true;})
Cosmic rejection for the NC sample from docdb 15241.
Definition: NusCuts.h:33
const std::vector< std::string > fnamefardata_unblind(MakeUnblindList())