Classes | Typedefs | Functions | Variables
caf_numu_validation.C File Reference
#include "CAFAna/Cuts/Cuts.h"
#include "CAFAna/Cuts/NumuCuts.h"
#include "CAFAna/Core/Binning.h"
#include "CAFAna/Core/Spectrum.h"
#include "CAFAna/Core/Var.h"
#include "CAFAna/Core/SpectrumLoader.h"
#include "CAFAna/Systs/Systs.h"
#include "CAFAna/Systs/NumuSysts.h"
#include "CAFAna/Vars/NumuVars.h"
#include "CAFAna/Cuts/SpillCuts.h"
#include "CAFAna/Analysis/Plots.h"
#include "CAFAna/Analysis/Style.h"
#include "CAFAna/Vars/HistAxes.h"
#include "TCanvas.h"
#include "TFile.h"
#include "TGraph.h"
#include "TH1.h"
#include "TH2.h"
#include "TMath.h"
#include "TGaxis.h"
#include "TMultiGraph.h"
#include "TLegend.h"
#include "TLatex.h"
#include "TStyle.h"
#include "THStack.h"
#include "TPaveText.h"
#include "TList.h"
#include "TAttLine.h"
#include "TAttMarker.h"
#include <cmath>
#include <iostream>
#include <vector>
#include <list>
#include <sstream>
#include <string>
#include <fstream>
#include <iomanip>

Go to the source code of this file.

Classes

class  Tangible< T >
 
class  UsefulHist
 

Typedefs

typedef Tangible< CutSelection
 
typedef Tangible< HistAxisTangibleAxis
 

Functions

void Preliminary ()
 Put NOvA Preliminary on plots. More...
 
void caf_numu_validation (std::string kInputFileName, std::string kOutputFileName, bool isFD)
 

Variables

const Cut kIsDytmanMEC ({"mc.nnu","mc.nu.mode"}, [](const caf::StandardRecord *sr){if(sr->mc.nnu==0) return false;assert(sr->mc.nnu==1);return(sr->mc.nu[0].mode==caf::kMEC);})
 
const TVector3 beamDirFD = NuMIBeamDirection(caf::kFARDET)
 
const TVector3 beamDirND = NuMIBeamDirection(caf::kNEARDET)
 
const Var kNumuHadTrkE = SIMPLEVAR(energy.numusimp.hadtrkE)
 
const Var kQePId = SIMPLEVAR(sel.qepid.pid)
 
const Var kNonQeE = SIMPLEVAR(energy.numusimp.trknonqeE)
 
const Var kQepidOffE = SIMPLEVAR(sel.qepid.offE)
 
const Var kQepidEDiff = SIMPLEVAR(sel.qepid.ediff)
 
const Var kQepidEDiffZ = SIMPLEVAR(sel.qepid.ediffz)
 
const Var kQepidDedx = SIMPLEVAR(sel.qepid.dedx)
 
const Var kQeE = SIMPLEVAR(energy.numusimp.trkqeE)
 
const Var kQeAngleE = SIMPLEVAR(energy.numusimp.angleE)
 
const Var kQeHadE ({"energy.numusimp.trkqeE","energy.mutrkE","trk.nkalman","sel.remid.bestidx"}, [](const caf::StandardRecord *sr){if(sr->trk.nkalman > 0 &&sr->sel.remid.bestidx!=999) return sr->energy.numusimp.trkqeE-sr->energy.mutrkE[sr->sel.remid.bestidx].E;return-5.f;})
 
const Var kNumuTrackE ({"energy.mutrkE","trk.nkalman","sel.remid.bestidx"}, [](const caf::StandardRecord *sr){if(sr->trk.nkalman > 0 &&sr->sel.remid.bestidx!=999) return sr->energy.mutrkE[sr->sel.remid.bestidx].E;return-5.f;})
 
const Var kNumuHadVisE ({"energy.numusimp.hadcalE","energy.numusimp.hadtrkE"}, [](const caf::StandardRecord *sr){return sr->energy.numusimp.hadcalE+sr->energy.numusimp.hadtrkE;})
 
const Var kSlcUnCalibNHit ({"slc.nhit","slc.ncalhit"}, [](const caf::StandardRecord *sr){return sr->slc.nhit-sr->slc.ncalhit;})
 
const Var kSlcMeanTime ({"slc.meantime"}, [](const caf::StandardRecord *sr){return sr->slc.meantime/1000.;})
 
const Var kSlcStartTime ({"slc.starttime"}, [](const caf::StandardRecord *sr){return sr->slc.starttime/1000.;})
 
const Var kSlcEndTime ({"slc.endtime"}, [](const caf::StandardRecord *sr){return sr->slc.endtime/1000.;})
 
const Var kSlcMinX ({"slc.boxmin.fX"}, [](const caf::StandardRecord *sr){return sr->slc.boxmin.X()/100.;})
 
const Var kSlcMinY ({"slc.boxmin.fY"}, [](const caf::StandardRecord *sr){return sr->slc.boxmin.Y()/100.;})
 
const Var kSlcMinZ ({"slc.boxmin.fZ"}, [](const caf::StandardRecord *sr){return sr->slc.boxmin.Z()/100.;})
 
const Var kSlcMaxX ({"slc.boxmax.fX"}, [](const caf::StandardRecord *sr){return sr->slc.boxmax.X()/100.;})
 
const Var kSlcMaxY ({"slc.boxmax.fY"}, [](const caf::StandardRecord *sr){return sr->slc.boxmax.Y()/100.;})
 
const Var kSlcMaxZ ({"slc.boxmax.fZ"}, [](const caf::StandardRecord *sr){return sr->slc.boxmax.Z()/100.;})
 
const Var kSlcExtentX ({"slc.boxmax.fX","slc.boxmin.fX"}, [](const caf::StandardRecord *sr){return(sr->slc.boxmax.X()-sr->slc.boxmin.X())/100.;})
 
const Var kSlcExtentY ({"slc.boxmax.fY","slc.boxmin.fY"}, [](const caf::StandardRecord *sr){return(sr->slc.boxmax.Y()-sr->slc.boxmin.Y())/100.;})
 
const Var kSlcExtentZ ({"slc.boxmax.fZ","slc.boxmin.fZ"}, [](const caf::StandardRecord *sr){return(sr->slc.boxmax.Z()-sr->slc.boxmin.Z())/100.;})
 
const Var kTrkNPlaneGap ({"trk.kalman.nplanegap","trk.nkalman","sel.remid.bestidx"}, [](const caf::StandardRecord *sr){if(sr->trk.nkalman > 0 &&sr->sel.remid.bestidx!=999) return sr->trk.kalman[sr->sel.remid.bestidx].nplanegap;return(unsigned short) 500;})
 
const Var kCosNumi ({"hdr.det","sel.remid.bestidx","trk.kalman.dir.fX","trk.kalman.dir.fY","trk.kalman.dir.fZ"}, [](const caf::StandardRecord *sr){if(sr->trk.nkalman > 0 &&sr->sel.remid.bestidx!=999){if(sr->hdr.det==1){return sr->trk.kalman[sr->sel.remid.bestidx].dir.Dot(beamDirND);}if(sr->hdr.det==2){return sr->trk.kalman[sr->sel.remid.bestidx].dir.Dot(beamDirFD);}}return-5.;})
 
const Var kDirX ({"trk.nkalman","trk.kalman.dir.fX","sel.remid.bestidx"}, [](const caf::StandardRecord *sr){if(sr->trk.nkalman< 1) return-5.;return sr->trk.kalman[sr->sel.remid.bestidx].dir.X();})
 
const Var kDirY ({"trk.nkalman","trk.kalman.dir.fY","sel.remid.bestidx"}, [](const caf::StandardRecord *sr){if(sr->trk.nkalman< 1) return-5.;return sr->trk.kalman[sr->sel.remid.bestidx].dir.Y();})
 
const Var kSlcCalEPerNHit ({"slc.nhit","slc.calE"}, [](const caf::StandardRecord *sr){if(sr->slc.nhit > 0) return sr->slc.calE/(1.78 *sr->slc.nhit);return-5.;})
 
const Var kNonQeHadE ({"energy.numusimp.trknonqeE","energy.mutrkE","trk.nkalman","sel.remid.bestidx"}, [](const caf::StandardRecord *sr){if(sr->trk.nkalman > 0 &&sr->sel.remid.bestidx!=999) return sr->energy.numusimp.trknonqeE-sr->energy.mutrkE[sr->sel.remid.bestidx].E;return-5.f;})
 

Typedef Documentation

Definition at line 89 of file caf_numu_validation.C.

Definition at line 90 of file caf_numu_validation.C.

Function Documentation

void caf_numu_validation ( std::string  kInputFileName,
std::string  kOutputFileName,
bool  isFD 
)

Definition at line 272 of file caf_numu_validation.C.

References ana::SpectrumLoaderBase::AddSpillHistogram(), om::cout, allTimeWatchdog::endl, ana::SpectrumLoader::Go(), analysePickle::hist, hists, ana::kCaloE, ana::kCCE, ana::kCosNumi, ana::kDirX, ana::kDirY, ana::kDirZ, ana::kEnergyBinning, ana::kHadE, ana::kHadEPerNHit, ana::kHadNHit, ana::kHadronicEnergyBinning, ana::kIsDytmanMEC, ana::kNHit, ana::kNKalman, ana::kNonQeHadE, ana::kNumuContainFD, ana::kNumuContainND, ana::kNumuCosmicRej, ana::kNumuHadCalE, ana::kNumuHadVisE, ana::kNumuNCRej, ana::kNumuQuality, kNumuTrackE, ana::kQeHadE, ana::kRemID, ana::kRemidBinning, ana::kReMIdDEDxLLH, ana::kReMIdMeasFrac, ana::kReMIdScatLLH, ana::kSlcCalEPerNHit, ana::kSlcEndTime, ana::kSlcExtentX, ana::kSlcExtentY, ana::kSlcExtentZ, ana::kSlcMaxX, ana::kSlcMaxY, ana::kSlcMaxZ, ana::kSlcMeanTime, ana::kSlcMinX, ana::kSlcMinY, ana::kSlcMinZ, ana::kSlcStartTime, ana::kSlcUnCalibNHit, ana::kSliceDuration, ana::kStandardSpillCuts, ana::kTrkEndX, ana::kTrkEndY, ana::kTrkEndZ, kTrkEPerNHit(), ana::kTrkLength, ana::kTrkNhits, ana::kTrkNPlaneGap, ana::kTrkStartX, ana::kTrkStartY, ana::kTrkStartZ, kXYBins, kZBins, demo0::loader, pot, ana::SpectrumLoaderBase::SetSpillCut(), ana::Binning::Simple(), SIMPLEVAR, caf_analysis::spill, string, APDHVSetting::temp, and galleryMaker::tempName.

273 {
274  std::cout << "\nrun : ---- Running CAF NuMU Validation.\n";
275  std::cout << "run : input file name: " << kInputFileName << std::endl;
276  std::cout << "run : output file name: " << kOutputFileName << std::endl;
277  std::cout << "run : FD binning/cuts: " << isFD << std::endl;
278 
279  gStyle->SetMarkerStyle(kFullCircle);
280  TGaxis::SetMaxDigits(3);
281 
282  SpectrumLoader loader(kInputFileName);
283 
284  TH1D* spillHist = new TH1D("reco-spills", ";Detector;Spills", 3, 0, 3);
285  SpillVar spillRun({"det"}, [](const caf::SRSpill* spill) {return spill->det;});
286 
287  loader.SetSpillCut(kStandardSpillCuts);
288  loader.AddSpillHistogram(spillHist, spillRun, kStandardSpillCuts);
289 
290  const Binning kXYBins = Binning::Simple(55,-2.20,2.20);
291  const Binning kZBins = Binning::Simple(32, 0,16.00);
292  const Binning kFDXYBins = Binning::Simple(55,-8.0,8.0);
293  const Binning kFDZBins = Binning::Simple(55,0,60.00);
294  const Binning kEnergyBinning = Binning::Simple(50,0,5);
295  const Binning kHadronicEnergyBinning = Binning::Simple(50,0,5);
296 
297  std::vector<Selection> selections;
298 
299  if (isFD){
300  selections.emplace_back((!kIsDytmanMEC) && kNumuContainFD && kNumuQuality && kNumuCosmicRej, "NumuContainFD",
301  "Selected events pass numu containment, cosmic rejection and slice quality cuts. ");
302  selections.emplace_back((!kIsDytmanMEC) && kNumuContainFD && kNumuQuality && kNumuCosmicRej && kNumuNCRej, "NumuFD",
303  "Selected events pass numu containment, cosmic rejection, slice quality, and ReMId cuts. ");
304  }
305  else{
306  selections.emplace_back((!kIsDytmanMEC) && kNumuContainND && kNumuQuality, "NumuContainND",
307  "Selected events pass numu containment and slice quality cuts. ");
308  selections.emplace_back((!kIsDytmanMEC) && kNumuContainND && kNumuQuality && kNumuNCRej, "NumuND",
309  "Selected events pass numu containment, slice quality, and ReMId cuts. ");
310  }
311 
312  std::vector<Selection> selectionsForQePId;
313 
314  if (isFD){
315  selectionsForQePId.emplace_back((!kIsDytmanMEC) && kNumuContainFD && kNumuQuality && kNumuCosmicRej && kNumuNCRej
316  && SIMPLEVAR(trk.nkalman)==1, "NumuFD1trk",
317  "Selected events pass numu containment, cosmic rejection, slice quality, ReMId cuts and have 1 track. ");
318 
319  selectionsForQePId.emplace_back((!kIsDytmanMEC) && kNumuContainFD && kNumuQuality && kNumuCosmicRej && kNumuNCRej
320  && SIMPLEVAR(trk.nkalman)==2, "NumuFD2trk",
321  "Selected events pass numu containment, cosmic rejection, slice quality, ReMId cuts and have 2 tracks. ");
322  }
323  else{
324  selectionsForQePId.emplace_back((!kIsDytmanMEC) && kNumuContainND && kNumuQuality && kNumuNCRej
325  && SIMPLEVAR(trk.nkalman)==1, "NumuND1trk",
326  "Selected events pass numu containment, slice quality, ReMId cuts and have 1 track. ");
327 
328  selectionsForQePId.emplace_back((!kIsDytmanMEC) && kNumuContainND && kNumuQuality && kNumuNCRej
329  && SIMPLEVAR(trk.nkalman)==2, "NumuND2trk",
330  "Selected events pass numu containment, slice quality, ReMId cuts and have 2 tracks. ");
331  }
332 
333  std::vector<TangibleAxis> variables;
334 
335  variables.emplace_back(
336  HistAxis("Reconstructed Neutrino Energy [GeV]", kEnergyBinning, kCCE),
337  "reco-numuE", "CC energy estimator. ");
338 
339  variables.emplace_back(
340  HistAxis("Slice N_{Hit}", Binning::Simple(50, 0, 500), kNHit),
341  "reco-slcNHit", "Number of hits in slice. " );
342 
343  variables.emplace_back(
344  HistAxis("Slice Calorimetric Energy [GeV]", kEnergyBinning, kCaloE),
345  "reco-calE", "Calorimetric energy of slice. " );
346 
347  variables.emplace_back(
348  HistAxis("Reconstructed Hadronic Energy [GeV]", kHadronicEnergyBinning, kHadE),
349  "reco-hadE", "Hadronic enery, i.e. numu energy estimate minus muon track energy. " );
350 
351  variables.emplace_back(
352  HistAxis("Muon Track Energy [GeV]", Binning::Simple(50, 0, 5), kNumuTrackE),
353  "reco-numuTrackE", "Muon track Energy. " );
354 
355  variables.emplace_back(
356  HistAxis("Average Hadronic Energy Per Hit [GeV]", Binning::Simple(40, 0, 0.04), kHadEPerNHit),
357  "reco-hadEPerNHit", "Average energy per hit in hadronic cluster, i.e. had_E/had_n_hit. " );
358 
359  variables.emplace_back(
360  HistAxis("Average Track Energy Per Hit [GeV]", Binning::Simple(40, 0, 0.04), kTrkEPerNHit),
361  "reco-trkEPerNHit", "Average energy per hit on primary track, i.e. trk_E/trk_n_hit. " );
362 
363  variables.emplace_back(
364  HistAxis("Hadronic N_{Hit}", Binning::Simple(50, 0, 100), kHadNHit),
365  "reco-hadNHit", "Number of hits in hadronic cluster. ");
366 
367  variables.emplace_back(
368  HistAxis("Off-track Calorimetric Hadronic Energy [GeV]", kHadronicEnergyBinning, kNumuHadCalE),
369  "reco-hadCalE", "Sum of calibrated energy deposits in hadronic cluster. " );
370 
371  variables.emplace_back(
372  HistAxis("On-track Calorimetric Hadronic Energy [GeV]", Binning::Simple(50, 0, 0.5), kNumuHadTrkE),
373  "reco-hadTrkE", "Sum of calibrated hadronic energy deposits on the muon track. " );
374 
375  variables.emplace_back(
376  HistAxis("Calorimetric Hadronic Energy [GeV]", kHadronicEnergyBinning, kNumuHadVisE),
377  "reco-hadVisE", "Sum of calibrated hadronic energy, both on and off the muon track. " );
378 
379  if(isFD){
380  variables.emplace_back(
381  HistAxis("Slice Maximum Y [m]", kFDXYBins, kSlcMaxY),
382  "reco-maxy", "Maximum Y position of slice. " );
383  }
384 
385  else{
386  variables.emplace_back(
387  HistAxis("Slice Maximum Y [m]", kXYBins, kSlcMaxY),
388  "reco-maxy", "Maximum Y position of slice. " );
389  }
390 
391  variables.emplace_back(
392  HistAxis("Number of Tracks in Slice", Binning::Simple(14, 1, 15), kNKalman),
393  "reco-nkal", "Number of tracks in slice. " );
394 
395  variables.emplace_back(
396  HistAxis("Number of Hits in Slice", Binning::Simple(50, 0, 500), kNHit),
397  "reco-nhit", "Number of hits in slice. " );
398 
399  if(isFD){
400  variables.emplace_back(
401  HistAxis("Track Start X Position [m]", kFDXYBins, kTrkStartX),
402  "reco-trkStartX", "Track start x position. " );
403 
404  variables.emplace_back(
405  HistAxis("Track Start Y Position [m]", kFDXYBins, kTrkStartY),
406  "reco-trkStartY", "Track start y position. " );
407 
408  variables.emplace_back(
409  HistAxis("Track Start Z Position [m]", kFDZBins, kTrkStartZ),
410  "reco-trkStartZ", "Track start z position. " );
411 
412  variables.emplace_back(
413  HistAxis("Track End X Position [m]", kFDXYBins, kTrkEndX),
414  "reco-trkEndX", "Track stop x position. " );
415 
416  variables.emplace_back(
417  HistAxis("Track End Y Position [m]", kFDXYBins, kTrkEndY),
418  "reco-trkEndY", "Track stop y position. " );
419 
420  variables.emplace_back(
421  HistAxis("Track End Z Position [m]", kFDZBins, kTrkEndZ),
422  "reco-trkEndZ", "Track stop z position. " );
423 
424  variables.emplace_back(
425  HistAxis("Slice Duration [ns]", Binning::Simple(50,0,3000), kSliceDuration),
426  "reco-sliceDuration", "Slice duration. " );
427  }
428 
429  else{
430  variables.emplace_back(
431  HistAxis("Track Start X Position [m]", kXYBins, kTrkStartX),
432  "reco-trkStartX", "Track start x position. " );
433 
434  variables.emplace_back(
435  HistAxis("Track Start Y Position [m]", kXYBins, kTrkStartY),
436  "reco-trkStartY", "Track start y position. " );
437 
438  variables.emplace_back(
439  HistAxis("Track Start Z Position [m]", kZBins, kTrkStartZ),
440  "reco-trkStartZ", "Track start z position. " );
441 
442  variables.emplace_back(
443  HistAxis("Track End X Position [m]", kXYBins, kTrkEndX),
444  "reco-trkEndX", "Track stop x position. " );
445 
446  variables.emplace_back(
447  HistAxis("Track End Y Position [m]", kXYBins, kTrkEndY),
448  "reco-trkEndY", "Track stop y position. " );
449 
450  variables.emplace_back(
451  HistAxis("Track End Z Position [m]", kZBins, kTrkEndZ),
452  "reco-trkEndZ", "Track stop z position. " );
453 
454  variables.emplace_back(
455  HistAxis("Slice Duration [ns]", Binning::Simple(50,0,500), kSliceDuration),
456  "reco-sliceDuration", "Slice duration. " );
457  }
458 
459  variables.emplace_back(
460  HistAxis("Number of Hits on Primary Track", Binning::Simple(50,0,500), kTrkNhits),
461  "reco-trkNhits", "Number of hits on primary track. ");
462 
463  variables.emplace_back(
464  HistAxis("Primary Track Length [m]", Binning::Simple(50,0,16), kTrkLength),
465  "reco-trkLength", "Primary track length. " );
466 
467  variables.emplace_back(
468  HistAxis("ReMId Input: Scattering Log-likelihood", Binning::Simple(50,-0.5,0.5), kReMIdScatLLH),
469  "reco-scatLL", "ReMId scattering log log-likelihood for primary track. " );
470 
471  variables.emplace_back(
472  HistAxis("ReMId Input: dE/dx Log-likelihood", Binning::Simple(50,-3,1), kReMIdDEDxLLH),
473  "reco-dedxLL", "ReMId dE/dx log log-likelihood for primary track. " );
474 
475  variables.emplace_back(
476  HistAxis("ReMId Input: Non-hadronic Plane Fraction", Binning::Simple(50,0,1), kReMIdMeasFrac),
477  "reco-nonHadPlaneFrac", "ReMId Non-hadronic plane fraction. " );
478 
479  variables.emplace_back(
480  HistAxis("ReMId", kRemidBinning, kRemID),
481  "reco-remid", "ReMId kNN score. " );
482 
483  variables.emplace_back(
484  HistAxis("Number of Uncalibrated Hits in Slice", Binning::Simple(50, 0, 50), kSlcUnCalibNHit),
485  "reco-slcUnCalibNHit", "Uncalibrated slice nhit. " );
486 
487  variables.emplace_back(
488  HistAxis("Slice Mean Time [#mus]", Binning::Simple(60, -50, 550), kSlcMeanTime),
489  "reco-slcMeanTime", "Slice mean time TNS in microseconds. " );
490 
491  variables.emplace_back(
492  HistAxis("Slice Start Time [#mus]", Binning::Simple(60, -50, 550), kSlcStartTime),
493  "reco-slcStartTime", "Slice start time TNS in microseconds. " );
494 
495  variables.emplace_back(
496  HistAxis("Slice End Time [#mus]", Binning::Simple(60, -50, 550), kSlcEndTime),
497  "reco-slcEndTime", "Slice end time TNS in microseconds. " );
498 
499  if(isFD){
500  variables.emplace_back(
501  HistAxis("Slice Minimum X [m]", kFDXYBins, kSlcMinX),
502  "reco-slcMinX", "Slice Min X [m]. " );
503 
504  variables.emplace_back(
505  HistAxis("Slice Minimum Y [m]", kFDXYBins, kSlcMinY),
506  "reco-slcMinY", "Slice Min Y [m]. " );
507 
508  variables.emplace_back(
509  HistAxis("Slice Minimum Z [m]", kFDZBins, kSlcMinZ),
510  "reco-slcMinZ", "Slice Min Z [m]. " );
511 
512  variables.emplace_back(
513  HistAxis("Slice Maximum X [m]", kFDXYBins, kSlcMaxX),
514  "reco-slcMaxX", "Slice Max X [m]. " );
515 
516  variables.emplace_back(
517  HistAxis("Slice Maximum Y [m]", kFDXYBins, kSlcMaxY),
518  "reco-slcMaxY", "Slice Max Y [m]. " );
519 
520  variables.emplace_back(
521  HistAxis("Slice Maximum Z [m]", kFDZBins, kSlcMaxZ),
522  "reco-slcMaxZ", "Slice Max Z [m]. " );
523 
524  variables.emplace_back(
525  HistAxis("Slice Extent X [m]", Binning::Simple(55, 0, 16.0), kSlcExtentX),
526  "reco-slcExtentX", "Slice Extent X [m]. " );
527 
528  variables.emplace_back(
529  HistAxis("Slice Extent Y [m]", Binning::Simple(55, 0, 16.0), kSlcExtentY),
530  "reco-slcExtentY", "Slice Extent Y [m]. " );
531 
532  variables.emplace_back(
533  HistAxis("Slice Extent Z [m]", Binning::Simple(55, 0, 60.0), kSlcExtentZ),
534  "reco-slcExtentZ", "Slice Extent Z [m]. " );
535  }
536 
537  else{
538  variables.emplace_back(
539  HistAxis("Slice Minimum X [m]", kXYBins, kSlcMinX),
540  "reco-slcMinX", "Slice Min X [m]. " );
541 
542  variables.emplace_back(
543  HistAxis("Slice Minimum Y [m]", kXYBins, kSlcMinY),
544  "reco-slcMinY", "Slice Min Y [m]. " );
545 
546  variables.emplace_back(
547  HistAxis("Slice Minimum Z [m]", kZBins, kSlcMinZ),
548  "reco-slcMinZ", "Slice Min Z [m]. " );
549 
550  variables.emplace_back(
551  HistAxis("Slice Maximum X [m]", kXYBins, kSlcMaxX),
552  "reco-slcMaxX", "Slice Max X [m]. " );
553 
554  variables.emplace_back(
555  HistAxis("Slice Maximum Y [m]", kXYBins, kSlcMaxY),
556  "reco-slcMaxY", "Slice Max Y [m]. " );
557 
558  variables.emplace_back(
559  HistAxis("Slice Maximum Z [m]", kZBins, kSlcMaxZ),
560  "reco-slcMaxZ", "Slice Max Z [m]. " );
561 
562  variables.emplace_back(
563  HistAxis("Slice Extent X [m]", Binning::Simple(55, 0, 4.4), kSlcExtentX),
564  "reco-slcExtentX", "Slice Extent X [m]. " );
565 
566  variables.emplace_back(
567  HistAxis("Slice Extent Y [m]", Binning::Simple(55, 0, 4.4), kSlcExtentY),
568  "reco-slcExtentY", "Slice Extent Y [m]. " );
569 
570  variables.emplace_back(
571  HistAxis("Slice Extent Z [m]", Binning::Simple(18, 0, 16), kSlcExtentZ),
572  "reco-slcExtentZ", "Slice Extent Z [m]. " );
573  }
574 
575  variables.emplace_back(
576  HistAxis("Kalman Track Cos #theta_{X}", Binning::Simple(100, -1, 1), kDirX),
577  "reco-dirX", "X-direction of muon track. " );
578 
579  variables.emplace_back(
580  HistAxis("Kalman Track Cos #theta_{Y}", Binning::Simple(100, -1, 1), kDirY),
581  "reco-dirY", "Y-direction of muon track. " );
582 
583  variables.emplace_back(
584  HistAxis("Kalman Track Cos #theta_{Z}", Binning::Simple(50, 0, 1), kDirZ),
585  "reco-dirZ", "Z-direction of muon track. " );
586 
587  variables.emplace_back(
588  HistAxis("Kalman Track Cos #theta_{NuMI}", Binning::Simple(50, 0, 1), kCosNumi),
589  "reco-cosNumi", "Beam direction of muon track. " );
590 
591  variables.emplace_back(
592  HistAxis("Number of Missing Planes in Primary Track", Binning::Simple(50, 0, 50),
593  kTrkNPlaneGap),
594  "reco-trkNPlaneGap", "Track N Plane Gap. " );
595 
596  variables.emplace_back(
597  HistAxis("Visible Slice Energy Per Hit [GeV]", Binning::Simple(40, 0, 0.04),
599  "reco-slcCalEPerNHit", "Slice Energy Per Slice NHit. " );
600 
601  /////////////////////////////////////////////////////
602  std::vector<TangibleAxis> variablesForQePId;
603 
604  variablesForQePId.emplace_back(
605  HistAxis("QePId", Binning::Simple(51, -0.01, 1.01), kQePId),
606  "reco-qepid", "QePId kNN score. " );
607 
608  variablesForQePId.emplace_back(
609  HistAxis("Non QE Neutrino Energy [GeV]", Binning::Simple(50, 0, 5), kNonQeE),
610  "reco-nonQeE", "Non QE Energy. " );
611 
612  variablesForQePId.emplace_back(
613  HistAxis("Hadronic Non-QE Energy [GeV]", Binning::Simple(50, 0, 5), kNonQeHadE),
614  "reco-nonQeHadE", "Hadronic Non QE Energy. " );
615 
616  variablesForQePId.emplace_back(
617  HistAxis("QePId Input: Off-track Energy Ratio", Binning::Simple(100, 0, 1), kQepidOffE),
618  "reco-QepidOffE", "Off-track Energy Ratio, QePId. " );
619 
620  variablesForQePId.emplace_back(
621  HistAxis("QePId Input: Fractional Energy Difference", Binning::Simple(100, -1, 1),
622  kQepidEDiff),
623  "reco-QepidEDiff", "Fractional Energy Difference, QePId. " );
624 
625  variablesForQePId.emplace_back(
626  HistAxis("QePId Input: Fractional Energy Difference Z-test", Binning::Simple(100, -5, 5),
627  kQepidEDiffZ),
628  "reco-QepidEDiffZ", "Fractional Energy Difference Z-test, QePId. " );
629 
630  variablesForQePId.emplace_back(
631  HistAxis("QePId Input: dE/dx Ratio", Binning::Simple(100, 0, 5), kQepidDedx),
632  "reco-QepidDedx", "dE/dx Ratio, applied only to 2 trk events, QePId. " );
633 
634  variablesForQePId.emplace_back(
635  HistAxis("QE Neutrino Energy [GeV]", Binning::Simple(50, 0, 5), kQeE),
636  "reco-qeE", "QE energy. " );
637 
638  variablesForQePId.emplace_back(
639  HistAxis("Hadronic QE Energy [GeV]", Binning::Simple(50, 0, 5), kQeHadE),
640  "reco-qeHadE", "Hadronic energy for QE things. " );
641 
642  variablesForQePId.emplace_back(
643  HistAxis("QE Angle Neutrino Energy [GeV]", Binning::Simple(50, 0, 5), kQeAngleE),
644  "reco-qeAngleE", "QE angle formula energy. " );
645 
646  variablesForQePId.emplace_back(
647  HistAxis("Primary Track Energy [GeV]", Binning::Simple(50, 0, 5), kNumuTrackE),
648  "reco-numuTrackE", "Primary track Energy. " );
649 
650  variablesForQePId.emplace_back(
651  HistAxis("Visible Hadronic Energy [GeV]", Binning::Simple(50, 0, 2), kNumuHadVisE),
652  "reco-HadVisE", "Hadronic Energy . " );
653 
654 
655  std::vector<UsefulHist> hists;
656  hists.reserve(selections.size() * variables.size() + selectionsForQePId.size()
657  * variablesForQePId.size());
658 
659  for(const auto& sel:selections){
660  for(const auto& variable:variables){
661  hists.emplace_back(sel, variable, loader);
662  }
663  }
664 
665  for(const auto& sel:selectionsForQePId){
666  for(const auto& variable:variablesForQePId){
667  hists.emplace_back(sel, variable, loader);
668  }
669  }
670 
671  std::cout << "\nrun : --- run loader.\n";
672  loader.Go();
673  std::cout << "\nrun : --- done.\n";
674  double pot = hists[0].fHist.POT();
675 
676 
677  std::cout << "\nrun : --- save output.\n";
678  // TFile inputfile(kInputFileName.c_str(), "READ");
679  TFile outputfile(kOutputFileName.c_str(), "RECREATE");
680 
681  for(const auto& hist:hists){
682  TH1 *temp = hist.fHist.ToTH1(pot);
683  std::string tempName = hist.fName;
684  temp->Write(tempName.c_str());
685  }
686 
687  std::cout << "\nrun : --- save PoT.\n";
688 
689  TH1F *pothist = new TH1F("meta-TotalPOT", "TotalPOT", 1, 0, 1);
690  TH1F *evthist = new TH1F("meta-TotalEvents", "TotalEvents", 1, 0, 1);
691  pothist->SetBinContent(1, pot);
692  evthist->SetBinContent(1, spillHist->GetEntries());
693  pothist->Write("meta-TotalPOT");
694  evthist->Write("meta-TotalEvents");
695 
696  std::cout << "\nrun : --- close output files.\n";
697  // inputfile.Close();
698  outputfile.Write();
699  outputfile.Close();
700 
701  std::cout << "\nrun : --- done.\n";
702 }
const Var kHadE
Definition: NumuVars.h:23
const Var kQepidEDiff
const Var kDirY({"trk.nkalman","trk.kalman.dir.fY","sel.remid.bestidx"}, [](const caf::StandardRecord *sr){if(sr->trk.nkalman< 1) return-5.;return sr->trk.kalman[sr->sel.remid.bestidx].dir.Y();})
const Var kSlcExtentY({"slc.boxmax.fY","slc.boxmin.fY"}, [](const caf::StandardRecord *sr){return(sr->slc.boxmax.Y()-sr->slc.boxmin.Y())/100.;})
const Var kHadNHit([](const caf::SRProxy *sr){unsigned int nought=0;if(sr->trk.kalman.ntracks< 1) return nought;return sr->slc.nhit-sr->trk.kalman.tracks[0].nhit;})
Definition: NumuVars.h:61
const Var kQeHadE({"energy.numusimp.trkqeE","energy.mutrkE","trk.nkalman","sel.remid.bestidx"}, [](const caf::StandardRecord *sr){if(sr->trk.nkalman > 0 &&sr->sel.remid.bestidx!=999) return sr->energy.numusimp.trkqeE-sr->energy.mutrkE[sr->sel.remid.bestidx].E;return-5.f;})
const Var kDirZ([](const caf::SRProxy *sr){if(sr->trk.kalman.ntracks< 1) return 0.f;return sr->trk.kalman.tracks[0].dir.Z();})
const Var kNKalman
Definition: NumuVars.cxx:540
_HistAxis< Var > HistAxis
Definition: HistAxis.h:103
Represent the binning of a Spectrum&#39;s x-axis.
Definition: Binning.h:16
const Var kQeAngleE
const Var kReMIdScatLLH
Definition: NumuVars.cxx:555
const Binning kRemidBinning
Binning for plotting remid attractively.
Definition: Binning.cxx:80
const Var kQepidDedx
const Cut kIsDytmanMEC({"mc.nnu","mc.nu.mode"}, [](const caf::StandardRecord *sr){if(sr->mc.nnu==0) return false;assert(sr->mc.nnu==1);return(sr->mc.nu[0].mode==caf::kMEC);})
const Var kTrkStartY([](const caf::SRProxy *sr){if(sr->trk.kalman.ntracks< 1) return-10.0f;return sr->trk.kalman.tracks[0].start.Y()/100;})
Definition: NumuVars.h:52
const Var kTrkNPlaneGap({"trk.kalman.nplanegap","trk.nkalman","sel.remid.bestidx"}, [](const caf::StandardRecord *sr){if(sr->trk.nkalman > 0 &&sr->sel.remid.bestidx!=999) return sr->trk.kalman[sr->sel.remid.bestidx].nplanegap;return(unsigned short) 500;})
const Cut kNumuCosmicRej([](const caf::SRProxy *sr){return(sr->sel.cosrej.anglekal > 0.5 && sr->sel.cosrej.numucontpid2019 > 0.535 && sr->slc.nhit< 400);})
Definition: NumuCuts.h:32
const Var kSliceDuration([](const caf::SRProxy *sr){return(sr->slc.endtime-sr->slc.starttime);})
Definition: NumuVars.h:35
const Cut kNumuContainFD([](const caf::SRProxy *sr){ std::pair< int, int > planes=calcFirstLastLivePlane(sr->slc.firstplane, std::bitset< 14 >(sr->hdr.dibmask));int planestofront=sr->slc.firstplane-planes.first;int planestoback=planes.second-sr->slc.lastplane;return( sr->slc.ncellsfromedge > 1 &&planestofront > 1 &&planestoback > 1 &&sr->sel.contain.kalfwdcell > 10 &&sr->sel.contain.kalbakcell > 10 &&sr->sel.contain.cosfwdcell > 0 &&sr->sel.contain.cosbakcell > 0);})
Definition: NumuCuts.h:20
const Var kTrkEPerNHit([](const caf::SRProxy *sr){return(sr->trk.kalman.tracks[0].calE/sr->trk.kalman.tracks[0].nhit);})
const Var kSlcMaxX({"slc.boxmax.fX"}, [](const caf::StandardRecord *sr){return sr->slc.boxmax.X()/100.;})
TString hists[nhists]
Definition: bdt_com.C:3
const Var kSlcMaxZ({"slc.boxmax.fZ"}, [](const caf::StandardRecord *sr){return sr->slc.boxmax.Z()/100.;})
const Var kReMIdMeasFrac
Definition: NumuVars.cxx:557
const Var kTrkLength([](const caf::SRProxy *sr){if(sr->trk.kalman.ntracks< 1) return-5.f;return sr->trk.kalman.tracks[0].len/100;})
Definition: NumuVars.h:65
#define SIMPLEVAR(CAFNAME)
For Vars where literally all you need is a single CAF variable.
Definition: Var.h:88
const Var kHadEPerNHit([](const caf::SRProxy *sr){if(sr->trk.kalman.ntracks< 1) return 0.0f;int nHit=sr->slc.nhit-sr->trk.kalman.tracks[0].nhit;if(nHit<=0) return 0.0f;float hadE=sr->energy.numu.hadcalE;return hadE/nHit;})
Definition: NumuVars.h:63
const Cut kNumuContainND([](const caf::SRProxy *sr){return( sr->trk.kalman.ntracks > sr->trk.kalman.idxremid &&sr->slc.ncellsfromedge > 1 &&sr->slc.firstplane > 1 &&sr->slc.lastplane< 212 &&sr->trk.kalman.tracks[0].start.Z()< 1150 &&( sr->trk.kalman.tracks[0].stop.Z()< 1275 ||sr->sel.contain.kalyposattrans< 55) &&( sr->energy.numu.ndhadcalcatE +sr->energy.numu.ndhadcaltranE)< 0.03 &&sr->sel.contain.kalfwdcellnd > 4 &&sr->sel.contain.kalbakcellnd > 8);})
Definition: NumuCuts.h:22
const Var kNumuHadCalE
Definition: NumuVars.cxx:538
const Var kNonQeHadE({"energy.numusimp.trknonqeE","energy.mutrkE","trk.nkalman","sel.remid.bestidx"}, [](const caf::StandardRecord *sr){if(sr->trk.nkalman > 0 &&sr->sel.remid.bestidx!=999) return sr->energy.numusimp.trknonqeE-sr->energy.mutrkE[sr->sel.remid.bestidx].E;return-5.f;})
const Var kSlcStartTime({"slc.starttime"}, [](const caf::StandardRecord *sr){return sr->slc.starttime/1000.;})
const Var kQepidEDiffZ
const Var kSlcEndTime({"slc.endtime"}, [](const caf::StandardRecord *sr){return sr->slc.endtime/1000.;})
Track finder for cosmic rays.
const Var kDirX({"trk.nkalman","trk.kalman.dir.fX","sel.remid.bestidx"}, [](const caf::StandardRecord *sr){if(sr->trk.nkalman< 1) return-5.;return sr->trk.kalman[sr->sel.remid.bestidx].dir.X();})
const Var kQepidOffE
const Var kQePId
const Var kRemID
PID
Definition: Vars.cxx:81
const Var kCaloE
Summed calorimetric energy of all hits in slice, uncorrected.
Definition: Vars.cxx:52
const Var kSlcMinY({"slc.boxmin.fY"}, [](const caf::StandardRecord *sr){return sr->slc.boxmin.Y()/100.;})
const Var kSlcMinX({"slc.boxmin.fX"}, [](const caf::StandardRecord *sr){return sr->slc.boxmin.X()/100.;})
const Binning kHadronicEnergyBinning
const Var kTrkStartZ([](const caf::SRProxy *sr){if(sr->trk.kalman.ntracks< 1) return-10.0f;return sr->trk.kalman.tracks[0].start.Z()/100;})
Definition: NumuVars.h:53
const Var kCCE
Definition: NumuVars.h:21
#define pot
const Binning kXYBins
Definition: VarsAndCuts.h:102
const Var kSlcMaxY({"slc.boxmax.fY"}, [](const caf::StandardRecord *sr){return sr->slc.boxmax.Y()/100.;})
const Cut kNumuNCRej([](const caf::SRProxy *sr){return(sr->sel.remid.pid >0.75);})
Definition: NumuCuts.h:24
loader
Definition: demo0.py:10
const Var kNumuHadTrkE
const Var kNonQeE
const Var kSlcMeanTime({"slc.meantime"}, [](const caf::StandardRecord *sr){return sr->slc.meantime/1000.;})
const Var kTrkStartX([](const caf::SRProxy *sr){if(sr->trk.kalman.ntracks< 1) return-10.0f;return sr->trk.kalman.tracks[0].start.X()/100;})
Definition: NumuVars.h:51
const Var kTrkEndZ([](const caf::SRProxy *sr){if(sr->trk.kalman.ntracks< 1) return-10.0f;return sr->trk.kalman.tracks[0].stop.Z()/100;})
Definition: NumuVars.h:57
OStream cout
Definition: OStream.cxx:6
const Binning kEnergyBinning
const Var kSlcExtentX({"slc.boxmax.fX","slc.boxmin.fX"}, [](const caf::StandardRecord *sr){return(sr->slc.boxmax.X()-sr->slc.boxmin.X())/100.;})
const Var kNumuTrackE({"energy.mutrkE","trk.nkalman","sel.remid.bestidx"}, [](const caf::StandardRecord *sr){if(sr->trk.nkalman > 0 &&sr->sel.remid.bestidx!=999) return sr->energy.mutrkE[sr->sel.remid.bestidx].E;return-5.f;})
const Var kTrkEndY([](const caf::SRProxy *sr){if(sr->trk.kalman.ntracks< 1) return-10.0f;return sr->trk.kalman.tracks[0].stop.Y()/100;})
Definition: NumuVars.h:56
const Var kTrkEndX([](const caf::SRProxy *sr){if(sr->trk.kalman.ntracks< 1) return-10.0f;return sr->trk.kalman.tracks[0].stop.X()/100;})
Definition: NumuVars.h:55
Collaborates with Spectrum and OscillatableSpectrum to fill spectra from CAF files.
const Var kSlcUnCalibNHit({"slc.nhit","slc.ncalhit"}, [](const caf::StandardRecord *sr){return sr->slc.nhit-sr->slc.ncalhit;})
const Var kQeE
const Var kSlcCalEPerNHit({"slc.nhit","slc.calE"}, [](const caf::StandardRecord *sr){if(sr->slc.nhit > 0) return sr->slc.calE/(1.78 *sr->slc.nhit);return-5.;})
const Var kNumuHadVisE({"energy.numusimp.hadcalE","energy.numusimp.hadtrkE"}, [](const caf::StandardRecord *sr){return sr->energy.numusimp.hadcalE+sr->energy.numusimp.hadtrkE;})
const Var kReMIdDEDxLLH
Definition: NumuVars.cxx:556
string tempName
const SpillCut kStandardSpillCuts
Apply this unless you&#39;re doing something special.
Definition: SpillCuts.h:49
const Var kCosNumi({"hdr.det","sel.remid.bestidx","trk.kalman.dir.fX","trk.kalman.dir.fY","trk.kalman.dir.fZ"}, [](const caf::StandardRecord *sr){if(sr->trk.nkalman > 0 &&sr->sel.remid.bestidx!=999){if(sr->hdr.det==1){return sr->trk.kalman[sr->sel.remid.bestidx].dir.Dot(beamDirND);}if(sr->hdr.det==2){return sr->trk.kalman[sr->sel.remid.bestidx].dir.Dot(beamDirFD);}}return-5.;})
const Cut kNumuQuality
Definition: NumuCuts.h:18
const Var kSlcMinZ({"slc.boxmin.fZ"}, [](const caf::StandardRecord *sr){return sr->slc.boxmin.Z()/100.;})
Template for Var and SpillVar.
const Binning kZBins
Definition: VarsAndCuts.h:103
kNHit
Definition: demo1.py:19
const Var kSlcExtentZ({"slc.boxmax.fZ","slc.boxmin.fZ"}, [](const caf::StandardRecord *sr){return(sr->slc.boxmax.Z()-sr->slc.boxmin.Z())/100.;})
const Var kTrkNhits([](const caf::SRProxy *sr){if(sr->trk.kalman.ntracks< 1) return 65535;return int(sr->trk.kalman.tracks[0].nhit);})
Definition: NumuVars.h:59
enum BeamMode string
void Preliminary ( )

Put NOvA Preliminary on plots.

Definition at line 56 of file caf_numu_validation.C.

References kBlue, and prelim.

56  {
57  TLatex* prelim = new TLatex(.9, .95, "NO#nuA Preliminary");
58  prelim->SetTextColor(kBlue);
59  prelim->SetNDC();
60  prelim->SetTextSize(2/30.);
61  prelim->SetTextAlign(32);
62  prelim->Draw();
63 }
TLatex * prelim
Definition: Xsec_final.C:133
enum BeamMode kBlue

Variable Documentation

const TVector3 beamDirFD = NuMIBeamDirection(caf::kFARDET)

Definition at line 92 of file caf_numu_validation.C.

const TVector3 beamDirND = NuMIBeamDirection(caf::kNEARDET)

Definition at line 93 of file caf_numu_validation.C.

const Var kCosNumi({"hdr.det","sel.remid.bestidx","trk.kalman.dir.fX","trk.kalman.dir.fY","trk.kalman.dir.fZ"},[](const caf::StandardRecord *sr){if(sr->trk.nkalman > 0 &&sr->sel.remid.bestidx!=999){if(sr->hdr.det==1){return sr->trk.kalman[sr->sel.remid.bestidx].dir.Dot(beamDirND);}if(sr->hdr.det==2){return sr->trk.kalman[sr->sel.remid.bestidx].dir.Dot(beamDirFD);}}return-5.;})
const Var kDirX({"trk.nkalman","trk.kalman.dir.fX","sel.remid.bestidx"},[](const caf::StandardRecord *sr){if(sr->trk.nkalman< 1) return-5.;return sr->trk.kalman[sr->sel.remid.bestidx].dir.X();})
const Var kDirY({"trk.nkalman","trk.kalman.dir.fY","sel.remid.bestidx"},[](const caf::StandardRecord *sr){if(sr->trk.nkalman< 1) return-5.;return sr->trk.kalman[sr->sel.remid.bestidx].dir.Y();})
const Cut kIsDytmanMEC({"mc.nnu","mc.nu.mode"},[](const caf::StandardRecord *sr){if(sr->mc.nnu==0) return false;assert(sr->mc.nnu==1);return(sr->mc.nu[0].mode==caf::kMEC);})
const Var kNonQeE = SIMPLEVAR(energy.numusimp.trknonqeE)

Definition at line 97 of file caf_numu_validation.C.

const Var kNonQeHadE({"energy.numusimp.trknonqeE","energy.mutrkE","trk.nkalman","sel.remid.bestidx"},[](const caf::StandardRecord *sr){if(sr->trk.nkalman > 0 &&sr->sel.remid.bestidx!=999) return sr->energy.numusimp.trknonqeE-sr->energy.mutrkE[sr->sel.remid.bestidx].E;return-5.f;})
const Var kNumuHadTrkE = SIMPLEVAR(energy.numusimp.hadtrkE)

Definition at line 95 of file caf_numu_validation.C.

const Var kNumuHadVisE({"energy.numusimp.hadcalE","energy.numusimp.hadtrkE"},[](const caf::StandardRecord *sr){return sr->energy.numusimp.hadcalE+sr->energy.numusimp.hadtrkE;})
const Var kNumuTrackE({"energy.mutrkE","trk.nkalman","sel.remid.bestidx"},[](const caf::StandardRecord *sr){if(sr->trk.nkalman > 0 &&sr->sel.remid.bestidx!=999) return sr->energy.mutrkE[sr->sel.remid.bestidx].E;return-5.f;})

Referenced by caf_numu_validation().

const Var kQeAngleE = SIMPLEVAR(energy.numusimp.angleE)

Definition at line 103 of file caf_numu_validation.C.

const Var kQeE = SIMPLEVAR(energy.numusimp.trkqeE)

Definition at line 102 of file caf_numu_validation.C.

const Var kQeHadE({"energy.numusimp.trkqeE","energy.mutrkE","trk.nkalman","sel.remid.bestidx"},[](const caf::StandardRecord *sr){if(sr->trk.nkalman > 0 &&sr->sel.remid.bestidx!=999) return sr->energy.numusimp.trkqeE-sr->energy.mutrkE[sr->sel.remid.bestidx].E;return-5.f;})
const Var kQePId = SIMPLEVAR(sel.qepid.pid)

Definition at line 96 of file caf_numu_validation.C.

const Var kQepidDedx = SIMPLEVAR(sel.qepid.dedx)

Definition at line 101 of file caf_numu_validation.C.

const Var kQepidEDiff = SIMPLEVAR(sel.qepid.ediff)

Definition at line 99 of file caf_numu_validation.C.

const Var kQepidEDiffZ = SIMPLEVAR(sel.qepid.ediffz)

Definition at line 100 of file caf_numu_validation.C.

const Var kQepidOffE = SIMPLEVAR(sel.qepid.offE)

Definition at line 98 of file caf_numu_validation.C.

const Var kSlcCalEPerNHit({"slc.nhit","slc.calE"},[](const caf::StandardRecord *sr){if(sr->slc.nhit > 0) return sr->slc.calE/(1.78 *sr->slc.nhit);return-5.;})
const Var kSlcEndTime({"slc.endtime"},[](const caf::StandardRecord *sr){return sr->slc.endtime/1000.; })
const Var kSlcExtentX({"slc.boxmax.fX","slc.boxmin.fX"},[](const caf::StandardRecord *sr){return(sr->slc.boxmax.X()-sr->slc.boxmin.X())/100.; })
const Var kSlcExtentY({"slc.boxmax.fY","slc.boxmin.fY"},[](const caf::StandardRecord *sr){return(sr->slc.boxmax.Y()-sr->slc.boxmin.Y())/100.; })
const Var kSlcExtentZ({"slc.boxmax.fZ","slc.boxmin.fZ"},[](const caf::StandardRecord *sr){return(sr->slc.boxmax.Z()-sr->slc.boxmin.Z())/100.; })
const Var kSlcMaxX({"slc.boxmax.fX"},[](const caf::StandardRecord *sr){return sr->slc.boxmax.X()/100.; })
const Var kSlcMaxY({"slc.boxmax.fY"},[](const caf::StandardRecord *sr){return sr->slc.boxmax.Y()/100.; })
const Var kSlcMaxZ({"slc.boxmax.fZ"},[](const caf::StandardRecord *sr){return sr->slc.boxmax.Z()/100.; })
const Var kSlcMeanTime({"slc.meantime"},[](const caf::StandardRecord *sr){return sr->slc.meantime/1000.; })
const Var kSlcMinX({"slc.boxmin.fX"},[](const caf::StandardRecord *sr){return sr->slc.boxmin.X()/100.; })
const Var kSlcMinY({"slc.boxmin.fY"},[](const caf::StandardRecord *sr){return sr->slc.boxmin.Y()/100.; })
const Var kSlcMinZ({"slc.boxmin.fZ"},[](const caf::StandardRecord *sr){return sr->slc.boxmin.Z()/100.; })
const Var kSlcStartTime({"slc.starttime"},[](const caf::StandardRecord *sr){return sr->slc.starttime/1000.; })
const Var kSlcUnCalibNHit({"slc.nhit","slc.ncalhit"},[](const caf::StandardRecord *sr){return sr->slc.nhit-sr->slc.ncalhit;})
const Var kTrkNPlaneGap({"trk.kalman.nplanegap","trk.nkalman","sel.remid.bestidx"},[](const caf::StandardRecord *sr){if(sr->trk.nkalman > 0 &&sr->sel.remid.bestidx!=999) return sr->trk.kalman[sr->sel.remid.bestidx].nplanegap;return(unsigned short) 500;})