All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Namespaces | Classes | Typedefs | Enumerations | Functions | Variables
ana Namespace Reference

Oscillation analysis framework, runs over CAF files outside of ART. More...

Namespaces

 CosmicIdUtils
 
 Current
 Enumeration for interaction currents (CC/NC)
 
 ExampleAnalysis
 
 Flavors
 Enumeration of neutrino transition modes.
 
 SBNOsc
 
 Sign
 Enumeration for neutrino sign (neutrino/antineutrino)
 

Classes

class  TPCPurityInfoAna
 
class  NuFitPenalizer
 
class  Penalizer_GlbLike
 
class  NuFitPenalizerCDR
 
class  Penalizer_GlbLikeCDR
 
class  Fitter
 Perform MINUIT fits in one or two dimensions. More...
 
class  FitAxis
 Collect information describing the axis of a fit variable. More...
 
class  GradientDescent
 
class  MedianSurface
 
class  OscCalcNoHash
 Helper for Surface::FillSurfacePoint. More...
 
class  Surface
 Log-likelihood scan across two parameters. More...
 
class  Binning
 Represent the binning of a Spectrum's x-axis. More...
 
class  _Cut
 Template for Cut and SpillCut. More...
 
class  InstallHandlers
 
class  EnsembleRatio
 
class  EnsembleSpectrum
 
class  FileListSource
 Simple file source based on an explicit list provided by the user. More...
 
class  FileReducer
 Create smaller CAFs. More...
 
class  _HistAxis
 Collect information describing the x-axis of an analysis histogram. More...
 
class  HistCache
 Helper for Spectrum. More...
 
class  IFileSource
 Interface class for accessing ROOT files in sequence. More...
 
class  IFitVar
 Interface definition for fittable variables. More...
 
class  IConstrainedFitVar
 Base class for variables with constraints. Apply penalty outside range. More...
 
class  ISyst
 Encapsulate code to systematically shift a caf::StandardRecord. More...
 
class  Loaders
 Collection of SpectrumLoaders for many configurations. More...
 
class  MultiVar2DFunc
 Helper for MultiVar2D. More...
 
class  _MultiVar
 
class  OscCalcSterileApprox
 
class  OscCalcSterileApproxAdjustable
 
class  OscCurve
 Transition probability for any one channel as a function of energy. More...
 
class  OscillatableSpectrum
 Spectrum with true energy information, allowing it to be oscillated More...
 
class  ProfilerSupport
 Support for the –prof commandline option. More...
 
class  Progress
 A simple ascii-art progress bar. More...
 
class  Ratio
 Represent the ratio between two spectra. More...
 
class  ReweightableSpectrum
 Spectrum with the value of a second variable, allowing for reweighting More...
 
class  SAMProjectSource
 Fetch files from a pre-existing SAM project. More...
 
class  SAMQuerySource
 File source based on a SAM query or dataset (definition) More...
 
class  Spectrum
 Representation of a spectrum in any variable, with associated POT. More...
 
struct  CompareByID
 
class  CutVarCache
 Helper for HandleRecord. More...
 
class  SpectrumLoader
 Collaborates with Spectrum and OscillatableSpectrum to fill spectra from CAF files. More...
 
class  SpectrumLoaderBase
 Base class for the various types of spectrum loader. More...
 
class  NullLoader
 Dummy loader that doesn't load any files. More...
 
class  SystRegistry
 
class  SystShifts
 Simple record of shifts applied to systematic parameters. More...
 
class  ThreadPool
 A very simple thread pool for use by Surface. More...
 
class  DontAddDirectory
 Prevent histograms being added to the current directory. More...
 
class  IFDHSilent
 ifdh calls between construction and destruction produce no output More...
 
class  FloatingExceptionOnNaN
 Alter floating-point exception flag. More...
 
class  LLPerBinFracSystErr
 
class  Var2DFunc
 Helper for Var2D. More...
 
class  Var3DFunc
 Helper for Var3D. More...
 
class  _Var
 Most useful for combining weights. More...
 
class  WildcardSource
 File source based on a wildcard (glob) More...
 
class  CCFlavSel
 Helper for defining true CC event cuts. More...
 
class  NCFlavOrig
 Helper for defining true CC event cuts. More...
 
class  CountingExperiment
 Compare a data spectrum to MC expectation using only the event count. More...
 
class  GaussianConstraint
 A simple Gaussian constraint on an arbitrary IFitVar. More...
 
class  IExperiment
 Base class defining interface for experiments. More...
 
class  MultiExperiment
 Combine multiple component experiments. More...
 
class  MultiExperimentSBN
 Combine multiple component experiments. More...
 
class  RatioExperiment
 
class  ReactorExperiment
 Very simple model allowing inclusion of reactor constraints. More...
 
class  SingleSampleExperiment
 Compare a single data spectrum to the MC + cosmics expectation. More...
 
class  SolarConstraints
 Constraints on the parameters $ \Delta m^2_{21} $ and $ \sin^22\theta_{12} $ from solar experiments. More...
 
class  IExtrap
 Interface to extrapolation procedures. More...
 
class  TrivialExtrap
 "Extrapolation" that simply returns the MC prediction More...
 
class  IncrementalCholeskyDecomp
 
class  IPrediction
 Standard interface to all prediction techniques. More...
 
class  PredictionExtrap
 Take the output of an extrapolation and oscillate it as required. More...
 
class  IPredictionGenerator
 Given loaders and an MC shift, Generate() generates an IPrediction. More...
 
class  PredictionIncDirt
 Prediction summing detector and dirt components. More...
 
class  PredictionInterp
 Implements systematic errors by interpolation between shifted templates. More...
 
class  PredictionLinFit
 Parameterize a collection of universes as a function of the syst knobs. More...
 
class  PredictionNoExtrap
 Prediction that just uses one detector's MC, with no extrapolation. More...
 
class  NoExtrapPredictionGenerator
 
class  PredictionNoOsc
 Prediction that wraps a simple Spectrum. More...
 
class  NoOscPredictionGenerator
 
class  PredictionSBNExtrap
 TODO comment. More...
 
class  SBNExtrapGenerator
 
class  PredictionScaleComp
 Prediction broken down into arbitrary components whose scales can be varied independently. More...
 
class  BoosterFluxHadronSyst
 
struct  BoosterFluxHadronSystVector
 
class  EnergyScaleSyst
 
class  NuMIFluxSyst
 
class  UniverseWeight
 
class  SBNWeightSyst
 
class  SystComponentScale
 Uncertainty in the scale of a single component of the spectrum. More...
 
class  UniverseOracle
 
class  FitTheta13
 $ \theta_{13} $ More...
 
class  FitSinSq2Theta13
 $ \sin^22\theta_{13} $ More...
 
class  FitDeltaInPiUnits
 $ \delta_{CP}/\pi $ More...
 
class  FitTheta23
 $ \theta_{13} $ More...
 
class  FitSinSqTheta23
 $ \sin^2\theta_{23} $ More...
 
class  FitSinSq2Theta23
 $ \sin^22\theta_{23} $ More...
 
class  FitDmSq32
 $ \Delta m^2_{32} $ More...
 
class  FitDmSq32Scaled
 $ \Delta m^2_{32}\times10^3{\rm eV}^2 $ More...
 
class  FitTanSqTheta12
 $ \tan^2\theta_{12} $ More...
 
class  FitSinSq2Theta12
 $ \sin^22\theta_{12} $ More...
 
class  FitDmSq21
 $ \Delta m^2_{21} $ More...
 
class  FitRho
 $ \rho $ More...
 
class  FitDmSq32Sterile
 $ \Delta m^2_{32} $ More...
 
class  FitDmSq41Sterile
 $ \Delta m^2_{41} $ More...
 
class  FitDmSq43Sterile
 $ \Delta m^2_{43} $ More...
 
class  FitDelta13InPiUnitsSterile
 $ \delta_{13}/\pi $ More...
 
class  FitDelta14InPiUnitsSterile
 $ \delta_{13}/\pi $ More...
 
class  FitDelta24InPiUnitsSterile
 $ \delta_{24}/\pi $ More...
 
class  FitTheta13Sterile
 $ \theta_{13} $ More...
 
class  FitSinSqTheta13Sterile
 $ \sin^2\theta_{13} $ More...
 
class  FitTheta23Sterile
 $ \theta_{23} $ More...
 
class  FitSinSqTheta23Sterile
 $ \sin^2\theta_{23} $ More...
 
class  FitTheta14Sterile
 $ \theta_{14} $ More...
 
class  FitSinSqTheta14Sterile
 $ \sin^2\theta_{14} $ More...
 
class  FitSinSq2Theta14Sterile
 $ \sin^22\theta_{14} $ More...
 
class  FitTheta24Sterile
 $ \theta_{24} $ More...
 
class  FitSinSqTheta24Sterile
 $ \sin^2\theta_{24} $ More...
 
class  FitSinSq2Theta24Sterile
 $ \sin^22\theta_{24} $ More...
 
class  FitTheta34Sterile
 $ \theta_{34} $ More...
 
class  FitSinSqTheta34Sterile
 $ \sin^2\theta_{34} $ More...
 
class  FitSinSq2Theta34Sterile
 $ \sin^22\theta_{34} $ More...
 
class  FitTheta13InDegreesSterile
 $ \theta_{13} $ More...
 
class  FitTheta23InDegreesSterile
 $ \theta_{23} $ More...
 
class  FitTheta14InDegreesSterile
 $ \theta_{14} $ More...
 
class  FitTheta24InDegreesSterile
 $ \theta_{24} $ More...
 
class  FitTheta34InDegreesSterile
 $ \theta_{34} $ More...
 
class  FitDmSqSterile
 $ \Delta m^2 $ More...
 
class  FluxTimesNuclei
 
class  ApaCrossCosmicIdAlg
 
class  CosmicIdAlg
 
class  CpaCrossCosmicIdAlg
 
class  CrtHitCosmicIdAlg
 
class  CrtTrackCosmicIdAlg
 
class  FiducialVolumeCosmicIdAlg
 
class  GeometryCosmicIdAlg
 
class  PandoraT0CosmicIdAlg
 
class  StoppingParticleCosmicIdAlg
 
class  PFPSliceValidation
 

Typedefs

typedef double( ExposureFunc_t )(const caf::SRSpill *spill)
 
typedef _Cut< caf::SRSliceProxySliceCut
 Representation of a cut (selection) to be applied to a caf::StandardRecord object. More...
 
typedef _Cut< caf::SRSliceProxyCut
 
typedef _Cut< caf::SRSpillProxySpillCut
 Equivalent of Cut acting on caf::SRSpill. For use in spill-by-spill data quality cuts. More...
 
typedef _Cut
< caf::SRSpillTruthBranch > 
SpillTruthCut
 Cut designed to be used over the nuTree, ie all neutrinos, not just those that got slices. More...
 
typedef _HistAxis< VarHistAxis
 
typedef _HistAxis< SpillVarSpillHistAxis
 
typedef _MultiVar
< caf::SRSliceProxy
MultiVar
 
typedef _MultiVar
< caf::SRSpillProxy
SpillMultiVar
 
typedef _Var< caf::SRSliceProxyVar
 Representation of a variable to be retrieved from a caf::StandardRecord object. More...
 
typedef _Var< caf::SRSpillProxySpillVar
 Equivalent of Var acting on caf::SRSpill. More...
 

Enumerations

enum  SterileOscAngles { SterileOscAngles::kNone = 0, SterileOscAngles::kSinSq2ThetaMuMu = 1, SterileOscAngles::kSinSq2ThetaMuE = (1 << 1), SterileOscAngles::kSinSq2ThetaEE = (1 << 2) }
 
enum  DataSource { kBeam, kCosmic }
 Is this data-file representing beam spills or cosmic spills? More...
 
enum  EBinType { kBinContent, kBinDensity }
 
enum  EExposureType { kPOT, kLivetime }
 For use as an argument to Spectrum::ToTH1. More...
 
enum  EnergyScaleSystTerm { EnergyScaleSystTerm::kConstant, EnergyScaleSystTerm::kSqrt, EnergyScaleSystTerm::kInverseSqrt }
 
enum  EnergyScaleSystParticle {
  EnergyScaleSystParticle::kMuon, EnergyScaleSystParticle::kHadron, EnergyScaleSystParticle::kNeutron, EnergyScaleSystParticle::kEM,
  EnergyScaleSystParticle::kChargedHadron
}
 
enum  EnergyScaleSystDetector { EnergyScaleSystDetector::kSBND, EnergyScaleSystDetector::kMicroBooNE, EnergyScaleSystDetector::kICARUS, EnergyScaleSystDetector::kAll }
 
enum  ESide { ESide::kAbove, ESide::kBelow, ESide::kEither }
 Desired match type in UniverseOracle::ClosestShiftIndex. More...
 

Functions

void ResetOscCalcToDefault (osc::IOscCalcAdjustable *calc)
 Reset calc to default assumptions for all parameters. More...
 
osc::IOscCalcAdjustableDefaultOscCalc ()
 Create a new calc with default assumptions for all parameters. More...
 
void ResetOscCalcToDefaultIH (osc::IOscCalcAdjustable *calc)
 
osc::IOscCalcAdjustableDefaultOscCalcIH ()
 
void ResetSterileCalcToDefault (osc::OscCalcSterile *calc)
 Reset calc to default assumptions for all parameters. More...
 
osc::OscCalcSterile * DefaultSterileCalc (int nflavors)
 Create a sterile calc with default assumptions for all parameters. More...
 
osc::IOscCalcAdjustableNuFitOscCalc (int hie)
 
bool HasVar (std::vector< const IFitVar * > oscVars, std::string name)
 
osc::IOscCalcAdjustableThrownNuFitOscCalc (int hie, std::vector< const IFitVar * > oscVars)
 
osc::IOscCalcAdjustableNuFitOscCalcPlusOneSigma (int hie)
 
osc::IOscCalcAdjustableNuFitOscCalcCDR (int hie)
 
osc::IOscCalcAdjustableThrownNuFitOscCalcCDR (int hie)
 
osc::IOscCalcAdjustableNuFitOscCalcCDRPlusOneSigma (int hie)
 
void MakeNMinusOneSpectra (SpectrumLoader &loader, const Cut &sigcut, const Cut &presel, const std::vector< HistAxis > &axes, const std::vector< double > &cut_pos, std::vector< Spectrum > &sigs, std::vector< Spectrum > &bkgs)
 Make a series of spectra leaving out one cut in turn. More...
 
double FindOptimumCut (TH1 *hsig, TH1 *hbkg, double &best_fom)
 Search for optimum cut position given signal and background histograms. More...
 
double OptimizeOneCut (const std::string &wildcard, double pot, const Cut &sigcut, const Cut &presel, const std::vector< HistAxis > &axes, std::vector< double > &cut_pos)
 Scan all cuts and update the one giving the largest FOM gain. More...
 
void OptimizeCuts (const std::string &wildcard, double pot, const Cut &sigcut, const Cut &presel, const std::vector< HistAxis > &axes, std::vector< double > &cut_pos)
 Repeatedly invoke OptimizeOneCut until the FOM increase becomes small. More...
 
double SimpleFOM (const Spectrum &obs, const Spectrum &unosc, double pot=0)
 Figure-of-merit with no systematics, for binned data. More...
 
TH1 * Profile (const IExperiment *expt, osc::IOscCalcAdjustable *calc, const IFitVar *v, int nbinsx, double minx, double maxx, double minchi=-1, const std::vector< const IFitVar * > &profVars={}, const std::vector< const ISyst * > &profSysts={}, const std::map< const IFitVar *, std::vector< double >> &seedPts={}, const std::vector< SystShifts > &systsSeedPts={}, std::map< const IFitVar *, TGraph * > &profVarsMap=empty_vars_map, std::map< const ISyst *, TGraph * > &systsMap=empty_syst_map)
 $\chi^2$ scan in one variable, profiling over all others More...
 
TH1 * Profile (const IExperiment *expt, osc::IOscCalcAdjustable *calc, const ISyst *s, int nbinsx, double minx, double maxx, double input_minchi, const std::vector< const IFitVar * > &profVars, const std::vector< const ISyst * > &profSysts, const std::map< const IFitVar *, std::vector< double >> &seedPts, const std::vector< SystShifts > &systSeedPts, std::map< const IFitVar *, TGraph * > &profVarsMap, std::map< const ISyst *, TGraph * > &profSystsMap)
 
TH1 * SqrtProfile (const IExperiment *expt, osc::IOscCalcAdjustable *calc, const IFitVar *v, int nbinsx, double minx, double maxx, double minchi=-1, std::vector< const IFitVar * > profVars={}, std::vector< const ISyst * > profSysts={}, const std::map< const IFitVar *, std::vector< double >> &seedPts={}, const std::vector< SystShifts > &systsSeedPts={}, std::map< const IFitVar *, TGraph * > &profVarsMap=empty_vars_map, std::map< const ISyst *, TGraph * > &systsMap=empty_syst_map)
 Forward to Profile but sqrt the result for a crude significance. More...
 
TH1 * SqrtProfile (const IExperiment *expt, osc::IOscCalcAdjustable *calc, const ISyst *s, int nbinsx, double minx, double maxx, double minchi, std::vector< const IFitVar * > profVars, std::vector< const ISyst * > profSysts, const std::map< const IFitVar *, std::vector< double >> &seedPts, const std::vector< SystShifts > &systSeedPts, std::map< const IFitVar *, TGraph * > &profVarsMap, std::map< const ISyst *, TGraph * > &systsMap)
 
TH1 * Slice (const IExperiment *expt, osc::IOscCalcAdjustable *calc, const IFitVar *v, int nbinsx, double minx, double maxx, double minchi=-1)
 $\chi^2$ scan in one variable, holding all others constant More...
 
TH1 * Slice (const IExperiment *expt, osc::IOscCalcAdjustable *calc, const ISyst *s, int nbinsx, double minx, double maxx, double minchi)
 
TH1 * SqrtSlice (const IExperiment *expt, osc::IOscCalcAdjustable *calc, const IFitVar *v, int nbinsx, double minx, double maxx, double minchi=-1)
 Forward to Slice but sqrt the result for a crude significance. More...
 
TH1 * SqrtSlice (const IExperiment *expt, osc::IOscCalcAdjustable *calc, const ISyst *s, int nbinsx, double minx, double maxx, double minchi)
 
TGraph * FindValley (const IExperiment *expt, osc::IOscCalcAdjustable *calc, const IFitVar &scanVar, const IFitVar &fitVar, int nbinsx, double xmin, double xmax, const std::vector< const IFitVar * > &profVars={}, const std::vector< const ISyst * > &profSysts={}, const std::map< const IFitVar *, std::vector< double >> &seedPts={}, const std::vector< SystShifts > &systsSeedPts={}, bool transpose=false)
 Find the minimum in one variable as a function of another. More...
 
std::vector< double > FindCurveCrossings (TH1 *h, double critVal)
 Intended for use on the output of Profile. More...
 
Fitter::Precision operator| (Fitter::Precision a, Fitter::Precision b)
 
TH1 * DataMCComparison (const Spectrum &data, const Spectrum &mc)
 
TH1 * DataMCComparisonAreaNormalized (const Spectrum &data, const Spectrum &mc)
 
TH1 * DataMCComparisonComponents (const Spectrum &data, const IPrediction *mc, osc::IOscCalc *calc)
 Plot MC broken down into flavour components, overlayed with data. More...
 
TH1 * GetMCSystTotal (const IPrediction *mc, osc::IOscCalc *calc, const SystShifts &shift, std::string hist_name, double pot, bool force1D)
 
TH1 * GetMCTotal (const IPrediction *mc, osc::IOscCalc *calc, std::string hist_name, double pot, bool force1D)
 
std::vector< TH1 * > GetMCComponents (const IPrediction *mc, osc::IOscCalc *calc, std::string hist_name, double pot, bool force1D)
 
std::vector< TH1 * > GetMCSystComponents (const IPrediction *mc, osc::IOscCalc *calc, const SystShifts &shift, std::string hist_name, double pot, bool force1D)
 
std::vector< TH1 * > GetMCTotalForSystShifts (const IPrediction *mc, osc::IOscCalc *calc, const ISyst *syst, std::string hist_base_name, double pot, bool force1D)
 
void DataMCRatio (const Spectrum &data, const IPrediction *mc, osc::IOscCalc *calc, double miny=0, double maxy=3)
 Plot data/MC ratio for the given spectrum. Normalize MC to Data by POT. More...
 
void DataMCRatio (const Spectrum &data, const Spectrum &mc, double miny=0, double maxy=3)
 Plot data/MC ratio for the given spectrum. Normalize MC to Data by POT. More...
 
void DataMCAreaNormalizedRatio (const Spectrum &data, const IPrediction *mc, osc::IOscCalc *calc, double miny=0, double maxy=3)
 Plot data/MC ratio for the given spectrum. Normalize MC to Data by area. More...
 
void DataMCAreaNormalizedRatio (const Spectrum &data, const Spectrum &mc, double miny=0, double maxy=3)
 Plot data/MC ratio for the given spectrum. Normalize MC to Data by area. More...
 
void RatioPlot (const Spectrum &data, const Spectrum &expected, const Spectrum &fit, double miny=0, double maxy=1.2)
 Plot data/expected, compared with fit/expected. More...
 
void PlotWithSystErrorBand (IPrediction *pred, const std::vector< const ISyst * > &systs, osc::IOscCalc *calc, double pot, int col=-1, int errCol=-1, float headroom=1.3, bool newaxis=true)
 Plot prediction with +/-1sigma error band. More...
 
void PlotWithSystErrorBand (const Spectrum &nominal, const std::vector< Spectrum > &upShifts, const std::vector< Spectrum > &downShifts, double pot, int col=-1, int errCol=-1, float headroom=1.3, bool newaxis=true)
 Plot prediction with error band. More...
 
THStack * ToTHStack (const std::vector< std::pair< Spectrum, Color_t >> &s, double pot)
 Can call like ToTHStack({{h1, kRed}, {h2, kBlue}}, pot) More...
 
double PointDistanceToBox (double x, double y, double x0, double y0, double x1, double y1)
 Helper for AutoPlaceLegend. More...
 
TLegend * AutoPlaceLegend (double dx, double dy, double yPin=-1)
 Create a legend, maximizing distance from all histograms. More...
 
TGraphAsymmErrors * GraphWithPoissonErrors (const TH1 *h, bool noErrorsXaxis=false, bool drawEmptyBins=true)
 Calculate statistical errors appropriate for small Poisson numbers. More...
 
TGraph * ShadeBetweenHistograms (TH1 *hmin, TH1 *hmax)
 
TGraphAsymmErrors * ProfileQuantile (const TH2 *hist, const std::string &axis_name, const std::string &graph_name="", const std::pair< double, double > &quantile_divisions={0.159, 0.841})
 Calculate profile with error bars corresponding to specified quantiles of a 2D distribution (by default, 68% coverage) More...
 
void CountingExperimentErrorBarChart (const std::map< std::string, double > &systs, double statErr=0, bool bkgdOrSig=false, bool shortchart=false)
 Make a simple plot of relative size of different errors. More...
 
double BinCenter (const TAxis *ax, int bin, bool islog)
 
TH2 * Flat (double level, const Surface &s)
 Helper function for the gaussian approximation surfaces. More...
 
TH2 * Gaussian68Percent2D (const Surface &s)
 Up-value surface for 68% confidence in 2D in gaussian approximation. More...
 
TH2 * Gaussian90Percent2D (const Surface &s)
 Up-value surface for 90% confidence in 2D in gaussian approximation. More...
 
TH2 * Gaussian95Percent2D (const Surface &s)
 Up-value surface for 95% confidence in 2D in gaussian approximation. More...
 
TH2 * Gaussian2Sigma2D (const Surface &s)
 Up-value surface for 2 sigma confidence in 2D in gaussian approximation. More...
 
TH2 * Gaussian99Percent2D (const Surface &s)
 Up-value surface for 99% confidence in 2D in gaussian approximation. More...
 
TH2 * Gaussian3Sigma2D (const Surface &s)
 Up-value surface for 3 sigma confidence in 2D in gaussian approximation. More...
 
TH2 * Gaussian5Sigma2D (const Surface &s)
 Up-value surface for 5 sigma confidence in 2D in gaussian approximation. More...
 
TH2 * Gaussian68Percent1D (const Surface &s)
 Up-value surface for 68% confidence in 1D in gaussian approximation. More...
 
TH2 * Gaussian90Percent1D (const Surface &s)
 Up-value surface for 90% confidence in 1D in gaussian approximation. More...
 
TH2 * Gaussian95Percent1D (const Surface &s)
 Up-value surface for 95% confidence in 1D in gaussian approximation. More...
 
TH2 * Gaussian2Sigma1D (const Surface &s)
 Up-value surface for 2 sigma confidence in 1D in gaussian approximation. More...
 
TH2 * Gaussian99Percent1D (const Surface &s)
 Up-value surface for 99% confidence in 1D in gaussian approximation. More...
 
TH2 * Gaussian3Sigma1D (const Surface &s)
 Up-value surface for 3 sigma confidence in 1D in gaussian approximation. More...
 
TH2 * Gaussian90Percent1D1Sided (const Surface &s)
 Up-value surface for 90% confidence in 1D in 1-sided gaussian approximation. More...
 
TH2 * Gaussian95Percent1D1Sided (const Surface &s)
 Up-value surface for 95% confidence in 1D in 1-sided gaussian approximation. More...
 
TH2 * Gaussian99Percent1D1Sided (const Surface &s)
 Up-value surface for 99% confidence in 1D in 1-sided gaussian approxiamtion. More...
 
TH2 * Gaussian3Sigma1D1Sided (const Surface &s)
 Up-value surface for 3 sigma confidence in 1D in 1-sided gaussian approximation. More...
 
TH2 * Gaussian5Sigma1D1Sided (const Surface &s)
 Up-value surface for 5 sigma confidence in 1D in 1-sided gaussian approximation. More...
 
Binning TrueEnergyBins ()
 Default true-energy bin edges. More...
 
Binning TrueLOverTrueEBins ()
 
std::function< ExposureFunc_tCombineExposures (const std::function< ExposureFunc_t > &a, const std::function< ExposureFunc_t > &b)
 
template<class T >
_Cut< T > operator&& (const _Cut< T > &a, const _Cut< T > &b)
 
template Cut operator&&< caf::SRSliceProxy > (const Cut &a, const Cut &b)
 
template SpillCut operator&&< caf::SRSpillProxy > (const SpillCut &a, const SpillCut &b)
 
template<class T >
_Cut< T > operator|| (const _Cut< T > &a, const _Cut< T > &b)
 
template Cut operator||< caf::SRSliceProxy > (const Cut &a, const Cut &b)
 
template SpillCut operator||< caf::SRSpillProxy > (const SpillCut &a, const SpillCut &b)
 
template<class T >
_Cut< T > operator! (const _Cut< T > &a)
 
template Cut operator!< caf::SRSliceProxy > (const Cut &a)
 
template SpillCut operator!< caf::SRSpillProxy > (const SpillCut &a)
 
template<class T >
_Cut< T > operator> (const _Var< T > &v, double c)
 
template<class T >
_Cut< T > operator>= (const _Var< T > &v, double c)
 
template<class T >
_Cut< T > operator< (const _Var< T > &v, double c)
 
template<class T >
_Cut< T > operator<= (const _Var< T > &v, double c)
 
template<class T >
_Cut< T > operator== (const _Var< T > &v, double c)
 
template<class T >
_Cut< T > operator!= (const _Var< T > &v, double c)
 
template<class T >
_Cut< T > operator> (const _Var< T > &a, const _Var< T > &b)
 
template<class T >
_Cut< T > operator>= (const _Var< T > &a, const _Var< T > &b)
 
template<class T >
_Cut< T > operator== (const _Var< T > &a, const _Var< T > &b)
 
template<class T >
_Cut< T > operator> (double c, const _Var< T > &v)
 
template<class T >
_Cut< T > operator< (double c, const _Var< T > &v)
 
template<class T >
_Cut< T > operator>= (double c, const _Var< T > &v)
 
template<class T >
_Cut< T > operator<= (double c, const _Var< T > &v)
 
template<class T >
_Cut< T > operator!= (double c, const _Var< T > &v)
 
template<class T >
_Cut< T > operator< (const _Var< T > &a, const _Var< T > &b)
 
template<class T >
_Cut< T > operator<= (const _Var< T > &a, const _Var< T > &b)
 
template<class T >
_Cut< T > operator!= (const _Var< T > &a, const _Var< T > &b)
 
template Cut operator> (const Var &, double)
 
template Cut operator< (const Var &, double)
 
template Cut operator>= (const Var &, double)
 
template Cut operator<= (const Var &, double)
 
template Cut operator== (const Var &, double)
 
template Cut operator!= (const Var &, double)
 
template Cut operator> (const Var &, const Var &)
 
template Cut operator< (const Var &, const Var &)
 
template Cut operator>= (const Var &, const Var &)
 
template Cut operator<= (const Var &, const Var &)
 
template Cut operator== (const Var &, const Var &)
 
template Cut operator!= (const Var &, const Var &)
 
template Cut operator> (double, const Var &)
 
template Cut operator< (double, const Var &)
 
template Cut operator>= (double, const Var &)
 
template Cut operator<= (double, const Var &)
 
const Cut kNoCut ([](const caf::SRSliceProxy *){return true;})
 The simplest possible cut: pass everything, used as a default. More...
 
const SpillCut kNoSpillCut ([](const caf::SRSpillProxy *){return true;})
 The simplest possible cut: pass everything, used as a default. More...
 
void gdb_backtrace ()
 
void handle_terminate ()
 
void handle_signal (int sig, siginfo_t *, void *)
 
EnsembleRatio operator/ (const EnsembleSpectrum &lhs, const EnsembleSpectrum &rhs)
 
void DrawErrorBand (TH1 *nom, TGraphAsymmErrors *band, int bandCol, double alpha)
 
EnsembleSpectrum operator* (const EnsembleRatio &lhs, const EnsembleSpectrum &rhs)
 
EnsembleSpectrum operator/ (const EnsembleRatio &lhs, const EnsembleSpectrum &rhs)
 
void ClearTrueParticles (caf::StandardRecord *sr)
 
std::vector< std::string > GetGenieWeightNames ()
 
std::pair< double, double > GetGenieDialLimits (const std::string &name)
 
int GetGenieIndex (const std::string &name, bool quiet)
 
std::string GetGenieWeightName (int index)
 
double GetGenieMin (int index)
 
double GetGenieMax (int index)
 
 fBins ({binsX, binsY})
 
 fVars ({varX, varY})
 
template<>
std::unique_ptr< osc::IOscCalcLoadFrom< osc::IOscCalc > (TDirectory *dir)
 
template<>
void SaveTo (const osc::IOscCalc &x, TDirectory *dir)
 
template<class T >
std::unique_ptr< T > LoadFrom (TDirectory *dir)
 
template<>
std::unique_ptr< IDecomp > LoadFrom< IDecomp > (TDirectory *dir)
 
template<>
std::unique_ptr< IExtrapLoadFrom< IExtrap > (TDirectory *dir)
 
template<>
std::unique_ptr< IPredictionLoadFrom< IPrediction > (TDirectory *dir)
 
template<>
std::unique_ptr< IExperimentLoadFrom< IExperiment > (TDirectory *dir)
 
template<>
std::unique_ptr
< ModularExtrapComponent > 
LoadFrom< ModularExtrapComponent > (TDirectory *dir)
 
template<>
std::unique_ptr< IBkgdEstimator > LoadFrom< IBkgdEstimator > (TDirectory *dir)
 
template<class T >
void SaveTo (const T &x, TDirectory *dir)
 
template<class T >
std::unique_ptr< T > LoadFromFile (const std::string &fname, const std::string &label)
 
template<class T >
void SaveToFile (const T &x, const std::string &fname, const std::string &label)
 
template<class T >
_MultiVar< T > MultiVar2D (const _MultiVar< T > &a, const Binning &binsa, const _MultiVar< T > &b, const Binning &binsb)
 
template MultiVar MultiVar2D (const MultiVar &, const Binning &, const MultiVar &, const Binning &)
 
double Si (double x)
 
double AvgSinSq (double k, double a, double b)
 
OscCalcSterileApproxAdjustableDefaultSterileApproxCalc (SterileOscAngles angles)
 
const OscCalcSterileApproxDowncastToSterileApprox (const osc::IOscCalc *calc, bool allowFail)
 
OscCalcSterileApproxDowncastToSterileApprox (osc::IOscCalc *calc, bool allowFail)
 
SterileOscAngles operator| (const SterileOscAngles a, const SterileOscAngles b)
 
SterileOscAngles operator& (const SterileOscAngles a, const SterileOscAngles b)
 
const Var kBaseline ([](const caf::SRSliceProxy *slc) -> double{return slc->truth.baseline *1e-3;})
 
 fCachedHash (0)
 
Ratio operator/ (const Spectrum &lhs, const Spectrum &rhs)
 
void ProjectionX (TH2D *from, TH1D *to)
 Helper for Unweighted. More...
 
void ProjectionY (TH2D *from, TH1D *to)
 Helper for WeightingVariable. More...
 
Spectrum operator* (const Ratio &lhs, const Spectrum &rhs)
 
Spectrum operator/ (const Ratio &lhs, const Spectrum &rhs)
 
std::string UniqueName ()
 Return a different string each time, for creating histograms. More...
 
std::string Experiment ()
 $EXPERIMENT or a nice error message and abort More...
 
std::string SAMExperiment ()
 $SAM_EXPERIMENT or a nice error message and abort More...
 
std::unique_ptr< TMatrixD > CalcCovMx (const std::vector< TArrayD * > &binSets, int firstBin=0, int lastBin=-1)
 Compute bin-to-bin covariance matrix from a collection of sets of bin contents. More...
 
double LogLikelihood (double exp, double obs)
 The log-likelihood formula for a single bin. More...
 
double LogLikelihood (const TH1 *exp, const TH1 *obs, bool useOverflow=false)
 The log-likelihood formula from the PDG. More...
 
double Chi2CovMx (const TVectorD *e, const TVectorD *o, const TMatrixD *covmxinv)
 
double Chi2CovMx (const TH1 *e, const TH1 *o, const TMatrixD *covmxinv)
 
TH2F * ExpandedHistogram (const std::string &title, int nbinsx, double xmin, double xmax, bool xlog, int nbinsy, double ymin, double ymax, bool ylog)
 
std::unique_ptr< TMatrixD > SymmMxInverse (const TMatrixD &mx)
 
TH1D * MakeTH1D (const char *name, const char *title, const Binning &bins)
 
TH2D * MakeTH2D (const char *name, const char *title, const Binning &binsx, const Binning &binsy)
 
TH2 * ToTH2 (const Spectrum &s, double exposure, ana::EExposureType expotype, const Binning &binsx, const Binning &binsy, ana::EBinType bintype)
 
TH2 * ToTH2 (const Ratio &r, const Binning &binsx, const Binning &binsy)
 
TH2 * ToTH2Helper (std::unique_ptr< TH1 > h1, const Binning &binsx, const Binning &binsy, ana::EBinType bintype)
 
TH3 * ToTH3 (const Spectrum &s, double exposure, ana::EExposureType expotype, const Binning &binsx, const Binning &binsy, const Binning &binsz, ana::EBinType bintype)
 
TH3 * ToTH3 (const Ratio &r, const Binning &binsx, const Binning &binsy, const Binning &binsz)
 
TH3 * ToTH3Helper (std::unique_ptr< TH1 > h1, const Binning &binsx, const Binning &binsy, const Binning &binsz, ana::EBinType bintype)
 
std::vector< std::string > Wildcard (const std::string &wildcardString)
 
std::string FindCAFAnaDir ()
 
std::vector< std::string > LoadFileList (const std::string &listfile)
 
std::map< std::string,
std::string > 
GetCAFMetadata (TDirectory *dir)
 
void CombineMetadata (std::map< std::string, std::string > &base, const std::map< std::string, std::string > &add, std::set< std::string > &mask)
 
void WriteCAFMetadata (TDirectory *dir, const std::map< std::string, std::string > &meta)
 
bool RunningOnGrid ()
 
size_t Stride (bool allow_default)
 
size_t Offset (bool allow_default)
 
int Limit ()
 
size_t JobNumber ()
 
size_t NumJobs ()
 
bool AlmostEqual (double a, double b)
 
std::string pnfs2xrootd (std::string loc, bool unauth)
 
void EnsurePositiveDefinite (TH2 *mat)
 
TH1 * GetMaskHist (const Spectrum &s, double xmin, double xmax, double ymin, double ymax)
 
double FindQuantile (double frac, std::vector< double > &xs)
 
template<class T >
_Var< T > Var2D (const _Var< T > &a, const Binning &binsa, const _Var< T > &b, const Binning &binsb)
 Variable formed from two input variables. More...
 
template<class T >
_Var< T > Var2D (const _Var< T > &a, int na, double a0, double a1, const _Var< T > &b, int nb, double b0, double b1)
 Variable formed from two input variables. More...
 
template Var Var2D (const Var &, const Binning &, const Var &, const Binning &)
 
template Var Var2D (const Var &, int, double, double, const Var &, int, double, double)
 
template<class T >
_Var< T > Var3D (const _Var< T > &a, const Binning &binsa, const _Var< T > &b, const Binning &binsb, const _Var< T > &c, const Binning &binsc)
 This is just like a Var2D, but useful for 3D Spectra. More...
 
template<class T >
_Var< T > Var3D (const _Var< T > &a, int na, double a0, double a1, const _Var< T > &b, int nb, double b0, double b1, const _Var< T > &c, int nc, double c0, double c1)
 This is just like a Var2D, but useful for 3D Spectra. More...
 
template Var Var3D (const Var &, const Binning &, const Var &, const Binning &, const Var &, const Binning &)
 
template Var Var3D (const Var &, int, double, double, const Var &, int, double, double, const Var &, int, double, double)
 
Var Scaled (const Var &v, double s)
 Use to rescale another variable. More...
 
Var Constant (double c)
 Use to weight events up and down by some factor. More...
 
Var Sqrt (const Var &v)
 Use to take sqrt of a var. More...
 
template<class T >
_Var< T > operator* (const _Var< T > &a, const _Var< T > &b)
 
template<class T >
_Var< T > operator/ (const _Var< T > &a, const _Var< T > &b)
 
template<class T >
_Var< T > operator+ (const _Var< T > &a, const _Var< T > &b)
 
template<class T >
_Var< T > operator- (const _Var< T > &a, const _Var< T > &b)
 
template Var operator* (const Var &, const Var &)
 
template Var operator/ (const Var &, const Var &)
 
template Var operator+ (const Var &, const Var &)
 
template Var operator- (const Var &, const Var &)
 
const Var kUnweighted ([](const caf::SRSliceProxy *){return 1;})
 The simplest possible Var, always 1. Used as a default weight. More...
 
const SpillVar kSpillUnweighted ([](const caf::SRSpillProxy *){return 1;})
 
const Cut kIsNueApp (CCFlavSel(12, 14))
 Select CC $ \nu_\mu\to\nu_e $. More...
 
const Cut kIsNumuCC (CCFlavSel(14, 14))
 Select CC $ \nu_\mu\to\nu_\mu $. More...
 
const Cut kIsBeamNue (CCFlavSel(12, 12))
 Select CC $ \nu_e\to\nu_e $. More...
 
const Cut kIsNumuApp (CCFlavSel(14, 12))
 Select CC $ \nu_e\to\nu_\mu $. More...
 
const Cut kIsTauFromMu (CCFlavSel(16, 14))
 Select CC $ \nu_\mu\to\nu_\tau $. More...
 
const Cut kIsTauFromE (CCFlavSel(16, 12))
 Select CC $ \nu_e\to\nu_\tau $. More...
 
const Cut kIsNCFromNumu (NCFlavOrig(14))
 
const Cut kIsNCFromNue (NCFlavOrig(12))
 
const ReactorExperimentDayaBayConstraint2014 ()
 A ReactorExperiment initialized with the Nu2014 Daya Bay constraints. More...
 
const ReactorExperimentWorldReactorConstraint2015 ()
 Weighted average of all experiments as of first nue paper writing. More...
 
const ReactorExperimentWorldReactorConstraint2016 ()
 Updated value for SecondAna based on the latest PDG. More...
 
const ReactorExperimentWorldReactorConstraint2017 ()
 Reactor constraint from PDG 2017 update. More...
 
const SolarConstraints kSolarConstraintsPDG2017 (7.53e-5, 0.18e-5, 0.851, 0.020)
 
 fSplitBySign (mode==kSplitBySign)
 
const BoosterFluxHadronSystGetBoosterFluxHadronSyst (unsigned int i)
 
BoosterFluxHadronSystVector GetBoosterFluxHadronSysts (unsigned int N)
 
std::vector< const ISyst * > GetEnergySysts ()
 
std::vector< const ISyst * > GetBigEnergySysts ()
 
const NuMIFluxSystGetNuMIFluxSyst (const std::string &dir, const std::string &prefix, const std::string &name)
 
std::vector< const ISyst * > GetNuMIHadronProductionFluxSysts ()
 These are envelopes not real systs. TODO make clearer in naming. More...
 
std::vector< const ISyst * > GetNuMIBeamlineFluxSysts ()
 
std::vector< const ISyst * > GetNuMIPCAFluxSysts (unsigned int Npcs)
 
std::vector< const ISyst * > GetAllNuMIFluxSysts (unsigned int Npcs)
 Combination of all beamline systs plus Npcs hadron production components. More...
 
std::vector< std::string > GetSBNGenieWeightNames ()
 
const std::vector< const ISyst * > & GetSBNGenieWeightSysts ()
 
std::vector< std::string > GetSBNBoosterFluxWeightNames ()
 
const std::vector< const ISyst * > & GetSBNBoosterFluxWeightSysts ()
 
const std::vector< const ISyst * > & GetSBNWeightSysts ()
 
Var GetUniverseWeight (const std::string &psetName, int univIdx)
 
caf::SRGlobal GetSRGlobal ()
 
void PrintSRGlobal (const caf::SRGlobal &global)
 
Spectrum UnfoldIterative (const Spectrum &reco, const ReweightableSpectrum &recoVsTrue, unsigned int nIterations)
 
Spectrum UnfoldSVD (const Spectrum &reco, const ReweightableSpectrum &recoVsTrue, unsigned int reg)
 Singular value decomposition unfolding using ROOT's TSVDDecomp. More...
 
Spectrum UnfoldTikhonov (const Spectrum &reco, const ReweightableSpectrum &recoVsTrue, double regStrength)
 Unfolding using Tikhonov regularization (penalizing true spectra with large second derivatives) More...
 
bool IsCCQEOnArgon (const caf::SRTrueInteractionProxy *nu, int pdg)
 
bool IsNCQEOnArgon (const caf::SRTrueInteractionProxy *nu, int pdg)
 
Cut IsCCQEOnArgonCut (int pdg)
 
TString thisCellColor (double weird)
 
TString fixLatexName (TString mystring)
 
void printTableHeader (int quantId=0)
 
void printTableFooter ()
 
void printEventsLine (std::string cutname, float nue, float numu, float nc, float cos, float other, float eff, float pur)
 
void SplitCanvas2 (TCanvas *&c1, TPad *&pad1, TPad *&pad2)
 
float GetHistMax (std::vector< TH1 * > histos)
 
void PimpHist (TH1 *histo, Color_t color, Style_t linestyle, int linewidth, Style_t markerstyle=8, double markersize=8)
 
void FillWithDimColor (TH1 *h, bool usealpha=false, float dim=0.8)
 
void DrawComponentsLegend (TH1 *hnue, TH1 *hnumu, TH1 *hnc, TH1 *hcos, TH1 *hother)
 
void DrawSigBkgLegend (TH1 *h1, char *name1, TH1 *h2, char *name2)
 
void DrawSigBkgIntLegend (TH1 *h1, char *name1, double iSig, TH1 *h2, char *name2, double iBkg)
 
void DrawIntEffPurLegend (TH1D *g1, char *name1, TH1D *g2, char *name2)
 
void DrawPurLegend (TH1D *g1, char *name1)
 
void DrawEffPurLegend (TH1D *g1, char *name1, TH1D *g2, char *name2)
 
void DrawSigBkgIntText (TH1 *hsig, TH1 *hbkg, float textsize)
 
TH1D * EffOrPurHistogram (TH1 *hSelSignal, TH1 *hSelBack, TH1 *hSignal, bool geteff)
 
TGraph * EffOrPurGraph (TH1 *hSelSignal, TH1 *hSelBack, TH1 *hSignal, bool geteff)
 
static bool Icarus202208contained (const caf::SRTrackProxy &trk)
 
bool IsPrimary (const caf::SRTrueParticleProxy &p)
 Whether this is a primary particle or generated by a secondary interaction. More...
 
bool HasBraggPeak (const caf::SRTrueParticleProxy &p)
 Whether this particle should have a bragg peak in the detector. More...
 
bool IsGenie (const caf::SRTrueParticleProxy &p)
 Whether this particle was generated by genie (as opposed to geant or corsika) More...
 
bool IsStable (const caf::SRTrueParticleProxy &p)
 Whether this is a stable particle as generated by genie. More...
 
const Cut kIsAntiNu ([](const caf::SRSliceProxy *slc){if(slc->truth.index< 0) return false;return slc->truth.pdg< 0;})
 
const Cut kIsCC ([](const caf::SRSliceProxy *slc){if(slc->truth.index< 0) return false;return(slc->truth.iscc==1);})
 
const Cut kIsNC ([](const caf::SRSliceProxy *slc){if(slc->truth.index< 0) return false;return(slc->truth.isnc==1);})
 
const caf::SRShowerProxy * LargestRecoShower (const caf::SRSliceProxy *slc)
 Pointer to largest reconstructed shower, or null pointer if none exists. More...
 
const caf::SRTrackProxy * LongestRecoTrack (const caf::SRSliceProxy *slc)
 Pointer to longest reconstructed shower, or null pointer if none exists. More...
 
const caf::SRTrkChi2PIDProxy * BestPlaneChi2PID (const caf::SRTrackProxy *trk)
 
const caf::SRTrkChi2PIDProxy * LongestTrackBestPlaneChi2PID (const caf::SRSliceProxy *slc)
 
static bool Icarus202208_proton_cut (const caf::SRTrackProxy &trk)
 
const Var kNuScore ([](const caf::SRSliceProxy *slc) -> double{return slc->nu_score;})
 
const Var kSlcIsRecoNu ([](const caf::SRSliceProxy *slc) -> double{return!slc->is_clear_cosmic;})
 

Variables

const double kNuFitDmsq21CV = 7.39e-5
 
const double kNuFitTh12CV = 33.82 * TMath::Pi()/180
 
const double kNuFitDmsq32CVNH = +2.525e-3 - kNuFitDmsq21CV
 
const double kNuFitTh23CVNH = 49.6 * TMath::Pi()/180
 
const double kNuFitTh13CVNH = 8.61 * TMath::Pi()/180
 
const double kNuFitdCPCVNH = 215 * TMath::Pi()/180
 
const double kNuFitDmsq32CVIH = -2.512e-3
 
const double kNuFitTh23CVIH = 49.8 * TMath::Pi()/180
 
const double kNuFitTh13CVIH = 8.65 * TMath::Pi()/180
 
const double kNuFitdCPCVIH = 284 * TMath::Pi()/180
 
const double kNuFitDmsq21Err = ((8.01-6.79)/6)*1e-5
 
const double kNuFitTh12Err = ((36.27-31.61)/6) * TMath::Pi()/180
 
const double kNuFitDmsq32ErrNH = ((2.625-2.427)/6)*1e-3
 
const double kNuFitTh23ErrNH = ((52.4-40.3)/6) * TMath::Pi()/180
 
const double kNuFitTh13ErrNH = ((8.99-8.22)/6) * TMath::Pi()/180
 
const double kNuFitDmsq32ErrIH = ((2.611-2.412)/6)*1e-3
 
const double kNuFitTh23ErrIH = ((52.5-40.6)/6) * TMath::Pi()/180
 
const double kNuFitTh13ErrIH = ((9.03-8.27)/6) * TMath::Pi()/180
 
const double kBaseline = 1284.9
 
const double kEarthDensity = 2.848
 
const double kPOTnominal = 6.6e20
 
const double kPOTuBoone = 1.3e21
 
const double kBaselineSBND = 0.11
 
const double kBaselineMicroBoone = 0.47
 
const double kBaselineIcarus = 0.6
 
const int kSBND = 0
 
const int kMicroBoone = 1
 
const int kICARUS = 2
 
const std::vector< double > kBLs = {kBaselineSBND, kBaselineMicroBoone, kBaselineIcarus}
 
static std::map< const IFitVar
*, TGraph * > 
empty_vars_map
 
static std::map< const ISyst
*, TGraph * > 
empty_syst_map
 
const Color_t kTotalMCColor = kRed
 
const Color_t kTotalMCErrorBandColor = kRed-10
 
const Color_t kNueSignalColor = kViolet-5
 
const Color_t kTotalBackgroundColor = kAzure+2
 
const Color_t kNCBackgroundColor = kAzure
 
const Color_t kBeamNueBackgroundColor = kPink+9
 
const Color_t kCosmicBackgroundColor = kAzure+1
 
const Color_t kNumuBackgroundColor = kGreen+2
 
const Color_t kNormalHierarchyColor = kAzure+3
 
const Color_t kInvertedHierarchyColor = kOrange+9
 
const Style_t k90PercentConfidenceStyle = 9
 
const Style_t k68PercentConfidenceStyle = 7
 Dashed. More...
 
const Color_t kPrimColorNH = kAzure+2
 
const Color_t kSecoColorNH = kAzure+1
 
const Color_t kPrimColorIH = kOrange+9
 
const Color_t kSecoColorIH = kOrange+10
 
const Style_t kFillStyleNH = 3013
 
const Style_t kFillStyleIH = 3003
 
const Style_t k1SigmaConfidenceStyle = 7
 
const Style_t k2SigmaConfidenceStyle = 9
 
const Style_t k3SigmaConfidenceStyle = 10
 
const Color_t kCentralValueColorNH = kAzure+3
 
const Color_t k1SigmaConfidenceColorNH = kAzure+3
 
const Color_t k90PercConfidenceColorNH = kAzure+2
 
const Color_t k2SigmaConfidenceColorNH = kAzure+2
 
const Color_t k3SigmaConfidenceColorNH = kAzure+1
 
const Color_t kCentralValueColorIH = kOrange+9
 
const Color_t k1SigmaConfidenceColorIH = kOrange+9
 
const Color_t k2SigmaConfidenceColorIH = kOrange+10
 
const Color_t k3SigmaConfidenceColorIH = kOrange+8
 
const Color_t k90PercConfidenceColorIH = kOrange+10
 
const Color_t kCentralValueColor = kGray+2
 
const Style_t kCentralValueStyle = kSolid
 
const Float_t kBlessedTitleFontSize = 0.08
 
const Float_t kBlessedLabelFontSize = 0.06
 
const Binning kTrueEnergyBins = TrueEnergyBins()
 Default true-energy bin edges. More...
 
const Binning kTrueLOverEBins = Binning::Simple(100, 0, 2)
 
bool gIsException = false
 
static InstallHandlers gHandlerInstaller
 
const Var kTrueE ([](const caf::SRSliceProxy *slc) -> double{return slc->truth.E;})
 
const Var kTrueLOverE = kBaseline / kTrueE
 
static NullLoader kNullLoader
 Dummy loader that doesn't load any files. More...
 
const SystShifts kNoShift = SystShifts::Nominal()
 
const Cut kHasMatchedNu ([](const caf::SRSliceProxy *slc){return slc->truth.index >=0;})
 
const Cut kIsNC ([](const caf::SRSliceProxy *slc){return kHasMatchedNu(slc)&&slc->truth.isnc;})
 Is this a Neutral Current event? More...
 
const Cut kIsCC ([](const caf::SRSliceProxy *slc){return kHasMatchedNu(slc)&&slc->truth.iscc;})
 
const Cut kIsAntiNu ([](const caf::SRSliceProxy *slc){return kHasMatchedNu(slc)&&slc->truth.pdg< 0;})
 Is this truly an antineutrino? More...
 
const EnergyScaleSyst kEnergyScaleMuon (EnergyScaleSystTerm::kConstant, EnergyScaleSystParticle::kMuon, EnergyScaleSystDetector::kAll, 0.02,"EnergyScaleMuon","Correlated linear E_{#mu} scale")
 
const EnergyScaleSyst kEnergyScaleMuonSqrt (EnergyScaleSystTerm::kSqrt, EnergyScaleSystParticle::kMuon, EnergyScaleSystDetector::kAll, 0.02,"EnergyScaleMuonSqrt","Correlated sqrt E_{#mu} scale")
 
const EnergyScaleSyst kEnergyScaleMuonInvSqrt (EnergyScaleSystTerm::kInverseSqrt, EnergyScaleSystParticle::kMuon, EnergyScaleSystDetector::kAll, 0.02,"EnergyScaleMuonInvSqrt","Correlated inv sqrt E_{#mu} scale")
 
const EnergyScaleSyst kEnergyScaleMuonND (EnergyScaleSystTerm::kConstant, EnergyScaleSystParticle::kMuon, EnergyScaleSystDetector::kSBND, 0.02,"EnergyScaleMuonND","Uncorrelated SBND linear E_{#mu} scale")
 
const EnergyScaleSyst kEnergyScaleMuonSqrtND (EnergyScaleSystTerm::kSqrt, EnergyScaleSystParticle::kMuon, EnergyScaleSystDetector::kSBND, 0.02,"EnergyScaleMuonSqrtND","Uncorrelated SBND sqrt E_{#mu} scale")
 
const EnergyScaleSyst kEnergyScaleMuonInvSqrtND (EnergyScaleSystTerm::kInverseSqrt, EnergyScaleSystParticle::kMuon, EnergyScaleSystDetector::kSBND, 0.02,"EnergyScaleMuonInvSqrtND","Uncorrelated SBND inv sqrt E_{#mu} scale")
 
const EnergyScaleSyst kEnergyScaleMuonUB (EnergyScaleSystTerm::kConstant, EnergyScaleSystParticle::kMuon, EnergyScaleSystDetector::kMicroBooNE, 0.02,"EnergyScaleMuonUB","Uncorrelated MicroBooNE linear E_{#mu} scale")
 
const EnergyScaleSyst kEnergyScaleMuonSqrtUB (EnergyScaleSystTerm::kSqrt, EnergyScaleSystParticle::kMuon, EnergyScaleSystDetector::kMicroBooNE, 0.02,"EnergyScaleMuonSqrtUB","Uncorrelated MicroBooNE sqrt E_{#mu} scale")
 
const EnergyScaleSyst kEnergyScaleMuonInvSqrtUB (EnergyScaleSystTerm::kInverseSqrt, EnergyScaleSystParticle::kMuon, EnergyScaleSystDetector::kMicroBooNE, 0.02,"EnergyScaleMuonInvSqrtUB","Uncorrelated MicroBooNE inv sqrt E_{#mu} scale")
 
const EnergyScaleSyst kEnergyScaleMuonFD (EnergyScaleSystTerm::kConstant, EnergyScaleSystParticle::kMuon, EnergyScaleSystDetector::kICARUS, 0.02,"EnergyScaleMuonFD","Uncorrelated ICARUS linear E_{#mu} scale")
 
const EnergyScaleSyst kEnergyScaleMuonSqrtFD (EnergyScaleSystTerm::kSqrt, EnergyScaleSystParticle::kMuon, EnergyScaleSystDetector::kICARUS, 0.02,"EnergyScaleMuonSqrtFD","Uncorrelated ICARUS sqrt E_{#mu} scale")
 
const EnergyScaleSyst kEnergyScaleMuonInvSqrtFD (EnergyScaleSystTerm::kInverseSqrt, EnergyScaleSystParticle::kMuon, EnergyScaleSystDetector::kICARUS, 0.02,"EnergyScaleMuonInvSqrtFD","Uncorrelated ICARUS inv sqrt E_{#mu} scale")
 
const EnergyScaleSyst kEnergyScaleHadron (EnergyScaleSystTerm::kConstant, EnergyScaleSystParticle::kHadron, EnergyScaleSystDetector::kAll, 0.05,"EnergyScaleHadron","Correlated linear E_{had} scale")
 
const EnergyScaleSyst kEnergyScaleHadronSqrt (EnergyScaleSystTerm::kSqrt, EnergyScaleSystParticle::kHadron, EnergyScaleSystDetector::kAll, 0.05,"EnergyScaleHadronSqrt","Correlated sqrt E_{had} scale")
 
const EnergyScaleSyst kEnergyScaleHadronInvSqrt (EnergyScaleSystTerm::kInverseSqrt, EnergyScaleSystParticle::kHadron, EnergyScaleSystDetector::kAll, 0.05,"EnergyScaleHadronInvSqrt","Correlated inv sqrt E_{had} scale")
 
const EnergyScaleSyst kEnergyScaleHadronND (EnergyScaleSystTerm::kConstant, EnergyScaleSystParticle::kHadron, EnergyScaleSystDetector::kSBND, 0.05,"EnergyScaleHadronND","Uncorrelated SBND linear E_{had} scale")
 
const EnergyScaleSyst kEnergyScaleHadronSqrtND (EnergyScaleSystTerm::kSqrt, EnergyScaleSystParticle::kHadron, EnergyScaleSystDetector::kSBND, 0.05,"EnergyScaleHadronSqrtND","Uncorrelated SBND sqrt E_{had} scale")
 
const EnergyScaleSyst kEnergyScaleHadronInvSqrtND (EnergyScaleSystTerm::kInverseSqrt, EnergyScaleSystParticle::kHadron, EnergyScaleSystDetector::kSBND, 0.05,"EnergyScaleHadronInvSqrtND","Uncorrelated SBND inv sqrt E_{had} scale")
 
const EnergyScaleSyst kEnergyScaleHadronUB (EnergyScaleSystTerm::kConstant, EnergyScaleSystParticle::kHadron, EnergyScaleSystDetector::kMicroBooNE, 0.05,"EnergyScaleHadronUB","Uncorrelated MicroBooNE linear E_{had} scale")
 
const EnergyScaleSyst kEnergyScaleHadronSqrtUB (EnergyScaleSystTerm::kSqrt, EnergyScaleSystParticle::kHadron, EnergyScaleSystDetector::kMicroBooNE, 0.05,"EnergyScaleHadronSqrtUB","Uncorrelated MicroBooNE sqrt E_{had} scale")
 
const EnergyScaleSyst kEnergyScaleHadronInvSqrtUB (EnergyScaleSystTerm::kInverseSqrt, EnergyScaleSystParticle::kHadron, EnergyScaleSystDetector::kMicroBooNE, 0.05,"EnergyScaleHadronInvSqrtUB","Uncorrelated MicroBooNE inv sqrt E_{had} scale")
 
const EnergyScaleSyst kEnergyScaleHadronFD (EnergyScaleSystTerm::kConstant, EnergyScaleSystParticle::kHadron, EnergyScaleSystDetector::kICARUS, 0.05,"EnergyScaleHadronFD","Uncorrelated ICARUS linear E_{had} scale")
 
const EnergyScaleSyst kEnergyScaleHadronSqrtFD (EnergyScaleSystTerm::kSqrt, EnergyScaleSystParticle::kHadron, EnergyScaleSystDetector::kICARUS, 0.05,"EnergyScaleHadronSqrtFD","Uncorrelated ICARUS sqrt E_{had} scale")
 
const EnergyScaleSyst kEnergyScaleHadronInvSqrtFD (EnergyScaleSystTerm::kInverseSqrt, EnergyScaleSystParticle::kHadron, EnergyScaleSystDetector::kICARUS, 0.05,"EnergyScaleHadronInvSqrtFD","Uncorrelated ICARUS inv sqrt E_{had} scale")
 
const EnergyScaleSyst kEnergyScaleMuonBig (EnergyScaleSystTerm::kConstant, EnergyScaleSystParticle::kMuon, EnergyScaleSystDetector::kAll, 0.05,"EnergyScaleMuonBig","Correlated linear E_{#mu} scale ")
 
const EnergyScaleSyst kEnergyScaleMuonSqrtBig (EnergyScaleSystTerm::kSqrt, EnergyScaleSystParticle::kMuon, EnergyScaleSystDetector::kAll, 0.05,"EnergyScaleMuonSqrtBig","Correlated sqrt E_{#mu} scale")
 
const EnergyScaleSyst kEnergyScaleMuonInvSqrtBig (EnergyScaleSystTerm::kInverseSqrt, EnergyScaleSystParticle::kMuon, EnergyScaleSystDetector::kAll, 0.05,"EnergyScaleMuonInvSqrtBig","Correlated inv sqrt E_{#mu} scale")
 
const EnergyScaleSyst kEnergyScaleMuonNDBig (EnergyScaleSystTerm::kConstant, EnergyScaleSystParticle::kMuon, EnergyScaleSystDetector::kSBND, 0.05,"EnergyScaleMuonNDBig","Uncorrelated SBND linear E_{#mu} scale")
 
const EnergyScaleSyst kEnergyScaleMuonSqrtNDBig (EnergyScaleSystTerm::kSqrt, EnergyScaleSystParticle::kMuon, EnergyScaleSystDetector::kSBND, 0.05,"EnergyScaleMuonSqrtNDBig","Uncorrelated SBND sqrt E_{#mu} scale")
 
const EnergyScaleSyst kEnergyScaleMuonInvSqrtNDBig (EnergyScaleSystTerm::kInverseSqrt, EnergyScaleSystParticle::kMuon, EnergyScaleSystDetector::kSBND, 0.05,"EnergyScaleMuonInvSqrtNDBig","Uncorrelated SBND inv sqrt E_{#mu} scale")
 
const EnergyScaleSyst kEnergyScaleMuonUBBig (EnergyScaleSystTerm::kConstant, EnergyScaleSystParticle::kMuon, EnergyScaleSystDetector::kMicroBooNE, 0.05,"EnergyScaleMuonUBBig","Uncorrelated MicroBooNE linear E_{#mu} scale")
 
const EnergyScaleSyst kEnergyScaleMuonSqrtUBBig (EnergyScaleSystTerm::kSqrt, EnergyScaleSystParticle::kMuon, EnergyScaleSystDetector::kMicroBooNE, 0.05,"EnergyScaleMuonSqrtUBBig","Uncorrelated MicroBooNE sqrt E_{#mu} scale")
 
const EnergyScaleSyst kEnergyScaleMuonInvSqrtUBBig (EnergyScaleSystTerm::kInverseSqrt, EnergyScaleSystParticle::kMuon, EnergyScaleSystDetector::kMicroBooNE, 0.05,"EnergyScaleMuonInvSqrtUBBig","Uncorrelated MicroBooNE inv sqrt E_{#mu} scale")
 
const EnergyScaleSyst kEnergyScaleMuonFDBig (EnergyScaleSystTerm::kConstant, EnergyScaleSystParticle::kMuon, EnergyScaleSystDetector::kICARUS, 0.05,"EnergyScaleMuonFDBig","Uncorrelated ICARUS linear E_{#mu} scale")
 
const EnergyScaleSyst kEnergyScaleMuonSqrtFDBig (EnergyScaleSystTerm::kSqrt, EnergyScaleSystParticle::kMuon, EnergyScaleSystDetector::kICARUS, 0.05,"EnergyScaleMuonSqrtFDBig","Uncorrelated ICARUS sqrt E_{#mu} scale")
 
const EnergyScaleSyst kEnergyScaleMuonInvSqrtFDBig (EnergyScaleSystTerm::kInverseSqrt, EnergyScaleSystParticle::kMuon, EnergyScaleSystDetector::kICARUS, 0.05,"EnergyScaleMuonInvSqrtFDBig","Uncorrelated ICARUS inv sqrt E_{#mu} scale")
 
const EnergyScaleSyst kEnergyScaleHadronBig (EnergyScaleSystTerm::kConstant, EnergyScaleSystParticle::kHadron, EnergyScaleSystDetector::kAll, 0.10,"EnergyScaleHadronBig","Correlated linear E_{had} scale")
 
const EnergyScaleSyst kEnergyScaleHadronSqrtBig (EnergyScaleSystTerm::kSqrt, EnergyScaleSystParticle::kHadron, EnergyScaleSystDetector::kAll, 0.10,"EnergyScaleHadronSqrtBig","Correlated sqrt E_{had} scale")
 
const EnergyScaleSyst kEnergyScaleHadronInvSqrtBig (EnergyScaleSystTerm::kInverseSqrt, EnergyScaleSystParticle::kHadron, EnergyScaleSystDetector::kAll, 0.10,"EnergyScaleHadronInvSqrtBig","Correlated inv sqrt E_{had} scale")
 
const EnergyScaleSyst kEnergyScaleHadronNDBig (EnergyScaleSystTerm::kConstant, EnergyScaleSystParticle::kHadron, EnergyScaleSystDetector::kSBND, 0.10,"EnergyScaleHadronNDBig","Uncorrelated SBND linear E_{had} scale")
 
const EnergyScaleSyst kEnergyScaleHadronSqrtNDBig (EnergyScaleSystTerm::kSqrt, EnergyScaleSystParticle::kHadron, EnergyScaleSystDetector::kSBND, 0.10,"EnergyScaleHadronSqrtNDBig","Uncorrelated SBND sqrt E_{had} scale")
 
const EnergyScaleSyst kEnergyScaleHadronInvSqrtNDBig (EnergyScaleSystTerm::kInverseSqrt, EnergyScaleSystParticle::kHadron, EnergyScaleSystDetector::kSBND, 0.10,"EnergyScaleHadronInvSqrtNDBig","Uncorrelated SBND inv sqrt E_{had} scale")
 
const EnergyScaleSyst kEnergyScaleHadronUBBig (EnergyScaleSystTerm::kConstant, EnergyScaleSystParticle::kHadron, EnergyScaleSystDetector::kMicroBooNE, 0.10,"EnergyScaleHadronUBBig","Uncorrelated MicroBooNE linear E_{had} scale")
 
const EnergyScaleSyst kEnergyScaleHadronSqrtUBBig (EnergyScaleSystTerm::kSqrt, EnergyScaleSystParticle::kHadron, EnergyScaleSystDetector::kMicroBooNE, 0.10,"EnergyScaleHadronSqrtUBBig","Uncorrelated MicroBooNE sqrt E_{had} scale")
 
const EnergyScaleSyst kEnergyScaleHadronInvSqrtUBBig (EnergyScaleSystTerm::kInverseSqrt, EnergyScaleSystParticle::kHadron, EnergyScaleSystDetector::kMicroBooNE, 0.10,"EnergyScaleHadronInvSqrtUBBig","Uncorrelated MicroBooNE inv sqrt E_{had} scale")
 
const EnergyScaleSyst kEnergyScaleHadronFDBig (EnergyScaleSystTerm::kConstant, EnergyScaleSystParticle::kHadron, EnergyScaleSystDetector::kICARUS, 0.10,"EnergyScaleHadronFDBig","Uncorrelated ICARUS linear E_{had} scale")
 
const EnergyScaleSyst kEnergyScaleHadronSqrtFDBig (EnergyScaleSystTerm::kSqrt, EnergyScaleSystParticle::kHadron, EnergyScaleSystDetector::kICARUS, 0.10,"EnergyScaleHadronSqrtFDBig","Uncorrelated ICARUS sqrt E_{had} scale")
 
const EnergyScaleSyst kEnergyScaleHadronInvSqrtFDBig (EnergyScaleSystTerm::kInverseSqrt, EnergyScaleSystParticle::kHadron, EnergyScaleSystDetector::kICARUS, 0.10,"EnergyScaleHadronInvSqrtFDBig","Uncorrelated ICARUS inv sqrt E_{had} scale")
 
const FitTheta13 kFitTheta13 = FitTheta13()
 $ \theta_{13} $ More...
 
const FitSinSq2Theta13 kFitSinSq2Theta13 = FitSinSq2Theta13()
 $ \sin^22\theta_{13} $ More...
 
const FitDeltaInPiUnits kFitDeltaInPiUnits = FitDeltaInPiUnits()
 $ \delta_{CP}/\pi $ More...
 
const FitTheta23 kFitTheta23 = FitTheta23()
 $ \theta_{13} $ More...
 
const FitSinSqTheta23 kFitSinSqTheta23 = FitSinSqTheta23()
 $ \sin^2\theta_{23} $ More...
 
const FitSinSq2Theta23 kFitSinSq2Theta23 = FitSinSq2Theta23()
 $ \sin^22\theta_{23} $ More...
 
const FitDmSq32 kFitDmSq32 = FitDmSq32()
 $ \Delta m^2_{32} $ More...
 
const FitDmSq32Scaled kFitDmSq32Scaled = FitDmSq32Scaled()
 $ \Delta m^2_{32}\times10^3{\rm eV}^2 $ More...
 
const FitTanSqTheta12 kFitTanSqTheta12 = FitTanSqTheta12()
 $ \tan^2\theta_{12} $ More...
 
const FitSinSq2Theta12 kFitSinSq2Theta12 = FitSinSq2Theta12()
 $ \sin^22\theta_{12} $ More...
 
const FitDmSq21 kFitDmSq21 = FitDmSq21()
 $ \Delta m^2_{21} $ More...
 
const FitRho kFitRho = FitRho()
 $ \rho $ More...
 
const FitDmSq32Sterile kFitDmSq32Sterile = FitDmSq32Sterile()
 $ \Delta m^2_{32} $ More...
 
const FitDmSq41Sterile kFitDmSq41Sterile = FitDmSq41Sterile()
 $ \Delta m^2_{41} $ More...
 
const FitDmSq43Sterile kFitDmSq43Sterile = FitDmSq43Sterile()
 $ \Delta m^2_{43} $ More...
 
const FitDelta13InPiUnitsSterile kFitDelta13InPiUnitsSterile = FitDelta13InPiUnitsSterile()
 $ \delta_{CP}/\pi $ More...
 
const FitDelta14InPiUnitsSterile kFitDelta14InPiUnitsSterile = FitDelta14InPiUnitsSterile()
 $ \delta_{14}/\pi $ More...
 
const FitDelta24InPiUnitsSterile kFitDelta24InPiUnitsSterile = FitDelta24InPiUnitsSterile()
 $ \delta_{24}/\pi $ More...
 
const FitTheta13Sterile kFitTheta13Sterile = FitTheta13Sterile()
 $ \theta_{13} $ More...
 
const FitSinSqTheta13Sterile kFitSinSqTheta13Sterile = FitSinSqTheta13Sterile()
 $ \sin^2\theta_{13} $ More...
 
const FitTheta23Sterile kFitTheta23Sterile = FitTheta23Sterile()
 $ \theta_{23} $ More...
 
const FitSinSqTheta23Sterile kFitSinSqTheta23Sterile = FitSinSqTheta23Sterile()
 $ \sin^2\theta_{23} $ More...
 
const FitTheta14Sterile kFitTheta14Sterile = FitTheta14Sterile()
 $ \theta_{14} $ More...
 
const FitSinSqTheta14Sterile kFitSinSqTheta14Sterile = FitSinSqTheta14Sterile()
 $ \sin^2\theta_{14} $ More...
 
const FitSinSq2Theta14Sterile kFitSinSq2Theta14Sterile = FitSinSq2Theta14Sterile()
 $ \sin^22\theta_{14} $ More...
 
const FitTheta24Sterile kFitTheta24Sterile = FitTheta24Sterile()
 $ \theta_{24} $ More...
 
const FitSinSqTheta24Sterile kFitSinSqTheta24Sterile = FitSinSqTheta24Sterile()
 $ \sin^2\theta_{24} $ More...
 
const FitSinSq2Theta24Sterile kFitSinSq2Theta24Sterile = FitSinSq2Theta24Sterile()
 $ \sin^22\theta_{24} $ More...
 
const FitTheta34Sterile kFitTheta34Sterile = FitTheta34Sterile()
 $ \theta_{34} $ More...
 
const FitSinSqTheta34Sterile kFitSinSqTheta34Sterile = FitSinSqTheta34Sterile()
 $ \sin^2\theta_{34} $ More...
 
const FitSinSq2Theta34Sterile kFitSinSq2Theta34Sterile = FitSinSq2Theta34Sterile()
 $ \sin^22\theta_{34} $ More...
 
const FitTheta13InDegreesSterile kFitTheta13InDegreesSterile = FitTheta13InDegreesSterile()
 $ \theta_{13} $ More...
 
const FitTheta23InDegreesSterile kFitTheta23InDegreesSterile = FitTheta23InDegreesSterile()
 $ \theta_{23} $ More...
 
const FitTheta14InDegreesSterile kFitTheta14InDegreesSterile = FitTheta14InDegreesSterile()
 $ \theta_{14} $ More...
 
const FitTheta24InDegreesSterile kFitTheta24InDegreesSterile = FitTheta24InDegreesSterile()
 $ \theta_{24} $ More...
 
const FitTheta34InDegreesSterile kFitTheta34InDegreesSterile = FitTheta34InDegreesSterile()
 $ \theta_{34} $ More...
 
const FitDmSqSterile kFitDmSqSterile = FitDmSqSterile()
 m^2 More...
 
f sin theta_
 
const Var kInvXSec ([](const caf::SRSliceProxy *sr){const double GeV2perm2=2.56819e31;return GeV2perm2/sr->truth.xsec;})
 
const SpillCut kFirstEvents = kEvt < 10
 
const SpillCut kFlashTrigger ([](const caf::SRSpillProxy *sr){return(sr->pass_flashtrig);})
 
const SpillCut kCRTHitVetoND ([](const caf::SRSpillProxy *sr){for(auto const &crtHit:sr->crt_hits){return false;}return true;})
 
const SpillCut kCRTHitVetoFD ([](const caf::SRSpillProxy *sr){for(auto const &crtHit:sr->crt_hits){auto thistime=crtHit.time-1600.;return false;}return true;})
 
const Cut kFiducialVolumeND ([](const caf::SRSliceProxy *slc){return PtInVolAbsX(slc->vertex, fvndAbs);})
 
const Cut kActiveVolumeND ([](const caf::SRSliceProxy *slc){return PtInVolAbsX(slc->vertex, avnd);})
 
const Cut kFiducialVolumeFDCryo1 ([](const caf::SRSliceProxy *slc){return PtInVol(slc->vertex, fvfd_cryo1);})
 
const Cut kFiducialVolumeFDCryo2 ([](const caf::SRSliceProxy *slc){return PtInVol(slc->vertex, fvfd_cryo2);})
 
const Cut kActiveVolumeFDCryo1 ([](const caf::SRSliceProxy *slc){return PtInVol(slc->vertex, avfd_cryo1);})
 
const Cut kActiveVolumeFDCryo2 ([](const caf::SRSliceProxy *slc){return PtInVol(slc->vertex, avfd_cryo2);})
 
const Cut kSlcIsRecoNu ([](const caf::SRSliceProxy *slc){return!slc->is_clear_cosmic;})
 
const Cut kSlcNuScoreCut ([](const caf::SRSliceProxy *slc){return(kSlcIsRecoNu(slc)&&slc->nu_score >0.4);})
 
const Cut kSlcHasFlashMatch ([](const caf::SRSliceProxy *slc){return slc->fmatch.present;})
 
const Cut kSlcFlashMatchCut ([](const caf::SRSliceProxy *slc){return(kSlcHasFlashMatch(slc)&&slc->fmatch.score >0 &&slc->fmatch.score< 6);})
 
const Cut kContainedFD = kFiducialVolumeFDCryo1 || kFiducialVolumeFDCryo2
 
const Cut kRecoShower ([](const caf::SRSliceProxy *slc){const int largestShwIdx(kLargestRecoShowerIdx(slc));return false;return(slc->reco.shw[largestShwIdx].bestplane_energy > 0.f &&slc->reco.shw[largestShwIdx].bestplane_dEdx > 0.f &&slc->reco.shw[largestShwIdx].conversion_gap > 0.f);})
 
const Cut kNueBasicCut ([](const caf::SRSliceProxy *slc){const int largestShwIdx(kLargestRecoShowerIdx(slc));return false;return(slc->reco.shw[largestShwIdx].bestplane_energy > 0.2f &&slc->reco.shw[largestShwIdx].bestplane_dEdx< 3 &&slc->reco.shw[largestShwIdx].conversion_gap< 3);})
 
const Cut kShowerEnergyCut ([](const caf::SRSliceProxy *slc){const int largestShwIdx(kLargestRecoShowerIdx(slc));return false;return(slc->reco.shw[largestShwIdx].bestplane_energy > 0.2f);})
 
const Cut kShowerdEdxCut ([](const caf::SRSliceProxy *slc){const int largestShwIdx(kLargestRecoShowerIdx(slc));return false;return(slc->reco.shw[largestShwIdx].bestplane_dEdx< 3.625f);})
 
const Cut kShowerConvGapCut ([](const caf::SRSliceProxy *slc){const int largestShwIdx(kLargestRecoShowerIdx(slc));return false;return(slc->reco.shw[largestShwIdx].conversion_gap< 3.25f);})
 
const Cut kNueNumShowersCut ([](const caf::SRSliceProxy *slc){return((unsigned int) kRecoShowers_EnergyCut(slc)==1);})
 
const Cut kNueHasTrackCut ([](const caf::SRSliceProxy *slc){return slc->reco.ntrk > 0;})
 
const Cut kNueTrackContainmentCut ([](const caf::SRSliceProxy *slc){const int longestTrackIdx(kLongestTrackIdx(slc));return true;return PtInVol(slc->reco.trk[longestTrackIdx].end, fvndExit);})
 
const Cut kNueTrackLenCut ([](const caf::SRSliceProxy *slc){return kLongestTrackLength(slc)< 110.f;})
 
const Cut kNueMuonCut ([](const caf::SRSliceProxy *slc){return(kLongestTrackLength(slc)< 80.f||kLongestTrackChi2Muon(slc) > 30.f||kLongestTrackChi2Proton(slc)< 60.f);})
 
const Cut kShowerDensityCut ([](const caf::SRSliceProxy *slc){const int largestShwIdx(kLargestRecoShowerIdx(slc));return false;return(slc->reco.shw[largestShwIdx].density > 4.5);})
 
const Cut kShowerOpenAngleCut ([](const caf::SRSliceProxy *slc){return kRecoShower_OpenAngle(slc)< 12.f;})
 
const Cut kShowerRazzleElectronCut = kRecoShowerRazzlePID == 11
 
const Cut kShowerRazzleElectronScoreCut = kRecoShowerRazzleElectronScore > 0.8
 
const Cut kNueLongestTrackDazzleMuonCut = kLongestTrackDazzlePID != 13
 
const Cut kNueLongestTrackDazzleMuonScoreCut = kLongestTrackDazzleMuonScore < 0.8
 
const Cut kNueAllTrackDazzleMuonCut ([](const caf::SRSliceProxy *slc){for(auto const &trk:slc->reco.trk){return false;}return true;})
 
const Cut kNueAllTrackDazzleMuonScoreCut ([](const caf::SRSliceProxy *slc){for(auto const &trk:slc->reco.trk){return false;}return true;})
 
const Cut kNueContainedND ([](const caf::SRSliceProxy *slc){const int largestShwIdx(kLargestRecoShowerIdx(slc));return false;double this_endx=slc->reco.shw[largestShwIdx].start.x+(slc->reco.shw[largestShwIdx].dir.x *slc->reco.shw[largestShwIdx].len);double this_endy=slc->reco.shw[largestShwIdx].start.y+(slc->reco.shw[largestShwIdx].dir.y *slc->reco.shw[largestShwIdx].len);double this_endz=slc->reco.shw[largestShwIdx].start.z+(slc->reco.shw[largestShwIdx].dir.z *slc->reco.shw[largestShwIdx].len);bool startx=(fvndAbs.xmin< std::abs(slc->reco.shw[largestShwIdx].start.x))&&(std::abs(slc->reco.shw[largestShwIdx].start.x)< fvndAbs.xmax);bool endx=(fvndAbs.xmin< std::abs(this_endx))&&(std::abs(this_endx)< fvndAbs.xmax);bool starty=(fvndAbs.ymin< slc->reco.shw[largestShwIdx].start.y)&&(slc->reco.shw[largestShwIdx].start.y< fvndAbs.ymax);bool endy=(fvndAbs.ymin< this_endy)&&(this_endy< fvndAbs.ymax);bool startz=(fvndAbs.zmin< slc->reco.shw[largestShwIdx].start.z)&&(slc->reco.shw[largestShwIdx].start.z< fvndAbs.zmax);bool endz=(fvndAbs.zmin< this_endz)&&(this_endz< fvndAbs.zmax);return(startx &&endx &&starty &&endy &&startz &&endz);})
 
const Cut kNueContainedFD ([](const caf::SRSliceProxy *slc){const int largestShwIdx(kLargestRecoShowerIdx(slc));return false;double this_endx=slc->reco.shw[largestShwIdx].start.x+(slc->reco.shw[largestShwIdx].dir.x *slc->reco.shw[largestShwIdx].len);double this_endy=slc->reco.shw[largestShwIdx].start.y+(slc->reco.shw[largestShwIdx].dir.y *slc->reco.shw[largestShwIdx].len);double this_endz=slc->reco.shw[largestShwIdx].start.z+(slc->reco.shw[largestShwIdx].dir.z *slc->reco.shw[largestShwIdx].len);bool startx=(fvfd_cryo1.xmin< slc->reco.shw[largestShwIdx].start.x)&&(slc->reco.shw[largestShwIdx].start.x< fvfd_cryo1.xmax);bool endx=(fvfd_cryo1.xmin< this_endx)&&(this_endx< fvfd_cryo1.xmax);bool starty=(fvfd_cryo1.ymin< slc->reco.shw[largestShwIdx].start.y)&&(slc->reco.shw[largestShwIdx].start.y< fvfd_cryo1.ymax);bool endy=(fvfd_cryo1.ymin< this_endy)&&(this_endy< fvfd_cryo1.ymax);bool startz=(fvfd_cryo1.zmin< slc->reco.shw[largestShwIdx].start.z)&&(slc->reco.shw[largestShwIdx].start.z< fvfd_cryo1.zmax);bool endz=(fvfd_cryo1.zmin< this_endz)&&(this_endz< fvfd_cryo1.zmax);return(startx &&endx &&starty &&endy &&startz &&endz);})
 
const Cut kNueMuonCutOLD
 
const Cut kNueMuonCutNEW
 
const Cut kPreNueSelND = kFiducialVolumeND && kSlcNuScoreCut && kSlcFlashMatchCut
 
const Cut kRecoNueSel = kRecoShower && kShowerEnergyCut
 
const Cut kFullNueSel = kNueTrackLenCut && kShowerConvGapCut && kShowerdEdxCut && kShowerDensityCut
 
const Cut kRazzleDazzleNueSel = kNueAllTrackDazzleMuonCut && kShowerRazzleElectronScoreCut
 
const Cut kNueFlashScoreFDCut = kSlcFlashMatchCut
 
const Cut kNuePandoraScoreFDCut = kSlcNuScoreCut
 
const Cut kRecoShowerFD = kRecoShower && kNueNumShowersCut && kShowerdEdxCut && kShowerConvGapCut && kNueTrackLenCut && kShowerDensityCut && kShowerEnergyCut
 
const Cut kNueFD = kContainedFD && kNueFlashScoreFDCut && kNuePandoraScoreFDCut && kRecoShowerFD
 
const Cut kNumuBasicQual ([](const caf::SRSliceProxy *slc){bool hastrk=(slc->reco.ntrk > 0);if(!hastrk) return hastrk;unsigned int muIdx=(unsigned int) kPrimMuonIdx(slc);double len=slc->reco.trk[muIdx].len;return(len > 0);})
 
const Cut kHasFlashMatch ([](const caf::SRSliceProxy *slc){return(slc->fmatch.present);})
 
const Cut kFlashMatchScore ([](const caf::SRSliceProxy *slc){return(slc->fmatch.time > 0 &&slc->fmatch.score > 6);})
 
const Cut kFlashMatchNumuCut = kHasFlashMatch && kFlashMatchScore
 
const Cut kNumuTrkLen ([](const caf::SRSliceProxy *slc){bool hastrk=(slc->reco.ntrk > 0);if(!hastrk) return hastrk;unsigned int muIdx=(unsigned int) kPrimMuonIdx(slc);double len=slc->reco.trk[muIdx].len;return(len > 50);})
 
const Cut kIsNuSlice = ( kTruthIndex >= 0.f )
 
const Cut kIsCosmic = ( !kIsNuSlice )
 
const Cut kIsNuMuCC ([](const caf::SRSliceProxy *slc){return(kIsNuSlice(slc)&&slc->truth.iscc &&(slc->truth.pdg==14||slc->truth.pdg==-14));})
 
const Cut kIsNuOther = ( kIsNuSlice && !kIsNuMuCC )
 
const Cut kCryo0 ([](const caf::SRSliceProxy *slc){return(!isnan(slc->vertex.x)&&slc->vertex.x< 0);})
 
const Cut kTFiducial ([](const caf::SRSliceProxy *slc){return(!isnan(slc->truth.position.x)&&((slc->truth.position.x< -71.1-25 &&slc->truth.position.x >-369.33+25)||(slc->truth.position.x > 71.1+25 &&slc->truth.position.x< 369.33-25))&&!isnan(slc->truth.position.y)&&(slc->truth.position.y >-181.7+25 &&slc->truth.position.y< 134.8-25)&&!isnan(slc->truth.position.z)&&(slc->truth.position.z >-895.95+30 &&slc->truth.position.z< 895.95-50));})
 
const Cut kRFiducial ([](const caf::SRSliceProxy *slc){return(!isnan(slc->vertex.x)&&((slc->vertex.x< -71.1-25 &&slc->vertex.x >-369.33+25)||(slc->vertex.x > 71.1+25 &&slc->vertex.x< 369.33-25))&&!isnan(slc->vertex.y)&&(slc->vertex.y >-181.7+25 &&slc->vertex.y< 134.8-25)&&!isnan(slc->vertex.z)&&(slc->vertex.z >-895.95+30 &&slc->vertex.z< 895.95-50));})
 
const Cut kNotClearCosmic ([](const caf::SRSliceProxy *slc){return!slc->is_clear_cosmic;})
 
const Cut kNuScore ([](const caf::SRSliceProxy *slc){return(!isnan(slc->nu_score)&&slc->nu_score > 0.4);})
 
const Cut kFMScore ([](const caf::SRSliceProxy *slc){return(!isnan(slc->fmatch.score)&&slc->fmatch.score< 7.0);})
 
const Cut kPTrack ([](const caf::SRSliceProxy *slc){return(kPTrackInd(slc) >=0);})
 
const Cut kPTrackContained ([](const caf::SRSliceProxy *slc){int Ind=kPTrackInd(slc);bool Contained(false);if(Ind >=0){auto const &trk=slc->reco.trk.at(Ind);Contained=(!isnan(trk.end.x)&&(trk.end.x< -71.1-25 &&trk.end.x >-369.33+25)&&!isnan(trk.end.y)&&(trk.end.y >-181.7+25 &&trk.end.y< 134.8-25)&&!isnan(trk.end.z)&&(trk.end.z >-895.95+30 &&trk.end.z< 895.95-50));}return Contained;})
 
const Cut kPTrackExiting ([](const caf::SRSliceProxy *slc){int Ind=kPTrackInd(slc);bool Exiting(false);if(Ind >=0){auto const &trk=slc->reco.trk.at(Ind);Exiting=!(!isnan(trk.end.x)&&(trk.end.x< -71.1-25 &&trk.end.x >-369.33+25)&&!isnan(trk.end.y)&&(trk.end.y >-181.7+25 &&trk.end.y< 134.8-25)&&!isnan(trk.end.z)&&(trk.end.z >-895.95+30 &&trk.end.z< 895.95-50));}return Exiting;})
 
const Cut kNuMuCC_Cryo0 = ( kIsNuMuCC && kCryo0 )
 
const Cut kCosmic_Cryo0 = ( kIsCosmic && kCryo0 )
 
const Cut kNuOther_Cryo0 = ( kIsNuOther && kCryo0 )
 
const Cut kNuMuCC_TFiducial = ( kNuMuCC_Cryo0 && kTFiducial )
 
const Cut kNuMuCC_RFiducial = ( kNuMuCC_Cryo0 && kRFiducial )
 
const Cut kCosmic_TFiducial = ( kCosmic_Cryo0 && kTFiducial )
 
const Cut kCosmic_RFiducial = ( kCosmic_Cryo0 && kRFiducial )
 
const Cut kNuOther_TFiducial = ( kNuOther_Cryo0 && kTFiducial )
 
const Cut kNuOther_RFiducial = ( kNuOther_Cryo0 && kRFiducial )
 
const Cut kNuMuCC_ClearCos = ( kNuMuCC_TFiducial && kNotClearCosmic )
 
const Cut kCosmic_ClearCos = ( kCosmic_RFiducial && kNotClearCosmic )
 
const Cut kNuOther_ClearCos = ( kNuOther_TFiducial && kNotClearCosmic )
 
const Cut kNuMuCC_NuScore = ( kNuMuCC_ClearCos && kNuScore )
 
const Cut kCosmic_NuScore = ( kCosmic_ClearCos && kNuScore )
 
const Cut kNuOther_NuScore = ( kNuOther_ClearCos && kNuScore )
 
const Cut kNuMuCC_FMScore = ( kNuMuCC_NuScore && kFMScore )
 
const Cut kCosmic_FMScore = ( kCosmic_NuScore && kFMScore )
 
const Cut kNuOther_FMScore = ( kNuOther_NuScore && kFMScore )
 
const Cut kNuMuCC_PTrack = ( kNuMuCC_FMScore && kPTrack )
 
const Cut kCosmic_PTrack = ( kCosmic_FMScore && kPTrack )
 
const Cut kNuOther_PTrack = ( kNuOther_FMScore && kPTrack )
 
const Cut kNuMuCC_FullSelection = ( kCryo0 && kRFiducial && kNotClearCosmic && kNuScore && kFMScore && kPTrack )
 
const SpillCut kLongTrack ([](const caf::SRSpillProxy *sr){bool ProgCut=false;bool NuIsNuMuCC, IsMuon, Contained;for(auto const &nu:sr->mc.nu){NuIsNuMuCC=nu.iscc &&(nu.pdg==14||nu.pdg==-14);for(auto const &prim:nu.prim){IsMuon=(prim.pdg==13||prim.pdg==-13);Contained=(prim.contained==1);ProgCut=ProgCut||(NuIsNuMuCC &&IsMuon &&((Contained &&prim.length > 50.0)||(!Contained &&prim.length > 100.0)));}}return ProgCut;})
 
const Cut kIcarus202208FMTimeCut = kFMTimeVar > 0 && kFMTimeVar < 1.8
 
const Cut kIcarus202208FMScoreCut = kFMScoreVar < 9
 
const Cut kIcarus202208LongTrackDirCut = kCRLongestTrackDirY > -0.91
 
const Cut kIcarus202208FoundMuon = kIcarus202208MuonIdx >= 0
 
const Cut kIcarus202208RecoFiducial ([](const caf::SRSliceProxy *slc){return(!isnan(slc->vertex.x)&&((slc->vertex.x< -71.1-25 &&slc->vertex.x >-369.33+25)||(slc->vertex.x > 71.1+25 &&slc->vertex.x< 369.33-25))&&!isnan(slc->vertex.y)&&(slc->vertex.y >-181.7+25 &&slc->vertex.y< 134.8-25)&&!isnan(slc->vertex.z)&&(slc->vertex.z >-895.95+30 &&slc->vertex.z< 895.95-50));})
 
const Cut kIcarus202208NumuSelection = kIcarus202208RecoFiducial && kIcarus202208FMScoreCut && kIcarus202208FMTimeCut && kIcarus202208LongTrackDirCut && kIcarus202208FoundMuon
 
const Cut kIcarus202208NoPion = kIcarus202208NumPions == 0
 
const Cut kIcarus202208ContainedHadrons ([](const caf::SRSliceProxy *slc){auto idx=kIcarus202208MuonIdx(slc);int muID=-1;if(idx >=0) muID=slc->reco.trk.at(idx).pfp.id;for(auto &trk:slc->reco.trk){if(!Icarus202208contained(trk)) return false;}return true;})
 
const Cut kIcarus202208ContainedMuon ([](const caf::SRSliceProxy *slc){return kIcarus202208FoundMuon(slc)&&Icarus202208contained(slc->reco.trk.at(kIcarus202208MuonIdx(slc)));})
 
const Cut kIcarus202208ContainedMuonAndHadrons = kIcarus202208ContainedMuon && kIcarus202208ContainedHadrons
 
const Cut kIcarus202208QELike = kIcarus202208NumuSelection && kIcarus202208NoPion && kIcarus202208ContainedHadrons
 
const Cut kIcarus202208QELikeContainedMuon = kIcarus202208QELike && kIcarus202208ContainedMuon
 
const Cut kInFV ([](const caf::SRSliceProxy *slc){return(slc->vertex.x >(-199.15+10)&&slc->vertex.x< (199.15-10)&&slc->vertex.y >(-200.+10)&&slc->vertex.y< (200.-10)&&slc->vertex.z >(0.0+10)&&slc->vertex.z< (500.-50));})
 
const Cut kSlcFlashMatchTimeCut ([](const caf::SRSliceProxy *slc){if(std::isnan(slc->fmatch.time)) return false;bool InBeam=(slc->fmatch.time > 0.&&slc->fmatch.time< 1.800);return(InBeam);})
 
const Cut kSlcFlashMatchScoreCut ([](const caf::SRSliceProxy *slc){return(slc->fmatch.score< 7);})
 
const Cut kHasPrimaryMuonTrk ([](const caf::SRSliceProxy *slc){int ptrkid=kPrimaryMuonTrkIdx(slc);double ptrkrecop=kPrimaryMuonTrkP(slc);return(ptrkid!=-1 &&!isnan(ptrkrecop)&&ptrkrecop > 0.&&ptrkrecop< 7.5);})
 
const Cut kCRTTrackAngleCut ([](const caf::SRSliceProxy *slc){int ptrkid=kPrimaryMuonTrkIdx(slc);const caf::SRTrackProxy &ptrk=slc->reco.trk[ptrkid];return(isnan(ptrk.crttrack.angle)||ptrk.crttrack.angle > 0.05);})
 
const Cut kCRTHitDistanceCut ([](const caf::SRSliceProxy *slc){int ptrkid=kPrimaryMuonTrkIdx(slc);const caf::SRCRTHitMatchProxy &crthit=slc->reco.trk[ptrkid].crthit;if(std::isnan(crthit.hit.time)||std::isnan(crthit.distance)) return true;return crthit.distance > 5||(crthit.hit.time > 0.&&crthit.hit.time< 1.800);})
 
const Cut kInBeamSpill
 Does the event fall inside the beam spill window. More...
 
const Cut kInTimingSideband
 Is the event far from the start and end of the spill window. More...
 
const Cut kTrueActiveVolumeND ([](const caf::SRSliceProxy *slc){return kHasNu(slc)&&PtInVolAbsX(slc->truth.position, avnd);})
 
const Cut kTrueFiducialVolumeND ([](const caf::SRSliceProxy *slc){return kHasNu(slc)&&PtInVolAbsX(slc->truth.position, fvndAbs);})
 
const Cut kTrueActiveVolumeFDCryo1 ([](const caf::SRSliceProxy *slc){return kHasNu(slc)&&PtInVol(slc->truth.position, avfd_cryo1);})
 
const Cut kTrueActiveVolumeFDCryo2 ([](const caf::SRSliceProxy *slc){return kHasNu(slc)&&PtInVol(slc->truth.position, avfd_cryo2);})
 
const Cut kTrueFiducialVolumeFDCryo1 ([](const caf::SRSliceProxy *slc){return kHasNu(slc)&&PtInVol(slc->truth.position, fvfd_cryo1);})
 
const Cut kTrueFiducialVolumeFDCryo2 ([](const caf::SRSliceProxy *slc){return kHasNu(slc)&&PtInVol(slc->truth.position, fvfd_cryo2);})
 
const Cut kIsNu ([](const caf::SRSliceProxy *slc){if(slc->truth.index< 0) return false;return slc->truth.pdg > 0;})
 
const Cut kHasNu ([](const caf::SRSliceProxy *slc){return slc->truth.index >=0;})
 
const Cut kIsNue ([](const caf::SRSliceProxy *slc){return slc->truth.index >=0 &&abs(slc->truth.pdg)==12;})
 
const Cut kIsNumu ([](const caf::SRSliceProxy *slc){return slc->truth.index >=0 &&abs(slc->truth.pdg)==14;})
 
const Cut kIsNutau ([](const caf::SRSliceProxy *slc){return slc->truth.index >=0 &&abs(slc->truth.pdg)==16;})
 
const Cut kVtxDistMagCut ([](const caf::SRSliceProxy *slc){if(slc->truth.index< 0) return true;return(kTruthVtxDistMag(slc)< 1);})
 
const Cut kSlcCompletenessCut ([](const caf::SRSliceProxy *slc){if(slc->truth.index< 0) return false;return(kCompletness(slc) > 0.5);})
 
const SpillCut kIsCosmicSpill ([](const caf::SRSpillProxy *sr){return(sr->mc.nnu==0);})
 
const SpillCut kIsSingleNuSpill ([](const caf::SRSpillProxy *sr){return(sr->mc.nnu< 2);})
 
const SpillCut kIsNueSpill ([](const caf::SRSpillProxy *sr){if(kIsCosmicSpill(sr)||!kIsSingleNuSpill(sr)) return false;return(std::abs(sr->mc.nu[0].pdg)==12);})
 
const SpillCut kIsNumuSpill ([](const caf::SRSpillProxy *sr){if(kIsCosmicSpill(sr)||!kIsSingleNuSpill(sr)) return false;return(std::abs(sr->mc.nu[0].pdg)==14);})
 
const SpillCut kIsNutauSpill ([](const caf::SRSpillProxy *sr){if(kIsCosmicSpill(sr)||!kIsSingleNuSpill(sr)) return false;return(std::abs(sr->mc.nu[0].pdg)==16);})
 
const SpillCut kIsCCSpill ([](const caf::SRSpillProxy *sr){if(kIsCosmicSpill(sr)||!kIsSingleNuSpill(sr)) return false;return((bool) sr->mc.nu[0].iscc);})
 
const SpillCut kIsNCSpill ([](const caf::SRSpillProxy *sr){if(kIsCosmicSpill(sr)||!kIsSingleNuSpill(sr)) return false;return((bool) sr->mc.nu[0].isnc);})
 
const std::vector< double > kLowEnergyEdges
 
const std::vector< double > kLowEnergyGeVEdges
 
const Binning kNueEnergyBinning = Binning::Simple( 20, 0., 5000.)
 
const Binning kNumuEnergyBinning = Binning::Simple( 20, 0., 5000.)
 
const Binning kLowEnergyBinning = Binning::Custom( kLowEnergyEdges )
 
const Binning kLowEnergyGeVBinning = Binning::Custom( kLowEnergyGeVEdges )
 
const Binning kPositionXNDBinning = Binning::Simple(40, avnd.xmin, avnd.xmax)
 
const Binning kPositionYNDBinning = Binning::Simple(40, avnd.ymin, avnd.ymax)
 
const Binning kPositionZNDBinning = Binning::Simple(50, avnd.zmin, avnd.zmax)
 
const Binning kPositionXFDBinning = Binning::Simple(47, avfd_cryo1.xmin, avfd_cryo1.xmax)
 
const Binning kPositionYFDBinning = Binning::Simple(35, avfd_cryo1.ymin, avfd_cryo1.ymax)
 
const Binning kPositionZFDBinning = Binning::Simple(90, avfd_cryo1.zmin, avfd_cryo1.zmax)
 
const Binning kCRTXFDBinning = Binning::Simple(60, crtfd.xmin, crtfd.xmax)
 
const Binning kCRTYFDBinning = Binning::Simple(100, crtfd.ymin, crtfd.ymax)
 
const Binning kCRTZFDBinning = Binning::Simple(130, crtfd.zmin, crtfd.zmax)
 
const Binning kBDTBinning = Binning::Simple(50,0, 1.0)
 
const Var kLargestRecoShowerIdx ([](const caf::SRSliceProxy *slc) -> int{int bestIdx(-1);double maxEnergy(-1);for(unsigned int i=0;i< slc->reco.nshw;i++){auto const &shw=slc->reco.shw[i];continue;if(shw.bestplane_energy > maxEnergy){bestIdx=i;maxEnergy=shw.bestplane_energy;}}return bestIdx;})
 
const Var kRecoShower_BestEnergy ([](const caf::SRSliceProxy *slc) -> double{const caf::SRShowerProxy *shw=LargestRecoShower(slc);return shw?double(shw->bestplane_energy):-5;})
 
const Var kRecoShower_TruePdg ([](const caf::SRSliceProxy *slc) -> int{const caf::SRShowerProxy *shw=LargestRecoShower(slc);return shw?int(shw->truth.p.pdg):-5;})
 
const Var kRecoShower_BestdEdx ([](const caf::SRSliceProxy *slc) -> double{const caf::SRShowerProxy *shw=LargestRecoShower(slc);if(!shw||shw->bestplane_dEdx< 0) return-5.;return shw->bestplane_dEdx;})
 
const Var kRecoShower_ConversionGap ([](const caf::SRSliceProxy *slc) -> double{const caf::SRShowerProxy *shw=LargestRecoShower(slc);return shw?double(shw->conversion_gap):-5.;})
 
const Var kRecoShower_Density ([](const caf::SRSliceProxy *slc) -> double{const caf::SRShowerProxy *shw=LargestRecoShower(slc);return shw?double(shw->density):-5.;})
 
const Var kRecoShower_Energy ([](const caf::SRSliceProxy *slc) -> double{const caf::SRShowerProxy *shw=LargestRecoShower(slc);return shw?double(shw->plane[1].energy):-5.;})
 
const Var kRecoShower_Length ([](const caf::SRSliceProxy *slc) -> double{const caf::SRShowerProxy *shw=LargestRecoShower(slc);return shw?double(shw->len):-5.;})
 
const Var kRecoShower_OpenAngle ([](const caf::SRSliceProxy *slc) -> double{const caf::SRShowerProxy *shw=LargestRecoShower(slc);return shw?180.*shw->open_angle/M_PI:-5.;})
 
const Var kRecoShower_StartX ([](const caf::SRSliceProxy *slc) -> double{const caf::SRShowerProxy *shw=LargestRecoShower(slc);return shw?double(shw->start.x):-9999.;})
 
const Var kRecoShower_StartY ([](const caf::SRSliceProxy *slc) -> double{const caf::SRShowerProxy *shw=LargestRecoShower(slc);return shw?double(shw->start.y):-9999.;})
 
const Var kRecoShower_StartZ ([](const caf::SRSliceProxy *slc) -> double{const caf::SRShowerProxy *shw=LargestRecoShower(slc);return shw?double(shw->start.z):-9999.;})
 
const Var kRecoShower_EndX ([](const caf::SRSliceProxy *slc) -> double{const caf::SRShowerProxy *shw=LargestRecoShower(slc);return shw?double(shw->start.x+shw->dir.x *shw->len):-9999.;})
 
const Var kRecoShower_EndY ([](const caf::SRSliceProxy *slc) -> double{const caf::SRShowerProxy *shw=LargestRecoShower(slc);return shw?double(shw->start.y+shw->dir.y *shw->len):-9999.;})
 
const Var kRecoShower_EndZ ([](const caf::SRSliceProxy *slc) -> double{const caf::SRShowerProxy *shw=LargestRecoShower(slc);return shw?double(shw->start.z+shw->dir.z *shw->len):-9999.;})
 
const Var kRecoShower_densityGradient ([](const caf::SRSliceProxy *slc) -> double{const caf::SRShowerProxy *shw=LargestRecoShower(slc);return shw?double(shw->selVars.densityGradient):-5.;})
 
const Var kRecoShower_densityGradientPower ([](const caf::SRSliceProxy *slc) -> double{const caf::SRShowerProxy *shw=LargestRecoShower(slc);return shw?double(shw->selVars.densityGradientPower):-5.;})
 
const Var kRecoShower_trackLength ([](const caf::SRSliceProxy *slc) -> double{const caf::SRShowerProxy *shw=LargestRecoShower(slc);return shw?double(shw->selVars.trackLength):-5.;})
 
const Var kRecoShower_trackWidth ([](const caf::SRSliceProxy *slc) -> double{const caf::SRShowerProxy *shw=LargestRecoShower(slc);return shw?double(shw->selVars.trackWidth):-5.;})
 
const Var kRecoShowers_EnergyCut ([](const caf::SRSliceProxy *slc) -> unsigned{unsigned int counter(0);for(auto const &shw:slc->reco.shw){++counter;}return counter;})
 
const Var kLongestTrackIdx ([](const caf::SRSliceProxy *slc) -> int{int bestIdx(-1);double maxLength(-1);for(unsigned int i=0;i< slc->reco.ntrk;i++){auto const &trk=slc->reco.trk[i];continue;if(trk.len > maxLength){bestIdx=i;maxLength=trk.len;}}return bestIdx;})
 
const Var kLongestTrackTruePdg ([](const caf::SRSliceProxy *slc) -> int{const caf::SRTrackProxy *trk=LongestRecoTrack(slc);return trk?int(trk->truth.p.pdg):-5;})
 
const Var kLongestTrackLength ([](const caf::SRSliceProxy *slc) -> double{const caf::SRTrackProxy *trk=LongestRecoTrack(slc);return trk?double(trk->len):-5.;})
 
const Var kLongestTrackChi2Muon ([](const caf::SRSliceProxy *slc) -> double{const caf::SRTrkChi2PIDProxy *chi2=LongestTrackBestPlaneChi2PID(slc);return chi2?double(chi2->chi2_muon):-5.;})
 
const Var kLongestTrackChi2Pion ([](const caf::SRSliceProxy *slc) -> double{const caf::SRTrkChi2PIDProxy *chi2=LongestTrackBestPlaneChi2PID(slc);return chi2?double(chi2->chi2_pion):-5.;})
 
const Var kLongestTrackChi2Kaon ([](const caf::SRSliceProxy *slc) -> double{const caf::SRTrkChi2PIDProxy *chi2=LongestTrackBestPlaneChi2PID(slc);return chi2?double(chi2->chi2_kaon):-5.;})
 
const Var kLongestTrackChi2Proton ([](const caf::SRSliceProxy *slc) -> double{const caf::SRTrkChi2PIDProxy *chi2=LongestTrackBestPlaneChi2PID(slc);return chi2?double(chi2->chi2_proton):-5.;})
 
const Var kMuonTrackLength ([](const caf::SRSliceProxy *slc) -> double{const caf::SRTrackProxy *trk=LongestRecoTrack(slc);if(!trk) return-5;if(trk &&(kLongestTrackChi2Muon(slc)< 30.f &&kLongestTrackChi2Proton(slc) > 60.f)){return trk->len;}return-5;})
 
const Var kLongestTrackDazzlePID ([](const caf::SRSliceProxy *slc) -> int{const caf::SRTrackProxy *trk=LongestRecoTrack(slc);return trk?(int) trk->dazzle.pdg:-5;})
 
const Var kLongestTrackDazzleMuonScore ([](const caf::SRSliceProxy *slc) -> float{const caf::SRTrackProxy *trk=LongestRecoTrack(slc);return trk?(float) trk->dazzle.muonScore:-5.f;})
 
const Var kRecoShowerRazzlePID ([](const caf::SRSliceProxy *slc) -> int{const caf::SRShowerProxy *shw=LargestRecoShower(slc);return shw?(int) shw->razzle.pdg:-5;})
 
const Var kRecoShowerRazzleElectronScore ([](const caf::SRSliceProxy *slc) -> float{const caf::SRShowerProxy *shw=LargestRecoShower(slc);return shw?(float) shw->razzle.electronScore:-5.f;})
 
const Var kPrimMuonIdx ([](const caf::SRSliceProxy *slc) -> double{if((int) slc->reco.ntrk==0) return-5.0;double best_idx=0;double best_len=-5.0;for(unsigned int trkIdx=0;trkIdx< slc->reco.ntrk;trkIdx++){auto &trk=slc->reco.trk[trkIdx];if(trk.chi2pid[2].pid_ndof< 0) return-5.0;bool isMuonLike=trk.chi2pid[2].chi2_pion > trk.chi2pid[2].chi2_muon;if(isMuonLike &&trk.len > best_len){best_len=trk.len;best_idx=trkIdx;}}return best_idx;})
 
const Var kPrimTrkLen ([](const caf::SRSliceProxy *slc) -> double{double len=-5.0;if(slc->reco.ntrk > 0){int muIdx=(int) kPrimMuonIdx(slc);if(muIdx >=0){len=slc->reco.trk[muIdx].len;}}return len;})
 
const Var kTruthIndex = SIMPLEVAR(truth.index)
 
const Var kPrimaryEnergy = SIMPLEVAR(truth.E)
 
const Var kMuMaxTrack ([](const caf::SRSliceProxy *slc) -> float{float len(-5.f);for(auto const &trk:slc->reco.trk){if((trk.truth.p.pdg==13||trk.truth.p.pdg==-13)&&trk.truth.p.length > len) len=trk.truth.p.length;}return len;})
 
const Var kPTrackInd ([](const caf::SRSliceProxy *slc) -> int{float Longest(0);int PTrackInd(-1);for(std::size_t i(0);i< slc->reco.trk.size();++i){auto const &trk=slc->reco.trk.at(i);if(trk.bestplane==-1) continue;const float Atslc=std::hypot(slc->vertex.x-trk.start.x, slc->vertex.y-trk.start.y, slc->vertex.z-trk.start.z);const bool AtSlice=(Atslc< 10.0 &&trk.pfp.parent_is_primary);const float Chi2Proton=trk.chi2pid[trk.bestplane].chi2_proton;const float Chi2Muon=trk.chi2pid[trk.bestplane].chi2_muon;const bool Contained=(!isnan(trk.end.x)&&(trk.end.x< -71.1-25 &&trk.end.x >-369.33+25)&&!isnan(trk.end.y)&&(trk.end.y >-181.7+25 &&trk.end.y< 134.8-25)&&!isnan(trk.end.z)&&(trk.end.z >-895.95+30 &&trk.end.z< 895.95-50));const bool MaybeMuonExiting=(!Contained &&trk.len > 100);const bool MaybeMuonContained=(Contained &&Chi2Proton > 60 &&Chi2Muon< 30 &&trk.len > 50);{Longest=trk.len;PTrackInd=i;}}return PTrackInd;})
 
const Var kRecoMuonP ([](const caf::SRSliceProxy *slc) -> float{float p(-5.f);{auto const &trk=slc->reco.trk.at(kPTrackInd(slc));const bool Contained=(!isnan(trk.end.x)&&(trk.end.x< -71.1-25 &&trk.end.x >-369.33+25)&&!isnan(trk.end.y)&&(trk.end.y >-181.7+25 &&trk.end.y< 134.8-25)&&!isnan(trk.end.z)&&(trk.end.z >-895.95+30 &&trk.end.z< 895.95-50));if(Contained) p=trk.rangeP.p_muon;else p=trk.mcsP.fwdP_muon;}return p;})
 
const Var kTrueMuonP ([](const caf::SRSliceProxy *slc) -> float{float p(-5.f);{auto const &trk=slc->reco.trk.at(kPTrackInd(slc));p=std::hypot(trk.truth.p.genp.x, trk.truth.p.genp.y, trk.truth.p.genp.z);}return p;})
 
const Var kCRLongestTrackDirY = SIMPLEVAR(nuid.crlongtrkdiry)
 
const Var kFMTimeVar = SIMPLEVAR(fmatch.time)
 
const Var kFMScoreVar = SIMPLEVAR(fmatch.score)
 
const Var kIcarus202208MuonIdx ([](const caf::SRSliceProxy *slc) -> int{float Longest(0);int PTrackInd(-1);for(std::size_t i(0);i< slc->reco.trk.size();++i){auto const &trk=slc->reco.trk.at(i);if(trk.bestplane==-1) continue;const float Atslc=std::hypot(slc->vertex.x-trk.start.x, slc->vertex.y-trk.start.y, slc->vertex.z-trk.start.z);const bool AtSlice=(Atslc< 10.0 &&trk.pfp.parent_is_primary);const float Chi2Proton=trk.chi2pid[trk.bestplane].chi2_proton;const float Chi2Muon=trk.chi2pid[trk.bestplane].chi2_muon;const bool Contained=(!isnan(trk.end.x)&&((trk.end.x< -71.1-5 &&trk.end.x >-369.33+5)||(trk.end.x< 71.1+5 &&trk.end.x >+369.33-5))&&!isnan(trk.end.y)&&(trk.end.y >-181.7+5 &&trk.end.y< 134.8-5)&&!isnan(trk.end.z)&&(trk.end.z >-895.95+5 &&trk.end.z< 895.95-5));const bool MaybeMuonExiting=(!Contained &&trk.len > 100);const bool MaybeMuonContained=(Contained &&Chi2Proton > 60 &&Chi2Muon< 30 &&trk.len > 50);if(AtSlice &&(MaybeMuonExiting||MaybeMuonContained)&&trk.len > Longest){Longest=trk.len;PTrackInd=i;}}return PTrackInd;})
 
const Var kIcarus202208NumPions ([](const caf::SRSliceProxy *slc){int count=0;auto idx=kIcarus202208MuonIdx(slc);int muID=-1;if(idx >=0) muID=slc->reco.trk.at(idx).pfp.id;for(auto &trk:slc->reco.trk){++count;}return count;})
 
const Var kPrimaryMuonTrkIdx ([](const caf::SRSliceProxy *slc){double longest=-1;int best_idx=-1;double dist=-1;bool atslc, contained, maybe_muon_exiting, maybe_muon_contained;float chi2_proton, chi2_muon;for(unsigned int trkidx=0;trkidx< slc->reco.trk.size();++trkidx){const caf::SRTrackProxy &trk=slc->reco.trk[trkidx];if(trk.bestplane==-1) continue;dist=sqrt((pow(trk.start.x-slc->vertex.x, 2))+(pow(trk.start.y-slc->vertex.y, 2))+(pow(trk.start.z-slc->vertex.z, 2)));atslc=dist< 10;if(!atslc||!trk.pfp.parent_is_primary) continue;contained=((-199.15+10)< trk.end.x &&trk.end.x< (199.15-10)&&(-200.+10)< trk.end.y &&trk.end.y< (200.-10)&&(0.0+10)< trk.end.z &&trk.end.z< (500.-50));chi2_proton=trk.chi2pid[trk.bestplane].chi2_proton;chi2_muon=trk.chi2pid[trk.bestplane].chi2_muon;maybe_muon_exiting=!contained &&trk.len > 100;maybe_muon_contained=contained &&chi2_proton > 60 &&chi2_muon< 30 &&trk.len > 50;if(!maybe_muon_contained &&!maybe_muon_exiting) continue;if(trk.len > longest){longest=trk.len;best_idx=trkidx;}}return best_idx;})
 
const Var kPrimaryMuonTrkP ([](const caf::SRSliceProxy *slc){float recop(-5.f);bool contained(false);if(kPrimaryMuonTrkIdx(slc) >=0){auto const &ptrk=slc->reco.trk.at(kPrimaryMuonTrkIdx(slc));contained=((-199.15+10)< ptrk.end.x &&ptrk.end.x< (199.15-10)&&(-200.+10)< ptrk.end.y &&ptrk.end.y< (200.-10)&&(0.0+10)< ptrk.end.z &&ptrk.end.z< (500.-50));if(contained) recop=ptrk.rangeP.p_muon;else recop=ptrk.mcsP.fwdP_muon;}return recop;})
 
const Var kCRTTrkTime ([](const caf::SRSliceProxy *slc) -> double{float crttrktime(-5.f);if(kPrimaryMuonTrkIdx(slc) >=0){int ptrkid=kPrimaryMuonTrkIdx(slc);const caf::SRTrackProxy &ptrk=slc->reco.trk[ptrkid];crttrktime=ptrk.crthit.hit.time;}return crttrktime;})
 
const Var kCRTTrkAngle ([](const caf::SRSliceProxy *slc) -> double{float crttrkangle(-5.f);if(kPrimaryMuonTrkIdx(slc) >=0){int ptrkid=kPrimaryMuonTrkIdx(slc);const caf::SRTrackProxy &ptrk=slc->reco.trk[ptrkid];crttrkangle=ptrk.crttrack.angle;}return crttrkangle;})
 
const Var kCRTHitDist ([](const caf::SRSliceProxy *slc) -> double{float crttrkdist(-5.f);if(kPrimaryMuonTrkIdx(slc) >=0){int ptrkid=kPrimaryMuonTrkIdx(slc);const caf::SRTrackProxy &ptrk=slc->reco.trk[ptrkid];crttrkdist=ptrk.crthit.distance;}return crttrkdist;})
 
const Var kPrimaryMuonTrkLen ([](const caf::SRSliceProxy *slc) -> double{float ptrklen(-5.f);if(kPrimaryMuonTrkIdx(slc) >=0){int ptrkid=kPrimaryMuonTrkIdx(slc);const caf::SRTrackProxy &ptrk=slc->reco.trk[ptrkid];ptrklen=ptrk.len;}return ptrklen;})
 
const Var kHasTruthMatch ([](const caf::SRSliceProxy *slc) -> double{return(slc->truth.index!=-1);})
 
const Var kCompletness ([](const caf::SRSliceProxy *slc) -> double{return(kHasTruthMatch(slc)?(float) slc->tmatch.eff:-5.f);})
 
const Var kTruthEnergy ([](const caf::SRSliceProxy *slc) -> double{return(kHasTruthMatch(slc)?(float) slc->truth.E:-5.f);})
 
const Var kTruthVtxX ([](const caf::SRSliceProxy *slc) -> double{return(kHasTruthMatch(slc)?(float) slc->truth.position.x:-999.f);})
 
const Var kTruthVtxY ([](const caf::SRSliceProxy *slc) -> double{return(kHasTruthMatch(slc)?(float) slc->truth.position.y:-999.f);})
 
const Var kTruthVtxZ ([](const caf::SRSliceProxy *slc) -> double{return(kHasTruthMatch(slc)?(float) slc->truth.position.z:-999.f);})
 
const Var kTruthVtxDistX ([](const caf::SRSliceProxy *slc) -> double{return(kHasTruthMatch(slc)?(float) std::abs(slc->truth.position.x-kSlcVtxX(slc)):-999.f);})
 
const Var kTruthVtxDistY ([](const caf::SRSliceProxy *slc) -> double{return(kHasTruthMatch(slc)?(float) std::abs(slc->truth.position.y-kSlcVtxY(slc)):-999.f);})
 
const Var kTruthVtxDistZ ([](const caf::SRSliceProxy *slc) -> double{return(kHasTruthMatch(slc)?(float) std::abs(slc->truth.position.z-kSlcVtxZ(slc)):-999.f);})
 
const Var kTruthVtxDistMag ([](const caf::SRSliceProxy *slc) -> double{return(kHasTruthMatch(slc)?(float) std::hypot(kTruthVtxDistX(slc), kTruthVtxDistY(slc), kTruthVtxDistZ(slc)):-5.f);})
 
const SpillVar kTruthNuEnergy ([](const caf::SRSpillProxy *sr) -> double{return(sr->mc.nnu!=1?-5.f:(float) sr->mc.nu[0].E);})
 
const SpillVar kTruthLeptonEnergy ([](const caf::SRSpillProxy *sr) -> double{if(sr->mc.nnu!=1) return-5.f;for(auto const &prim:sr->mc.nu[0].prim){if(std::abs(prim.pdg)!=11 &&std::abs(prim.pdg)!=13) continue;return prim.startE;}return-5.f;})
 
const SpillVar kRun = SIMPLESPILLVAR(hdr.run)
 
const SpillVar kEvt = SIMPLESPILLVAR(hdr.evt)
 
const Var kCounting = kUnweighted
 
const SpillVar kSpillCounting = kSpillUnweighted
 
const SpillMultiVar kCRTHitX ([](const caf::SRSpillProxy *sr){std::vector< double > positions;for(const auto &hit:sr->crt_hits){positions.push_back(hit.position.x);}return positions;})
 
const SpillMultiVar kCRTHitY ([](const caf::SRSpillProxy *sr){std::vector< double > positions;for(const auto &hit:sr->crt_hits){positions.push_back(hit.position.y);}return positions;})
 
const SpillMultiVar kCRTHitZ ([](const caf::SRSpillProxy *sr){std::vector< double > positions;for(const auto &hit:sr->crt_hits){positions.push_back(hit.position.z);}return positions;})
 
const SpillMultiVar kCRTHitPE ([](const caf::SRSpillProxy *sr){std::vector< double > pes;for(const auto &hit:sr->crt_hits){pes.push_back(hit.pe);}return pes;})
 
const SpillMultiVar kCRTHitTime ([](const caf::SRSpillProxy *sr){std::vector< double > times;for(const auto &hit:sr->crt_hits){times.push_back(hit.time);}return times;})
 
const SpillMultiVar kCRTHitTimeFD ([](const caf::SRSpillProxy *sr){std::vector< double > times;for(const auto &hit:sr->crt_hits){auto thistime=hit.time-1600.;times.push_back(thistime);}return times;})
 
const Var kSlcVtxX ([](const caf::SRSliceProxy *slc) -> double{return slc->vertex.x;})
 
const Var kSlcVtxY ([](const caf::SRSliceProxy *slc) -> double{return slc->vertex.y;})
 
const Var kSlcVtxZ ([](const caf::SRSliceProxy *slc) -> double{return slc->vertex.z;})
 
const Var kSlcNuScore ([](const caf::SRSliceProxy *slc) -> double{return slc->nu_score;})
 
const Var kSlcHasFlash ([](const caf::SRSliceProxy *slc) -> double{return slc->fmatch.present;})
 
const Var kSlcFlashScore ([](const caf::SRSliceProxy *slc) -> double{return((bool) kSlcHasFlash(slc)?(float) slc->fmatch.score:-5.f);})
 

Detailed Description

Oscillation analysis framework, runs over CAF files outside of ART.

Beam spill duration is 1.6 microseconds TO DO: Change numbers to reflect reality: Where the beam spill actually starts after the beam trigger?

All analysis code is defined in namespace "ana"

Typedef Documentation

Definition at line 95 of file Cut.h.

typedef double( ana::ExposureFunc_t)(const caf::SRSpill *spill)

Definition at line 24 of file Cut.h.

Definition at line 62 of file HistAxis.h.

Definition at line 48 of file MultiVar.h.

Representation of a cut (selection) to be applied to a caf::StandardRecord object.

A Cut consists of a function, taking a StandardRecord and returning a boolean indicating if that event passes the cut.

Cut objects may be combined with the standard boolean operations && || and !

Definition at line 94 of file Cut.h.

Equivalent of Cut acting on caf::SRSpill. For use in spill-by-spill data quality cuts.

Definition at line 99 of file Cut.h.

Definition at line 63 of file HistAxis.h.

Definition at line 49 of file MultiVar.h.

typedef _Cut<caf::SRSpillTruthBranch> ana::SpillTruthCut

Cut designed to be used over the nuTree, ie all neutrinos, not just those that got slices.

Definition at line 103 of file Cut.h.

Equivalent of Var acting on caf::SRSpill.

Definition at line 76 of file Var.h.

Representation of a variable to be retrieved from a caf::StandardRecord object.

A Var consists of a function, taking a StandardRecord and returning the value of the variable (which may be some complicated function).

Definition at line 73 of file Var.h.

Enumeration Type Documentation

Is this data-file representing beam spills or cosmic spills?

Enumerator
kBeam 
kCosmic 

Definition at line 28 of file SpectrumLoaderBase.h.

28  {
29  // TODO there are no longer any actions taken as a result of this
30  // distinction. Remove after SA.
31  kBeam,
32  kCosmic
33  };
Enumerator
kBinContent 

Regular histogram.

kBinDensity 

Divide bin contents by bin widths.

Definition at line 36 of file sbnana/sbnana/CAFAna/Core/Utilities.h.

37  {
38  kBinContent, ///< Regular histogram
39  kBinDensity ///< Divide bin contents by bin widths
40  };
Divide bin contents by bin widths.

For use as an argument to Spectrum::ToTH1.

Enumerator
kPOT 
kLivetime 

Definition at line 44 of file sbnana/sbnana/CAFAna/Core/Utilities.h.

Enumerator
kSBND 
kMicroBooNE 
kICARUS 
kAll 

Definition at line 26 of file EnergySysts.h.

26  {
27  kSBND,
29  kICARUS,
30  kAll
31  };
const int kSBND
Definition: ExpInfo.h:11
const int kICARUS
Definition: ExpInfo.h:13
All neutrinos, any flavor.
Definition: IPrediction.h:25
Enumerator
kMuon 
kHadron 
kNeutron 
kEM 
kChargedHadron 

Definition at line 18 of file EnergySysts.h.

Enumerator
kConstant 
kSqrt 
kInverseSqrt 

Definition at line 12 of file EnergySysts.h.

enum ana::ESide
strong

Desired match type in UniverseOracle::ClosestShiftIndex.

Enumerator
kAbove 
kBelow 
kEither 

Definition at line 12 of file UniverseOracle.h.

enum ana::SterileOscAngles
strong
Enumerator
kNone 
kSinSq2ThetaMuMu 
kSinSq2ThetaMuE 
kSinSq2ThetaEE 

Definition at line 7 of file OscCalcSterileApprox.h.

7  {
8  kNone = 0,
10  kSinSq2ThetaMuE = (1 << 1),
11  kSinSq2ThetaEE = (1 << 2)
12  };
no compression
Definition: RawTypes.h:9

Function Documentation

bool ana::AlmostEqual ( double  a,
double  b 
)

Definition at line 799 of file sbnana/sbnana/CAFAna/Core/Utilities.cxx.

800  {
801  if(a == 0 && b == 0) return true;
802 
803  return fabs(a-b)/std::max(a, b) < .0001; // allow 0.01% error
804  }
process_name gaushit a
TLegend * ana::AutoPlaceLegend ( double  dx,
double  dy,
double  yPin = -1 
)

Create a legend, maximizing distance from all histograms.

Parameters
dxWidth of the legend, fraction of pad width
dyHeight of the legend, fraction of pad height
yPin,heightin NDC (frac) to pin center of legend, i.e only move x

Definition at line 510 of file Plots.cxx.

511  {
512  gPad->Update();
513 
514  // Convert requested width and height into physics coordinates
515  dx *= (gPad->GetX2()-gPad->GetX1());
516  dy *= (gPad->GetY2()-gPad->GetY1());
517 
518  // Range of axes in physics units
519  const double x0 = gPad->GetUxmin();
520  const double x1 = gPad->GetUxmax();
521  const double y0 = gPad->GetUymin();
522  const double y1 = gPad->GetUymax();
523 
524  const double X = x1-x0;
525  const double Y = y1-y0;
526 
527  double bestd = 0;
528  double bestx = 0;
529  double besty = 0;
530  // If we want to pin Y pos, set it to that now.
531  if(yPin >= 0) besty = yPin * (gPad->GetY2()-gPad->GetY1());
532 
533  for(bool fallback: {false, true}){
534  for(double x = x0+dx/2; x < x1-dx/2; x += X/50){
535  for(double y = y0+dy/2; y < y1-dy/2; y += Y/50){
536  double d = 999999;
537 
538  // Repel from edges
539  d = std::min(d, util::sqr((x-dx/2-x0)/X));
540  d = std::min(d, util::sqr((x+dx/2-x1)/X));
541  d = std::min(d, util::sqr((y-dy/2-y0)/Y));
542  d = std::min(d, util::sqr((y+dy/2-y1)/Y));
543  if(d < bestd) continue;
544 
545  TIter next(gPad->GetListOfPrimitives());
546  while(TObject* obj = next()){
547 
548  if(!obj->InheritsFrom(TH1::Class())) continue;
549  if( obj->InheritsFrom(TH2::Class())) continue;
550 
551  TH1* h = (TH1*)obj;
552 
553  for(int n = 1; n <= h->GetNbinsX(); ++n){
554  const double px = h->GetBinCenter(n);
555  const double py = h->GetBinContent(n);
556 
557  if(fallback){
558  d = std::min(d, util::sqr((px-x)/X)+util::sqr((py-y)/Y));
559  }
560  else{
561  d = std::min(d, PointDistanceToBox(px/X, py/Y,
562  (x-dx/2)/X, (y-dy/2)/Y,
563  (x+dx/2)/X, (y+dy/2)/Y));
564  }
565  if(d < bestd) break;
566  }
567  if(d < bestd) break;
568  } // end while
569 
570  if(d > bestd){
571  bestd = d;
572  bestx = x;
573  // Update Y if we're not pinning it.
574  if (yPin < 0) besty = y;
575  }
576  } // end for y
577  } // end for x
578 
579  if(bestd != 0) break; // If we always collide, have to do fallback
580  } // end for fallback
581 
582  // Convert to pad coordinates
583  const double nx = (bestx-gPad->GetX1())/(gPad->GetX2()-gPad->GetX1());
584  const double ny = (besty-gPad->GetY1())/(gPad->GetY2()-gPad->GetY1());
585 
586  const double ndx = dx/(gPad->GetX2()-gPad->GetX1());
587  const double ndy = dy/(gPad->GetY2()-gPad->GetY1());
588 
589  return new TLegend(nx-ndx/2, ny-ndy/2, nx+ndx/2, ny+ndy/2);
590  }
process_name opflash particleana ie x
then echo echo For and will not be changed by echo further linking echo echo B echo The symbol is in the uninitialized data multiple common symbols may appear with the echo same name If the symbol is defined the common echo symbols are treated as undefined references For more echo details on common see the discussion of warn common echo in *Note Linker see the discussion of warn common echo in *Note Linker such as a global int variable echo as opposed to a large global array echo echo I echo The symbol is an indirect reference to another symbol This echo is a GNU extension to the a out object file format which is echo rarely used echo echo N echo The symbol is a debugging symbol echo echo R echo The symbol is in a read only data section echo echo S echo The symbol is in an uninitialized data section for small echo objects echo echo T echo The symbol is in the the normal defined echo symbol is used with no error When a weak undefined symbol echo is linked and the symbol is not the value of the echo weak symbol becomes zero with no error echo echo W echo The symbol is a weak symbol that has not been specifically echo tagged as a weak object symbol When a weak defined symbol echo is linked with a normal defined the normal defined echo symbol is used with no error When a weak undefined symbol echo is linked and the symbol is not the value of the echo weak symbol becomes zero with no error echo echo echo The symbol is a stabs symbol in an a out object file In echo this the next values printed are the stabs other echo the stabs desc and the stab type Stabs symbols are echo used to hold debugging information For more echo see *Note or object file format specific echo echo For Mac OS X
T sqr(T x)
More efficient square function than pow(x,2)
Definition: MathUtil.h:23
while getopts h
process_name opflash particleana ie ie y
double PointDistanceToBox(double x, double y, double x0, double y0, double x1, double y1)
Helper for AutoPlaceLegend.
Definition: Plots.cxx:483
BEGIN_PROLOG px
Definition: filemuons.fcl:10
process_name physics producers generator physics producers generator physics producers generator py
double ana::AvgSinSq ( double  k,
double  a,
double  b 
)

Definition at line 145 of file OscCalcSterileApprox.cxx.

146  {
147  // This function shows up high in profiles, and is often called with the same masses/baselines/energies
148  static std::map<std::tuple<double, double, double>, double> cache;
149  const std::tuple<double, double, double> key = {k, a, b};
150 
151  // energies times masses times baselines plus some slack
152  if(cache.size() > 100*100*10) cache.clear();
153 
154  auto it = cache.find(key);
155  if(it != cache.end()) return it->second;
156 
157  double ret = 0;
158  if(a == b){
159  ret = util::sqr(sin(k/a));
160  }
161  else{
162  // https://www.wolframalpha.com/input/?i=integral+sin%5E2(k%2Fx)+from+a+to+b
163  ret = k*(Si(2*k/a)-Si(2*k/b));
164  assert(!isnan(ret));
165  if(a) ret -= a * util::sqr(sin(k/a));
166  assert(!isnan(ret));
167  if(b) ret += b * util::sqr(sin(k/b));
168  assert(!isnan(ret));
169 
170  ret /= (b-a);
171  }
172 
173  cache[key] = ret;
174  return ret;
175  }
T sqr(T x)
More efficient square function than pow(x,2)
Definition: MathUtil.h:23
process_name gaushit a
pdgs k
Definition: selectors.fcl:22
double Si(double x)
const caf::SRTrkChi2PIDProxy* ana::BestPlaneChi2PID ( const caf::SRTrackProxy *  trk)

Definition at line 193 of file NueVars.cxx.

194 {
195  if(trk->bestplane == -1) return 0;
196  return &trk->chi2pid[trk->bestplane];
197 }
double ana::BinCenter ( const TAxis *  ax,
int  bin,
bool  islog 
)
inline

Definition at line 32 of file sbnana/sbnana/CAFAna/Analysis/Surface.cxx.

33  {
34  return islog ? ax->GetBinCenterLog(bin) : ax->GetBinCenter(bin);
35  }
constexpr details::BinObj< T > bin(T value)
Returns a wrapper to print the specified data in binary format.
std::unique_ptr< TMatrixD > ana::CalcCovMx ( const std::vector< TArrayD * > &  binSets,
int  firstBin = 0,
int  lastBin = -1 
)

Compute bin-to-bin covariance matrix from a collection of sets of bin contents.

Parameters
binSetsCollection of sets of bins from which covariances should be calculated
firstBinThe first bin that should be considered (inclusive)
lastBinThe last bin that should be considered (inclusive). -1 means "last in set"
Returns
unique_ptr to TMatrixD containing computed covariance matrix unless binSets.size() < 2, in which case the unique_ptr's target is nullptr.

Note TH1D is a child class of TArrayD – so you can pass a vector of TH1D* to this method.

Definition at line 118 of file sbnana/sbnana/CAFAna/Core/Utilities.cxx.

119  {
120  if (binSets.size() < 2)
121  return std::unique_ptr<TMatrixD>(nullptr);
122 
123  if (lastBin < 0)
124  lastBin = binSets[0]->GetSize() - 1; // indexed from 0
125 
126  int nBins = lastBin - firstBin + 1; // firstBin and lastBin are inclusive
127 
128  std::vector<double> binMeans(nBins);
129  for( const auto & binSet : binSets )
130  {
131  for ( decltype(lastBin) binIdx = firstBin; binIdx <= lastBin; binIdx++ )
132  binMeans[binIdx] += (*binSet)[binIdx];
133  }
134  for (decltype(lastBin) binIdx = firstBin; binIdx <= lastBin; binIdx++)
135  binMeans[binIdx] /= binSets.size();
136 
137 
138  auto covmx = std::make_unique<TMatrixD>(nBins, nBins);
139 
140  for( unsigned int hist_idx = 0; hist_idx < binSets.size(); ++hist_idx )
141  {
142  // first calculate the weighted sum of squares of the deviations
143  for( decltype(nBins) i = 0; i < nBins; i++ )
144  {
145  double xi = (*(binSets[hist_idx]))[i];
146  for( decltype(nBins) k = i; k < nBins; k++ )
147  {
148  double xk = (*(binSets[hist_idx]))[k];
149  (*covmx)[i][k] += (xi - binMeans[i]) * (xk - binMeans[k]);
150  if (i != k)
151  (*covmx)[k][i] = (*covmx)[i][k]; // covariance matrices are always symmetric
152  }
153  }
154  } // for (hist_idx)
155 
156  // now divide by N-1 to get sample covariance
157  (*covmx) *= 1./(binSets.size()-1);
158 
159  return covmx;
160  }
pdgs k
Definition: selectors.fcl:22
double ana::Chi2CovMx ( const TVectorD *  e,
const TVectorD *  o,
const TMatrixD *  covmxinv 
)

Definition at line 221 of file sbnana/sbnana/CAFAna/Core/Utilities.cxx.

222  {
223  assert (e->GetNrows() == o->GetNrows());
224 
225  TVectorD diff = *o - *e;
226  return diff * ((*covmxinv) * diff); // operator* for two TVectorDs is the "dot product" (i.e., v1 * v2 = v1^{trans}v1)
227  }
do i e
double ana::Chi2CovMx ( const TH1 *  e,
const TH1 *  o,
const TMatrixD *  covmxinv 
)

Definition at line 230 of file sbnana/sbnana/CAFAna/Core/Utilities.cxx.

231  {
232  TVectorD eVec(e->GetNbinsX());
233  TVectorD oVec(o->GetNbinsX());
234  for (int bin = 1; bin <= e->GetNbinsX(); bin++)
235  eVec[bin-1] = e->GetBinContent(bin);
236  for (int bin = 1; bin <= o->GetNbinsX(); bin++)
237  oVec[bin-1] = o->GetBinContent(bin);
238 
239  return Chi2CovMx(&eVec, &oVec, covmxinv);
240  }
constexpr details::BinObj< T > bin(T value)
Returns a wrapper to print the specified data in binary format.
do i e
double Chi2CovMx(const TVectorD *e, const TVectorD *o, const TMatrixD *covmxinv)
void ana::ClearTrueParticles ( caf::StandardRecord sr)

Definition at line 25 of file FileReducer.cxx.

26  {
27  sr->true_particles.clear();
28  sr->ntrue_particles = 0;
29  }
std::vector< SRTrueParticle > true_particles
True particles in spill.
int ntrue_particles
Number of true particles in list.
std::function<ExposureFunc_t> ana::CombineExposures ( const std::function< ExposureFunc_t > &  a,
const std::function< ExposureFunc_t > &  b 
)

Definition at line 26 of file Cut.cxx.

28  {
29  if(!a && !b) return 0;
30  if(!a) return b;
31  if(!b) return a;
32 
33  return [a, b](const caf::SRSpill* spill){
34  const double va = a(spill);
35  const double vb = b(spill);
36 
37  if(va >= 0 && vb >= 0){
38  std::cout << "Inconsistent pot/livetime values of "
39  << va << " and " << vb
40  << " from two cuts being combined." << std::endl;
41  abort();
42  }
43 
44  return std::max(va, vb);
45  };
46  }
process_name gaushit a
BEGIN_PROLOG could also be cout
void ana::CombineMetadata ( std::map< std::string, std::string > &  base,
const std::map< std::string, std::string > &  add,
std::set< std::string > &  mask 
)

Definition at line 612 of file sbnana/sbnana/CAFAna/Core/Utilities.cxx.

615  {
616  for(auto it: add){
617  const std::string& key = it.first;
618 
619  // Needs special handling anyway, skip it
620  if(key == "parents") continue;
621 
622  // Accumulate the runs list
623  if(key == "runs"){
624  const std::string& r1 = base[key];
625  const std::string& r2 = it.second;
626 
627  assert(!r2.empty());
628 
629  // Strip the outermost enclosing []
630  const std::string& r2tmp = r2.substr(1, r2.length()-2);
631 
632  // Check that the run/subrun is not already present
633  if (r1.find(r2tmp) != std::string::npos){
634  std::cout << "Found files with duplicate run/subrun metadata: " << r2tmp << std::endl;
635 
636  abort();
637  }
638 
639  if(r1.empty()){
640  base[key] = r2;
641  continue;
642  }
643 
644  // "[foo]" + "[bar]"
645  std::string sum = r1+&r2[1]; // "[foo]bar]"
646  sum[r1.size()-1] = ','; // "[foo,bar]"
647  base[key] = sum;
648  continue;
649  }
650 
651  if(base.find(key) == base.end()){
652  // If it's new, add it
653  base[key] = it.second;
654  }
655  else{
656  if(key == "simulated.number_of_spills" ||
657  key == "event_count" ||
658  key == "online.totalevents"){
659  // These two fields should be accumulated
660  base[key] = TString::Format("%d",
661  atoi(base[key].c_str()) +
662  atoi(it.second.c_str())).Data();
663  }
664  else{
665  // If it's a clash, record it
666  if(base[key] != it.second) mask.insert(key);
667  }
668  }
669  }
670  }
BEGIN_PROLOG could also be cout
Var ana::Constant ( double  c)

Use to weight events up and down by some factor.

Definition at line 165 of file Var.cxx.

166  {
167  return Var([c](const caf::SRSliceProxy*){return c;});
168  }
caf::Proxy< caf::SRSlice > SRSliceProxy
Definition: EpilogFwd.h:2
_Var< caf::SRSliceProxy > Var
Representation of a variable to be retrieved from a caf::StandardRecord object.
Definition: Var.h:73
void ana::CountingExperimentErrorBarChart ( const std::map< std::string, double > &  systs,
double  statErr = 0,
bool  bkgdOrSig = false,
bool  shortchart = false 
)

Make a simple plot of relative size of different errors.

Parameters
systsMap from error label to size in percent
statErrPercentage statistical error. Optional.
bkgdOrSigLabel axis for background or signal. Default (false) = bkgd
void ana::DataMCAreaNormalizedRatio ( const Spectrum &  data,
const IPrediction *  mc,
osc::IOscCalc calc,
double  miny,
double  maxy 
)

Plot data/MC ratio for the given spectrum. Normalize MC to Data by area.

Definition at line 328 of file Plots.cxx.

332  {
333  DataMCAreaNormalizedRatio(data, mc->Predict(calc), miny, maxy);
334  }
void DataMCAreaNormalizedRatio(const Spectrum &data, const IPrediction *mc, osc::IOscCalc *calc, double miny, double maxy)
Plot data/MC ratio for the given spectrum. Normalize MC to Data by area.
Definition: Plots.cxx:328
void ana::DataMCAreaNormalizedRatio ( const Spectrum &  data,
const Spectrum &  mc,
double  miny,
double  maxy 
)

Plot data/MC ratio for the given spectrum. Normalize MC to Data by area.

Definition at line 337 of file Plots.cxx.

340  {
341  Spectrum mcScaled = mc;
342  mcScaled.OverridePOT(mcScaled.POT() * mc.Integral(1) / data.Integral(1));
343 
344  DataMCRatio(data, mcScaled, miny, maxy);
345  }
void DataMCRatio(const Spectrum &data, const IPrediction *mc, osc::IOscCalc *calc, double miny, double maxy)
Plot data/MC ratio for the given spectrum. Normalize MC to Data by POT.
Definition: Plots.cxx:299
TH1 * ana::DataMCComparison ( const Spectrum &  data,
const Spectrum &  mc 
)

Overlay MC spectrum with data spectrum

Returns
The first histogram drawn so you can alter axis labels etc

Definition at line 32 of file Plots.cxx.

33  {
34  TH1* ret = 0;
35 
36  TH1* hMC = mc.ToTH1(data.POT());
37  hMC->SetLineColor(kTotalMCColor);
38 
39  TH1* hData = data.ToTH1(data.POT());
40  hData->Sumw2();
41  hData->SetMarkerStyle(kFullCircle);
42 
43  // Need to draw the biggest thing first to get correct axis limits
44  if(hMC->GetMaximum() > hData->GetMaximum()+sqrt(hData->GetMaximum())){
45  ret = hMC;
46  hMC->Draw("hist");
47  hData->Draw("ep same");
48  }
49  else{
50  ret = hData;
51  hData->Draw("ep");
52  hMC->Draw("hist same");
53  hData->Draw("ep same"); // Data always goes on top
54  }
55 
56  gPad->Update();
57 
58  return ret;
59  }
const Color_t kTotalMCColor
TH1 * ana::DataMCComparisonAreaNormalized ( const Spectrum &  data,
const Spectrum &  mc 
)

Overlay MC spectrum with data spectrum, area normalized

Returns
The first histogram drawn so you can alter axis labels etc

Definition at line 62 of file Plots.cxx.

63  {
64  TH1* ret = 0;
65 
66  TH1* hMC = mc.ToTH1(mc.POT());
67  hMC->SetLineColor(kTotalMCColor);
68 
69  TH1* hData = data.ToTH1(data.POT());
70  hData->Sumw2();
71  hData->SetMarkerStyle(kFullCircle);
72 
73  hMC->Scale(hData->Integral()/hMC->Integral());
74 
75  // Need to draw the biggest thing first to get correct axis limits
76  if(hMC->GetMaximum() > hData->GetMaximum()+sqrt(hData->GetMaximum())){
77  ret = hMC;
78  hMC->Draw("hist");
79  hData->Draw("ep same");
80  }
81  else{
82  ret = hData;
83  hData->Draw("ep");
84  hMC->Draw("hist same");
85  hData->Draw("ep same"); // Data always goes on top
86  }
87 
88  gPad->Update();
89 
90  return ret;
91  }
const Color_t kTotalMCColor
TH1 * ana::DataMCComparisonComponents ( const Spectrum &  data,
const IPrediction *  mc,
osc::IOscCalc calc 
)

Plot MC broken down into flavour components, overlayed with data.

Returns
The first histogram drawn so you can alter axis labels etc

Definition at line 94 of file Plots.cxx.

97  {
98  TH1* ret = 0;
99 
100  TH1* hMC = mc->Predict(calc).ToTH1(data.POT());
101  hMC->SetLineColor(kTotalMCColor);
102 
103  TH1* hNC = mc->PredictComponent(calc,
105  Current::kNC,
106  Sign::kBoth).ToTH1(data.POT());
107  hNC->SetLineColor(kNCBackgroundColor);
108 
109  TH1* hCC = mc->PredictComponent(calc,
111  Current::kCC,
112  Sign::kBoth).ToTH1(data.POT());
113  hCC->SetLineColor(kNumuBackgroundColor);
114 
115  TH1* hBeam = mc->PredictComponent(calc,
117  Current::kCC,
118  Sign::kBoth).ToTH1(data.POT());
119  hBeam->SetLineColor(kBeamNueBackgroundColor);
120 
121  TH1* hData = data.ToTH1(data.POT());
122  hData->SetMarkerStyle(kFullCircle);
123 
124  // Need to draw the biggest thing first to get correct axis limits
125  if(hMC->GetMaximum() > hData->GetMaximum()+sqrt(hData->GetMaximum())){
126  ret = hMC;
127  hMC->Draw("hist");
128  hData->Draw("ep same");
129  }
130  else{
131  ret = hData;
132  hData->Draw("ep");
133  hMC->Draw("hist same");
134  hData->Draw("ep same"); // Data always goes on top
135  }
136 
137  hNC->Draw("hist same");
138  hCC->Draw("hist same");
139  hBeam->Draw("hist same");
140 
141  gPad->Update();
142 
143  return ret;
144  }
(&#39;beam &#39;)
Definition: IPrediction.h:14
const Color_t kNumuBackgroundColor
Charged-current interactions.
Definition: IPrediction.h:38
Interactions of both types.
Definition: IPrediction.h:41
const Color_t kBeamNueBackgroundColor
Neutral-current interactions.
Definition: IPrediction.h:39
const Color_t kTotalMCColor
All neutrinos, any flavor.
Definition: IPrediction.h:25
const Color_t kNCBackgroundColor
void ana::DataMCRatio ( const Spectrum &  data,
const IPrediction *  mc,
osc::IOscCalc calc,
double  miny,
double  maxy 
)

Plot data/MC ratio for the given spectrum. Normalize MC to Data by POT.

Definition at line 299 of file Plots.cxx.

303  {
304  DataMCRatio(data, mc->Predict(calc), miny, maxy);
305  }
void DataMCRatio(const Spectrum &data, const IPrediction *mc, osc::IOscCalc *calc, double miny, double maxy)
Plot data/MC ratio for the given spectrum. Normalize MC to Data by POT.
Definition: Plots.cxx:299
void ana::DataMCRatio ( const Spectrum &  data,
const Spectrum &  mc,
double  miny,
double  maxy 
)

Plot data/MC ratio for the given spectrum. Normalize MC to Data by POT.

Definition at line 308 of file Plots.cxx.

311  {
312  Ratio ratio(data, mc);
313  TH1* h = ratio.ToTH1();
314  h->GetYaxis()->SetTitle("Data / MC");
315  h->GetYaxis()->SetRangeUser(miny, maxy);
316  h->Draw();
317 
318  TLine* one = new TLine(h->GetXaxis()->GetXmin(), 1,
319  h->GetXaxis()->GetXmax(), 1);
320  one->SetLineWidth(2);
321  one->SetLineStyle(7);
322  one->Draw();
323 
324  gPad->Update();
325  }
while getopts h
then echo Cowardly refusing to create a new FHiCL file with the same name as the original one('${SourceName}')." >&2 exit 1 fi echo "'$
const ReactorExperiment * ana::DayaBayConstraint2014 ( )

A ReactorExperiment initialized with the Nu2014 Daya Bay constraints.

Definition at line 56 of file ReactorExperiment.cxx.

57  {
58  // Daya Bay, Neutrino 2014:
59  // https://indico.fnal.gov/getFile.py/access?contribId=256&sessionId=15&resId=0&materialId=slides&confId=8022
60  return new ReactorExperiment(.084, .005);
61  }
osc::IOscCalcAdjustable * ana::DefaultOscCalc ( )

Create a new calc with default assumptions for all parameters.

Definition at line 39 of file Calcs.cxx.

40  {
41  osc::IOscCalcAdjustable* ret = new osc::OscCalcPMNSOpt;
43  return ret;
44  }
void ResetOscCalcToDefault(osc::IOscCalcAdjustable *calc)
Reset calc to default assumptions for all parameters.
Definition: Calcs.cxx:12
osc::IOscCalcAdjustable * ana::DefaultOscCalcIH ( )

Definition at line 58 of file Calcs.cxx.

59  {
60  osc::IOscCalcAdjustable* ret = new osc::OscCalcPMNSOpt;
62  return ret;
63  }
void ResetOscCalcToDefaultIH(osc::IOscCalcAdjustable *calc)
Definition: Calcs.cxx:47
OscCalcSterileApproxAdjustable * ana::DefaultSterileApproxCalc ( SterileOscAngles  angles)

Definition at line 293 of file OscCalcSterileApprox.cxx.

294  {
295  auto ret = new OscCalcSterileApproxAdjustable;
296  ret->calc.SetDmsq(0);
297  if((angles & SterileOscAngles::kSinSq2ThetaMuMu) != SterileOscAngles::kNone)
298  ret->calc.SetSinSq2ThetaMuMu(0);
299  if((angles & SterileOscAngles::kSinSq2ThetaMuE) != SterileOscAngles::kNone)
300  ret->calc.SetSinSq2ThetaMuE(0);
301  if((angles & SterileOscAngles::kSinSq2ThetaEE) != SterileOscAngles::kNone)
302  ret->calc.SetSinSq2ThetaEE(0);
303  ret->calc.SetL(0); // make clear this is uninitialized
304 
305  return ret;
306  }
no compression
Definition: RawTypes.h:9
osc::OscCalcSterile * ana::DefaultSterileCalc ( int  nflavors)

Create a sterile calc with default assumptions for all parameters.

Definition at line 87 of file Calcs.cxx.

88  {
89  osc::OscCalcSterile* ret = new osc::OscCalcSterile;
90 
91  if(nflavors < 3) {
92  std::cout << "The default calc requires at least 3 flavors." << std::endl;
93  std::cout << "Using 3 flavors." << std::endl;
94  ret->SetNFlavors(3);
95  }
96  else {
97  ret->SetNFlavors(nflavors);
98  }
99 
101  return ret;
102  }
void ResetSterileCalcToDefault(osc::OscCalcSterile *calc)
Reset calc to default assumptions for all parameters.
Definition: Calcs.cxx:66
BEGIN_PROLOG could also be cout
const OscCalcSterileApprox * ana::DowncastToSterileApprox ( const osc::IOscCalc calc,
bool  allowFail 
)

Definition at line 309 of file OscCalcSterileApprox.cxx.

310  {
311  const OscCalcSterileApprox* ret1
312  = dynamic_cast<const OscCalcSterileApprox*>(calc);
313  if(ret1) return ret1;
314 
315  const OscCalcSterileApproxAdjustable* ret2
316  = dynamic_cast<const OscCalcSterileApproxAdjustable*>(calc);
317  if(ret2) return &ret2->calc;
318 
319  if(allowFail) return 0;
320 
321  std::cout << "Calculator was not of type OscCalcSterileApprox." << std::endl;
322  abort();
323  }
BEGIN_PROLOG could also be cout
OscCalcSterileApprox * ana::DowncastToSterileApprox ( osc::IOscCalc calc,
bool  allowFail 
)

Definition at line 326 of file OscCalcSterileApprox.cxx.

328  {
329  OscCalcSterileApprox* ret1
330  = dynamic_cast<OscCalcSterileApprox*>(calc);
331  if(ret1) return ret1;
332 
333  OscCalcSterileApproxAdjustable* ret2
334  = dynamic_cast<OscCalcSterileApproxAdjustable*>(calc);
335  if(ret2) return &ret2->calc;
336 
337  if(allowFail) return 0;
338 
339  std::cout << "Calculator was not of type OscCalcSterileApprox." << std::endl;
340  abort();
341  }
BEGIN_PROLOG could also be cout
void ana::DrawComponentsLegend ( TH1 *  hnue,
TH1 *  hnumu,
TH1 *  hnc,
TH1 *  hcos,
TH1 *  hother 
)

Definition at line 146 of file tools_nuesel_icarus.h.

146  {
147  // TLegend *l = new TLegend(0.60, 0.65, 0.85, 0.85, NULL,"brNDC");
148  TLegend *l = new TLegend(0.70, 0.70, 0.85, 0.85, NULL,"brNDC");
149  l->SetFillStyle(0);
150  l->SetTextSize(0.035);
151  // l->SetHeader(pot_tag.c_str());
152  // l->SetHeader("Integral");
153  // l->AddEntry(hnue, Form("#nu_{e} CC: %.2f", hnue->Integral()), "l");
154  // l->AddEntry(hnumu, Form("#nu_{#mu} CC: %.2f", hnumu->Integral()), "l");
155  // l->AddEntry(hnc, Form("NC: %.2f", hnc->Integral()), "l");
156  // l->AddEntry(hcos, Form("Cosmics: %.2f", hcos->Integral()), "l");
157  // l->AddEntry(hother, Form("Other bkg: %.2f", hother->Integral()), "l");
158  l->AddEntry(hnue, "#nu_{e} CC", "l");
159  l->AddEntry(hnumu, "#nu_{#mu} CC", "l");
160  l->AddEntry(hnc, "NC", "l");
161  l->AddEntry(hcos, "Cosmics", "l");
162  l->AddEntry(hother, "Other bkg", "l");
163  l->Draw("");
164  }
void ana::DrawEffPurLegend ( TH1D *  g1,
char *  name1,
TH1D *  g2,
char *  name2 
)

Definition at line 230 of file tools_nuesel_icarus.h.

230  {
231 
232  TLegend *leg = new TLegend(.65,.2,.85,.3);
233  leg->AddEntry(g1, name1,"l");
234  leg->AddEntry(g2, name2,"l");
235  leg->SetBorderSize(0); //no border for legend
236  leg->SetFillColor(0); //fill colour is white
237  leg->SetFillStyle(0); //fill colour is white
238  leg->SetTextSize(0.03); // this goes in the split canvas so use smaller text
239  leg->Draw();
240 
241  }
void ana::DrawErrorBand ( TH1 *  nom,
TGraphAsymmErrors *  band,
int  bandCol,
double  alpha 
)

Definition at line 196 of file EnsembleSpectrum.cxx.

197  {
198  if(bandCol == -1) bandCol = nom->GetLineColor()-10; // hopefully a lighter version
199 
200  // Check if this pad has already been drawn in
201  const bool same = gPad && !gPad->GetListOfPrimitives()->IsEmpty();
202 
203  nom->Draw(same ? "hist same" : "hist");
204 
205  band->SetFillColorAlpha(bandCol, alpha);
206  band->Draw("e2 same");
207 
208  nom->Draw("hist same");
209 
210  // If we are the first spectrum to draw, scale the y-axis appropriately to
211  // fit the error band as well as the nominal
212  if(!same){
213  double maxY = 0;
214  // Don't consider underflow or overflow bins when determining maximum
215  for(int i = 1; i < band->GetN()-1; ++i){
216  maxY = std::max(maxY, band->GetY()[i] + band->GetErrorYhigh(i));
217  }
218 
219  // Use non-zero lower value so that SetLogy() still works
220  nom->GetYaxis()->SetRangeUser(1e-10, 1.1 * maxY);
221  }
222 
223  gPad->RedrawAxis();
224  }
do i e
void ana::DrawIntEffPurLegend ( TH1D *  g1,
char *  name1,
TH1D *  g2,
char *  name2 
)

Definition at line 199 of file tools_nuesel_icarus.h.

199  {
200 
201  float int1 = g1->Integral();
202  float int2 = g2->Integral();
203  TLegend *leg = new TLegend(.65,.2,.85,.3);
204  leg->AddEntry(g1, name1,"l");
205  leg->AddEntry(g2, name2,"l");
206  // leg->AddEntry(g1, Form("%s: %2.f", name1, int1),"l");
207  // leg->AddEntry(g2, Form("%s: %2.f", name2, int2),"l");
208  leg->SetBorderSize(0); //no border for legend
209  leg->SetFillColor(0); //fill colour is white
210  leg->SetFillStyle(0); //fill colour is white
211  leg->SetTextSize(0.03); // this goes in the split canvas so use smaller text
212  leg->Draw();
213 
214  }
void ana::DrawPurLegend ( TH1D *  g1,
char *  name1 
)

Definition at line 217 of file tools_nuesel_icarus.h.

217  {
218 
219  TLegend *leg = new TLegend(.65,.25,.85,.35);
220  leg->AddEntry(g1, name1,"l");
221  leg->SetBorderSize(0); //no border for legend
222  leg->SetFillColor(0); //fill colour is white
223  leg->SetFillStyle(0); //fill colour is white
224  leg->SetTextSize(0.03); // this goes in the split canvas so use smaller text
225  leg->Draw();
226 
227  }
void ana::DrawSigBkgIntLegend ( TH1 *  h1,
char *  name1,
double  iSig,
TH1 *  h2,
char *  name2,
double  iBkg 
)

Definition at line 180 of file tools_nuesel_icarus.h.

180  {
181 
182  //double iRatio = iBac/iSig;
183 
184  TLegend *leg = new TLegend(.60,.60,.8,.8);
185  leg->AddEntry(h1, name1,"l");
186  leg->AddEntry(h1, TString::Format("%.2f",iSig),"");
187  leg->AddEntry(h2, name2,"l");
188  leg->AddEntry(h2, TString::Format("%.2f",iBkg),"");
189  //leg->AddEntry(h2, TString::Format("Ratio=%.2f",iRatio),"");
190  leg->SetBorderSize(0); //no border for legend
191  leg->SetFillColor(0); //fill colour is white
192  leg->SetFillStyle(0); //fill colour is white
193  leg->SetTextSize(0.04);
194  leg->Draw();
195 
196  }
void ana::DrawSigBkgIntText ( TH1 *  hsig,
TH1 *  hbkg,
float  textsize 
)

Definition at line 243 of file tools_nuesel_icarus.h.

243  {
244 
245  float isig = hsig->Integral();
246  float ibkg = hbkg->Integral();
247  float psig = 100. * isig / (isig + ibkg);
248  float pbkg = 100. * ibkg / (isig + ibkg);
249 
250  TPaveText *pText1 = new TPaveText(0.15, 0.84, 0.30, 0.89, "brNDC");
251  TText *text1 = (pText1->AddText("6.6 #times 10^{20} POT"));
252  text1->SetTextSize(textsize);
253  pText1->SetBorderSize(0);
254  pText1->SetFillStyle(0);
255  pText1->Draw();
256  TPaveText *pText2 = new TPaveText(0.15, 0.72, 0.30, 0.80, "brNDC");
257  TText *text2 = pText2->AddText(Form("Sig: %2.f = %2.f %%", isig, psig));
258  text2->SetTextAlign(11);
259  text2->SetTextSize(textsize);
260  TText *text3 = pText2->AddText(Form("Bkg: %2.f = %2.f %%", ibkg, pbkg));
261  text3->SetTextAlign(11);
262  text3->SetTextSize(textsize);
263  pText2->SetBorderSize(0);
264  pText2->SetFillStyle(0);
265  pText2->Draw();
266  }
void ana::DrawSigBkgLegend ( TH1 *  h1,
char *  name1,
TH1 *  h2,
char *  name2 
)

Definition at line 166 of file tools_nuesel_icarus.h.

166  {
167 
168  TLegend *leg = new TLegend(.60,.60,.8,.8);
169  leg->AddEntry(h1, name1,"l");
170  leg->AddEntry(h2, name2,"l");
171  leg->SetBorderSize(0); //no border for legend
172  leg->SetFillColor(0); //fill colour is white
173  leg->SetFillStyle(0); //fill colour is white
174  leg->SetTextSize(0.04);
175  leg->Draw();
176 
177  }
TGraph* ana::EffOrPurGraph ( TH1 *  hSelSignal,
TH1 *  hSelBack,
TH1 *  hSignal,
bool  geteff 
)

Definition at line 292 of file tools_nuesel_icarus.h.

292  {
293 
294  const int NBins = hSignal->GetNbinsX();
295 
296  TString xTitle = hSignal->GetXaxis()->GetTitle();
297  TString yTitle = hSignal->GetYaxis()->GetTitle();
298 
299  double eff[NBins], pur[NBins], val[NBins];
300  double sb[NBins], ssb[NBins];
301 
302  // loop over bins to calculate eff and pur as functions of the bin
303  for(unsigned int i = 1; i <= (unsigned int)NBins; ++i) {
304  double allsig = hSignal ->GetBinContent(i);
305  double selsig = hSelSignal->GetBinContent(i);
306  double selbac = hSelBack ->GetBinContent(i);
307 
308  val[i-1] = hSignal->GetBinCenter(i);
309  double EFF = selsig;
310  double PUR = selsig;
311 
312  if ( (selsig + selbac) > 0 ){
313  if ( allsig > 0 ) EFF = EFF/allsig;
314  PUR = PUR / (selsig + selbac);
315  }
316 
317  eff[i-1] = EFF;
318  pur[i-1] = PUR;
319  if ( PUR > 1 || EFF > 1 ){
320  std::cout << "\n\n\n" << " >>> EFF " << EFF << "\t PUR " << PUR << std::endl;
321  }
322  }
323 
324  TString n = hSignal->GetName();
325  TGraph *graphPur= new TGraph(NBins,val,pur);
326  graphPur->SetName("SelPur_"+n);
327  graphPur->GetXaxis()->SetTitle(xTitle);
328  graphPur->GetYaxis()->SetTitle("Pur.");
329  TGraph *graphEff= new TGraph(NBins,val,eff);
330  graphEff->SetName("SelEff_"+n);
331  graphEff->GetXaxis()->SetTitle(xTitle);
332  graphEff->GetYaxis()->SetTitle("Eff.");
333 
334  if ( geteff )
335  return graphEff;
336  else
337  return graphPur;
338 
339  }
BEGIN_PROLOG could also be cout
TH1D* ana::EffOrPurHistogram ( TH1 *  hSelSignal,
TH1 *  hSelBack,
TH1 *  hSignal,
bool  geteff 
)

Definition at line 271 of file tools_nuesel_icarus.h.

271  {
272 
273  //
274  // Make a ROC TGraph for the given signal and background histos
275  //
276  TH1D* hTotal = (TH1D*)hSelSignal->Clone();
277  hTotal->Add(hSelBack);
278 
279  TH1D* hPurity = (TH1D*)hSelSignal->Clone();
280  hPurity->Divide(hTotal);
281 
282  TH1D* hEfficiency = (TH1D*)hSelSignal->Clone();
283  hEfficiency->Divide(hSignal);
284 
285  if ( geteff )
286  return hEfficiency;
287  else
288  return hPurity;
289 
290  }
void ana::EnsurePositiveDefinite ( TH2 *  mat)

Definition at line 903 of file sbnana/sbnana/CAFAna/Core/Utilities.cxx.

904  {
905  // Convert histogram to a proper matrix
906  assert(mat->GetNbinsX() == mat->GetNbinsY());
907  const int N = mat->GetNbinsX();
908  TMatrixD m(N, N);
909  for(int i = 0; i < N; ++i)
910  for(int j = 0; j < N; ++j)
911  m(i, j) = mat->GetBinContent(i+1, j+1);
912 
913  // Decompose it
914  TVectorD evals;
915  TMatrixD evecs = m.EigenVectors(evals);
916  TMatrixD evalmat(N, N);
917  // Force any negative eigenvalues slightly positive (floating point errors)
918  for(int i = 0; i < N; ++i) evalmat(i, i) = std::max(1e-14, evals[i]);
919 
920  // Put the original matrix back together
921  const TMatrixD evecs_inv(TMatrixD::kTransposed, evecs);
922  m = evecs*evalmat*evecs_inv;
923 
924  // Decompose again to check for floating point problems
925  m.EigenVectors(evals);
926  for(int i = 0; i < N; ++i) assert(evals[i] > 0);
927 
928  // Copy the new matrix contents back into the histogram
929  for(int i = 0; i < N; ++i)
930  for(int j = 0; j < N; ++j)
931  mat->SetBinContent(i+1, j+1, m(i, j));
932  }
tuple m
now if test mode generate materials, CRT shell, world, gdml header else just generate CRT shell for u...
process_name largeant stream1 can override from command line with o or output physics producers generator N
do i e
TH2F* ana::ExpandedHistogram ( const std::string &  title,
int  nbinsx,
double  xmin,
double  xmax,
bool  xlog,
int  nbinsy,
double  ymin,
double  ymax,
bool  ylog 
)

Definition at line 243 of file sbnana/sbnana/CAFAna/Core/Utilities.cxx.

246  {
247  DontAddDirectory guard;
248 
249  if(xlog){xmin = log(xmin); xmax = log(xmax);}
250  if(ylog){ymin = log(ymin); ymax = log(ymax);}
251 
252  // How wide the bins will be once we're done
253  const double xwidth = (xmax-xmin)/(nbinsx-1);
254  const double ywidth = (ymax-ymin)/(nbinsy-1);
255 
256  // Move the bin edges so that the limits occur at the centres
257  xmin -= xwidth/2; ymin -= ywidth/2;
258  xmax += xwidth/2; ymax += ywidth/2;
259 
260  std::vector<double> xedges(nbinsx+1);
261  std::vector<double> yedges(nbinsy+1);
262 
263  for(int i = 0; i <= nbinsx; ++i){
264  xedges[i] = xmin + (xmax-xmin)*i/double(nbinsx);
265  if(xlog) xedges[i] = exp(xedges[i]);
266  }
267  for(int i = 0; i <= nbinsy; ++i){
268  yedges[i] = ymin + (ymax-ymin)*i/double(nbinsy);
269  if(ylog) yedges[i] = exp(yedges[i]);
270  }
271 
272  return new TH2F(UniqueName().c_str(), title.c_str(),
273  nbinsx, &xedges.front(),
274  nbinsy, &yedges.front());
275  }
process_name pandoraGausCryo1 vertexChargeCryo1 vertexStubCryo1 xmin
std::string UniqueName()
Return a different string each time, for creating histograms.
std::string ana::Experiment ( )

$EXPERIMENT or a nice error message and abort

Definition at line 92 of file sbnana/sbnana/CAFAna/Core/Utilities.cxx.

93  {
94  const char* ret = getenv("EXPERIMENT");
95 
96  if(!ret){
97  std::cout << "\nERROR: Environment variable $EXPERIMENT not set." << std::endl;
98  exit(1);
99  }
100 
101  return ret;
102  }
BEGIN_PROLOG could also be cout
ana::fBins ( {binsX, binsY}  )
ana::fCachedHash ( )

Definition at line 42 of file OscillatableSpectrum.cxx.

43  {
44  fTrueLabel = "True baseline / True energy (km / GeV)";
45 
46  DontAddDirectory guard;
47 
48  fHist = HistCache::NewTH2D("", bins, kTrueLOverEBins);
49 
50  loader.AddReweightableSpectrum(*this, var, cut, shift, wei);
51  }
tuple loader
Definition: demo.py:7
const Binning kTrueLOverEBins
Definition: Binning.h:74
shift
Definition: fcl_checks.sh:26
void ana::FillWithDimColor ( TH1 *  h,
bool  usealpha = false,
float  dim = 0.8 
)

Definition at line 130 of file tools_nuesel_icarus.h.

131  {
132  if ( usealpha ){
133  h->SetFillColorAlpha(h->GetLineColor(),dim);
134  return;
135  }
136  TColor *color = gROOT->GetColor(h->GetLineColor());
137  float R,G,B,hR,hG,hB,hHue,hSat,hVal;
138  color->GetRGB(hR,hG,hB);
139  color->RGB2HSV(hR,hG,hB,hHue,hSat,hVal);
140  color->HSV2RGB(hHue,dim*hSat,hVal,R,G,B);
141  h->SetFillColor(color->GetColor(R,G,B));
142  }
while getopts h
std::string ana::FindCAFAnaDir ( )

Definition at line 562 of file sbnana/sbnana/CAFAna/Core/Utilities.cxx.

563  {
564  return std::string(getenv("MRB_SOURCE"))+"/sbnana/sbnana/CAFAna";
565  }
std::vector< double > ana::FindCurveCrossings ( TH1 *  h,
double  critVal 
)

Intended for use on the output of Profile.

Returns a list of all the x-coordinates at which the curve described by h crosses critVal. eg using critVal=1 will find the 1sigma lower and upper bounds.

Definition at line 691 of file Fit.cxx.

692  {
693  std::vector<double> ret;
694 
695  // Don't look at the under/overflow bins because they don't have properly
696  // defined centre positions in any case. Stop one short because we compare
697  // i and i+1 inside the loop.
698  for(int i = 1; i < h->GetNbinsX(); ++i){
699  const double x0 = h->GetXaxis()->GetBinCenter(i);
700  const double x1 = h->GetXaxis()->GetBinCenter(i+1);
701 
702  const double y0 = h->GetBinContent(i);
703  const double y1 = h->GetBinContent(i+1);
704 
705  // Passed the critical value between the two points
706  if((y0 < critVal) != (y1 < critVal)){
707  // Interpolate the actual crossing point
708  const double x = x0 + (x1-x0)*(critVal-y0)/(y1-y0);
709  ret.push_back(x);
710  }
711  } // end for i
712 
713  return ret;
714  }
process_name opflash particleana ie x
while getopts h
double ana::FindOptimumCut ( TH1 *  hsig,
TH1 *  hbkg,
double &  best_fom 
)

Search for optimum cut position given signal and background histograms.

Parameters
hsigSignal distribution
hbkgBackground distribution
[out]best_fomFigure of Merit obtained by best cut
Returns
Best cut position

Definition at line 37 of file CutOptimizer.cxx.

38  {
39  double nsig = 0;
40  double nbkg = 0;
41  best_fom = 0;
42  double best_cut = -1;
43 
44  for(int binIdx = hsig->GetNbinsX()+1; binIdx >= 0; --binIdx){
45  nsig += hsig->GetBinContent(binIdx);
46  nbkg += hbkg->GetBinContent(binIdx);
47  const double fom = nsig ? nsig/sqrt(nsig+nbkg) : 0;
48  if(fom > best_fom){
49  best_fom = fom;
50  best_cut = hsig->GetXaxis()->GetBinLowEdge(binIdx);
51  }
52  } // end for binIdx
53 
54  return best_cut;
55  }
double ana::FindQuantile ( double  frac,
std::vector< double > &  xs 
)

Definition at line 974 of file sbnana/sbnana/CAFAna/Core/Utilities.cxx.

975  {
976  // This turns out to be a much more fraught issue than you would naively
977  // expect. This algorithm is equivalent to R-6 here:
978  // https://en.wikipedia.org/wiki/Quantile#Estimating_quantiles_from_a_sample
979 
980  // In principle we could use std::nth_element(). Probably doesn't matter
981  // much in practice since this is only for plotting.
982  std::sort(xs.begin(), xs.end());
983 
984  const int N = xs.size();
985  // The index we would ideally be sampling at
986  const double h = frac*(N+1);
987  // The indices on either side where we have to actually evaluate
988  const unsigned int h0 = std::floor(h);
989  const unsigned int h1 = std::ceil(h);
990  if(h0 == 0) return xs[0]; // Don't underflow indexing
991  if(h1 > xs.size()) return xs.back(); // Don't overflow indexing
992  // The values at those indices
993  const double x0 = xs[h0-1]; // wikipedia is using 1-based indexing
994  const double x1 = xs[h1-1];
995 
996  if(h0 == h1) return x0;
997 
998  // Linear interpolation
999  return (h1-h)*x0 + (h-h0)*x1;
1000  }
while getopts h
process_name largeant stream1 can override from command line with o or output physics producers generator N
TGraph * ana::FindValley ( const IExperiment *  expt,
osc::IOscCalcAdjustable calc,
const IFitVar &  scanVar,
const IFitVar &  fitVar,
int  nbinsx,
double  xmin,
double  xmax,
const std::vector< const IFitVar * > &  profVars = {},
const std::vector< const ISyst * > &  profSysts = {},
const std::map< const IFitVar *, std::vector< double >> &  seedPts = {},
const std::vector< SystShifts > &  systsSeedPts = {},
bool  transpose = false 
)

Find the minimum in one variable as a function of another.

Parameters
transposeplot scanVar on the y axis

Definition at line 657 of file Fit.cxx.

667  {
668  TGraph* g = new TGraph;
669  g->SetLineWidth(2);
670 
671  std::vector<const IFitVar*> vars = profVars;
672  vars.push_back(&fitVar);
673 
674  for(int i = 0; i <= nbinsx; ++i){
675  const double x = xmin + i*(xmax-xmin)/nbinsx;
676  scanVar.SetValue(calc, x);
677  Fitter fit(expt, vars, profSysts);
678  SystShifts shiftSeed = SystShifts::Nominal();
679  fit.Fit(calc, shiftSeed, seedPts, systSeedPts, Fitter::kQuiet);
680  const double y = fitVar.GetValue(calc);
681  if(transpose)
682  g->SetPoint(i, y, x);
683  else
684  g->SetPoint(i, x, y);
685  }
686 
687  return g;
688  }
process_name opflash particleana ie x
BEGIN_PROLOG g
process_name pandoraGausCryo1 vertexChargeCryo1 vertexStubCryo1 xmin
process_name opflash particleana ie ie y
TString ana::fixLatexName ( TString  mystring)

Definition at line 35 of file tools_nuesel_icarus.h.

35  {
36  // latex doesnt like underscores
37  std::vector<TString> in = {"#"," ",".","_"};
38  std::vector<TString> out = {"","","","\\_"};
39 
40  for(unsigned int i=0;i<in.size();i++)
41  mystring.ReplaceAll(in[i],out[i]);
42  return mystring;
43  }
if &&[-z"$BASH_VERSION"] then echo Attempting to switch to bash bash shellSwitch exit fi &&["$1"= 'shellSwitch'] shift declare a IncludeDirectives for Dir in
TH2* ana::Flat ( double  level,
const Surface &  s 
)

Helper function for the gaussian approximation surfaces.

Definition at line 525 of file sbnana/sbnana/CAFAna/Analysis/Surface.cxx.

526  {
527  TH2* h = s.ToTH2();
528 
529  for(int x = 0; x < h->GetNbinsX()+2; ++x)
530  for(int y = 0; y < h->GetNbinsY()+2; ++y)
531  h->SetBinContent(x, y, level);
532 
533  return h;
534  }
process_name opflash particleana ie x
while getopts h
process_name opflash particleana ie ie y
then echo File list $list not found else cat $list while read file do echo $file sed s
Definition: file_to_url.sh:60
ana::fSplitBySign ( mode  = = kSplitBySign)

Definition at line 37 of file PredictionInterp.cxx.

38  {
39  for(const ISyst* syst: systs){
40  ShiftedPreds sp;
41  sp.systName = syst->ShortName();
42 
43  for(int x = -syst->PredInterpMaxNSigma(); x <= +syst->PredInterpMaxNSigma(); ++x){
44  sp.shifts.push_back(x);
45  }
46 
47  for(int sigma: sp.shifts){
48  SystShifts shiftHere = shiftMC;
49  shiftHere.SetShift(syst, sigma);
50  sp.preds.push_back(predGen.Generate(loaders, shiftHere).release());
51  }
52 
53  fPreds.emplace(syst, sp);
54  } // end for syst
55 
56  fPredNom = predGen.Generate(loaders, shiftMC);
57  }
process_name opflash particleana ie x
ana::fVars ( {varX, varY}  )

Definition at line 39 of file HistAxis.cxx.

39  {varX, varY})
40  {
41  }
TH2 * ana::Gaussian2Sigma1D ( const Surface &  s)

Up-value surface for 2 sigma confidence in 1D in gaussian approximation.

Definition at line 548 of file sbnana/sbnana/CAFAna/Analysis/Surface.cxx.

548 {return Flat(4.00, s);}
then echo File list $list not found else cat $list while read file do echo $file sed s
Definition: file_to_url.sh:60
TH2 * Flat(double level, const Surface &s)
Helper function for the gaussian approximation surfaces.
TH2 * ana::Gaussian2Sigma2D ( const Surface &  s)

Up-value surface for 2 sigma confidence in 2D in gaussian approximation.

Definition at line 540 of file sbnana/sbnana/CAFAna/Analysis/Surface.cxx.

540 {return Flat(6.18, s);}
then echo File list $list not found else cat $list while read file do echo $file sed s
Definition: file_to_url.sh:60
TH2 * Flat(double level, const Surface &s)
Helper function for the gaussian approximation surfaces.
TH2 * ana::Gaussian3Sigma1D ( const Surface &  s)

Up-value surface for 3 sigma confidence in 1D in gaussian approximation.

Definition at line 550 of file sbnana/sbnana/CAFAna/Analysis/Surface.cxx.

550 {return Flat(9.00, s);}
then echo File list $list not found else cat $list while read file do echo $file sed s
Definition: file_to_url.sh:60
TH2 * Flat(double level, const Surface &s)
Helper function for the gaussian approximation surfaces.
TH2 * ana::Gaussian3Sigma1D1Sided ( const Surface &  s)

Up-value surface for 3 sigma confidence in 1D in 1-sided gaussian approximation.

Definition at line 555 of file sbnana/sbnana/CAFAna/Analysis/Surface.cxx.

555 {return Flat(7.74, s);}
then echo File list $list not found else cat $list while read file do echo $file sed s
Definition: file_to_url.sh:60
TH2 * Flat(double level, const Surface &s)
Helper function for the gaussian approximation surfaces.
TH2 * ana::Gaussian3Sigma2D ( const Surface &  s)

Up-value surface for 3 sigma confidence in 2D in gaussian approximation.

Definition at line 542 of file sbnana/sbnana/CAFAna/Analysis/Surface.cxx.

542 {return Flat(11.83, s);}
then echo File list $list not found else cat $list while read file do echo $file sed s
Definition: file_to_url.sh:60
TH2 * Flat(double level, const Surface &s)
Helper function for the gaussian approximation surfaces.
TH2 * ana::Gaussian5Sigma1D1Sided ( const Surface &  s)

Up-value surface for 5 sigma confidence in 1D in 1-sided gaussian approximation.

Definition at line 556 of file sbnana/sbnana/CAFAna/Analysis/Surface.cxx.

556 {return Flat(23.66, s);}
then echo File list $list not found else cat $list while read file do echo $file sed s
Definition: file_to_url.sh:60
TH2 * Flat(double level, const Surface &s)
Helper function for the gaussian approximation surfaces.
TH2 * ana::Gaussian5Sigma2D ( const Surface &  s)

Up-value surface for 5 sigma confidence in 2D in gaussian approximation.

Definition at line 543 of file sbnana/sbnana/CAFAna/Analysis/Surface.cxx.

543 {return Flat(28.74, s);}
then echo File list $list not found else cat $list while read file do echo $file sed s
Definition: file_to_url.sh:60
TH2 * Flat(double level, const Surface &s)
Helper function for the gaussian approximation surfaces.
TH2 * ana::Gaussian68Percent1D ( const Surface &  s)

Up-value surface for 68% confidence in 1D in gaussian approximation.

Definition at line 545 of file sbnana/sbnana/CAFAna/Analysis/Surface.cxx.

545 {return Flat(1.00, s);}
then echo File list $list not found else cat $list while read file do echo $file sed s
Definition: file_to_url.sh:60
TH2 * Flat(double level, const Surface &s)
Helper function for the gaussian approximation surfaces.
TH2 * ana::Gaussian68Percent2D ( const Surface &  s)

Up-value surface for 68% confidence in 2D in gaussian approximation.

Definition at line 537 of file sbnana/sbnana/CAFAna/Analysis/Surface.cxx.

537 {return Flat(2.30, s);}
then echo File list $list not found else cat $list while read file do echo $file sed s
Definition: file_to_url.sh:60
TH2 * Flat(double level, const Surface &s)
Helper function for the gaussian approximation surfaces.
TH2 * ana::Gaussian90Percent1D ( const Surface &  s)

Up-value surface for 90% confidence in 1D in gaussian approximation.

Definition at line 546 of file sbnana/sbnana/CAFAna/Analysis/Surface.cxx.

546 {return Flat(2.71, s);}
then echo File list $list not found else cat $list while read file do echo $file sed s
Definition: file_to_url.sh:60
TH2 * Flat(double level, const Surface &s)
Helper function for the gaussian approximation surfaces.
TH2 * ana::Gaussian90Percent1D1Sided ( const Surface &  s)

Up-value surface for 90% confidence in 1D in 1-sided gaussian approximation.

Definition at line 552 of file sbnana/sbnana/CAFAna/Analysis/Surface.cxx.

552 {return Flat(1.64, s);}
then echo File list $list not found else cat $list while read file do echo $file sed s
Definition: file_to_url.sh:60
TH2 * Flat(double level, const Surface &s)
Helper function for the gaussian approximation surfaces.
TH2 * ana::Gaussian90Percent2D ( const Surface &  s)

Up-value surface for 90% confidence in 2D in gaussian approximation.

Definition at line 538 of file sbnana/sbnana/CAFAna/Analysis/Surface.cxx.

538 {return Flat(4.61, s);}
then echo File list $list not found else cat $list while read file do echo $file sed s
Definition: file_to_url.sh:60
TH2 * Flat(double level, const Surface &s)
Helper function for the gaussian approximation surfaces.
TH2 * ana::Gaussian95Percent1D ( const Surface &  s)

Up-value surface for 95% confidence in 1D in gaussian approximation.

Definition at line 547 of file sbnana/sbnana/CAFAna/Analysis/Surface.cxx.

547 {return Flat(3.84, s);}
then echo File list $list not found else cat $list while read file do echo $file sed s
Definition: file_to_url.sh:60
TH2 * Flat(double level, const Surface &s)
Helper function for the gaussian approximation surfaces.
TH2 * ana::Gaussian95Percent1D1Sided ( const Surface &  s)

Up-value surface for 95% confidence in 1D in 1-sided gaussian approximation.

Definition at line 553 of file sbnana/sbnana/CAFAna/Analysis/Surface.cxx.

553 {return Flat(2.71, s);}
then echo File list $list not found else cat $list while read file do echo $file sed s
Definition: file_to_url.sh:60
TH2 * Flat(double level, const Surface &s)
Helper function for the gaussian approximation surfaces.
TH2 * ana::Gaussian95Percent2D ( const Surface &  s)

Up-value surface for 95% confidence in 2D in gaussian approximation.

Definition at line 539 of file sbnana/sbnana/CAFAna/Analysis/Surface.cxx.

539 {return Flat(5.99, s);}
then echo File list $list not found else cat $list while read file do echo $file sed s
Definition: file_to_url.sh:60
TH2 * Flat(double level, const Surface &s)
Helper function for the gaussian approximation surfaces.
TH2 * ana::Gaussian99Percent1D ( const Surface &  s)

Up-value surface for 99% confidence in 1D in gaussian approximation.

Definition at line 549 of file sbnana/sbnana/CAFAna/Analysis/Surface.cxx.

549 {return Flat(6.63, s);}
then echo File list $list not found else cat $list while read file do echo $file sed s
Definition: file_to_url.sh:60
TH2 * Flat(double level, const Surface &s)
Helper function for the gaussian approximation surfaces.
TH2 * ana::Gaussian99Percent1D1Sided ( const Surface &  s)

Up-value surface for 99% confidence in 1D in 1-sided gaussian approxiamtion.

Definition at line 554 of file sbnana/sbnana/CAFAna/Analysis/Surface.cxx.

554 {return Flat(5.41, s);}
then echo File list $list not found else cat $list while read file do echo $file sed s
Definition: file_to_url.sh:60
TH2 * Flat(double level, const Surface &s)
Helper function for the gaussian approximation surfaces.
TH2 * ana::Gaussian99Percent2D ( const Surface &  s)

Up-value surface for 99% confidence in 2D in gaussian approximation.

Definition at line 541 of file sbnana/sbnana/CAFAna/Analysis/Surface.cxx.

541 {return Flat(9.21, s);}
then echo File list $list not found else cat $list while read file do echo $file sed s
Definition: file_to_url.sh:60
TH2 * Flat(double level, const Surface &s)
Helper function for the gaussian approximation surfaces.
void ana::gdb_backtrace ( )

Definition at line 16 of file DebugHelpers.cxx.

17  {
18  // Have to end with a 'kill' command, otherwise GDB winds up sending us
19  // SIGSTOP and never resuming us afterwards.
20  char s[1024];
21  sprintf(s, "gdb --batch -ex 'set confirm off' -ex sharedlibrary -ex bt -ex kill root.exe %d", getpid());
22  system(s);
23  }
then echo File list $list not found else cat $list while read file do echo $file sed s
Definition: file_to_url.sh:60
std::vector< const ISyst * > ana::GetAllNuMIFluxSysts ( unsigned int  Npcs)

Combination of all beamline systs plus Npcs hadron production components.

Definition at line 160 of file NuMIFluxSysts.cxx.

161  {
162  std::vector<const ISyst*> ret = GetNuMIBeamlineFluxSysts();
163  std::vector<const ISyst*> add = GetNuMIPCAFluxSysts(Npcs);
164  ret.insert(ret.end(), add.begin(), add.end());
165  return ret;
166  }
std::vector< const ISyst * > GetNuMIPCAFluxSysts(unsigned int Npcs)
std::vector< const ISyst * > GetNuMIBeamlineFluxSysts()
std::vector< const ISyst * > ana::GetBigEnergySysts ( )

Definition at line 185 of file EnergySysts.cxx.

185  {
186  return {&kEnergyScaleMuonBig,
192  //&kEnergyScaleMuonUBBig,
193  //&kEnergyScaleMuonSqrtUBBig,
194  //&kEnergyScaleMuonInvSqrtUBBig,
204  //&kEnergyScaleHadronUBBig,
205  //&kEnergyScaleHadronSqrtUBBig,
206  //&kEnergyScaleHadronInvSqrtUBBig,
210  }
const EnergyScaleSyst kEnergyScaleMuonNDBig(EnergyScaleSystTerm::kConstant, EnergyScaleSystParticle::kMuon, EnergyScaleSystDetector::kSBND, 0.05,"EnergyScaleMuonNDBig","Uncorrelated SBND linear E_{#mu} scale")
Definition: EnergySysts.h:84
const EnergyScaleSyst kEnergyScaleMuonInvSqrtFDBig(EnergyScaleSystTerm::kInverseSqrt, EnergyScaleSystParticle::kMuon, EnergyScaleSystDetector::kICARUS, 0.05,"EnergyScaleMuonInvSqrtFDBig","Uncorrelated ICARUS inv sqrt E_{#mu} scale")
Definition: EnergySysts.h:94
const EnergyScaleSyst kEnergyScaleHadronFDBig(EnergyScaleSystTerm::kConstant, EnergyScaleSystParticle::kHadron, EnergyScaleSystDetector::kICARUS, 0.10,"EnergyScaleHadronFDBig","Uncorrelated ICARUS linear E_{had} scale")
Definition: EnergySysts.h:108
const EnergyScaleSyst kEnergyScaleHadronSqrtBig(EnergyScaleSystTerm::kSqrt, EnergyScaleSystParticle::kHadron, EnergyScaleSystDetector::kAll, 0.10,"EnergyScaleHadronSqrtBig","Correlated sqrt E_{had} scale")
Definition: EnergySysts.h:97
const EnergyScaleSyst kEnergyScaleMuonBig(EnergyScaleSystTerm::kConstant, EnergyScaleSystParticle::kMuon, EnergyScaleSystDetector::kAll, 0.05,"EnergyScaleMuonBig","Correlated linear E_{#mu} scale ")
Definition: EnergySysts.h:80
const EnergyScaleSyst kEnergyScaleHadronBig(EnergyScaleSystTerm::kConstant, EnergyScaleSystParticle::kHadron, EnergyScaleSystDetector::kAll, 0.10,"EnergyScaleHadronBig","Correlated linear E_{had} scale")
Definition: EnergySysts.h:96
const EnergyScaleSyst kEnergyScaleMuonInvSqrtBig(EnergyScaleSystTerm::kInverseSqrt, EnergyScaleSystParticle::kMuon, EnergyScaleSystDetector::kAll, 0.05,"EnergyScaleMuonInvSqrtBig","Correlated inv sqrt E_{#mu} scale")
Definition: EnergySysts.h:82
const EnergyScaleSyst kEnergyScaleHadronInvSqrtNDBig(EnergyScaleSystTerm::kInverseSqrt, EnergyScaleSystParticle::kHadron, EnergyScaleSystDetector::kSBND, 0.10,"EnergyScaleHadronInvSqrtNDBig","Uncorrelated SBND inv sqrt E_{had} scale")
Definition: EnergySysts.h:102
const EnergyScaleSyst kEnergyScaleHadronInvSqrtBig(EnergyScaleSystTerm::kInverseSqrt, EnergyScaleSystParticle::kHadron, EnergyScaleSystDetector::kAll, 0.10,"EnergyScaleHadronInvSqrtBig","Correlated inv sqrt E_{had} scale")
Definition: EnergySysts.h:98
const EnergyScaleSyst kEnergyScaleHadronSqrtFDBig(EnergyScaleSystTerm::kSqrt, EnergyScaleSystParticle::kHadron, EnergyScaleSystDetector::kICARUS, 0.10,"EnergyScaleHadronSqrtFDBig","Uncorrelated ICARUS sqrt E_{had} scale")
Definition: EnergySysts.h:109
const EnergyScaleSyst kEnergyScaleHadronInvSqrtFDBig(EnergyScaleSystTerm::kInverseSqrt, EnergyScaleSystParticle::kHadron, EnergyScaleSystDetector::kICARUS, 0.10,"EnergyScaleHadronInvSqrtFDBig","Uncorrelated ICARUS inv sqrt E_{had} scale")
Definition: EnergySysts.h:110
const EnergyScaleSyst kEnergyScaleMuonSqrtNDBig(EnergyScaleSystTerm::kSqrt, EnergyScaleSystParticle::kMuon, EnergyScaleSystDetector::kSBND, 0.05,"EnergyScaleMuonSqrtNDBig","Uncorrelated SBND sqrt E_{#mu} scale")
Definition: EnergySysts.h:85
const EnergyScaleSyst kEnergyScaleMuonFDBig(EnergyScaleSystTerm::kConstant, EnergyScaleSystParticle::kMuon, EnergyScaleSystDetector::kICARUS, 0.05,"EnergyScaleMuonFDBig","Uncorrelated ICARUS linear E_{#mu} scale")
Definition: EnergySysts.h:92
const EnergyScaleSyst kEnergyScaleHadronNDBig(EnergyScaleSystTerm::kConstant, EnergyScaleSystParticle::kHadron, EnergyScaleSystDetector::kSBND, 0.10,"EnergyScaleHadronNDBig","Uncorrelated SBND linear E_{had} scale")
Definition: EnergySysts.h:100
const EnergyScaleSyst kEnergyScaleMuonSqrtFDBig(EnergyScaleSystTerm::kSqrt, EnergyScaleSystParticle::kMuon, EnergyScaleSystDetector::kICARUS, 0.05,"EnergyScaleMuonSqrtFDBig","Uncorrelated ICARUS sqrt E_{#mu} scale")
Definition: EnergySysts.h:93
const EnergyScaleSyst kEnergyScaleMuonInvSqrtNDBig(EnergyScaleSystTerm::kInverseSqrt, EnergyScaleSystParticle::kMuon, EnergyScaleSystDetector::kSBND, 0.05,"EnergyScaleMuonInvSqrtNDBig","Uncorrelated SBND inv sqrt E_{#mu} scale")
Definition: EnergySysts.h:86
const EnergyScaleSyst kEnergyScaleMuonSqrtBig(EnergyScaleSystTerm::kSqrt, EnergyScaleSystParticle::kMuon, EnergyScaleSystDetector::kAll, 0.05,"EnergyScaleMuonSqrtBig","Correlated sqrt E_{#mu} scale")
Definition: EnergySysts.h:81
const EnergyScaleSyst kEnergyScaleHadronSqrtNDBig(EnergyScaleSystTerm::kSqrt, EnergyScaleSystParticle::kHadron, EnergyScaleSystDetector::kSBND, 0.10,"EnergyScaleHadronSqrtNDBig","Uncorrelated SBND sqrt E_{had} scale")
Definition: EnergySysts.h:101
const BoosterFluxHadronSyst * ana::GetBoosterFluxHadronSyst ( unsigned int  i)

Definition at line 63 of file BoosterFluxSysts.cxx.

64 {
65  // Make sure we always give the same one back
66  static std::vector<const BoosterFluxHadronSyst*> cache;
67 
68  if(i >= cache.size()) cache.resize(i+1);
69 
70  if(!cache[i]) cache[i] = new BoosterFluxHadronSyst(i);
71 
72  return cache[i];
73 }
BoosterFluxHadronSystVector ana::GetBoosterFluxHadronSysts ( unsigned int  N)
Parameters
Ntotal number of systematics

Definition at line 76 of file BoosterFluxSysts.cxx.

77 {
78  BoosterFluxHadronSystVector ret;
79  for(unsigned int i = 0; i < N; ++i)
80  ret.push_back(GetBoosterFluxHadronSyst(i));
81 
82  return ret;
83 }
const BoosterFluxHadronSyst * GetBoosterFluxHadronSyst(unsigned int i)
process_name largeant stream1 can override from command line with o or output physics producers generator N
std::map<std::string, std::string> ana::GetCAFMetadata ( TDirectory *  dir)

Definition at line 587 of file sbnana/sbnana/CAFAna/Core/Utilities.cxx.

588  {
589  std::map<std::string, std::string> ret;
590 
591  TTree* tr = (TTree*)dir->Get("metatree");
592  if(!tr){
593  std::cout << "Failed to find metadata tree in input CAF. Metadata will be blank." << std::endl;
594  return ret;
595  }
596 
597  std::string key, value;
598  std::string* pkey = &key;
599  std::string* pvalue = &value;
600  tr->SetBranchAddress("key", &pkey);
601  tr->SetBranchAddress("value", &pvalue);
602 
603  for(int i = 0; i < tr->GetEntries(); ++i){
604  tr->GetEntry(i);
605  ret[key] = value;
606  }
607 
608  return ret;
609  }
tuple dir
Definition: dropbox.py:28
temporary value
BEGIN_PROLOG could also be cout
std::vector< const ISyst * > ana::GetEnergySysts ( )

Definition at line 128 of file EnergySysts.cxx.

128  {
129  // MicroBooNE, ChargedHadron, Neutron, and EM systs
130  // not being used right now
131  return {&kEnergyScaleMuon,
137  //&kEnergyScaleMuonUB,
138  //&kEnergyScaleMuonSqrtUB,
139  //&kEnergyScaleMuonInvSqrtUB,
144  //&kEnergyScaleChargedHadron,
145  //&kEnergyScaleEM,
146  //&kEnergyScaleNeutron,
148  //&kEnergyScaleEMSqrt,
149  //&kEnergyScaleNeutronSqrt,
151  //&kEnergyScaleEMInvSqrt,
152  //&kEnergyScaleNeutronInvSqrt,
154  //&kEnergyScaleChargedHadronND,
155  //&kEnergyScaleEMND,
156  //&kEnergyScaleNeutronND,
158  //&kEnergyScaleEMSqrtND,
159  //&kEnergyScaleNeutronSqrtND,
161  //&kEnergyScaleEMInvSqrtND,
162  //&kEnergyScaleNeutronInvSqrtND,
163  //&kEnergyScaleHadronUB,
164  //&kEnergyScaleChargedHadronUB,
165  //&kEnergyScaleEMUB,
166  //&kEnergyScaleNeutronUB,
167  //&kEnergyScaleHadronSqrtUB,
168  //&kEnergyScaleEMSqrtUB,
169  //&kEnergyScaleNeutronSqrtUB,
170  //&kEnergyScaleHadronInvSqrtUB,
171  //&kEnergyScaleEMInvSqrtUB,
172  //&kEnergyScaleNeutronInvSqrtUB,
174  //&kEnergyScaleChargedHadronFD,
175  //&kEnergyScaleEMFD,
176  //&kEnergyScaleNeutronFD,
178  //&kEnergyScaleEMSqrtFD,
179  //&kEnergyScaleNeutronSqrtFD,
180  //&kEnergyScaleEMInvSqrtFD,
181  //&kEnergyScaleNeutronInvSqrtFD,
183  }
const EnergyScaleSyst kEnergyScaleMuonInvSqrtND(EnergyScaleSystTerm::kInverseSqrt, EnergyScaleSystParticle::kMuon, EnergyScaleSystDetector::kSBND, 0.02,"EnergyScaleMuonInvSqrtND","Uncorrelated SBND inv sqrt E_{#mu} scale")
Definition: EnergySysts.h:54
const EnergyScaleSyst kEnergyScaleMuon(EnergyScaleSystTerm::kConstant, EnergyScaleSystParticle::kMuon, EnergyScaleSystDetector::kAll, 0.02,"EnergyScaleMuon","Correlated linear E_{#mu} scale")
Definition: EnergySysts.h:48
const EnergyScaleSyst kEnergyScaleHadronInvSqrt(EnergyScaleSystTerm::kInverseSqrt, EnergyScaleSystParticle::kHadron, EnergyScaleSystDetector::kAll, 0.05,"EnergyScaleHadronInvSqrt","Correlated inv sqrt E_{had} scale")
Definition: EnergySysts.h:66
const EnergyScaleSyst kEnergyScaleMuonND(EnergyScaleSystTerm::kConstant, EnergyScaleSystParticle::kMuon, EnergyScaleSystDetector::kSBND, 0.02,"EnergyScaleMuonND","Uncorrelated SBND linear E_{#mu} scale")
Definition: EnergySysts.h:52
const EnergyScaleSyst kEnergyScaleHadronSqrt(EnergyScaleSystTerm::kSqrt, EnergyScaleSystParticle::kHadron, EnergyScaleSystDetector::kAll, 0.05,"EnergyScaleHadronSqrt","Correlated sqrt E_{had} scale")
Definition: EnergySysts.h:65
const EnergyScaleSyst kEnergyScaleHadronFD(EnergyScaleSystTerm::kConstant, EnergyScaleSystParticle::kHadron, EnergyScaleSystDetector::kICARUS, 0.05,"EnergyScaleHadronFD","Uncorrelated ICARUS linear E_{had} scale")
Definition: EnergySysts.h:76
const EnergyScaleSyst kEnergyScaleMuonSqrtFD(EnergyScaleSystTerm::kSqrt, EnergyScaleSystParticle::kMuon, EnergyScaleSystDetector::kICARUS, 0.02,"EnergyScaleMuonSqrtFD","Uncorrelated ICARUS sqrt E_{#mu} scale")
Definition: EnergySysts.h:61
const EnergyScaleSyst kEnergyScaleHadronInvSqrtFD(EnergyScaleSystTerm::kInverseSqrt, EnergyScaleSystParticle::kHadron, EnergyScaleSystDetector::kICARUS, 0.05,"EnergyScaleHadronInvSqrtFD","Uncorrelated ICARUS inv sqrt E_{had} scale")
Definition: EnergySysts.h:78
const EnergyScaleSyst kEnergyScaleHadron(EnergyScaleSystTerm::kConstant, EnergyScaleSystParticle::kHadron, EnergyScaleSystDetector::kAll, 0.05,"EnergyScaleHadron","Correlated linear E_{had} scale")
Definition: EnergySysts.h:64
const EnergyScaleSyst kEnergyScaleMuonInvSqrt(EnergyScaleSystTerm::kInverseSqrt, EnergyScaleSystParticle::kMuon, EnergyScaleSystDetector::kAll, 0.02,"EnergyScaleMuonInvSqrt","Correlated inv sqrt E_{#mu} scale")
Definition: EnergySysts.h:50
const EnergyScaleSyst kEnergyScaleHadronND(EnergyScaleSystTerm::kConstant, EnergyScaleSystParticle::kHadron, EnergyScaleSystDetector::kSBND, 0.05,"EnergyScaleHadronND","Uncorrelated SBND linear E_{had} scale")
Definition: EnergySysts.h:68
const EnergyScaleSyst kEnergyScaleMuonSqrtND(EnergyScaleSystTerm::kSqrt, EnergyScaleSystParticle::kMuon, EnergyScaleSystDetector::kSBND, 0.02,"EnergyScaleMuonSqrtND","Uncorrelated SBND sqrt E_{#mu} scale")
Definition: EnergySysts.h:53
const EnergyScaleSyst kEnergyScaleMuonSqrt(EnergyScaleSystTerm::kSqrt, EnergyScaleSystParticle::kMuon, EnergyScaleSystDetector::kAll, 0.02,"EnergyScaleMuonSqrt","Correlated sqrt E_{#mu} scale")
Definition: EnergySysts.h:49
const EnergyScaleSyst kEnergyScaleHadronSqrtFD(EnergyScaleSystTerm::kSqrt, EnergyScaleSystParticle::kHadron, EnergyScaleSystDetector::kICARUS, 0.05,"EnergyScaleHadronSqrtFD","Uncorrelated ICARUS sqrt E_{had} scale")
Definition: EnergySysts.h:77
const EnergyScaleSyst kEnergyScaleMuonFD(EnergyScaleSystTerm::kConstant, EnergyScaleSystParticle::kMuon, EnergyScaleSystDetector::kICARUS, 0.02,"EnergyScaleMuonFD","Uncorrelated ICARUS linear E_{#mu} scale")
Definition: EnergySysts.h:60
const EnergyScaleSyst kEnergyScaleMuonInvSqrtFD(EnergyScaleSystTerm::kInverseSqrt, EnergyScaleSystParticle::kMuon, EnergyScaleSystDetector::kICARUS, 0.02,"EnergyScaleMuonInvSqrtFD","Uncorrelated ICARUS inv sqrt E_{#mu} scale")
Definition: EnergySysts.h:62
const EnergyScaleSyst kEnergyScaleHadronSqrtND(EnergyScaleSystTerm::kSqrt, EnergyScaleSystParticle::kHadron, EnergyScaleSystDetector::kSBND, 0.05,"EnergyScaleHadronSqrtND","Uncorrelated SBND sqrt E_{had} scale")
Definition: EnergySysts.h:69
const EnergyScaleSyst kEnergyScaleHadronInvSqrtND(EnergyScaleSystTerm::kInverseSqrt, EnergyScaleSystParticle::kHadron, EnergyScaleSystDetector::kSBND, 0.05,"EnergyScaleHadronInvSqrtND","Uncorrelated SBND inv sqrt E_{had} scale")
Definition: EnergySysts.h:70
std::pair< double, double > ana::GetGenieDialLimits ( const std::string &  name)

Definition at line 33 of file GenieWeightList.cxx.

33  {
34 
35  static std::map<std::string,std::pair<double,double>> genieMap = {
36  // Regular dials
37  {"MaCCQE",{-3,3}},
38  {"MaNCEL",{-3,3}},
39  {"EtaNCEL",{-3,3}},
40  {"MaCCRES",{-3,3}},
41  {"MvCCRES",{-3,3}},
42  {"MaNCRES",{-3,3}},
43  {"MvNCRES",{-3,3}},
44  {"RDecBR1gamma",{-3,3}},
45  {"RDecBR1eta",{-3,3}},
46  {"AhtBY",{-3,3}},
47  {"BhtBY",{-3,3}},
48  {"CV1uBY",{-3,3}},
49  {"CV2uBY",{-3,3}},
50  {"BeRPA_A",{-3,3}},
51  {"BeRPA_B",{-3,3}},
52  {"BeRPA_D",{-3,3}},
53  {"BeRPA_E",{-3,3}},
54 
55  // NRpi dials
56  {"NR_nu_n_CC_2Pi",{-2,3}},
57  {"NR_nu_n_CC_3Pi",{-2,3}},
58  {"NR_nu_p_CC_2Pi",{-2,3}},
59  {"NR_nu_p_CC_3Pi",{-2,3}},
60  {"NR_nu_np_CC_1Pi",{-2,3}},
61  {"NR_nu_n_NC_1Pi",{-2,3}},
62  {"NR_nu_n_NC_2Pi",{-2,3}},
63  {"NR_nu_n_NC_3Pi",{-2,3}},
64  {"NR_nu_p_NC_1Pi",{-2,3}},
65  {"NR_nu_p_NC_2Pi",{-2,3}},
66  {"NR_nu_p_NC_3Pi",{-2,3}},
67  {"NR_nubar_n_CC_1Pi",{-2,3}},
68  {"NR_nubar_n_CC_2Pi",{-2,3}},
69  {"NR_nubar_n_CC_3Pi",{-2,3}},
70  {"NR_nubar_p_CC_1Pi",{-2,3}},
71  {"NR_nubar_p_CC_2Pi",{-2,3}},
72  {"NR_nubar_p_CC_3Pi",{-2,3}},
73  {"NR_nubar_n_NC_1Pi",{-2,3}},
74  {"NR_nubar_n_NC_2Pi",{-2,3}},
75  {"NR_nubar_n_NC_3Pi",{-2,3}},
76  {"NR_nubar_p_NC_1Pi",{-2,3}},
77  {"NR_nubar_p_NC_2Pi",{-2,3}},
78  {"NR_nubar_p_NC_3Pi",{-2,3}},
79 
80  // FSI
81  {"FormZone",{-2,2}},
82  {"MFP_pi",{-2,2}},
83  {"FrCEx_pi",{-2,2}},
84  {"FrElas_pi",{-2,2}},
85  {"FrInel_pi",{-2,2}},
86  {"FrAbs_pi",{-2,2}},
87  {"FrPiProd_pi",{-2,2}},
88  {"MFP_N",{-2,2}},
89  {"FrCEx_N",{-2,2}},
90  {"FrElas_N",{-2,2}},
91  {"FrInel_N",{-2,2}},
92  {"FrAbs_N",{-2,2}},
93  {"FrPiProd_N",{-2,2}},
94 
95  // On/Off dials
96  {"VecFFCCQEshape",{-1,1}},
97  {"Theta_Delta2Npi",{-1,1}},
98  {"CCQEPauliSupViaKF",{-1,1}},
99  {"Mnv2p2hGaussEnhancement",{-1,1}},
100  {"MKSPP_ReWeight",{-1,1}},
101  {"E2p2h_A_nu",{-1,1}},
102  {"E2p2h_B_nu",{-1,1}},
103  {"E2p2h_A_nubar",{-1,1}},
104  {"E2p2h_B_nubar",{-1,1}},
105  {"C12ToAr40_2p2hScaling_nu",{-1,1}},
106  {"C12ToAr40_2p2hScaling_nubar",{-1,1}},
107  {"nuenuebar_xsec_ratio",{-1,1}},
108  {"nuenumu_xsec_ratio",{-1,1}},
109  {"SPPLowQ2Suppression",{-1,1}}
110  };
111 
112  if (genieMap.find(name) == genieMap.end()){
113  std::cout << "Warning, no known systematic called " << name << " returning nominal" << std::endl;
114  return {-3,3};
115  }
116  return genieMap[name];
117  }
then echo fcl name
BEGIN_PROLOG could also be cout
int ana::GetGenieIndex ( const std::string &  name,
bool  quiet 
)

Definition at line 121 of file GenieWeightList.cxx.

122  {
123  const std::vector<std::string> names = GetGenieWeightNames();
124 
125  auto it = std::find(names.begin(), names.end(), name);
126 
127  if(it == names.end()){
128  if(!quiet){
129  std::cerr << "Warning: couldn't find " << name
130  << " in list of genie systs" << std::endl;
131  }
132  return -1;
133  }
134 
135  return it-names.begin();
136  }
std::vector< std::string > GetGenieWeightNames()
BEGIN_PROLOG could also be cerr
static const std::vector< std::string > names
then echo fcl name
double ana::GetGenieMax ( int  index)

Definition at line 148 of file GenieWeightList.cxx.

148  {
149  static const std::vector<std::string> names = GetGenieWeightNames();
150  return GetGenieDialLimits(names[index]).second;
151  }
std::vector< std::string > GetGenieWeightNames()
static const std::vector< std::string > names
std::pair< double, double > GetGenieDialLimits(const std::string &name)
double ana::GetGenieMin ( int  index)

Definition at line 143 of file GenieWeightList.cxx.

143  {
144  static const std::vector<std::string> names = GetGenieWeightNames();
145  return GetGenieDialLimits(names[index]).first;
146  }
std::vector< std::string > GetGenieWeightNames()
static const std::vector< std::string > names
std::pair< double, double > GetGenieDialLimits(const std::string &name)
std::string ana::GetGenieWeightName ( int  index)

Definition at line 138 of file GenieWeightList.cxx.

138  {
139  const std::vector<std::string> names = GetGenieWeightNames();
140  return names[index];
141  }
std::vector< std::string > GetGenieWeightNames()
static const std::vector< std::string > names
std::vector< std::string > ana::GetGenieWeightNames ( )

Definition at line 9 of file GenieWeightList.cxx.

10  {
11  // I wonder if we can share this somehow with the code that generates these?
12  return {"MaCCQE","VecFFCCQEshape",
13  "MaNCEL","EtaNCEL","MaCCRES","MvCCRES",
14  "MaNCRES","MvNCRES","RDecBR1gamma","RDecBR1eta",
15  "Theta_Delta2Npi","AhtBY","BhtBY","CV1uBY",
16  "CV2uBY","FormZone","MFP_pi","FrCEx_pi",
17  "FrElas_pi","FrInel_pi","FrAbs_pi","FrPiProd_pi",
18  "MFP_N","FrCEx_N","FrElas_N","FrInel_N",
19  "FrAbs_N","FrPiProd_N","CCQEPauliSupViaKF","Mnv2p2hGaussEnhancement",
20  "MKSPP_ReWeight","E2p2h_A_nu","E2p2h_B_nu","E2p2h_A_nubar",
21  "E2p2h_B_nubar","NR_nu_n_CC_2Pi","NR_nu_n_CC_3Pi","NR_nu_p_CC_2Pi",
22  "NR_nu_p_CC_3Pi","NR_nu_np_CC_1Pi","NR_nu_n_NC_1Pi","NR_nu_n_NC_2Pi",
23  "NR_nu_n_NC_3Pi","NR_nu_p_NC_1Pi","NR_nu_p_NC_2Pi","NR_nu_p_NC_3Pi",
24  "NR_nubar_n_CC_1Pi","NR_nubar_n_CC_2Pi","NR_nubar_n_CC_3Pi","NR_nubar_p_CC_1Pi",
25  "NR_nubar_p_CC_2Pi","NR_nubar_p_CC_3Pi","NR_nubar_n_NC_1Pi","NR_nubar_n_NC_2Pi",
26  "NR_nubar_n_NC_3Pi","NR_nubar_p_NC_1Pi","NR_nubar_p_NC_2Pi","NR_nubar_p_NC_3Pi",
27  "BeRPA_A","BeRPA_B","BeRPA_D","BeRPA_E",
28  "C12ToAr40_2p2hScaling_nu","C12ToAr40_2p2hScaling_nubar",
29  "nuenuebar_xsec_ratio","nuenumu_xsec_ratio","SPPLowQ2Suppression"
30  };
31  }
float ana::GetHistMax ( std::vector< TH1 * >  histos)

Definition at line 108 of file tools_nuesel_icarus.h.

108  {
109 
110  float hmax = 0.;
111  for(unsigned int hId=0; hId<histos.size(); hId++){
112  float thismax = histos[hId]->GetMaximum();
113  if(thismax>hmax) hmax=thismax;
114  }
115  return hmax;
116  }
TH1* ana::GetMaskHist ( const Spectrum &  s,
double  xmin,
double  xmax,
double  ymin,
double  ymax 
)

Definition at line 936 of file sbnana/sbnana/CAFAna/Core/Utilities.cxx.

937  {
938  if (s.GetBinnings().size() > 2){
939  std::cout << "Error: unable to apply a mask in " << s.GetBinnings().size() << " dimensions" << std::endl;
940  abort();
941  }
942 
943  // The exposure isn't important here
944  TH1* fMaskND = s.ToTHX(s.POT());
945  TH1D* fMask1D = s.ToTH1(s.POT());
946 
947  int ybins = fMaskND->GetNbinsY();
948 
949  for(int i = 0; i < fMask1D->GetNbinsX()+2; ++i){
950 
951  int ix = i / ybins;
952  int iy = i % ybins;
953 
954  bool isMask = false;
955 
956  if (xmin < xmax){
957  if (fMaskND->GetXaxis()->GetBinLowEdge(ix+1) < xmin) isMask=true;
958  if (fMaskND->GetXaxis()->GetBinUpEdge(ix+1) > xmax) isMask=true;
959  }
960 
961  if (ymin < ymax){
962  if (fMaskND->GetYaxis()->GetBinLowEdge(iy+1) < ymin) isMask=true;
963  if (fMaskND->GetYaxis()->GetBinUpEdge(iy+1) > ymax) isMask=true;
964  }
965 
966  if (isMask) fMask1D->SetBinContent(i+1, 0);
967  else fMask1D->SetBinContent(i+1, 1);
968 
969  }
970  return fMask1D;
971  }
process_name pandoraGausCryo1 vertexChargeCryo1 vertexStubCryo1 xmin
then echo File list $list not found else cat $list while read file do echo $file sed s
Definition: file_to_url.sh:60
BEGIN_PROLOG could also be cout
std::vector< TH1 * > ana::GetMCComponents ( const IPrediction *  mc,
osc::IOscCalc calc,
std::string  hist_name,
double  pot,
bool  force1D = false 
)

A vector of histograms for the MC components. Easier to manipulate elsewhere Not ideal as returned pointers probably won't get deleted... but very useful...

Definition at line 167 of file Plots.cxx.

172  {
173  return GetMCSystComponents(mc, calc, kNoShift, hist_name, pot, force1D);
174  }
std::vector< TH1 * > GetMCSystComponents(const IPrediction *mc, osc::IOscCalc *calc, const SystShifts &shift, std::string hist_name, double pot, bool force1D)
Definition: Plots.cxx:176
const SystShifts kNoShift
Definition: SystShifts.h:61
std::vector< TH1 * > ana::GetMCSystComponents ( const IPrediction *  mc,
osc::IOscCalc calc,
const SystShifts &  shift,
std::string  hist_name,
double  pot,
bool  force1D 
)

Definition at line 176 of file Plots.cxx.

182  {
183  std::vector<TH1*> ret;
184 
185  TH1* hTotal = mc->PredictSyst(calc, shift).ToTHX(pot, force1D);
186  hTotal->SetNameTitle((hist_name+"_total").c_str(), (hist_name+"_total").c_str());
187  ret .push_back(hTotal);
188 
189  TH1* hNC = mc->PredictComponentSyst(calc,shift,
191  Current::kNC,
192  Sign::kBoth).ToTHX(pot, force1D);
193  hNC->SetNameTitle((hist_name+"_NC").c_str(), (hist_name+"_NC").c_str());
194  ret .push_back(hNC);
195 
196  TH1* hAllNumu = mc->PredictComponentSyst(calc,shift,
198  Current::kCC,
199  Sign::kBoth).ToTHX(pot, force1D);
200  hAllNumu->SetNameTitle((hist_name+"_AllNumu").c_str(), (hist_name+"_AllNumu").c_str());
201  ret .push_back(hAllNumu);
202 
203  TH1* hNumu = mc->PredictComponentSyst(calc,shift,
205  Current::kCC,
206  Sign::kNu).ToTHX(pot, force1D);
207  hNumu->SetNameTitle((hist_name+"_Numu").c_str(), (hist_name+"_Numu").c_str());
208  ret .push_back(hNumu);
209 
210  TH1* hNumubar = mc->PredictComponentSyst(calc,shift,
212  Current::kCC,
213  Sign::kAntiNu).ToTHX(pot, force1D);
214  hNumubar->SetNameTitle((hist_name+"_Numubar").c_str(), (hist_name+"_Numubar").c_str());
215  ret .push_back(hNumubar);
216 
217  TH1* hAllNutau = mc->PredictComponentSyst(calc,shift,
219  Current::kCC,
220  Sign::kBoth).ToTHX(pot, force1D);
221  hAllNutau->SetNameTitle((hist_name+"_AllNutau").c_str(), (hist_name+"_AllNutau").c_str());
222  ret .push_back(hAllNutau);
223 
224  // Want AllSignalNue, SignalNue, SignalNuebar
225  TH1* hAllNue = mc->PredictComponentSyst(calc,shift,
227  Current::kCC,
228  Sign::kBoth).ToTHX(pot, force1D);
229  hAllNue->SetNameTitle((hist_name+"_AllNue").c_str(), (hist_name+"_AllNue").c_str());
230  ret .push_back(hAllNue);
231 
232  TH1* hAllBeamNue = mc->PredictComponentSyst(calc,shift,
234  Current::kCC,
235  Sign::kBoth).ToTHX(pot, force1D);
236  hAllBeamNue->SetNameTitle((hist_name+"_AllBeamNue").c_str(), (hist_name+"_AllBeamNue").c_str());
237  ret .push_back(hAllBeamNue);
238 
239  TH1* hBeamNue = mc->PredictComponentSyst(calc,shift,
241  Current::kCC,
242  Sign::kNu).ToTHX(pot, force1D);
243  hBeamNue->SetNameTitle((hist_name+"_BeamNue").c_str(), (hist_name+"_BeamNue").c_str());
244  ret .push_back(hBeamNue);
245 
246  TH1* hBeamNuebar = mc->PredictComponentSyst(calc,shift,
248  Current::kCC,
249  Sign::kAntiNu).ToTHX(pot, force1D);
250  hBeamNuebar->SetNameTitle((hist_name+"_BeamNuebar").c_str(), (hist_name+"_BeamNuebar").c_str());
251  ret .push_back(hBeamNuebar);
252 
253  TH1* hAllSignalNue = mc->PredictComponentSyst(calc,shift,
255  Current::kCC,
256  Sign::kBoth).ToTHX(pot, force1D);
257  hAllSignalNue->SetNameTitle((hist_name+"_AllSignalNue").c_str(), (hist_name+"_AllSignalNue").c_str());
258  ret .push_back(hAllSignalNue);
259 
260  TH1* hSignalNue = mc->PredictComponentSyst(calc,shift,
262  Current::kCC,
263  Sign::kNu).ToTHX(pot, force1D);
264  hSignalNue->SetNameTitle((hist_name+"_SignalNue").c_str(), (hist_name+"_SignalNue").c_str());
265  ret .push_back(hSignalNue);
266 
267  TH1* hSignalNuebar = mc->PredictComponentSyst(calc,shift,
269  Current::kCC,
270  Sign::kAntiNu).ToTHX(pot, force1D);
271  hSignalNuebar->SetNameTitle((hist_name+"_SignalNuebar").c_str(), (hist_name+"_SignalNuebar").c_str());
272  ret .push_back(hSignalNuebar);
273 
274  return ret;
275  }
Antineutrinos-only.
Definition: IPrediction.h:49
(&#39; appearance&#39;)
Definition: IPrediction.h:17
(&#39;beam &#39;)
Definition: IPrediction.h:14
shift
Definition: fcl_checks.sh:26
Charged-current interactions.
Definition: IPrediction.h:38
Interactions of both types.
Definition: IPrediction.h:41
Neutrinos-only.
Definition: IPrediction.h:48
Neutral-current interactions.
Definition: IPrediction.h:39
All neutrinos, any flavor.
Definition: IPrediction.h:25
TH1 * ana::GetMCSystTotal ( const IPrediction *  mc,
osc::IOscCalc calc,
const SystShifts &  shift,
std::string  hist_name,
double  pot,
bool  force1D 
)

Definition at line 146 of file Plots.cxx.

152  {
153  TH1* hTotal = mc->PredictSyst(calc, shift).ToTHX(pot, force1D);
154  hTotal->SetNameTitle((hist_name+"_total").c_str(), (hist_name+"_total").c_str());
155  return hTotal;
156  }
shift
Definition: fcl_checks.sh:26
TH1 * ana::GetMCTotal ( const IPrediction *  mc,
osc::IOscCalc calc,
std::string  hist_name,
double  pot,
bool  force1D 
)

Definition at line 158 of file Plots.cxx.

163  {
164  return GetMCSystTotal(mc, calc, kNoShift, hist_name, pot, force1D);
165  }
const SystShifts kNoShift
Definition: SystShifts.h:61
TH1 * GetMCSystTotal(const IPrediction *mc, osc::IOscCalc *calc, const SystShifts &shift, std::string hist_name, double pot, bool force1D)
Definition: Plots.cxx:146
std::vector< TH1 * > ana::GetMCTotalForSystShifts ( const IPrediction *  mc,
osc::IOscCalc calc,
const ISyst *  syst,
std::string  hist_base_name,
double  pot,
bool  force1D 
)

Definition at line 278 of file Plots.cxx.

284  {
285  std::vector<TH1*> ret;
286  std::string syst_name = syst->ShortName();
287  for (int i = -3; i < 4; ++i){
288  SystShifts s(syst, double(i));
289  TH1* hTotal = mc->PredictSyst(calc, s).ToTHX(pot, force1D);
290  hTotal->SetNameTitle((hist_base_name+"_total_"+syst_name+"_"+std::to_string(i)).c_str(),
291  (hist_base_name+"_total_"+syst_name+"_"+std::to_string(i)).c_str());
292  ret .push_back(hTotal);
293  }
294  return ret;
295  }
std::string to_string(WindowPattern const &pattern)
then echo File list $list not found else cat $list while read file do echo $file sed s
Definition: file_to_url.sh:60
std::vector< const ISyst * > ana::GetNuMIBeamlineFluxSysts ( )

Definition at line 127 of file NuMIFluxSysts.cxx.

128  {
129  const std::vector<std::string> syst_names =
130  {
131  "horn_current",
132  "horn1_position_xy",
133  "horn2_position_xy",
134  "beam_shift_xy",
135  "target_position_z",
136  "beam_spot_size",
137  "water_layer",
138  "B_field",
139  "beam_divergence"
140  };
141 
142  std::vector<const ISyst*> ret;
143  for(std::string name: syst_names)
144  ret.push_back(GetNuMIFluxSyst("fractional_uncertainties/beamline", "hfrac_", name));
145  return ret;
146  }
const NuMIFluxSyst * GetNuMIFluxSyst(const std::string &dir, const std::string &prefix, const std::string &name)
then echo fcl name
const NuMIFluxSyst * ana::GetNuMIFluxSyst ( const std::string &  dir,
const std::string &  prefix,
const std::string &  name 
)

Definition at line 91 of file NuMIFluxSysts.cxx.

94  {
95  // Make sure we always give the same one back
96  static std::map<std::string, const NuMIFluxSyst*> cache;
97 
98  const std::string key = dir+"/"+prefix+name;
99  if(cache.count(key) == 0) cache[key] = new NuMIFluxSyst(dir, prefix, name);
100 
101  return cache[key];
102  }
tuple dir
Definition: dropbox.py:28
then echo fcl name
std::vector< const ISyst * > ana::GetNuMIHadronProductionFluxSysts ( )

These are envelopes not real systs. TODO make clearer in naming.

Definition at line 105 of file NuMIFluxSysts.cxx.

106  {
107  const std::vector<std::string> syst_names =
108  {
109  "pCpi",
110  "pCk",
111  "pCnu",
112  "nCpi",
113  "mesinc",
114  "nua",
115  "nuAlFe",
116  "attenuation",
117  "others"
118  };
119 
120  std::vector<const ISyst*> ret;
121  for(std::string name: syst_names)
122  ret.push_back(GetNuMIFluxSyst("fractional_uncertainties/hadron_production", "hfrac_", name));
123  return ret;
124  }
const NuMIFluxSyst * GetNuMIFluxSyst(const std::string &dir, const std::string &prefix, const std::string &name)
then echo fcl name
std::vector< const ISyst * > ana::GetNuMIPCAFluxSysts ( unsigned int  Npcs = 100)
Parameters
NpcsNumber of principal components. High-indexed components should have negligible effect on the analysis.

Definition at line 149 of file NuMIFluxSysts.cxx.

150  {
151  std::vector<const ISyst*> ret;
152  for(unsigned int i = 0; i < Npcs; ++i){
153  ret.push_back(GetNuMIFluxSyst("principal_component_analysis",
154  "h", "pc"+std::to_string(i)));
155  }
156  return ret;
157  }
const NuMIFluxSyst * GetNuMIFluxSyst(const std::string &dir, const std::string &prefix, const std::string &name)
std::string to_string(WindowPattern const &pattern)
std::vector<std::string> ana::GetSBNBoosterFluxWeightNames ( )

Definition at line 172 of file SBNWeightSysts.cxx.

173  {
174  // We can't ask the UniverseOracle about this, because it doesn't get
175  // properly configured until it's seen its first CAF file.
176  return {"expskin",
177  "horncurrent",
178  "nucleoninexsec",
179  "nucleonqexsec",
180  "nucleontotxsec",
181  "pioninexsec",
182  "pionqexsec",
183  "piontotxsec"};
184  }
const std::vector< const ISyst * > & ana::GetSBNBoosterFluxWeightSysts ( )

Definition at line 188 of file SBNWeightSysts.cxx.

189  {
190  static std::vector<const ISyst*> ret;
191  if(!ret.empty()) return ret;
192 
193  for(const std::string& name: GetSBNBoosterFluxWeightNames())
194  ret.push_back(new SBNWeightSyst(name));
195 
196  return ret;
197  }
std::vector< std::string > GetSBNBoosterFluxWeightNames()
then echo fcl name
std::vector< std::string > ana::GetSBNGenieWeightNames ( )

Definition at line 113 of file SBNWeightSysts.cxx.

114  {
115  // We can't ask the UniverseOracle about this, because it doesn't get
116  // properly configured until it's seen its first CAF file.
117  return {"AhtBY",
118  "BhtBY",
119  "CV1uBY",
120  "CV2uBY",
121  "EtaNCEL",
122  "FormZone",
123  "FrAbs_N",
124  "FrAbs_pi",
125  "FrCEx_N",
126  "FrCEx_pi",
127  "FrInel_N",
128  "FrInel_pi",
129  "FrPiProd_N",
130  "FrPiProd_pi",
131  "MFP_N",
132  "MFP_pi",
133  "MaCCQE",
134  "MaCCRES",
135  "MaNCEL",
136  "MaNCRES",
137  "MvCCRES",
138  "MvNCRES",
139  "NonRESBGvbarnCC1pi",
140  "NonRESBGvbarnCC2pi",
141  "NonRESBGvbarnNC1pi",
142  "NonRESBGvbarnNC2pi",
143  "NonRESBGvbarpCC1pi",
144  "NonRESBGvbarpCC2pi",
145  "NonRESBGvbarpNC1pi",
146  "NonRESBGvbarpNC2pi",
147  "NonRESBGvnCC1pi",
148  "NonRESBGvnCC2pi",
149  "NonRESBGvnNC1pi",
150  "NonRESBGvnNC2pi",
151  "NonRESBGvpCC1pi",
152  "NonRESBGvpCC2pi",
153  "NonRESBGvpNC1pi",
154  "NonRESBGvpNC2pi",
155  };
156  }
const std::vector< const ISyst * > & ana::GetSBNGenieWeightSysts ( )

Definition at line 159 of file SBNWeightSysts.cxx.

160  {
161  static std::vector<const ISyst*> ret;
162  if(!ret.empty()) return ret;
163 
164  for(const std::string& name: GetSBNGenieWeightNames())
165  ret.push_back(new SBNWeightSyst(name));
166 
167  return ret;
168  }
then echo fcl name
std::vector< std::string > GetSBNGenieWeightNames()
const std::vector< const ISyst * > & ana::GetSBNWeightSysts ( )

Definition at line 200 of file SBNWeightSysts.cxx.

201  {
202  static std::vector<const ISyst*> ret;
203  if(ret.empty()){
204  const std::vector<const ISyst*>& g = GetSBNGenieWeightSysts();
205  const std::vector<const ISyst*>& f = GetSBNBoosterFluxWeightSysts();
206  ret.reserve(g.size()+f.size());
207  ret.insert(ret.end(), g.begin(), g.end());
208  ret.insert(ret.end(), f.begin(), f.end());
209  }
210  return ret;
211  }
const std::vector< const ISyst * > & GetSBNBoosterFluxWeightSysts()
BEGIN_PROLOG g
const std::vector< const ISyst * > & GetSBNGenieWeightSysts()
caf::SRGlobal ana::GetSRGlobal ( )

Definition at line 22 of file UniverseOracle.cxx.

23  {
24  caf::SRGlobal global;
25  bool got = false;
26 
27  TSeqCollection* seq = gROOT->GetListOfFiles();
28  for(int i = 0; i < seq->GetEntries(); ++i){
29  TFile* f = (TFile*)seq->At(i);
30  if(f->GetOption() != std::string("READ")) continue;
31  TTree* tr = (TTree*)f->Get("globalTree");
32  if(!tr) continue;
33  if(tr->GetEntries() < 1) continue;
34 
35  if(got){
36  std::cout << "\nUniverseOracle: Found globalTree in multiple places. Will use first one, but this is unexpected" << std::endl;
37  }
38 
39  caf::SRGlobal* pglobal = &global;
40  tr->SetBranchAddress("global", &pglobal);
41  tr->GetEntry(0);
42  got = true;
43  }
44 
45  if(!got){
46  std::cout << "\nUniverseOracle: Failed to find globalTree in any open input file" << std::endl;
47  abort();
48  }
49 
50  return global;
51  }
BEGIN_PROLOG could also be cout
Var ana::GetUniverseWeight ( const std::string &  psetName,
int  univIdx 
)

Definition at line 27 of file SBNWeightSysts.h.

28  {
29  return Var(UniverseWeight(psetName, univIdx));
30  }
_Var< caf::SRSliceProxy > Var
Representation of a variable to be retrieved from a caf::StandardRecord object.
Definition: Var.h:73
TGraphAsymmErrors * ana::GraphWithPoissonErrors ( const TH1 *  h,
bool  noErrorsXaxis,
bool  drawEmptyBins 
)

Calculate statistical errors appropriate for small Poisson numbers.

Definition at line 678 of file Plots.cxx.

679  {
680  TGraphAsymmErrors* gr = new TGraphAsymmErrors(h);
681 
682  TFeldmanCousins fc(0.6827);//1 sigma
683 
684  for(int i = 0; i < h->GetNbinsX(); ++i){
685  double x, y;
686  gr->GetPoint(i, x, y);
687 
688  if ( drawEmptyBins || y!=0 ){
689  if ( y < 50 ) gr->SetPointEYlow(i, y-fc.CalculateLowerLimit(y,0));
690  else gr->SetPointEYlow(i,sqrt(y));
691  if ( y < 30 ) gr->SetPointEYhigh(i,fc.CalculateUpperLimit(y,0)-y);
692  else gr->SetPointEYhigh(i,sqrt(y));
693  }
694 
695  if(noErrorsXaxis){
696  gr->SetPointEXlow(i, 0);
697  gr->SetPointEXhigh(i, 0);
698  } // Do not use bin width as X-error for points
699  }
700 
701  return gr;
702  }
process_name opflash particleana ie x
while getopts h
process_name opflash particleana ie ie y
void ana::handle_signal ( int  sig,
siginfo_t *  ,
void *   
)

Definition at line 34 of file DebugHelpers.cxx.

35  {
36  if(sig == SIGABRT && !gIsException)
37  std::cout << "\n\nAborted\n" << std::endl;
38  if(sig == SIGSEGV)
39  std::cout << "\n\nSegmentation fault\n" << std::endl;
40  if(sig == SIGFPE)
41  std::cout << "\n\nFloating point exception\n" << std::endl;
42  if(sig == SIGBUS)
43  std::cout << "\n\nBus error\n" << std::endl;
44 
45  gdb_backtrace();
46 
47  // gdb_backtrace() never returns. But if it did, this would be the right
48  // way to exit with the correct code.
49  _exit(sig+128);
50  }
bool gIsException
void gdb_backtrace()
BEGIN_PROLOG could also be cout
void ana::handle_terminate ( )

Definition at line 27 of file DebugHelpers.cxx.

28  {
29  std::cout << "\n\nUncaught exception\n" << std::endl;
30  gIsException = true;
31  // Next thing that happens is abort(), which goes to handle_signal()
32  }
bool gIsException
BEGIN_PROLOG could also be cout
bool ana::HasBraggPeak ( const caf::SRTrueParticleProxy &  p)

Whether this particle should have a bragg peak in the detector.

Definition at line 11 of file TrueParticleHelpers.cxx.

11  {
12  // check contained, id, & end process (stopping-only)
13  return p.contained &&
14  ( abs(p.pdg) == 13 || abs(p.pdg) == 2212 ||
15  abs(p.pdg) == 211 || abs(p.pdg) == 321 ) &&
16  ( p.end_process == caf::kG4CoupledTransportation ||
17  p.end_process == caf::kG4FastScintillation ||
18  p.end_process == caf::kG4Decay ||
19  p.end_process == caf::kG4muMinusCaptureAtRest );
20  }
pdgs p
Definition: selectors.fcl:22
T abs(T value)
bool ana::HasVar ( std::vector< const IFitVar * >  oscVars,
std::string  name 
)

Definition at line 39 of file CalcsNuFit.cxx.

39  {
40  for(auto *s :oscVars ) if(s->ShortName() == name) return true;
41  return false;
42  }
then echo File list $list not found else cat $list while read file do echo $file sed s
Definition: file_to_url.sh:60
then echo fcl name
static bool ana::Icarus202208_proton_cut ( const caf::SRTrackProxy &  trk)
static

Definition at line 48 of file NumuVarsIcarus202208.cxx.

49 {
50  return trk.chi2pid[trk.bestplane].chi2_proton < 100;
51 }
static bool ana::Icarus202208contained ( const caf::SRTrackProxy &  trk)
static

Definition at line 9 of file NumuCutsIcarus202208.cxx.

10 {
11  return ((trk.end.x < -71.1 - 5 && trk.end.x > -369.33 + 5)
12  || (trk.end.x > 71.1 + 5 && trk.end.x < 369.33 - 5))
13  && trk.end.y > -181.7 + 5 && trk.end.y < 134.8 - 5
14  && trk.end.z > -895.95 + 5 && trk.end.z < 895.95 - 5;
15 }
bool ana::IsCCQEOnArgon ( const caf::SRTrueInteractionProxy *  nu,
int  pdg 
)

Definition at line 10 of file Flux.cxx.

11  {
12  // It doesn't matter exactly what process we choose, so long as it
13  // corresponds to one of the modes GENIE considers as a top-level
14  // cross-section. Here we go for CC QE on Argon.
15  return nu->pdg == pdg && nu->iscc &&
16  nu->genie_mode == caf::kQE && nu->genie_inttype == caf::kCCQE &&
17  nu->targetPDG == 1000180400 /* Argon 40 */ &&
18  !nu->ischarm;
19  }
var pdg
Definition: selectors.fcl:14
charged current quasi-elastic
Definition: SREnums.h:86
BEGIN_PROLOG SN nu
Cut ana::IsCCQEOnArgonCut ( int  pdg)

Definition at line 46 of file Flux.cxx.

47  {
48  return Cut([pdg](const caf::SRSliceProxy* slc)
49  {
50  if(slc->truth.index < 0) return false;
51  return IsCCQEOnArgon(&slc->truth, pdg);
52  });
53  }
var pdg
Definition: selectors.fcl:14
caf::Proxy< caf::SRSlice > SRSliceProxy
Definition: EpilogFwd.h:2
_Cut< caf::SRSliceProxy > Cut
Definition: Cut.h:95
bool IsCCQEOnArgon(const caf::SRTrueInteractionProxy *nu, int pdg)
Definition: Flux.cxx:10
bool ana::IsGenie ( const caf::SRTrueParticleProxy &  p)

Whether this particle was generated by genie (as opposed to geant or corsika)

Definition at line 22 of file TrueParticleHelpers.cxx.

22  {
23  return p.gstatus != caf::kNotGenie;
24  }
pdgs p
Definition: selectors.fcl:22
Not a genie particle.
Definition: SREnums.h:151
bool ana::IsNCQEOnArgon ( const caf::SRTrueInteractionProxy *  nu,
int  pdg 
)

Definition at line 22 of file Flux.cxx.

23  {
24  // This process works for very low neutrino energy where the muon mass
25  // becomes relevant.
26  return nu->pdg == pdg && !nu->iscc &&
27  nu->genie_mode == caf::kQE && nu->genie_inttype == caf::kNCQE &&
28  nu->targetPDG == 1000180400 /* Argon 40 */ &&
29  !nu->ischarm &&
30  nu->hitnuc == 2112;
31  }
var pdg
Definition: selectors.fcl:14
neutral current quasi-elastic
Definition: SREnums.h:87
BEGIN_PROLOG SN nu
bool ana::IsPrimary ( const caf::SRTrueParticleProxy &  p)

Whether this is a primary particle or generated by a secondary interaction.

Definition at line 7 of file TrueParticleHelpers.cxx.

7  {
8  return p.start_process == caf::kG4primary;
9  }
pdgs p
Definition: selectors.fcl:22
bool ana::IsStable ( const caf::SRTrueParticleProxy &  p)

Whether this is a stable particle as generated by genie.

Definition at line 26 of file TrueParticleHelpers.cxx.

26  {
27  // non-genie particles are stable, otherwise check with genie
28  return ( p.gstatus == caf::kNotGenie || p.gstatus == caf::kIStStableFinalState);
29  }
pdgs p
Definition: selectors.fcl:22
Not a genie particle.
Definition: SREnums.h:151
size_t ana::JobNumber ( )

Definition at line 776 of file sbnana/sbnana/CAFAna/Core/Utilities.cxx.

777  {
778  if(!RunningOnGrid()){
779  std::cout << "JobNumber() called, but we are not running on the grid" << std::endl;
780  abort();
781  }
782 
783  return Offset(false);
784  }
size_t Offset(bool allow_default)
BEGIN_PROLOG could also be cout
const Var ana::kBaseline ( [] (const caf::SRSliceProxy *slc) -> double{return slc->truth.baseline *1e-3;}  )
const Cut ana::kIsAntiNu ( [] (const caf::SRSliceProxy *slc){if(slc->truth.index< 0) return false;return slc->truth.pdg< 0;}  )
const Cut ana::kIsBeamNue ( CCFlavSel(12, 12)  )

Select CC $ \nu_e\to\nu_e $.

const Cut ana::kIsCC ( [] (const caf::SRSliceProxy *slc){if(slc->truth.index< 0) return false;return(slc->truth.iscc==1);}  )
const Cut ana::kIsNC ( [] (const caf::SRSliceProxy *slc){if(slc->truth.index< 0) return false;return(slc->truth.isnc==1);}  )
const Cut ana::kIsNCFromNue ( NCFlavOrig(12)  )
const Cut ana::kIsNCFromNumu ( NCFlavOrig(14)  )
const Cut ana::kIsNueApp ( CCFlavSel(12, 14)  )

Select CC $ \nu_\mu\to\nu_e $.

const Cut ana::kIsNumuApp ( CCFlavSel(14, 12)  )

Select CC $ \nu_e\to\nu_\mu $.

const Cut ana::kIsNumuCC ( CCFlavSel(14, 14)  )

Select CC $ \nu_\mu\to\nu_\mu $.

const Cut ana::kIsTauFromE ( CCFlavSel(16, 12)  )

Select CC $ \nu_e\to\nu_\tau $.

const Cut ana::kIsTauFromMu ( CCFlavSel(16, 14)  )

Select CC $ \nu_\mu\to\nu_\tau $.

const Cut ana::kNoCut ( [] (const caf::SRSliceProxy *){return true;}  )

The simplest possible cut: pass everything, used as a default.

const SpillCut ana::kNoSpillCut ( [] (const caf::SRSpillProxy *){return true;}  )

The simplest possible cut: pass everything, used as a default.

const Var ana::kNuScore ( [] (const caf::SRSliceProxy *slc) -> double{return slc->nu_score;}  )
const Var ana::kSlcIsRecoNu ( [] (const caf::SRSliceProxy *slc) -> double{return!slc->is_clear_cosmic;}  )
const SolarConstraints ana::kSolarConstraintsPDG2017 ( 7.53e-  5,
0.18e-  5,
0.  851,
0.  020 
)
const SpillVar ana::kSpillUnweighted ( [] (const caf::SRSpillProxy *){return 1;}  )
const Var ana::kUnweighted ( [] (const caf::SRSliceProxy *){return 1;}  )

The simplest possible Var, always 1. Used as a default weight.

const caf::SRShowerProxy* ana::LargestRecoShower ( const caf::SRSliceProxy slc)

Pointer to largest reconstructed shower, or null pointer if none exists.

Definition at line 26 of file NueVars.cxx.

27 {
28  const int largestShwIdx = kLargestRecoShowerIdx(slc);
29  if(largestShwIdx == -1) return 0;
30  return &slc->reco.shw[largestShwIdx];
31 }
const Var kLargestRecoShowerIdx([](const caf::SRSliceProxy *slc) -> int{int bestIdx(-1);double maxEnergy(-1);for(unsigned int i=0;i< slc->reco.nshw;i++){auto const &shw=slc->reco.shw[i];continue;if(shw.bestplane_energy > maxEnergy){bestIdx=i;maxEnergy=shw.bestplane_energy;}}return bestIdx;})
Definition: NueVars.h:9
int ana::Limit ( )

Definition at line 758 of file sbnana/sbnana/CAFAna/Core/Utilities.cxx.

759  {
760  static int cache = 0;
761 
762  if(cache == 0){
763  char* env = getenv("CAFANA_LIMIT");
764  if(env){
765  cache = std::atoi(env);
766  }
767  else{
768  cache = -1;
769  }
770  }
771 
772  return cache;
773  }
std::vector<std::string> ana::LoadFileList ( const std::string &  listfile)

Definition at line 568 of file sbnana/sbnana/CAFAna/Core/Utilities.cxx.

569  {
570  std::vector<std::string> ret;
571 
572  std::ifstream is(listfile);
573  if(!is.good()){
574  std::cerr << "Can't open file list '" << listfile << "'. Aborting." << std::endl;
575  abort();
576  }
577 
578  while(!is.eof()){
579  std::string fname;
580  is >> fname;
581  if(!fname.empty()) ret.push_back(fname);
582  }
583  return ret;
584  }
string fname
Definition: demo.py:5
BEGIN_PROLOG could also be cerr
template<class T >
std::unique_ptr<T> ana::LoadFrom ( TDirectory *  dir)

Definition at line 22 of file LoadFromFile.h.

23  {
24  return T::LoadFrom(dir);
25  }
tuple dir
Definition: dropbox.py:28
std::unique_ptr< T > LoadFrom(TDirectory *dir)
Definition: LoadFromFile.h:22
template<>
std::unique_ptr<IBkgdEstimator> ana::LoadFrom< IBkgdEstimator > ( TDirectory *  dir)
template<>
std::unique_ptr<IDecomp> ana::LoadFrom< IDecomp > ( TDirectory *  dir)
template<>
std::unique_ptr< IExperiment > ana::LoadFrom< IExperiment > ( TDirectory *  dir)

Definition at line 22 of file IExperiment.cxx.

23  {
24  TObjString* ptag = (TObjString*)dir->Get("type");
25  assert(ptag);
26 
27  const TString tag = ptag->GetString();
28 
29  if(tag == "CountingExperiment") return CountingExperiment::LoadFrom(dir);
30  if(tag == "ReactorExperiment") return ReactorExperiment::LoadFrom(dir);
31  if(tag == "SingleSampleExperiment") return SingleSampleExperiment::LoadFrom(dir);
32  if(tag == "SolarConstraints") return SolarConstraints::LoadFrom(dir);
33  if(tag == "MultiExperiment") return MultiExperiment::LoadFrom(dir);
34 
35  std::cerr << "Unknown Experiment type '" << tag << "'" << std::endl;
36  abort();
37  }
BEGIN_PROLOG could also be cerr
tuple dir
Definition: dropbox.py:28
std::unique_ptr< T > LoadFrom(TDirectory *dir)
Definition: LoadFromFile.h:22
template<>
std::unique_ptr< IExtrap > ana::LoadFrom< IExtrap > ( TDirectory *  dir)

Definition at line 17 of file IExtrap.cxx.

18  {
19  TObjString* ptag = (TObjString*)dir->Get("type");
20  assert(ptag);
21 
22  const TString tag = ptag->GetString();
23 
24  if(tag == "TrivialExtrap") return TrivialExtrap::LoadFrom(dir);
25 
26  std::cerr << "Unknown Extrap type '" << tag << "'" << std::endl;
27  abort();
28  }
BEGIN_PROLOG could also be cerr
tuple dir
Definition: dropbox.py:28
std::unique_ptr< T > LoadFrom(TDirectory *dir)
Definition: LoadFromFile.h:22
template<>
std::unique_ptr< IPrediction > ana::LoadFrom< IPrediction > ( TDirectory *  dir)

Definition at line 26 of file IPrediction.cxx.

27  {
28  TObjString* ptag = (TObjString*)dir->Get("type");
29  assert(ptag);
30 
31  const TString tag = ptag->GetString();
32 
33  if(tag == "PredictionNoExtrap") return PredictionNoExtrap::LoadFrom(dir);
34 
35  // Backwards compatibility
36  if(tag == "PredictionInterp" ||
37  tag == "PredictionInterp2") return PredictionInterp::LoadFrom(dir);
38 
39  // if(tag == "PredictionLinFit") return PredictionLinFit::LoadFrom(dir);
40 
41  if(tag == "PredictionNoOsc") return PredictionNoOsc::LoadFrom(dir);
42 
43  if(tag == "PredictionScaleComp") return PredictionScaleComp::LoadFrom(dir);
44 
45  if(tag == "PredictionIncDirt") return PredictionIncDirt::LoadFrom(dir);
46 
47  if(tag == "PredictionSBNExtrap") return PredictionSBNExtrap::LoadFrom(dir);
48 
49  std::cerr << "Unknown Prediction type '" << tag << "'" << std::endl;
50  abort();
51  }
BEGIN_PROLOG could also be cerr
tuple dir
Definition: dropbox.py:28
std::unique_ptr< T > LoadFrom(TDirectory *dir)
Definition: LoadFromFile.h:22
template<>
std::unique_ptr<ModularExtrapComponent> ana::LoadFrom< ModularExtrapComponent > ( TDirectory *  dir)
template<>
std::unique_ptr< osc::IOscCalc > ana::LoadFrom< osc::IOscCalc > ( TDirectory *  dir)

Definition at line 22 of file LoadFromFile.cxx.

23  {
24  TObjString* ptag = (TObjString*)dir->Get("type");
25  assert(ptag);
26  const TString tag = ptag->GetString();
27 
28  if(tag == "NoOscillations") return std::unique_ptr<osc::IOscCalc>(new osc::NoOscillations);
29  if(tag == "OscCalculatorDumb") return std::unique_ptr<osc::IOscCalc>(new osc::OscCalcDumb);
30 
31  TVectorD* params = (TVectorD*)dir->Get("params");
32  assert(params);
33 
34  osc::IOscCalcAdjustable* ret = 0;
35 
36  if(tag == "OscCalculator") ret = new osc::OscCalc;
37  if(tag == "OscCalculatorGeneral") ret = new osc::OscCalcGeneral;
38  if(tag == "OscCalculatorPMNS") ret = new osc::OscCalcPMNS;
39  if(tag == "OscCalculatorPMNSOpt") ret = new osc::OscCalcPMNSOpt;
40  if(tag == "OscCalculatorSterile") ret = new osc::OscCalcSterile;
41  if(tag == "OscCalculatorPMNS_NSI") ret = new osc::OscCalcPMNS_NSI;
42  if(tag == "OscCalcSterileApprox"){
43  assert(params->GetNrows() == 4);
44  auto ret = new OscCalcSterileApproxAdjustable;
45  ret->calc.SetDmsq((*params)[0]);
46  ret->calc.SetSinSq2ThetaMuMu((*params)[1]);
47  ret->calc.SetSinSq2ThetaMuE((*params)[2]);
48  ret->calc.SetL((*params)[3]);
49  return std::unique_ptr<osc::IOscCalcAdjustable>(ret);
50  }
51 
52  if(!ret){
53  std::cout << "LoadFrom not implemented for " << tag << std::endl;
54  abort();
55  }
56 
57  //special case how OscCalcSterile is initialized
58  if(tag == "OscCalculatorSterile") {
59  std::vector<double> state;
60  for (int i = 0; i < params->GetNrows(); ++i) {
61  state.push_back( (*params)[i] );
62  }
63  dynamic_cast<osc::OscCalcSterile*>(ret)->SetState(state);
64  return std::unique_ptr<osc::IOscCalcAdjustable>(ret);
65  }
66  //special case how OscCalcPMNS_NSI is initialized
67  if(tag == "OscCalculatorPMNS_NSI") {
68  std::vector<double> state;
69  for (int i = 0; i < params->GetNrows(); ++i) {
70  state.push_back( (*params)[i] );
71  }
72  dynamic_cast<osc::OscCalcPMNS_NSI*>(ret)->SetState(state);
73  return std::unique_ptr<osc::IOscCalcAdjustable>(ret);
74  }
75 
76  assert(params->GetNrows() == 8);
77 
78  ret->SetL ((*params)[0]);
79  ret->SetRho ((*params)[1]);
80  ret->SetDmsq21((*params)[2]);
81  ret->SetDmsq32((*params)[3]);
82  ret->SetTh12 ((*params)[4]);
83  ret->SetTh13 ((*params)[5]);
84  ret->SetTh23 ((*params)[6]);
85  ret->SetdCP ((*params)[7]);
86 
87  return std::unique_ptr<osc::IOscCalcAdjustable>(ret);
88  }
tuple dir
Definition: dropbox.py:28
BEGIN_PROLOG could also be cout
template<class T >
std::unique_ptr<T> ana::LoadFromFile ( const std::string &  fname,
const std::string &  label 
)

Definition at line 61 of file LoadFromFile.h.

63  {
64  TFile fin(fname.c_str());
65  assert(!fin.IsZombie());
66  TDirectory* dir = fin.GetDirectory(label.c_str());
67  if(!dir){
68  std::cerr << "Didn't find '" << label << "' in " << fname << std::endl;
69  abort();
70  }
71  return LoadFrom<T>(dir);
72  }
string fname
Definition: demo.py:5
BEGIN_PROLOG could also be cerr
tuple dir
Definition: dropbox.py:28
double ana::LogLikelihood ( double  exp,
double  obs 
)

The log-likelihood formula for a single bin.

Parameters
expExpected count
obsObserved count
Returns
The log-likelihood formula from the PDG

\[ \chi^2=2\left(e-o+o\ln\left({o\over e}\right)\right) \]

Handles zero observed or expected events correctly.

Definition at line 163 of file sbnana/sbnana/CAFAna/Core/Utilities.cxx.

164  {
165  // http://www.wolframalpha.com/input/?i=d%2Fds+m*(1%2Bs)+-d+%2B+d*ln(d%2F(m*(1%2Bs)))%2Bs%5E2%2FS%5E2%3D0
166  // http://www.wolframalpha.com/input/?i=solve+-d%2F(s%2B1)%2Bm%2B2*s%2FS%5E2%3D0+for+s
167  const double S = LLPerBinFracSystErr::GetError();
168  if(S > 0){
169  const double S2 = util::sqr(S);
170  const double s = .25*(sqrt(8*o*S2+util::sqr(e*S2-2))-e*S2-2);
171  e *= 1+s;
172  }
173 
174  // With this value, negative expected events and one observed
175  // event gives a chisq from this one bin of 182.
176  const double minexp = 1e-40; // Don't let expectation go lower than this
177 
178  assert(o >= 0);
179  if(e < minexp){
180  if(!o) return 0;
181  e = minexp;
182  }
183 
184  if(o*1000 > e){
185  // This strange form is for numerical stability when e~o
186  return 2*o*((e-o)/o + log1p((o-e)/e));
187  }
188  else{
189  // But log1p doesn't like arguments near -1 (observation much smaller
190  // than expectation), and it's better to use the usual formula in that
191  // case.
192  if(o){
193  return 2*(e-o + o*log(o/e));
194  }
195  else{
196  return 2*e;
197  }
198  }
199  }
see a below echo S(symbol in a section other than those above)
T sqr(T x)
More efficient square function than pow(x,2)
Definition: MathUtil.h:23
then echo File list $list not found else cat $list while read file do echo $file sed s
Definition: file_to_url.sh:60
do i e
double ana::LogLikelihood ( const TH1 *  exp,
const TH1 *  obs,
bool  useOverflow = false 
)

The log-likelihood formula from the PDG.

Parameters
expThe expected spectrum
obsThe corresponding observed spectrum
Returns
The log-likelihood formula from the PDG

\[ \chi^2=2\sum_i^{\rm bins}\left(e_i-o_i+o_i\ln\left({o_i\over e_i}\right)\right) \]

Includes underflow bin and an option for overflow bin (off by default) and handles zero observed or expected events correctly.

Definition at line 202 of file sbnana/sbnana/CAFAna/Core/Utilities.cxx.

203  {
204  assert(eh->GetNbinsX() == oh->GetNbinsX());
205 
206  double chi = 0;
207 
208  int bufferBins = useOverflow? 2 : 1;
209 
210  for(int i = 0; i < eh->GetNbinsX()+bufferBins; ++i){
211  const double e = eh->GetBinContent(i);
212  const double o = oh->GetBinContent(i);
213 
214  chi += LogLikelihood(e, o);
215  }
216 
217  return chi;
218  }
double LogLikelihood(double e, double o)
The log-likelihood formula for a single bin.
do i e
const caf::SRTrackProxy* ana::LongestRecoTrack ( const caf::SRSliceProxy slc)

Pointer to longest reconstructed shower, or null pointer if none exists.

Definition at line 173 of file NueVars.cxx.

174 {
175  const int longestTrackIdx = kLongestTrackIdx(slc);
176  if(longestTrackIdx == -1) return 0;
177  return &slc->reco.trk[longestTrackIdx];
178 }
const Var kLongestTrackIdx([](const caf::SRSliceProxy *slc) -> int{int bestIdx(-1);double maxLength(-1);for(unsigned int i=0;i< slc->reco.ntrk;i++){auto const &trk=slc->reco.trk[i];continue;if(trk.len > maxLength){bestIdx=i;maxLength=trk.len;}}return bestIdx;})
Definition: NueVars.h:33
const caf::SRTrkChi2PIDProxy* ana::LongestTrackBestPlaneChi2PID ( const caf::SRSliceProxy slc)

Definition at line 199 of file NueVars.cxx.

200 {
201  const caf::SRTrackProxy* trk = LongestRecoTrack(slc);
202  return trk ? BestPlaneChi2PID(trk) : 0;
203 }
const caf::SRTrkChi2PIDProxy * BestPlaneChi2PID(const caf::SRTrackProxy *trk)
Definition: NueVars.cxx:193
const caf::SRTrackProxy * LongestRecoTrack(const caf::SRSliceProxy *slc)
Pointer to longest reconstructed shower, or null pointer if none exists.
Definition: NueVars.cxx:173
void ana::MakeNMinusOneSpectra ( SpectrumLoader &  loader,
const Cut &  sigcut,
const Cut &  presel,
const std::vector< HistAxis > &  axes,
const std::vector< double > &  cut_pos,
std::vector< Spectrum > &  sigs,
std::vector< Spectrum > &  bkgs 
)

Make a series of spectra leaving out one cut in turn.

This function does not call Go() on the loader, allowing you to combine it with other spectra-filling if desired.

Parameters
loaderSpectrumLoader to associate spectra with
sigcutDefinition of signal (inverse defines background)
preselCuts that will always be applied
axesVariables that will be cut on
cut_posCut position for each variable
[out]sigsResulting signal spectra
[out]bkgsResulting background spectra

Definition at line 10 of file CutOptimizer.cxx.

17  {
18  assert(cut_pos.size() == axes.size());
19 
20  sigs.reserve(axes.size());
21  bkgs.reserve(axes.size());
22 
23  for(unsigned int i = 0; i < axes.size(); ++i){
24  Cut nminusone = presel;
25  for(unsigned j = 0; j < axes.size(); ++j){
26  if(j == i) continue;
27  // TODO support cuts with a < sign
28  nminusone = nminusone && axes[j].GetVars()[0] > cut_pos[j];
29  } // end for j
30 
31  sigs.emplace_back(loader, axes[i], nminusone && sigcut);
32  bkgs.emplace_back(loader, axes[i], nminusone && !sigcut);
33  } // end for i
34  }
tuple loader
Definition: demo.py:7
_Cut< caf::SRSliceProxy > Cut
Definition: Cut.h:95
TH1D* ana::MakeTH1D ( const char *  name,
const char *  title,
const Binning &  bins 
)

Definition at line 393 of file sbnana/sbnana/CAFAna/Core/Utilities.cxx.

394  {
395  return MakeHist<TH1D>(bins, name, title);
396  }
then echo fcl name
TH2D* ana::MakeTH2D ( const char *  name,
const char *  title,
const Binning &  binsx,
const Binning &  binsy 
)

Definition at line 399 of file sbnana/sbnana/CAFAna/Core/Utilities.cxx.

402  {
403  return MakeHist<TH2D>(binsx, binsy, name, title);
404  }
then echo fcl name
template<class T >
_MultiVar< T > ana::MultiVar2D ( const _MultiVar< T > &  a,
const Binning &  binsa,
const _MultiVar< T > &  b,
const Binning &  binsb 
)

Definition at line 69 of file MultiVar.cxx.

71  {
72  return _MultiVar<T>(MultiVar2DFunc<T>(a, binsa, b, binsb));
73  }
process_name gaushit a
template SpillMultiVar ana::MultiVar2D ( const MultiVar &  ,
const Binning &  ,
const MultiVar &  ,
const Binning &   
)
osc::IOscCalcAdjustable * ana::NuFitOscCalc ( int  hie)

Definition at line 12 of file CalcsNuFit.cxx.

13  {
14  assert(hie == +1 || hie == -1);
15 
16  osc::IOscCalcAdjustable* ret = new osc::OscCalcPMNSOpt;
17  ret->SetL(kBaseline);
18  ret->SetRho(kEarthDensity);
19 
20  ret->SetDmsq21(kNuFitDmsq21CV);
21  ret->SetTh12(kNuFitTh12CV);
22 
23  if(hie > 0){
24  ret->SetDmsq32(kNuFitDmsq32CVNH);
25  ret->SetTh23(kNuFitTh23CVNH);
26  ret->SetTh13(kNuFitTh13CVNH);
27  ret->SetdCP(kNuFitdCPCVNH);
28  }
29  else{
30  ret->SetDmsq32(kNuFitDmsq32CVIH);
31  ret->SetTh23(kNuFitTh23CVIH);
32  ret->SetTh13(kNuFitTh13CVIH);
33  ret->SetdCP(kNuFitdCPCVIH);
34  }
35 
36  return ret;
37  }
const double kNuFitdCPCVIH
Definition: CalcsNuFit.h:26
const double kNuFitDmsq32CVIH
Definition: CalcsNuFit.h:23
const double kNuFitTh23CVIH
Definition: CalcsNuFit.h:24
const double kEarthDensity
Definition: CalcsNuFit.h:42
const double kNuFitTh23CVNH
Definition: CalcsNuFit.h:19
const double kNuFitDmsq21CV
Definition: CalcsNuFit.h:14
const double kNuFitdCPCVNH
Definition: CalcsNuFit.h:21
const double kBaseline
Definition: CalcsNuFit.h:41
const double kNuFitTh13CVIH
Definition: CalcsNuFit.h:25
const double kNuFitDmsq32CVNH
Definition: CalcsNuFit.h:18
const double kNuFitTh12CV
Definition: CalcsNuFit.h:15
const double kNuFitTh13CVNH
Definition: CalcsNuFit.h:20
osc::IOscCalcAdjustable * ana::NuFitOscCalcCDR ( int  hie)

Definition at line 10 of file CalcsNuFit_cdr.cxx.

11  {
12  assert(hie == +1 || hie == -1);
13 
14  osc::IOscCalcAdjustable* ret = new osc::OscCalcPMNSOpt;
15  ret->SetL(1300);
16  ret->SetRho(2.95674); // g/cm^3. Dan Cherdack's doc "used in GLOBES"
17 
18  ret->SetDmsq21(kNuFitDmsq21CV);
19  ret->SetTh12(kNuFitTh12CV);
20 
21  if(hie > 0){
22  ret->SetDmsq32(kNuFitDmsq32CVNH);
23  ret->SetTh23(kNuFitTh23CVNH);
24  ret->SetTh13(kNuFitTh13CVNH);
25  ret->SetdCP(kNuFitdCPCVNH);
26  }
27  else{
28  ret->SetDmsq32(kNuFitDmsq32CVIH);
29  ret->SetTh23(kNuFitTh23CVIH);
30  ret->SetTh13(kNuFitTh13CVIH);
31  ret->SetdCP(kNuFitdCPCVIH);
32  }
33 
34  return ret;
35  }
const double kNuFitdCPCVIH
Definition: CalcsNuFit.h:26
const double kNuFitDmsq32CVIH
Definition: CalcsNuFit.h:23
const double kNuFitTh23CVIH
Definition: CalcsNuFit.h:24
const double kNuFitTh23CVNH
Definition: CalcsNuFit.h:19
const double kNuFitDmsq21CV
Definition: CalcsNuFit.h:14
const double kNuFitdCPCVNH
Definition: CalcsNuFit.h:21
const double kNuFitTh13CVIH
Definition: CalcsNuFit.h:25
const double kNuFitDmsq32CVNH
Definition: CalcsNuFit.h:18
const double kNuFitTh12CV
Definition: CalcsNuFit.h:15
const double kNuFitTh13CVNH
Definition: CalcsNuFit.h:20
osc::IOscCalcAdjustable * ana::NuFitOscCalcCDRPlusOneSigma ( int  hie)

Definition at line 73 of file CalcsNuFit_cdr.cxx.

74  {
75  assert(hie == +1 || hie == -1);
76 
77  osc::IOscCalcAdjustable* ret = new osc::OscCalcPMNSOpt;
78  ret->SetL(1300);
79  ret->SetRho(2.95674); // g/cm^3. Dan Cherdack's doc "used in GLOBES"
80 
81  ret->SetDmsq21(kNuFitDmsq21CV + kNuFitDmsq21Err);
82  ret->SetTh12(kNuFitTh12CV + kNuFitTh12Err);
83 
84  if(hie > 0){
85  ret->SetDmsq32(kNuFitDmsq32CVNH + kNuFitDmsq32ErrNH);
86  ret->SetTh23(kNuFitTh23CVNH + kNuFitTh23ErrNH);
87  ret->SetTh13(kNuFitTh13CVNH + kNuFitTh13ErrNH);
88  }
89  else{
90  ret->SetDmsq32(kNuFitDmsq32CVIH + kNuFitDmsq32ErrIH);
91  ret->SetTh23(kNuFitTh23CVIH + kNuFitTh23ErrIH);
92  ret->SetTh13(kNuFitTh13CVIH + kNuFitTh13ErrIH);
93  }
94 
95  ret->SetdCP(0); // a little ambiguous in the instructions
96 
97  return ret;
98  }
const double kNuFitDmsq32ErrNH
Definition: CalcsNuFit.h:32
const double kNuFitTh23ErrIH
Definition: CalcsNuFit.h:37
const double kNuFitDmsq32ErrIH
Definition: CalcsNuFit.h:36
const double kNuFitTh12Err
Definition: CalcsNuFit.h:30
const double kNuFitDmsq32CVIH
Definition: CalcsNuFit.h:23
const double kNuFitTh23CVIH
Definition: CalcsNuFit.h:24
const double kNuFitTh23CVNH
Definition: CalcsNuFit.h:19
const double kNuFitTh13ErrIH
Definition: CalcsNuFit.h:38
const double kNuFitDmsq21Err
Definition: CalcsNuFit.h:29
const double kNuFitDmsq21CV
Definition: CalcsNuFit.h:14
const double kNuFitTh13CVIH
Definition: CalcsNuFit.h:25
const double kNuFitDmsq32CVNH
Definition: CalcsNuFit.h:18
const double kNuFitTh23ErrNH
Definition: CalcsNuFit.h:33
const double kNuFitTh13ErrNH
Definition: CalcsNuFit.h:34
const double kNuFitTh12CV
Definition: CalcsNuFit.h:15
const double kNuFitTh13CVNH
Definition: CalcsNuFit.h:20
osc::IOscCalcAdjustable * ana::NuFitOscCalcPlusOneSigma ( int  hie)

Definition at line 98 of file CalcsNuFit.cxx.

99  {
100  assert(hie == +1 || hie == -1);
101 
102  osc::IOscCalcAdjustable* ret = new osc::OscCalcPMNSOpt;
103  ret->SetL(kBaseline);
104  ret->SetRho(kEarthDensity);
105 
106  ret->SetDmsq21(kNuFitDmsq21CV + kNuFitDmsq21Err);
107  ret->SetTh12(kNuFitTh12CV + kNuFitTh12Err);
108 
109  if(hie > 0){
110  ret->SetDmsq32(kNuFitDmsq32CVNH + kNuFitDmsq32ErrNH);
111  ret->SetTh23(kNuFitTh23CVNH + kNuFitTh23ErrNH);
112  ret->SetTh13(kNuFitTh13CVNH + kNuFitTh13ErrNH);
113  }
114  else{
115  ret->SetDmsq32(kNuFitDmsq32CVIH + kNuFitDmsq32ErrIH);
116  ret->SetTh23(kNuFitTh23CVIH + kNuFitTh23ErrIH);
117  ret->SetTh13(kNuFitTh13CVIH + kNuFitTh13ErrIH);
118  }
119 
120  ret->SetdCP(0); // a little ambiguous in the instructions
121 
122  return ret;
123  }
const double kNuFitDmsq32ErrNH
Definition: CalcsNuFit.h:32
const double kNuFitTh23ErrIH
Definition: CalcsNuFit.h:37
const double kNuFitDmsq32ErrIH
Definition: CalcsNuFit.h:36
const double kNuFitTh12Err
Definition: CalcsNuFit.h:30
const double kNuFitDmsq32CVIH
Definition: CalcsNuFit.h:23
const double kNuFitTh23CVIH
Definition: CalcsNuFit.h:24
const double kEarthDensity
Definition: CalcsNuFit.h:42
const double kNuFitTh23CVNH
Definition: CalcsNuFit.h:19
const double kNuFitTh13ErrIH
Definition: CalcsNuFit.h:38
const double kNuFitDmsq21Err
Definition: CalcsNuFit.h:29
const double kNuFitDmsq21CV
Definition: CalcsNuFit.h:14
const double kBaseline
Definition: CalcsNuFit.h:41
const double kNuFitTh13CVIH
Definition: CalcsNuFit.h:25
const double kNuFitDmsq32CVNH
Definition: CalcsNuFit.h:18
const double kNuFitTh23ErrNH
Definition: CalcsNuFit.h:33
const double kNuFitTh13ErrNH
Definition: CalcsNuFit.h:34
const double kNuFitTh12CV
Definition: CalcsNuFit.h:15
const double kNuFitTh13CVNH
Definition: CalcsNuFit.h:20
size_t ana::NumJobs ( )

Definition at line 787 of file sbnana/sbnana/CAFAna/Core/Utilities.cxx.

788  {
789  if(!RunningOnGrid()){
790  std::cout << "NumJobs() called, but we are not running on the grid" << std::endl;
791  abort();
792  }
793 
794  return Stride(false);
795  }
size_t Stride(bool allow_default)
BEGIN_PROLOG could also be cout
size_t ana::Offset ( bool  allow_default)

Definition at line 734 of file sbnana/sbnana/CAFAna/Core/Utilities.cxx.

735  {
736  static int cache = -1;
737 
738  if(cache < 0){
739  char* env = getenv("CAFANA_OFFSET");
740  if(env){
741  cache = std::atoi(env);
742  }
743  else{
744  if(allow_default){
745  cache = 0;
746  }
747  else{
748  std::cout << "Offset() called, but CAFANA_OFFSET is not set (--offset not passed?)" << std::endl;
749  abort();
750  }
751  }
752  }
753 
754  return cache;
755  }
BEGIN_PROLOG could also be cout
template<class T >
_Cut< T > ana::operator! ( const _Cut< T > &  a)

Definition at line 100 of file Cut.cxx.

101  {
102  static std::map<int, int> ids;
103  if(ids.count(a.ID())){
104  return _Cut<T>([a](const T* sr){return !a(sr);},
105  0, 0, ids[a.ID()]);
106  }
107  else{
108  const _Cut<T> ret([a](const T* sr){return !a(sr);});
109  ids[a.ID()] = ret.ID();
110  return ret;
111  }
112  }
process_name gaushit a
template Cut ana::operator!< caf::SRSliceProxy > ( const Cut &  a)
template SpillCut ana::operator!< caf::SRSpillProxy > ( const SpillCut &  a)
template<class T >
_Cut< T > ana::operator!= ( const _Var< T > &  v,
double  c 
)

Definition at line 156 of file Cut.cxx.

157  {
158  return !(v == c);
159  }
template<class T >
_Cut< T > ana::operator!= ( double  c,
const _Var< T > &  v 
)

Definition at line 188 of file Cut.cxx.

188 {return v != c;}
template<class T >
_Cut< T > ana::operator!= ( const _Var< T > &  a,
const _Var< T > &  b 
)

Definition at line 192 of file Cut.cxx.

192 {return !(b == a);}
process_name gaushit a
template Cut ana::operator!= ( const Var &  ,
double   
)
template Cut ana::operator!= ( const Var &  ,
const Var &   
)
SterileOscAngles ana::operator& ( const SterileOscAngles  a,
const SterileOscAngles  b 
)
inline

Definition at line 97 of file OscCalcSterileApprox.h.

98  {
99  int a_int = static_cast<int>(a);
100  int b_int = static_cast<int>(b);
101  return static_cast<SterileOscAngles>(a_int & b_int);
102  }
process_name gaushit a
template<class T >
_Cut< T > ana::operator&& ( const _Cut< T > &  a,
const _Cut< T > &  b 
)

Definition at line 49 of file Cut.cxx.

50  {
51  // The same pairs of cuts are frequently and-ed together. Make sure those
52  // duplicates get the same IDs by remembering what we've done in the past.
53  static std::map<std::pair<int, int>, int> ids;
54  const std::pair<int, int> key(a.ID(), b.ID());
55 
56  if(ids.count(key)){
57  return _Cut<T>([a, b](const T* sr){return a(sr) && b(sr);},
58  CombineExposures(a.fLiveFunc, b.fLiveFunc),
59  CombineExposures(a.fPOTFunc, b.fPOTFunc),
60  ids[key]);
61  }
62  else{
63  const _Cut<T> ret([a, b](const T* sr){return a(sr) && b(sr);},
64  CombineExposures(a.fLiveFunc, b.fLiveFunc),
65  CombineExposures(a.fPOTFunc, b.fPOTFunc));
66  ids[key] = ret.ID();
67  return ret;
68  }
69  }
std::function< ExposureFunc_t > CombineExposures(const std::function< ExposureFunc_t > &a, const std::function< ExposureFunc_t > &b)
Definition: Cut.cxx:26
process_name gaushit a
template Cut ana::operator&&< caf::SRSliceProxy > ( const Cut &  a,
const Cut &  b 
)
template SpillCut ana::operator&&< caf::SRSpillProxy > ( const SpillCut &  a,
const SpillCut &  b 
)
EnsembleSpectrum ana::operator* ( const EnsembleRatio &  lhs,
const EnsembleSpectrum &  rhs 
)
inline

Definition at line 79 of file EnsembleSpectrum.h.

79 {return rhs*lhs;}
template<class T >
_Var< T > ana::operator* ( const _Var< T > &  a,
const _Var< T > &  b 
)

Definition at line 179 of file Var.cxx.

180  {
181  static std::map<std::pair<int, int>, int> ids;
182  const std::pair<int, int> key(a.ID(), b.ID());
183 
184  if(ids.count(key)){
185  return _Var<T>([a, b](const T* sr){return a(sr) * b(sr);},
186  ids[key]);
187  }
188  else{
189  const _Var<T> ret([a, b](const T* sr){return a(sr) * b(sr);});
190  ids[key] = ret.ID();
191  return ret;
192  }
193  }
process_name gaushit a
template Var ana::operator* ( const Var &  ,
const Var &   
)
Spectrum ana::operator* ( const Ratio &  lhs,
const Spectrum &  rhs 
)
inline

Definition at line 353 of file Spectrum.h.

353 {return rhs*lhs;}
template<class T >
_Var< T > ana::operator+ ( const _Var< T > &  a,
const _Var< T > &  b 
)

Definition at line 229 of file Var.cxx.

230  {
231  static std::map<std::pair<int, int>, int> ids;
232  const std::pair<int, int> key(a.ID(), b.ID());
233 
234  if(ids.count(key)){
235  return _Var<T>([a, b](const T* sr){return a(sr) + b(sr);},
236  ids[key]);
237  }
238  else{
239  const _Var<T> ret([a, b](const T* sr){return a(sr) + b(sr);});
240  ids[key] = ret.ID();
241  return ret;
242  }
243  }
process_name gaushit a
template Var ana::operator+ ( const Var &  ,
const Var &   
)
template<class T >
_Var< T > ana::operator- ( const _Var< T > &  a,
const _Var< T > &  b 
)

Definition at line 247 of file Var.cxx.

248  {
249  static std::map<std::pair<int, int>, int> ids;
250  const std::pair<int, int> key(a.ID(), b.ID());
251 
252  if(ids.count(key)){
253  return _Var<T>([a, b](const T* sr){return a(sr) - b(sr);},
254  ids[key]);
255  }
256  else{
257  const _Var<T> ret([a, b](const T* sr){return a(sr) - b(sr);});
258  ids[key] = ret.ID();
259  return ret;
260  }
261  }
process_name gaushit a
template Var ana::operator- ( const Var &  ,
const Var &   
)
Ratio ana::operator/ ( const Spectrum &  lhs,
const Spectrum &  rhs 
)
inline

Definition at line 39 of file Ratio.h.

39 {return Ratio(lhs, rhs);}
EnsembleRatio ana::operator/ ( const EnsembleSpectrum &  lhs,
const EnsembleSpectrum &  rhs 
)
inline

Definition at line 39 of file EnsembleRatio.h.

41  {
42  return EnsembleRatio(lhs, rhs);
43  }
EnsembleSpectrum ana::operator/ ( const EnsembleRatio &  lhs,
const EnsembleSpectrum &  rhs 
)
inline

Definition at line 80 of file EnsembleSpectrum.h.

80 {return rhs/lhs;}
template<class T >
_Var< T > ana::operator/ ( const _Var< T > &  a,
const _Var< T > &  b 
)

Definition at line 197 of file Var.cxx.

198  {
199  static std::map<std::pair<int, int>, int> ids;
200  const std::pair<int, int> key(a.ID(), b.ID());
201 
202  if(ids.count(key)){
203  return _Var<T>([a, b](const T* sr)
204  {
205  const double denom = b(sr);
206  if(denom != 0)
207  return a(sr) / denom;
208  else
209  return 0.0;
210  },
211  ids[key]);
212  }
213  else{
214  const _Var<T> ret([a, b](const T* sr)
215  {
216  const double denom = b(sr);
217  if(denom != 0)
218  return a(sr) / denom;
219  else
220  return 0.0;
221  });
222  ids[key] = ret.ID();
223  return ret;
224  }
225  }
process_name gaushit a
template Var ana::operator/ ( const Var &  ,
const Var &   
)
Spectrum ana::operator/ ( const Ratio &  lhs,
const Spectrum &  rhs 
)
inline

Definition at line 354 of file Spectrum.h.

354 {return rhs/lhs;}
template<class T >
_Cut< T > ana::operator< ( const _Var< T > &  v,
double  c 
)

Definition at line 135 of file Cut.cxx.

136  {
137  return _Cut<T>([v, c](const T* sr){return v(sr) < c;});
138  }
template<class T >
_Cut< T > ana::operator< ( double  c,
const _Var< T > &  v 
)

Definition at line 185 of file Cut.cxx.

185 {return v > c;}
template<class T >
_Cut< T > ana::operator< ( const _Var< T > &  a,
const _Var< T > &  b 
)

Definition at line 190 of file Cut.cxx.

190 {return !(b >= a);}
process_name gaushit a
template Cut ana::operator< ( const Var &  ,
double   
)
template Cut ana::operator< ( const Var &  ,
const Var &   
)
template Cut ana::operator< ( double  ,
const Var &   
)
template<class T >
_Cut< T > ana::operator<= ( const _Var< T > &  v,
double  c 
)

Definition at line 142 of file Cut.cxx.

143  {
144  return _Cut<T>([v, c](const T* sr){return v(sr) <= c;});
145  }
template<class T >
_Cut< T > ana::operator<= ( double  c,
const _Var< T > &  v 
)

Definition at line 187 of file Cut.cxx.

187 {return v >= c;}
template<class T >
_Cut< T > ana::operator<= ( const _Var< T > &  a,
const _Var< T > &  b 
)

Definition at line 191 of file Cut.cxx.

191 {return !(b > a);}
process_name gaushit a
template Cut ana::operator<= ( const Var &  ,
double   
)
template Cut ana::operator<= ( const Var &  ,
const Var &   
)
template Cut ana::operator<= ( double  ,
const Var &   
)
template<class T >
_Cut< T > ana::operator== ( const _Var< T > &  v,
double  c 
)

Definition at line 149 of file Cut.cxx.

150  {
151  return _Cut<T>([v, c](const T* sr){return v(sr) == c;});
152  }
template<class T >
_Cut< T > ana::operator== ( const _Var< T > &  a,
const _Var< T > &  b 
)

Definition at line 177 of file Cut.cxx.

178  {
179  return _Cut<T>([a, b](const T* sr){return a(sr) == b(sr);});
180  }
process_name gaushit a
template Cut ana::operator== ( const Var &  ,
double   
)
template Cut ana::operator== ( const Var &  ,
const Var &   
)
template<class T >
_Cut< T > ana::operator> ( const _Var< T > &  v,
double  c 
)

Definition at line 121 of file Cut.cxx.

122  {
123  return _Cut<T>([v, c](const T* sr){return v(sr) > c;});
124  }
template<class T >
_Cut< T > ana::operator> ( const _Var< T > &  a,
const _Var< T > &  b 
)

Definition at line 163 of file Cut.cxx.

164  {
165  return _Cut<T>([a, b](const T* sr){return a(sr) > b(sr);});
166  }
process_name gaushit a
template<class T >
_Cut< T > ana::operator> ( double  c,
const _Var< T > &  v 
)

Definition at line 184 of file Cut.cxx.

184 {return v < c;}
template Cut ana::operator> ( const Var &  ,
double   
)
template Cut ana::operator> ( const Var &  ,
const Var &   
)
template Cut ana::operator> ( double  ,
const Var &   
)
template<class T >
_Cut< T > ana::operator>= ( const _Var< T > &  v,
double  c 
)

Definition at line 128 of file Cut.cxx.

129  {
130  return _Cut<T>([v, c](const T* sr){return v(sr) >= c;});
131  }
template<class T >
_Cut< T > ana::operator>= ( const _Var< T > &  a,
const _Var< T > &  b 
)

Definition at line 170 of file Cut.cxx.

171  {
172  return _Cut<T>([a, b](const T* sr){return a(sr) >= b(sr);});
173  }
process_name gaushit a
template<class T >
_Cut< T > ana::operator>= ( double  c,
const _Var< T > &  v 
)

Definition at line 186 of file Cut.cxx.

186 {return v <= c;}
template Cut ana::operator>= ( const Var &  ,
double   
)
template Cut ana::operator>= ( const Var &  ,
const Var &   
)
template Cut ana::operator>= ( double  ,
const Var &   
)
SterileOscAngles ana::operator| ( const SterileOscAngles  a,
const SterileOscAngles  b 
)
inline

Definition at line 90 of file OscCalcSterileApprox.h.

91  {
92  int a_int = static_cast<int>(a);
93  int b_int = static_cast<int>(b);
94  return static_cast<SterileOscAngles>(a_int | b_int);
95  }
process_name gaushit a
Fitter::Precision ana::operator| ( Fitter::Precision  a,
Fitter::Precision  b 
)
inline

Definition at line 199 of file Fit.h.

200  {
201  return Fitter::Precision(int(a) | int(b));
202  }
process_name gaushit a
template<class T >
_Cut< T > ana::operator|| ( const _Cut< T > &  a,
const _Cut< T > &  b 
)

Definition at line 76 of file Cut.cxx.

77  {
78  static std::map<std::pair<int, int>, int> ids;
79  const std::pair<int, int> key(a.ID(), b.ID());
80  if(ids.count(key)){
81  return _Cut<T>([a, b](const T* sr){return a(sr) || b(sr);},
82  CombineExposures(a.fLiveFunc, b.fLiveFunc),
83  CombineExposures(a.fPOTFunc, b.fPOTFunc),
84  ids[key]);
85  }
86  else{
87  const _Cut<T> ret([a, b](const T* sr){return a(sr) || b(sr);},
88  CombineExposures(a.fLiveFunc, b.fLiveFunc),
89  CombineExposures(a.fPOTFunc, b.fPOTFunc));
90  ids[key] = ret.ID();
91  return ret;
92  }
93  }
std::function< ExposureFunc_t > CombineExposures(const std::function< ExposureFunc_t > &a, const std::function< ExposureFunc_t > &b)
Definition: Cut.cxx:26
process_name gaushit a
template Cut ana::operator||< caf::SRSliceProxy > ( const Cut &  a,
const Cut &  b 
)
template SpillCut ana::operator||< caf::SRSpillProxy > ( const SpillCut &  a,
const SpillCut &  b 
)
void ana::OptimizeCuts ( const std::string &  wildcard,
double  pot,
const Cut &  sigcut,
const Cut &  presel,
const std::vector< HistAxis > &  axes,
std::vector< double > &  cut_pos 
)

Repeatedly invoke OptimizeOneCut until the FOM increase becomes small.

Definition at line 99 of file CutOptimizer.cxx.

105  {
106  std::cout << "Initial cuts:" << std::endl;
107  for(unsigned int i = 0; i < axes.size(); ++i){
108  std::cout << " " << axes[i].GetLabels()[0] << " > " << cut_pos[i] << std::endl;
109  }
110 
111  double fom = 0;
112  while(true){
113  const double new_fom = OptimizeOneCut(wildcard, pot, sigcut, presel, axes, cut_pos);
114  // Give up once the new FOM is not more than a 1% improvement
115  if(new_fom < fom*1.01) break;
116  fom = new_fom;
117  }
118 
119  std::cout << "Final optimized cuts:" << std::endl;
120  for(unsigned int i = 0; i < axes.size(); ++i){
121  std::cout << " " << axes[i].GetLabels()[0] << " > " << cut_pos[i] << std::endl;
122  }
123  }
BEGIN_PROLOG could also be cout
double OptimizeOneCut(const std::string &wildcard, double pot, const Cut &sigcut, const Cut &presel, const std::vector< HistAxis > &axes, std::vector< double > &cut_pos)
Scan all cuts and update the one giving the largest FOM gain.
double ana::OptimizeOneCut ( const std::string &  wildcard,
double  pot,
const Cut &  sigcut,
const Cut &  presel,
const std::vector< HistAxis > &  axes,
std::vector< double > &  cut_pos 
)

Scan all cuts and update the one giving the largest FOM gain.

Parameters
wildcardFile name / wildcard / dataset name
potPOT to scale to
sigcutDefinition of signal (inverse defines background)
preselCuts that will always be applied
axesVariables that will be cut on
[out]cut_posStarting cut position for each variable. One of these values will be updated
Returns
FOM achieved by optimized cuts

Definition at line 58 of file CutOptimizer.cxx.

64  {
65  SpectrumLoader loader(wildcard);
66  std::vector<Spectrum> sigs, bkgs;
67  MakeNMinusOneSpectra(loader, sigcut, presel, axes, cut_pos, sigs, bkgs);
68  loader.Go();
69 
70  double best_fom = 0;
71  double best_cut = -1;
72  int best_idx = -1;
73 
74  for(unsigned int cutIdx = 0; cutIdx < axes.size(); ++cutIdx){
75  TH1* hsig = sigs[cutIdx].ToTH1(pot, kRed);
76  TH1* hbkg = bkgs[cutIdx].ToTH1(pot, kBlue);
77  // TODO support multiple background spectra, such as cosmics
78 
79  double fom;
80  const double cut = FindOptimumCut(hsig, hbkg, fom);
81 
82  if(fom > best_fom){
83  best_fom = fom;
84  best_cut = cut;
85  best_idx = cutIdx;
86  }
87 
88  // TODO plot distributions and optimized cuts at each phase
89  } // end for cutIdx
90 
91  std::cout << "Updated cut on '" << axes[best_idx].GetLabels()[0] << "' to " << best_cut << ". FOM now " << best_fom << std::endl;
92 
93  // Store the result
94  cut_pos[best_idx] = best_cut;
95  return best_fom;
96  }
tuple loader
Definition: demo.py:7
void MakeNMinusOneSpectra(SpectrumLoader &loader, const Cut &sigcut, const Cut &presel, const std::vector< HistAxis > &axes, const std::vector< double > &cut_pos, std::vector< Spectrum > &sigs, std::vector< Spectrum > &bkgs)
Make a series of spectra leaving out one cut in turn.
double FindOptimumCut(TH1 *hsig, TH1 *hbkg, double &best_fom)
Search for optimum cut position given signal and background histograms.
BEGIN_PROLOG could also be cout
void ana::PimpHist ( TH1 *  histo,
Color_t  color,
Style_t  linestyle,
int  linewidth,
Style_t  markerstyle = 8,
double  markersize = 8 
)

Definition at line 119 of file tools_nuesel_icarus.h.

119  {
120 
121  histo->SetLineColor(color);
122  histo->SetLineStyle(linestyle);
123  histo->SetLineWidth(linewidth);
124  histo->SetMarkerColor(color);
125  histo->SetMarkerStyle(markerstyle);
126  histo->SetMarkerSize(markersize);
127 
128  }
void ana::PlotWithSystErrorBand ( IPrediction *  pred,
const std::vector< const ISyst * > &  systs,
osc::IOscCalc calc,
double  pot,
int  col = -1,
int  errCol = -1,
float  headroom = 1.3,
bool  newaxis = true 
)

Plot prediction with +/-1sigma error band.

When multiple systematics are used, the errors are the quadrature sum

Parameters
predThe prediction. Must be able to generate shifted spectra
systsList of systematics to include in error band
calcOscillation parameters
potPOT to evaluate prediction at
colColor of the prediction, default kRed
errColColor of the shading, default col-7 (kRed-7 is light red)
headroomFraction of maximum bin for headroom, default 30%

Definition at line 377 of file Plots.cxx.

383  {
384 
385  Spectrum nom = pred->Predict(calc);
386 
387  std::vector<Spectrum> ups, dns;
388 
389  for(const ISyst* syst: systs){
390  SystShifts shifts;
391  shifts.SetShift(syst, +1);
392  ups.push_back(pred->PredictSyst(calc, shifts));
393  shifts.SetShift(syst, -1);
394  dns.push_back(pred->PredictSyst(calc, shifts));
395  }
396 
397  PlotWithSystErrorBand(nom, ups, dns, pot, col, errCol, headroom, newaxis);
398 
399 
400  }
void PlotWithSystErrorBand(IPrediction *pred, const std::vector< const ISyst * > &systs, osc::IOscCalc *calc, double pot, int col, int errCol, float headroom, bool newaxis)
Plot prediction with +/-1sigma error band.
Definition: Plots.cxx:377
void ana::PlotWithSystErrorBand ( const Spectrum &  nominal,
const std::vector< Spectrum > &  upShifts,
const std::vector< Spectrum > &  downShifts,
double  pot,
int  col = -1,
int  errCol = -1,
float  headroom = 1.3,
bool  newaxis = true 
)

Plot prediction with error band.

When multiple systematics are used, the errors are the quadrature sum

Parameters
nominalNominal spectrum
upShiftsVector of spectra which have + shifts
downShiftsVector of spectra which have - shifts, same order as +
potPOT to scale spectra to
colColor of the prediction, default kRed
errColColor of the shading, default col-7(kRed-7 is light red)
headroomFraction of maximum bin for headroom, default 30%

Definition at line 404 of file Plots.cxx.

409  {
410  if(col == -1){
411  col = kTotalMCColor;
412  errCol = kTotalMCErrorBandColor;
413  }
414  else if(errCol == -1) errCol = col-7; // hopefully a lighter version
415 
416  TH1* nom = nominal.ToTH1(pot);
417 
418  std::vector<TH1*> ups, dns;
419 
420  for(const auto& upShift:upShifts) ups.push_back(upShift.ToTH1(pot));
421  for(const auto& downShift:downShifts) dns.push_back(downShift.ToTH1(pot));
422 
423  nom->SetLineColor(col);
424  nom->GetXaxis()->CenterTitle();
425  nom->GetYaxis()->CenterTitle();
426  if(newaxis) nom->Draw("hist ]["); // Set the axes up
427 
428  double yMax = nom->GetBinContent(nom->GetMaximumBin());
429 
430  TGraphAsymmErrors* g = new TGraphAsymmErrors;
431 
432  for(int binIdx = 0; binIdx < nom->GetNbinsX()+2; ++binIdx){
433  const double y = nom->GetBinContent(binIdx);
434  g->SetPoint(binIdx, nom->GetXaxis()->GetBinCenter(binIdx), y);
435 
436  const double w = nom->GetXaxis()->GetBinWidth(binIdx);
437 
438  double errUp = 0;
439  double errDn = 0;
440 
441  for(unsigned int systIdx = 0; systIdx < ups.size(); ++systIdx){
442  double hi = ups[systIdx]->GetBinContent(binIdx)-y;
443  double lo = y-dns[systIdx]->GetBinContent(binIdx);
444 
445  if(lo <= 0 && hi <= 0) std::swap(lo, hi);
446 
447  errUp += hi*hi;
448  errDn += lo*lo;
449 
450  // TODO: what happens if they're both high or both low?
451  } // end for systIdx
452 
453 
454  g->SetPointError(binIdx, w/2, w/2, sqrt(errDn), sqrt(errUp));
455  } // end for i
456 
457  g->SetFillColor(errCol);
458  g->Draw("e2 same");
459  g->GetYaxis()->SetRangeUser(0, headroom*yMax);
460  nom->GetYaxis()->SetRangeUser(0, headroom*yMax);
461 
462  nom->Draw("hist ][ same");
463 
464  for(TH1* up: ups) delete up;
465  for(TH1* dn: dns) delete dn;
466  }
const Color_t kTotalMCErrorBandColor
BEGIN_PROLOG g
process_name opflash particleana ie ie y
const Color_t kTotalMCColor
std::string ana::pnfs2xrootd ( std::string  loc,
bool  unauth 
)

Definition at line 808 of file sbnana/sbnana/CAFAna/Core/Utilities.cxx.

809  {
810  static bool first = true;
811  static bool onsite = false;
812 
813  if (first && unauth) {
814  first = false;
815  char chostname[255];
816  gethostname(chostname, 255);
817  std::string hostname = chostname;
818 
819  if ( hostname.find("fnal.gov") != std::string::npos ){
820  onsite = true;
821  std::cout << "Using unauthenticated xrootd access (port 1095) while on-site, hostname: " << hostname << std::endl;
822  }
823  else {
824  onsite = false;
825  std::cout << "Using authenticated xrootd access (port 1094) access while off-site, hostname: " << hostname << std::endl;
826  }
827  }
828 
829  if(loc.rfind("/pnfs/", 0) == 0){ // ie begins with
830  if ( onsite && unauth )
831  loc = std::string("root://fndcagpvm01.fnal.gov:1095//pnfs/fnal.gov/usr/")+&loc.c_str()[6];
832  else
833  loc = std::string("root://fndcagpvm01.fnal.gov:1094//pnfs/fnal.gov/usr/")+&loc.c_str()[6];
834  }
835  return loc;
836  }
BEGIN_PROLOG could also be cout
double ana::PointDistanceToBox ( double  x,
double  y,
double  x0,
double  y0,
double  x1,
double  y1 
)

Helper for AutoPlaceLegend.

Definition at line 483 of file Plots.cxx.

485  {
486  // Inside
487  if(x > x0 && x < x1 && y > y0 && y < y1) return 0;
488 
489  // Corners
490  double d = util::sqr(x-x0)+util::sqr(y-y0);
491  d = std::min(d, util::sqr(x-x1)+util::sqr(y-y0));
492  d = std::min(d, util::sqr(x-x1)+util::sqr(y-y1));
493  d = std::min(d, util::sqr(x-x0)+util::sqr(y-y1));
494 
495  // Top and bottom edges
496  if(x > x0 && x < x1){
497  d = std::min(d, util::sqr(y-y0));
498  d = std::min(d, util::sqr(y-y1));
499  }
500  // Left and right
501  if(y > y0 && y < y1){
502  d = std::min(d, util::sqr(x-x0));
503  d = std::min(d, util::sqr(x-x1));
504  }
505 
506  return d;
507  }
process_name opflash particleana ie x
T sqr(T x)
More efficient square function than pow(x,2)
Definition: MathUtil.h:23
process_name opflash particleana ie ie y
void ana::printEventsLine ( std::string  cutname,
float  nue,
float  numu,
float  nc,
float  cos,
float  other,
float  eff,
float  pur 
)

Definition at line 67 of file tools_nuesel_icarus.h.

67  {
68  float total = nue+numu+nc+cos+other;
69  float percnue = 100*nue/total;
70  float percnumu = 100*numu/total;
71  float percnc = 100*nc/total;
72  float perccos = 100*cos/total;
73  float percother = 100*other/total;
74  float perctotbkg = 100*(numu+nc+cos+other)/total;
75  // output << std::fixed << std::setw(6) << std::setprecision(3) << cutname << "&" << nue <<"("<<percnue<<")"<< "&" << numu<<"("<<percnumu<<")"<< "&" << nc<<"("<<percnc<<")"<< "&" << cos<<"("<<perccos<<")"<< "&" << other<<"("<<percother<<")"<< "&" << eff << "&" << pur << "\\\\ \\hline \n";
76  output << std::fixed << std::setw(6) << std::setprecision(3) << cutname << "&" << nue <<"("<<percnue<<")"<< "&" << numu<<"("<<percnumu<<")"<< "&" << nc<<"("<<percnc<<")"<< "&" << cos<<"("<<perccos<<")"<< "&" << eff << "&" << pur << "\\\\ \\hline \n";
77  }
BEGIN_PROLOG sequence::SlidingWindowTriggerPatternsOppositeWindows END_PROLOG simSlidingORM6O6 effSlidingORW output
void ana::PrintSRGlobal ( const caf::SRGlobal global)

Definition at line 54 of file UniverseOracle.cxx.

55  {
56  std::cout << global.wgts.size() << " parameter sets:" << std::endl;
57  for(unsigned int i = 0; i < global.wgts.size(); ++i){
58  const caf::SRWeightPSet& pset = global.wgts[i];
59  std::cout << " " << i << ": " << pset.name << ", type " << pset.type << ", " << pset.nuniv << " universes, adjusted parameters:" << std::endl;
60 
61  for(const caf::SRWeightMapEntry& entry: pset.map){
62  std::cout << " " << entry.param.name << std::endl;
63  }
64  }
65  }
ReweightType_t type
Definition: SRWeightPSet.h:17
std::string name
Definition: SRWeightParam.h:11
std::vector< SRWeightPSet > wgts
Definition: SRGlobal.h:13
std::vector< SRWeightMapEntry > map
Definition: SRWeightPSet.h:21
std::string name
Definition: SRWeightPSet.h:16
BEGIN_PROLOG could also be cout
void ana::printTableFooter ( )

Definition at line 60 of file tools_nuesel_icarus.h.

60  {
61  output << "\\end{tabular}}\n";
62  output << "\\end{table}";
63  output << "\n\n\n";
64  //output.close();
65  }
BEGIN_PROLOG sequence::SlidingWindowTriggerPatternsOppositeWindows END_PROLOG simSlidingORM6O6 effSlidingORW output
void ana::printTableHeader ( int  quantId = 0)

Definition at line 45 of file tools_nuesel_icarus.h.

46  {
47  std::setprecision(3);
48  output << "\\begin{table}[H]\n";
49  output << "\\centering\n";
50  output << "\\resizebox{\\textwidth}{!}{\n";
51  // output << "\\begin{tabular}{|l||c|c|c|c|c||c|c|}\n";
52  output << "\\begin{tabular}{|l||c|c|c|c|c||c|}\n";
53  output << "\\hline \n";
54  // output << "\\multicolumn{1}{|c||}{} & \\multicolumn{5}{c||}{Number of interactions (\\% total)} & \\multicolumn{2}{c|}{Integrated} \\\\ \\hline \n \
55  // \\multicolumn{1}{|c||}{Cut} & $\\nu_{e}$ CC & $\\nu_{\\mu}$ CC & NC & Cosmic & Other bkg & Efficiency & Purity \\\\ \\hline \n";
56  output << "\\multicolumn{1}{|c||}{} & \\multicolumn{4}{c||}{Number of interactions (\\% total)} & \\multicolumn{2}{c|}{Integrated} \\\\ \\hline \n \
57  \\multicolumn{1}{|c||}{Cut} & $\\nu_{e}$ CC & $\\nu_{\\mu}$ CC & NC & Cosmic & Efficiency & Purity \\\\ \\hline \n";
58  }// printTableHeader
BEGIN_PROLOG sequence::SlidingWindowTriggerPatternsOppositeWindows END_PROLOG simSlidingORM6O6 effSlidingORW output
TH1 * ana::Profile ( const IExperiment *  expt,
osc::IOscCalcAdjustable calc,
const IFitVar *  v,
int  nbinsx,
double  minx,
double  maxx,
double  minchi = -1,
const std::vector< const IFitVar * > &  profVars = {},
const std::vector< const ISyst * > &  profSysts = {},
const std::map< const IFitVar *, std::vector< double >> &  seedPts = {},
const std::vector< SystShifts > &  systsSeedPts = {},
std::map< const IFitVar *, TGraph * > &  profVarsMap = empty_vars_map,
std::map< const ISyst *, TGraph * > &  systsMap = empty_syst_map 
)

$\chi^2$ scan in one variable, profiling over all others

Parameters
exptThe experiment to retrieve chisq values from
calcInitial values of all oscillation parameters
vScan over this variable
nbinsxBinning
minxBinning
maxxBinning
minchiSet non-default to force a chisq value to evaluate delta chisqs against. Useful for comparing two profiles. If set to zero it will not zero-adjust and the axis will be labelled without "delta"
profVarsProfile over these variables
profSystsProfile over these systematics
seedPtsSet each var to each of the values. Try all combinations. Beware of combinatorical explosion...
systSeedPtsIf non-empty, try fit starting at each of these
[out]profVarsMapPass empty map. Returns best values of each var.
[out]systsMapPass empty map. Returns best values of each syst.
Returns
The best fit delta chisq as a function of a

Definition at line 390 of file Fit.cxx.

400  {
401  Progress prog ("Filling profile");
402  // If we're called with the default arguments they could already have stuff
403  // in from before.
404  for(auto it: profVarsMap) delete it.second;
405  for(auto it: profSystsMap) delete it.second;
406  profVarsMap.clear();
407  profSystsMap.clear();
408 
409  // And then create the plots we'll be filling
410  for(const IFitVar* v: profVars) profVarsMap[v] = new TGraph;
411  for(const ISyst* s: profSysts) profSystsMap[s] = new TGraph;
412 
413  TH1* ret = new TH1F(UniqueName().c_str(),
414  (";"+v->LatexName()+ (input_minchi == 0? ";#chi^{2}" : ";#Delta#chi^{2}") ).c_str(),
415  nbinsx, minx, maxx);
416 
417  // Save the values of the fit vars as they were in the seed so we can put
418  // them back to that value every iteration.
419  std::vector<double> seedValues;
420  for(const IFitVar* v: profVars) seedValues.push_back(v->GetValue(calc));
421 
422  double minpos = 0;
423  double minchi = 1e10;
424 
425  Fitter fit(expt, profVars, profSysts);
426 
427  for(int n = 0; n < nbinsx; ++n){
428  prog.SetProgress((double) n/nbinsx);
429 
430  const double x = ret->GetXaxis()->GetBinCenter(n+1);
431  v->SetValue(calc, x);
432 
433  // Put oscillation values back to their seed position each iteration
434  for(unsigned int i = 0; i < seedValues.size(); ++i)
435  profVars[i]->SetValue( calc, seedValues[i] );
436 
437  SystShifts systshift = SystShifts::Nominal();
438  const double chi = fit.Fit(calc, systshift, seedPts, systSeedPts, Fitter::kQuiet);
439 
440  ret->Fill(x, chi);
441 
442  if(chi < minchi){
443  minchi = chi;
444  minpos = x;
445  }
446  for(const IFitVar* var: profVars){
447  profVarsMap[var]->SetPoint(n, x, var->GetValue(calc));
448  }
449  for(const ISyst* s: profSysts){
450  profSystsMap[s]->SetPoint(n, x, systshift.GetShift(s));
451  }
452  }
453  prog.Done();
454  // If we weren't given an explicit minimum chisq, go find one
455  if(input_minchi == -1){
456  std::vector<const IFitVar*> allVars = {v};
457  for(unsigned int i = 0; i < seedValues.size(); ++i) {
458  profVars[i]->SetValue(calc, seedValues[i]);
459  allVars.push_back(profVars[i]);
460  }
461  Fitter fit(expt, allVars, profSysts);
462  // Seed from best grid point
463  v->SetValue(calc, minpos);
464  minchi = fit.Fit(calc); // get a better value
465  }
466  else{
467  minchi = input_minchi;
468  }
469 
470  // Zero-subtract the result histogram
471  for(int n = 0; n < nbinsx; ++n) ret->AddBinContent(n+1, -minchi);
472 
473  return ret;
474  }
process_name opflash particleana ie x
then echo File list $list not found else cat $list while read file do echo $file sed s
Definition: file_to_url.sh:60
then echo ***************************************echo Variable FHICL_FILE_PATH not found echo You porbably haven t set up larsoft echo Try setup uboonecode vXX_XX_XX q e10
Definition: find_fhicl.sh:6
prog
Definition: just_cmake.sh:3
std::string UniqueName()
Return a different string each time, for creating histograms.
TH1 * ana::Profile ( const IExperiment *  expt,
osc::IOscCalcAdjustable calc,
const ISyst *  s,
int  nbinsx,
double  minx,
double  maxx,
double  input_minchi,
const std::vector< const IFitVar * > &  profVars,
const std::vector< const ISyst * > &  profSysts,
const std::map< const IFitVar *, std::vector< double >> &  seedPts,
const std::vector< SystShifts > &  systSeedPts,
std::map< const IFitVar *, TGraph * > &  profVarsMap,
std::map< const ISyst *, TGraph * > &  profSystsMap 
)

Definition at line 477 of file Fit.cxx.

487  {
488  Progress prog ("Filling profile");
489  // If we're called with the default arguments they could already have stuff
490  // in from before.
491  for(auto it: profVarsMap) delete it.second;
492  for(auto it: profSystsMap) delete it.second;
493  profVarsMap.clear();
494  profSystsMap.clear();
495 
496  // And then create the plots we'll be filling
497  for(const IFitVar* v: profVars) profVarsMap[v] = new TGraph;
498  for(const ISyst* prof_syst: profSysts) profSystsMap[prof_syst] = new TGraph;
499 
500  TH1* ret = new TH1F(UniqueName().c_str(),
501  (";"+s->LatexName()+ (input_minchi == 0? ";#chi^{2}" : ";#Delta#chi^{2}") ).c_str(),
502  nbinsx, minx, maxx);
503 
504  // Save the values of the fit vars as they were in the seed so we can put
505  // them back to that value every iteration.
506  std::vector<double> seedValues;
507  for(const IFitVar* v: profVars) seedValues.push_back(v->GetValue(calc));
508 
509  double minpos = 0;
510  double minchi = 1e10;
511 
512  Fitter fit(expt, profVars, profSysts);
513 
514  for(int n = 0; n < nbinsx; ++n){
515  prog.SetProgress((double) n/nbinsx);
516 
517  const double x = ret->GetXaxis()->GetBinCenter(n+1);
518  SystShifts systshift(s, x);
519 
520  // Put oscillation values back to their seed position each iteration
521  for(unsigned int i = 0; i < seedValues.size(); ++i)
522  profVars[i]->SetValue( calc, seedValues[i] );
523 
524  const double chi = fit.Fit(calc, systshift, seedPts, systSeedPts, Fitter::kQuiet);
525 
526  ret->Fill(x, chi);
527 
528  if(chi < minchi){
529  minchi = chi;
530  minpos = x;
531  }
532  for(const IFitVar* var: profVars){
533  profVarsMap[var]->SetPoint(n, x, var->GetValue(calc));
534  }
535  for(const ISyst* s: profSysts){
536  profSystsMap[s]->SetPoint(n, x, systshift.GetShift(s));
537  }
538  }
539  prog.Done();
540  // If we weren't given an explicit minimum chisq, go find one
541  if(input_minchi == -1){
542  std::vector<const ISyst*> allSysts = {s};
543  for(unsigned int i = 0; i < seedValues.size(); ++i) {
544  profVars[i]->SetValue(calc, seedValues[i]);
545  }
546  for(unsigned int i = 0; i < profSysts.size(); ++i) {
547  allSysts.push_back(profSysts[i]);
548  }
549  Fitter fit(expt, profVars, allSysts);
550  // Seed from best grid point
551  SystShifts systshift(s, minpos);
552  minchi = fit.Fit(calc, systshift); // get a better value
553  }
554  else{
555  minchi = input_minchi;
556  }
557 
558  // Zero-subtract the result histogram
559  for(int n = 0; n < nbinsx; ++n) ret->AddBinContent(n+1, -minchi);
560 
561  return ret;
562  }
process_name opflash particleana ie x
std::vector< const ISyst * > allSysts
Definition: toysysts.h:42
then echo File list $list not found else cat $list while read file do echo $file sed s
Definition: file_to_url.sh:60
then echo ***************************************echo Variable FHICL_FILE_PATH not found echo You porbably haven t set up larsoft echo Try setup uboonecode vXX_XX_XX q e10
Definition: find_fhicl.sh:6
prog
Definition: just_cmake.sh:3
std::string UniqueName()
Return a different string each time, for creating histograms.
TGraphAsymmErrors * ana::ProfileQuantile ( const TH2 *  hist,
const std::string &  axisName,
const std::string &  graphName,
const std::pair< double, double > &  quantileDivisions 
)

Calculate profile with error bars corresponding to specified quantiles of a 2D distribution (by default, 68% coverage)

Definition at line 728 of file Plots.cxx.

732  {
733  if (hist->GetDimension() != 2)
734  throw std::runtime_error(Form("Can't profile a histogram with other than 2 dimensions. Yours is a %d-D histogram...", hist->GetDimension()));
735 
736  const TAxis * axis = nullptr;
737  std::function<TH1D*(const char *, Int_t, Int_t, Option_t*)> projectionMethod;
738  if (axisName == "x" || axisName == "X")
739  {
740  axis = hist->GetXaxis();
741  projectionMethod = std::bind(&TH2::ProjectionY, hist, std::placeholders::_1, std::placeholders::_2, std::placeholders::_3, std::placeholders::_4);
742  }
743  else if (axisName == "y" || axisName == "Y")
744  {
745  axis = hist->GetYaxis();
746  projectionMethod = std::bind(&TH2::ProjectionX, hist, std::placeholders::_1, std::placeholders::_2, std::placeholders::_3, std::placeholders::_4);
747  }
748  else
749  throw std::runtime_error( Form("Can't profile onto unknown axis: '%s'", axisName.c_str()) );
750 
751 
752  std::vector<double> points_x, points_y, errors_x_low, errors_x_high, errors_y_low, errors_y_high;
753 
754  double quantiles[2] = {0, 0};
755  double _quantileDivisions[2] = {quantileDivisions.first, quantileDivisions.second};
756  for (int binNum = 1; binNum <= axis->GetNbins(); binNum++) // remember, 0 is underflow and Nbins+1 is overflow...
757  {
758  std::unique_ptr<TH1D> proj ( projectionMethod(Form("%s_tmp_%d", hist->GetName(), int(std::time(nullptr))), binNum, binNum, "") ); // randomish name, just to be safe
759 
760  double y = proj->GetMean();
761  points_x.push_back(axis->GetBinCenter(binNum));
762  points_y.push_back(y);
763 
764  // for now, make the errors for an empty projection 0
765  unsigned int n_qs = 0;
766  if (proj->Integral() == 0)
767  {
768  n_qs = 2;
769  quantiles[0] = quantiles[1] = 0;
770  }
771  else
772  n_qs = proj->GetQuantiles(2, quantiles, _quantileDivisions);
773  if (n_qs != 2)
774  throw std::runtime_error( Form("GetQuantiles() didn't compute all the quantiles in HistoTools.ProfileQuantile(). I requested 2 quantiles, but got %d of them...", n_qs) );
775 
776  double binWidth = axis->GetBinWidth(binNum);
777  errors_x_low.push_back(binWidth/2.);
778  errors_x_high.push_back(binWidth/2.);
779  errors_y_low.push_back(y-quantiles[0]);
780  errors_y_high.push_back(quantiles[1]-y);
781  }
782 
783  TGraphAsymmErrors * outGraph = new TGraphAsymmErrors(
784  points_x.size(),
785  &points_x[0],
786  &points_y[0],
787  &errors_x_low[0],
788  &errors_x_high[0],
789  &errors_y_low[0],
790  &errors_y_high[0]
791  );
792  std::string name = (graphName.size()) ? graphName : Form("%s_quantile_errors", hist->GetName());
793  outGraph->SetName(name.c_str());
794 
795  return outGraph;
796 
797  }
void ProjectionY(TH2D *from, TH1D *to)
Helper for WeightingVariable.
process_name opflash particleana ie ie y
void ProjectionX(TH2D *from, TH1D *to)
Helper for Unweighted.
then echo fcl name
void ana::ProjectionX ( TH2D *  from,
TH1D *  to 
)

Helper for Unweighted.

Definition at line 255 of file ReweightableSpectrum.cxx.

256  {
257  const int Nx = from->GetNbinsX();
258  const int Ny = from->GetNbinsY();
259 
260  // Direct access to the bins is faster
261  double* fromArr = from->GetArray();
262  double* toArr = to->GetArray();
263 
264  int fromBin = 0;
265  for(int y = 0; y < Ny+2; ++y){
266  for(int x = 0; x < Nx+2; ++x){
267  // Our loops go over the bins in the order they are internally in
268  // 'from', and we do overflows, so we keep up exactly. If you get
269  // paranoid, reenable this briefly.
270  // assert(fromBin == from->GetBin(x, y));
271 
272  const double z = fromArr[fromBin];
273  ++fromBin;
274 
275  toArr[x] += z;
276  }
277  }
278  }
process_name opflash particleana ie ie ie z
process_name opflash particleana ie x
process_name opflash particleana ie ie y
void ana::ProjectionY ( TH2D *  from,
TH1D *  to 
)

Helper for WeightingVariable.

Definition at line 294 of file ReweightableSpectrum.cxx.

295  {
296  const int Nx = from->GetNbinsX();
297  const int Ny = from->GetNbinsY();
298 
299  // Direct access to the bins is faster
300  double* fromArr = from->GetArray();
301  double* toArr = to->GetArray();
302 
303  int fromBin = 0;
304  for(int y = 0; y < Ny+2; ++y){
305  for(int x = 0; x < Nx+2; ++x){
306  // Our loops go over the bins in the order they are internally in
307  // 'from', and we do overflows, so we keep up exactly. If you get
308  // paranoid, reenable this briefly.
309  // assert(fromBin == from->GetBin(x, y));
310 
311  const double z = fromArr[fromBin];
312  ++fromBin;
313 
314  toArr[y] += z;
315  }
316  }
317  }
process_name opflash particleana ie ie ie z
process_name opflash particleana ie x
process_name opflash particleana ie ie y
void ana::RatioPlot ( const Spectrum &  data,
const Spectrum &  expected,
const Spectrum &  fit,
double  miny,
double  maxy 
)

Plot data/expected, compared with fit/expected.

Definition at line 348 of file Plots.cxx.

352  {
353  Ratio fitRatio(fit, expected);
354  Ratio dataRatio(data, expected);
355 
356  TH1* h = fitRatio.ToTH1();
357  h->GetYaxis()->SetTitle("Ratio to expectation");
358  h->GetYaxis()->SetRangeUser(miny, maxy);
359  h->SetLineColor(kTotalMCColor);
360  h->Draw("][");
361 
362  h = dataRatio.ToTH1();
363  h->SetMarkerStyle(kFullCircle);
364  h->Draw("ep same");
365 
366  TLine* one = new TLine(h->GetXaxis()->GetXmin(), 1,
367  h->GetXaxis()->GetXmax(), 1);
368  one->SetLineWidth(2);
369  one->SetLineStyle(7);
370  one->Draw();
371 
372  gPad->Update();
373  }
while getopts h
then echo Cowardly refusing to create a new FHiCL file with the same name as the original one('${SourceName}')." >&2 exit 1 fi echo "'$
const Color_t kTotalMCColor
void ana::ResetOscCalcToDefault ( osc::IOscCalcAdjustable calc)

Reset calc to default assumptions for all parameters.

Definition at line 12 of file Calcs.cxx.

13  {
14  // Default to ICARUS
15  calc->SetL(0.6);
16 
17  // TODO: get good reference from Alex and Joao
18  calc->SetRho(2.84); // g/cm^3
19 
20  // PDG: http://pdg.lbl.gov/2014/tables/rpp2014-sum-leptons.pdf
21  calc->SetDmsq21(7.53e-5);
22  calc->SetTh12(asin(sqrt(.846))/2);
23 
24  // Picking anything other than maximal mixing opens a can of worms
25  calc->SetTh23(M_PI/4);
26 
27  // NH from PDG2014 + 2015 update
28  //http://pdg.lbl.gov/2015/tables/rpp2015-sum-leptons.pdf
29  calc->SetDmsq32(2.44e-3); // NB: this is normal hierarchy
30 
31  // Reactor average from PDG2014 + 2015 update
32  calc->SetTh13(asin(sqrt(.085))/2);
33 
34  // Going to have to plot for nue analysis anyway
35  calc->SetdCP(0);
36  }
do i e
void ana::ResetOscCalcToDefaultIH ( osc::IOscCalcAdjustable calc)

Definition at line 47 of file Calcs.cxx.

48  {
49  //Share most defaults
51  // IH from PDG2014 + 2015 update
52  // http://pdg.lbl.gov/2015/tables/rpp2015-sum-leptons.pdf
53  calc->SetDmsq32(-2.49e-3);
54 
55  }
void ResetOscCalcToDefault(osc::IOscCalcAdjustable *calc)
Reset calc to default assumptions for all parameters.
Definition: Calcs.cxx:12
do i e
void ana::ResetSterileCalcToDefault ( osc::OscCalcSterile *  calc)

Reset calc to default assumptions for all parameters.

Definition at line 66 of file Calcs.cxx.

67  {
68  osc::OscCalcPMNSOpt* tmp = new osc::OscCalcPMNSOpt();
70 
71  calc->SetL(tmp->GetL());
72  calc->SetRho(tmp->GetRho());
73 
74  calc->SetDm(2, tmp->GetDmsq21());
75  calc->SetDm(3, tmp->GetDmsq21() + tmp->GetDmsq32());
76 
77  calc->SetAngle(1, 2, tmp->GetTh12());
78  calc->SetAngle(1, 3, tmp->GetTh13());
79  calc->SetAngle(2, 3, tmp->GetTh23());
80 
81  calc->SetDelta(1, 3, tmp->GetdCP());
82 
83  delete tmp;
84  }
void ResetOscCalcToDefault(osc::IOscCalcAdjustable *calc)
Reset calc to default assumptions for all parameters.
Definition: Calcs.cxx:12
bool ana::RunningOnGrid ( )

Definition at line 697 of file sbnana/sbnana/CAFAna/Core/Utilities.cxx.

698  {
699  static bool cache;
700  static bool cache_set = false;
701  if(!cache_set){
702  cache = (getenv("_CONDOR_SCRATCH_DIR") != 0);
703  cache_set = true;
704  }
705 
706  return cache;
707  }
std::string ana::SAMExperiment ( )

$SAM_EXPERIMENT or a nice error message and abort

Definition at line 105 of file sbnana/sbnana/CAFAna/Core/Utilities.cxx.

106  {
107  const char* ret = getenv("SAM_EXPERIMENT");
108 
109  if(!ret){
110  std::cout << "\nERROR: Environment variable $SAM_EXPERIMENT not set.\nThis is required for various ifdh/sam functionality.\nYou likely want it to be set to 'sbn', though it should have been set automatically by setup scripts." << std::endl;
111  exit(1);
112  }
113 
114  return ret;
115  }
BEGIN_PROLOG could also be cout
template<class T >
void ana::SaveTo ( const T &  x,
TDirectory *  dir 
)

Definition at line 52 of file LoadFromFile.h.

53  {
54  x.SaveTo(dir);
55  }
process_name opflash particleana ie x
tuple dir
Definition: dropbox.py:28
template<>
void ana::SaveTo ( const osc::IOscCalc x,
TDirectory *  dir 
)

Definition at line 91 of file LoadFromFile.cxx.

92  {
93  TDirectory* tmp = gDirectory;
94 
95  dir->cd();
96 
97  if(dynamic_cast<const osc::NoOscillations*>(&x)){
98  TObjString("NoOscillations").Write("type");
99  tmp->cd();
100  return;
101  }
102 
103  if(dynamic_cast<const osc::OscCalcDumb*>(&x)){
104  TObjString("OscCalculatorDumb").Write("type");
105  tmp->cd();
106  return;
107  }
108 
109  const OscCalcSterileApproxAdjustable* approx = dynamic_cast<const OscCalcSterileApproxAdjustable*>(&x);
110  if(approx){
111  TObjString("OscCalcSterileApprox").Write("type");
112  TVectorD params(4);
113  params[0] = approx->calc.GetDmsq();
114  params[1] = approx->calc.GetSinSq2ThetaMuMu();
115  params[2] = approx->calc.GetSinSq2ThetaMuE();
116  params[3] = approx->calc.GetL();
117  params.Write("params");
118  tmp->cd();
119  return;
120  }
121 
122  const osc::IOscCalcAdjustable* y = dynamic_cast<const osc::IOscCalcAdjustable*>(&x);
123  if(!y){
124  std::cout << "Unknown calculator in SaveTo " << typeid(x).name() << std::endl;
125  abort();
126  }
127 
128  const osc::OscCalcSterile* tmpSterile = dynamic_cast<const osc::OscCalcSterile*>(&x);
129  if(tmpSterile) {
130  TObjString("OscCalculatorSterile").Write("type");
131  std::vector<double> state = tmpSterile->GetState();
132  TVectorD params(state.size());
133  for (unsigned int i = 0; i < state.size(); ++i) params[i] = state[i];
134  params.Write("params");
135  tmp->cd();
136  return;
137  }
138 
139  //for the implementation of OscCalcPMNS_NSI
140  const osc::OscCalcPMNS_NSI* tmpNSI = dynamic_cast<const osc::OscCalcPMNS_NSI*>(&x);
141  if(tmpNSI) {
142  TObjString("OscCalcPMNS_NSI").Write("type");
143  std::vector<double> state = tmpNSI->GetState();
144  TVectorD params(state.size());
145  for (unsigned int i = 0; i < state.size(); ++i) params[i] = state[i];
146  params.Write("params");
147  tmp->cd();
148  return;
149  }
150 
151  /* */if(dynamic_cast<const osc::OscCalc*>(&x)) TObjString("OscCalculatorPMNS").Write("type");
152  else if(dynamic_cast<const osc::OscCalcGeneral*>(&x)) TObjString("OscCalculatorGeneral").Write("type");
153  else if(dynamic_cast<const osc::OscCalcPMNS*>(&x)) TObjString("OscCalculatorPMNS").Write("type");
154  else if(dynamic_cast<const osc::OscCalcPMNSOpt*>(&x)) TObjString("OscCalculatorPMNSOpt").Write("type");
155  else{
156  std::cout << "Unimplemented calculator in SaveTo " << typeid(x).name() << std::endl;
157  abort();
158  }
159 
160  TVectorD params(8);
161 
162  params[0] = y->GetL();
163  params[1] = y->GetRho();
164  params[2] = y->GetDmsq21();
165  params[3] = y->GetDmsq32();
166  params[4] = y->GetTh12();
167  params[5] = y->GetTh13();
168  params[6] = y->GetTh23();
169  params[7] = y->GetdCP();
170 
171  params.Write("params");
172 
173  tmp->cd();
174  }
process_name opflash particleana ie x
process_name opflash particleana ie ie y
tuple dir
Definition: dropbox.py:28
then echo fcl name
BEGIN_PROLOG could also be cout
template<class T >
void ana::SaveToFile ( const T &  x,
const std::string &  fname,
const std::string &  label 
)

Definition at line 75 of file LoadFromFile.h.

78  {
79  TFile fout(fname.c_str(), "RECREATE");
80  x.SaveTo(fout.mkdir(label.c_str()));
81  }
string fname
Definition: demo.py:5
process_name opflash particleana ie x
Var ana::Scaled ( const Var &  v,
double  s 
)

Use to rescale another variable.

Definition at line 159 of file Var.cxx.

160  {
161  return Var([v, s](const caf::SRSliceProxy* sr){return s*v(sr);});
162  }
caf::Proxy< caf::SRSlice > SRSliceProxy
Definition: EpilogFwd.h:2
_Var< caf::SRSliceProxy > Var
Representation of a variable to be retrieved from a caf::StandardRecord object.
Definition: Var.h:73
then echo File list $list not found else cat $list while read file do echo $file sed s
Definition: file_to_url.sh:60
TGraph * ana::ShadeBetweenHistograms ( TH1 *  hmin,
TH1 *  hmax 
)

Gives a TGraph with the area between two histograms. Do Draw("f") to draw this area. By default it has a lighter version of the colour of hmin

Definition at line 704 of file Plots.cxx.

705  {
706  int n = hmin->GetNbinsX();
707  TGraph* gr = new TGraph(4*n);
708 
709  for(int i=1; i<=n; i++)
710  {
711  double xdown = hmax->GetBinLowEdge(i);
712  double xup = hmax->GetBinLowEdge(i+1);
713  double ydown = hmin->GetBinContent(i);
714  double yup = hmax->GetBinContent(i);
715 
716  gr->SetPoint(2*(i-1), xdown, ydown);
717  gr->SetPoint(2*(i-1)+1, xup, ydown);
718  gr->SetPoint(4*n-2*i, xup, yup);
719  gr->SetPoint(4*n-2*i+1, xdown, yup);
720  }
721 
722  gr->SetFillColor(hmin->GetLineColor() - 9); // In principle this is lighter
723  gr->SetLineColor(hmin->GetLineColor() - 9); // In case one does Draw("lf")
724 
725  return gr;
726  }
double ana::Si ( double  x)

Definition at line 138 of file OscCalcSterileApprox.cxx.

139  {
140  if(isinf(x)) return TMath::Pi()/2;
141  return ROOT::Math::sinint(x);
142  }
process_name opflash particleana ie x
double ana::SimpleFOM ( const Spectrum &  obs,
const Spectrum &  unosc,
double  pot = 0 
)

Figure-of-merit with no systematics, for binned data.

Parameters
obsThe observed data
unoscA spectrum representing the null hypothesis
potPOT to scale to. Leave at default to adopt POT from obs
Returns
Sum in quadrature over the bins

\[ \sqrt{\sum_i^{\rm bins}\left({s_i\over\sqrt{s_i+b_i}}\right)^2} \]

Definition at line 28 of file Fit.cxx.

29  {
30  if(pot == 0) pot = obs.POT();
31 
32  std::unique_ptr<TH1> oh(obs.ToTH1(pot));
33  std::unique_ptr<TH1> bh(unosc.ToTH1(pot));
34  assert(oh->GetNbinsX() == bh->GetNbinsX());
35 
36  double fomSq = 0;
37 
38  // Combine s/sqrt(s+b) in quadrature between bins
39  for(int i = 0; i < oh->GetNbinsX(); ++i){
40  const double o = oh->GetBinContent(i);
41  const double b = bh->GetBinContent(i);
42  const double s = o-b;
43 
44  if(s <= 0) continue;
45 
46  fomSq += util::sqr(s)/(s+b);
47  }
48 
49  return sqrt(fomSq);
50  }
T sqr(T x)
More efficient square function than pow(x,2)
Definition: MathUtil.h:23
then echo File list $list not found else cat $list while read file do echo $file sed s
Definition: file_to_url.sh:60
TH1 * ana::Slice ( const IExperiment *  expt,
osc::IOscCalcAdjustable calc,
const IFitVar *  v,
int  nbinsx,
double  minx,
double  maxx,
double  minchi 
)

$\chi^2$ scan in one variable, holding all others constant

Definition at line 611 of file Fit.cxx.

615  {
616  return Profile(expt, calc, v, nbinsx, minx, maxx, minchi);
617  }
TH1 * Profile(const IExperiment *expt, osc::IOscCalcAdjustable *calc, const IFitVar *v, int nbinsx, double minx, double maxx, double input_minchi, const std::vector< const IFitVar * > &profVars, const std::vector< const ISyst * > &profSysts, const std::map< const IFitVar *, std::vector< double >> &seedPts, const std::vector< SystShifts > &systSeedPts, std::map< const IFitVar *, TGraph * > &profVarsMap, std::map< const ISyst *, TGraph * > &profSystsMap)
scan in one variable, profiling over all others
Definition: Fit.cxx:390
TH1 * ana::Slice ( const IExperiment *  expt,
osc::IOscCalcAdjustable calc,
const ISyst *  s,
int  nbinsx,
double  minx,
double  maxx,
double  minchi 
)

Definition at line 620 of file Fit.cxx.

624  {
625  return Profile(expt, calc, s, nbinsx, minx, maxx, minchi);
626  }
TH1 * Profile(const IExperiment *expt, osc::IOscCalcAdjustable *calc, const IFitVar *v, int nbinsx, double minx, double maxx, double input_minchi, const std::vector< const IFitVar * > &profVars, const std::vector< const ISyst * > &profSysts, const std::map< const IFitVar *, std::vector< double >> &seedPts, const std::vector< SystShifts > &systSeedPts, std::map< const IFitVar *, TGraph * > &profVarsMap, std::map< const ISyst *, TGraph * > &profSystsMap)
scan in one variable, profiling over all others
Definition: Fit.cxx:390
then echo File list $list not found else cat $list while read file do echo $file sed s
Definition: file_to_url.sh:60
void ana::SplitCanvas2 ( TCanvas *&  c1,
TPad *&  pad1,
TPad *&  pad2 
)

Definition at line 83 of file tools_nuesel_icarus.h.

83  {
84 
85  c1 = new TCanvas("c1","",700,800);
86  c1->cd();
87 
88  pad1 = new TPad("pad1","pad1",0,0,1,1);
89  pad1->SetTopMargin(0.1);
90  pad1->SetBottomMargin(0.4);
91  pad1->SetLeftMargin(0.12);
92  pad1->SetRightMargin(0.03);
93  pad1->SetFillStyle(0);
94  pad1->Draw();
95  c1->cd();
96 
97  pad2 = new TPad("pad2","pad2",0,0,1,1);// x1 y1 x2 y2
98  pad2->SetTopMargin(0.6);
99  pad2->SetBottomMargin(0.1);
100  pad2->SetLeftMargin(0.12);
101  pad2->SetRightMargin(0.03);
102  pad2->SetFillStyle(0);
103  pad2->Draw();
104  c1->cd();
105 
106  }
Var ana::Sqrt ( const Var &  v)

Use to take sqrt of a var.

Definition at line 172 of file Var.cxx.

173  {
174  return Var([v](const caf::SRSliceProxy* sr){return sqrt(v(sr));});
175  }
caf::Proxy< caf::SRSlice > SRSliceProxy
Definition: EpilogFwd.h:2
_Var< caf::SRSliceProxy > Var
Representation of a variable to be retrieved from a caf::StandardRecord object.
Definition: Var.h:73
TH1 * ana::SqrtProfile ( const IExperiment *  expt,
osc::IOscCalcAdjustable calc,
const IFitVar *  v,
int  nbinsx,
double  minx,
double  maxx,
double  minchi,
std::vector< const IFitVar * >  profVars,
std::vector< const ISyst * >  profSysts,
const std::map< const IFitVar *, std::vector< double >> &  seedPts,
const std::vector< SystShifts > &  systSeedPts,
std::map< const IFitVar *, TGraph * > &  profVarsMap,
std::map< const ISyst *, TGraph * > &  systsMap 
)

Forward to Profile but sqrt the result for a crude significance.

Definition at line 565 of file Fit.cxx.

574  {
575  TH1* ret = Profile(expt, calc,
576  v, nbinsx, minx, maxx,
577  minchi, profVars, profSysts, seedPts, systSeedPts,
578  profVarsMap, systsMap);
579  for(int n = 0; n < ret->GetNbinsX()+2; ++n){
580  const double v = ret->GetBinContent(n);
581  ret->SetBinContent(n, v > 0 ? sqrt(v) : 0);
582  }
583  ret->GetYaxis()->SetTitle("#sigma");
584  return ret;
585  }
TH1 * Profile(const IExperiment *expt, osc::IOscCalcAdjustable *calc, const IFitVar *v, int nbinsx, double minx, double maxx, double input_minchi, const std::vector< const IFitVar * > &profVars, const std::vector< const ISyst * > &profSysts, const std::map< const IFitVar *, std::vector< double >> &seedPts, const std::vector< SystShifts > &systSeedPts, std::map< const IFitVar *, TGraph * > &profVarsMap, std::map< const ISyst *, TGraph * > &profSystsMap)
scan in one variable, profiling over all others
Definition: Fit.cxx:390
TH1 * ana::SqrtProfile ( const IExperiment *  expt,
osc::IOscCalcAdjustable calc,
const ISyst *  s,
int  nbinsx,
double  minx,
double  maxx,
double  minchi,
std::vector< const IFitVar * >  profVars,
std::vector< const ISyst * >  profSysts,
const std::map< const IFitVar *, std::vector< double >> &  seedPts,
const std::vector< SystShifts > &  systSeedPts,
std::map< const IFitVar *, TGraph * > &  profVarsMap,
std::map< const ISyst *, TGraph * > &  systsMap 
)

Definition at line 588 of file Fit.cxx.

597  {
598  TH1* ret = Profile(expt, calc,
599  s, nbinsx, minx, maxx,
600  minchi, profVars, profSysts, seedPts, systSeedPts,
601  profVarsMap, systsMap);
602  for(int n = 0; n < ret->GetNbinsX()+2; ++n){
603  const double v = ret->GetBinContent(n);
604  ret->SetBinContent(n, v > 0 ? sqrt(v) : 0);
605  }
606  ret->GetYaxis()->SetTitle("#sigma");
607  return ret;
608  }
TH1 * Profile(const IExperiment *expt, osc::IOscCalcAdjustable *calc, const IFitVar *v, int nbinsx, double minx, double maxx, double input_minchi, const std::vector< const IFitVar * > &profVars, const std::vector< const ISyst * > &profSysts, const std::map< const IFitVar *, std::vector< double >> &seedPts, const std::vector< SystShifts > &systSeedPts, std::map< const IFitVar *, TGraph * > &profVarsMap, std::map< const ISyst *, TGraph * > &profSystsMap)
scan in one variable, profiling over all others
Definition: Fit.cxx:390
then echo File list $list not found else cat $list while read file do echo $file sed s
Definition: file_to_url.sh:60
TH1 * ana::SqrtSlice ( const IExperiment *  expt,
osc::IOscCalcAdjustable calc,
const IFitVar *  v,
int  nbinsx,
double  minx,
double  maxx,
double  minchi 
)

Forward to Slice but sqrt the result for a crude significance.

Definition at line 629 of file Fit.cxx.

632  {
633  TH1* ret = Slice(expt, calc, v, nbinsx, minx, maxx, minchi);
634  for(int n = 0; n < ret->GetNbinsX()+2; ++n){
635  const double v = ret->GetBinContent(n);
636  ret->SetBinContent(n, v > 0 ? sqrt(v) : 0);
637  }
638  ret->GetYaxis()->SetTitle("#sigma");
639  return ret;
640  }
SlicingAlgorithm::Slice Slice
TH1 * ana::SqrtSlice ( const IExperiment *  expt,
osc::IOscCalcAdjustable calc,
const ISyst *  s,
int  nbinsx,
double  minx,
double  maxx,
double  minchi 
)

Definition at line 643 of file Fit.cxx.

646  {
647  TH1* ret = Slice(expt, calc, s, nbinsx, minx, maxx, minchi);
648  for(int n = 0; n < ret->GetNbinsX()+2; ++n){
649  const double v = ret->GetBinContent(n);
650  ret->SetBinContent(n, v > 0 ? sqrt(v) : 0);
651  }
652  ret->GetYaxis()->SetTitle("#sigma");
653  return ret;
654  }
SlicingAlgorithm::Slice Slice
then echo File list $list not found else cat $list while read file do echo $file sed s
Definition: file_to_url.sh:60
size_t ana::Stride ( bool  allow_default)

Definition at line 710 of file sbnana/sbnana/CAFAna/Core/Utilities.cxx.

711  {
712  static int cache = -1;
713 
714  if(cache < 0){
715  char* env = getenv("CAFANA_STRIDE");
716  if(env){
717  cache = std::atoi(env);
718  }
719  else{
720  if(allow_default){
721  cache = 1;
722  }
723  else{
724  std::cout << "Stride() called, but CAFANA_STRIDE is not set (--stride not passed?)" << std::endl;
725  abort();
726  }
727  }
728  }
729 
730  return cache;
731  }
BEGIN_PROLOG could also be cout
std::unique_ptr<TMatrixD> ana::SymmMxInverse ( const TMatrixD &  mx)

Definition at line 279 of file sbnana/sbnana/CAFAna/Core/Utilities.cxx.

280  {
281  // check if there are any null rows/columns.
282  // if there are, they make the matrix singular.
283  // we will remove them temporarily,
284  // invert the matrix, then put them back afterwards.
285  std::set<int> nullRows;
286  for (auto row = mx.GetRowLwb(); row <= mx.GetRowUpb(); row++)
287  {
288  bool rowIsNull = true;
289  for (auto col = mx.GetColLwb(); col <= mx.GetColUpb(); col++)
290  {
291  if (mx[row][col] != 0.)
292  {
293  rowIsNull = false;
294  break;
295  }
296  }
297 
298  if (rowIsNull)
299  nullRows.insert(row);
300  }
301 
302  std::cerr << " Notice: covariance matrix '" << mx.GetName() << "' has " << nullRows.size() << " null rows.\n"
303  << "They will be removed before inverting and added back afterwards." << std::endl;
304 
305  // create a new matrix for inverting, skipping the null rows
306  auto invMx = std::make_unique<TMatrixD>(mx.GetRowLwb(), mx.GetRowUpb() - nullRows.size(),
307  mx.GetColLwb(), mx.GetColUpb() - nullRows.size());
308  unsigned int skippedRows = 0;
309  for (auto row = mx.GetRowLwb(); row <= mx.GetRowUpb(); row++)
310  {
311  if (nullRows.find(row) != nullRows.end())
312  {
313  skippedRows++;
314  continue;
315  }
316  unsigned int skippedCols = 0;
317  for (auto col = mx.GetColLwb(); col <= mx.GetColUpb(); col++)
318  {
319  // since we assumed the matrix is symmetric,
320  // we can just use the null rows list here
321  if (nullRows.find(col) != nullRows.end())
322  {
323  skippedCols++;
324  continue;
325  }
326 
327  (*invMx)[col-skippedCols][row-skippedRows] = (*invMx)[row-skippedRows][col-skippedCols] = mx[row][col];
328  }
329  }
330 
331  invMx->Invert();
332 
333  // put back the empty rows if there were any
334  if (nullRows.size())
335  {
336  skippedRows = 0;
337  auto retMx = std::make_unique<TMatrixD>(mx.GetRowLwb(), mx.GetRowUpb(),
338  mx.GetColLwb(), mx.GetColUpb());
339  for (auto row = mx.GetRowLwb(); row <= mx.GetRowUpb(); row++)
340  {
341  if (nullRows.find(row) != nullRows.end())
342  {
343  skippedRows++;
344  continue;
345  }
346 
347  unsigned int skippedCols = skippedRows;
348  for (auto col = row; col <= mx.GetColUpb(); col++)
349  {
350  if (nullRows.find(col) != nullRows.end())
351  {
352  skippedCols++;
353  continue;
354  }
355 
356  (*retMx)[col][row] = (*retMx)[row][col] = (*invMx)[row-skippedRows][col-skippedCols];
357  }
358  }
359 
360  return retMx;
361  }
362 
363  return invMx;
364  }
BEGIN_PROLOG could also be cerr
TString ana::thisCellColor ( double  weird)

Definition at line 26 of file tools_nuesel_icarus.h.

26  {
27  TString mystring = "";
28  double thisval = abs(weird);
29  if( thisval>=0.05 && thisval<0.10) mystring = "\\cellcolor{green!25}";
30  else if( thisval>=0.10 && thisval<0.15) mystring = "\\cellcolor{yellow!25}";
31  else if( thisval>=0.15) mystring = "\\cellcolor{red!25}";
32  return mystring;
33  }
T abs(T value)
osc::IOscCalcAdjustable * ana::ThrownNuFitOscCalc ( int  hie,
std::vector< const IFitVar * >  oscVars 
)

Definition at line 45 of file CalcsNuFit.cxx.

46  {
47  assert(hie == +1 || hie == -1);
48 
49  osc::IOscCalcAdjustable* ret = NuFitOscCalc(hie);//new osc::OscCalcPMNSOpt;
50 
51  // Throw 12 and rho within errors
52  if (HasVar(oscVars, kFitRho.ShortName()))
53  ret->SetRho(kEarthDensity*(1+0.02*gRandom->Gaus()));
54 
55  if (HasVar(oscVars, kFitDmSq21.ShortName()))
56  ret->SetDmsq21(kNuFitDmsq21CV*(1+kNuFitDmsq21Err*gRandom->Gaus()));
57 
58  if (HasVar(oscVars, kFitSinSq2Theta12.ShortName()))
59  ret->SetTh12(kNuFitTh12CV*(1+kNuFitTh12Err*gRandom->Gaus()));
60 
61  // Uniform throws within +/-3 sigma
62  if(hie > 0){
63  if (HasVar(oscVars, kFitDmSq32Scaled.ShortName()))
64  ret->SetDmsq32(gRandom->Uniform(kNuFitDmsq32CVNH-3*kNuFitDmsq32ErrNH,
66 
67  if (HasVar(oscVars, kFitSinSqTheta23.ShortName()))
68  ret->SetTh23(gRandom->Uniform(kNuFitTh23CVNH-3*kNuFitTh23ErrNH,
70 
71  if (HasVar(oscVars, kFitTheta13.ShortName()))
72  ret->SetTh13(gRandom->Uniform(kNuFitTh13CVNH-3*kNuFitTh13ErrNH,
74 
75  if (HasVar(oscVars, kFitDeltaInPiUnits.ShortName()))
76  ret->SetdCP(gRandom->Uniform(-1*TMath::Pi(), TMath::Pi()));
77 
78  } else {
79  if (HasVar(oscVars, kFitDmSq32Scaled.ShortName()))
80  ret->SetDmsq32(gRandom->Uniform(kNuFitDmsq32CVIH-3*kNuFitDmsq32ErrIH,
82 
83  if (HasVar(oscVars, kFitSinSqTheta23.ShortName()))
84  ret->SetTh23(gRandom->Uniform(kNuFitTh23CVIH-3*kNuFitTh23ErrIH,
86 
87  if (HasVar(oscVars, kFitTheta13.ShortName()))
88  ret->SetTh13(gRandom->Uniform(kNuFitTh13CVIH-3*kNuFitTh13ErrIH,
90 
91  if (HasVar(oscVars, kFitDeltaInPiUnits.ShortName()))
92  ret->SetdCP(gRandom->Uniform(-1*TMath::Pi(), TMath::Pi()));
93  }
94  return ret;
95  }
const FitSinSq2Theta12 kFitSinSq2Theta12
Definition: FitVars.h:179
const FitTheta13 kFitTheta13
Definition: FitVars.h:20
const double kNuFitDmsq32ErrNH
Definition: CalcsNuFit.h:32
const double kNuFitTh23ErrIH
Definition: CalcsNuFit.h:37
virtual std::string ShortName() const
Definition: FitVars.h:171
const double kNuFitDmsq32ErrIH
Definition: CalcsNuFit.h:36
virtual std::string ShortName() const
Definition: FitVars.h:207
virtual std::string ShortName() const
Definition: FitVars.h:76
virtual std::string ShortName() const
Definition: FitVars.h:48
const double kNuFitTh12Err
Definition: CalcsNuFit.h:30
virtual std::string ShortName() const
Definition: FitVars.h:15
const FitDmSq21 kFitDmSq21
Definition: FitVars.h:199
virtual std::string ShortName() const
Definition: FitVars.h:189
const double kNuFitDmsq32CVIH
Definition: CalcsNuFit.h:23
virtual std::string ShortName() const
Definition: FitVars.h:133
const double kNuFitTh23CVIH
Definition: CalcsNuFit.h:24
const double kEarthDensity
Definition: CalcsNuFit.h:42
const double kNuFitTh23CVNH
Definition: CalcsNuFit.h:19
const double kNuFitTh13ErrIH
Definition: CalcsNuFit.h:38
const double kNuFitDmsq21Err
Definition: CalcsNuFit.h:29
const double kNuFitDmsq21CV
Definition: CalcsNuFit.h:14
const FitDmSq32Scaled kFitDmSq32Scaled
Definition: FitVars.h:143
const double kNuFitTh13CVIH
Definition: CalcsNuFit.h:25
const double kNuFitDmsq32CVNH
Definition: CalcsNuFit.h:18
const FitSinSqTheta23 kFitSinSqTheta23
Definition: FitVars.h:84
const double kNuFitTh23ErrNH
Definition: CalcsNuFit.h:33
const double kNuFitTh13ErrNH
Definition: CalcsNuFit.h:34
osc::IOscCalcAdjustable * NuFitOscCalc(int hie)
Definition: CalcsNuFit.cxx:12
const FitDeltaInPiUnits kFitDeltaInPiUnits
Definition: FitVars.h:53
bool HasVar(std::vector< const IFitVar * > oscVars, std::string name)
Definition: CalcsNuFit.cxx:39
const FitRho kFitRho
Definition: FitVars.h:217
const double kNuFitTh12CV
Definition: CalcsNuFit.h:15
const double kNuFitTh13CVNH
Definition: CalcsNuFit.h:20
osc::IOscCalcAdjustable * ana::ThrownNuFitOscCalcCDR ( int  hie)

Definition at line 38 of file CalcsNuFit_cdr.cxx.

39  {
40  assert(hie == +1 || hie == -1);
41 
42  osc::IOscCalcAdjustable* ret = new osc::OscCalcPMNSOpt;
43  ret->SetL(1300);
44 
45  // Throw 12 and rho within errors
46  ret->SetRho(2.95674*(1+0.02*gRandom->Gaus()));
47  ret->SetDmsq21(kNuFitDmsq21CV*(1+kNuFitDmsq21Err*gRandom->Gaus()));
48  ret->SetTh12(kNuFitTh12CV*(1+kNuFitTh12Err*gRandom->Gaus()));
49 
50  // Uniform throws within +/-3 sigma
51  if(hie > 0){
52  ret->SetDmsq32(gRandom->Uniform(kNuFitDmsq32CVNH-3*kNuFitDmsq32ErrNH,
54  ret->SetTh23(gRandom->Uniform(kNuFitTh23CVNH-3*kNuFitTh23ErrNH,
56  ret->SetTh13(gRandom->Uniform(kNuFitTh13CVNH-3*kNuFitTh13ErrNH,
58  } else {
59  ret->SetDmsq32(gRandom->Uniform(kNuFitDmsq32CVIH-3*kNuFitDmsq32ErrIH,
61  ret->SetTh23(gRandom->Uniform(kNuFitTh23CVIH-3*kNuFitTh23ErrIH,
63  ret->SetTh13(gRandom->Uniform(kNuFitTh13CVIH-3*kNuFitTh13ErrIH,
65  }
66  ret->SetdCP(gRandom->Uniform(-1*TMath::Pi(), TMath::Pi()));
67 
68  return ret;
69  }
const double kNuFitDmsq32ErrNH
Definition: CalcsNuFit.h:32
const double kNuFitTh23ErrIH
Definition: CalcsNuFit.h:37
const double kNuFitDmsq32ErrIH
Definition: CalcsNuFit.h:36
const double kNuFitTh12Err
Definition: CalcsNuFit.h:30
const double kNuFitDmsq32CVIH
Definition: CalcsNuFit.h:23
const double kNuFitTh23CVIH
Definition: CalcsNuFit.h:24
const double kNuFitTh23CVNH
Definition: CalcsNuFit.h:19
const double kNuFitTh13ErrIH
Definition: CalcsNuFit.h:38
const double kNuFitDmsq21Err
Definition: CalcsNuFit.h:29
const double kNuFitDmsq21CV
Definition: CalcsNuFit.h:14
const double kNuFitTh13CVIH
Definition: CalcsNuFit.h:25
const double kNuFitDmsq32CVNH
Definition: CalcsNuFit.h:18
const double kNuFitTh23ErrNH
Definition: CalcsNuFit.h:33
const double kNuFitTh13ErrNH
Definition: CalcsNuFit.h:34
const double kNuFitTh12CV
Definition: CalcsNuFit.h:15
const double kNuFitTh13CVNH
Definition: CalcsNuFit.h:20
TH2* ana::ToTH2 ( const Spectrum &  s,
double  exposure,
ana::EExposureType  expotype,
const Binning &  binsx,
const Binning &  binsy,
ana::EBinType  bintype 
)

Definition at line 407 of file sbnana/sbnana/CAFAna/Core/Utilities.cxx.

409  {
410  DontAddDirectory guard;
411 
412  std::unique_ptr<TH1> h1(s.ToTH1(exposure, expotype));
413  return ToTH2Helper(std::move(h1), binsx, binsy, bintype);
414  }
TH2 * ToTH2Helper(std::unique_ptr< TH1 > h1, const Binning &binsx, const Binning &binsy, ana::EBinType bintype)
then echo File list $list not found else cat $list while read file do echo $file sed s
Definition: file_to_url.sh:60
TH2* ana::ToTH2 ( const Ratio &  r,
const Binning &  binsx,
const Binning &  binsy 
)

Definition at line 417 of file sbnana/sbnana/CAFAna/Core/Utilities.cxx.

419  {
420  DontAddDirectory guard;
421 
422  std::unique_ptr<TH1> h1(r.ToTH1());
423  return ToTH2Helper(std::move(h1), binsx, binsy);
424  }
TH2 * ToTH2Helper(std::unique_ptr< TH1 > h1, const Binning &binsx, const Binning &binsy, ana::EBinType bintype)
esac echo uname r
TH2* ana::ToTH2Helper ( std::unique_ptr< TH1 >  h1,
const Binning &  binsx,
const Binning &  binsy,
ana::EBinType  bintype 
)

Definition at line 427 of file sbnana/sbnana/CAFAna/Core/Utilities.cxx.

430  {
431  // Make sure it's compatible with having been made with this binning
432  assert(h1->GetNbinsX() == binsx.NBins()*binsy.NBins());
433 
434  TH2* ret = MakeTH2D(UniqueName().c_str(), "", binsx, binsy);
435 
436  for(int i = 0; i < h1->GetNbinsX(); ++i){
437  const double val = h1->GetBinContent(i+1);
438  const double err = h1->GetBinError(i+1);
439 
440  const int ix = i / binsy.NBins();
441  const int iy = i % binsy.NBins();
442 
443  ret->SetBinContent(ix+1, iy+1, val);
444  ret->SetBinError (ix+1, iy+1, err);
445  }
446 
447  if(bintype == ana::EBinType::kBinDensity) ret->Scale(1, "width");
448 
449  return ret;
450  }
TH2D * MakeTH2D(const char *name, const char *title, const Binning &binsx, const Binning &binsy)
EResult err(const char *call)
Divide bin contents by bin widths.
std::string UniqueName()
Return a different string each time, for creating histograms.
TH3* ana::ToTH3 ( const Spectrum &  s,
double  exposure,
ana::EExposureType  expotype,
const Binning &  binsx,
const Binning &  binsy,
const Binning &  binsz,
ana::EBinType  bintype 
)

Definition at line 454 of file sbnana/sbnana/CAFAna/Core/Utilities.cxx.

457  {
458  DontAddDirectory guard;
459 
460  std::unique_ptr<TH1> h1(s.ToTH1(exposure, expotype));
461 
462  return ToTH3Helper(std::move(h1), binsx, binsy, binsz, bintype);
463  }
TH3 * ToTH3Helper(std::unique_ptr< TH1 > h1, const Binning &binsx, const Binning &binsy, const Binning &binsz, ana::EBinType bintype)
then echo File list $list not found else cat $list while read file do echo $file sed s
Definition: file_to_url.sh:60
TH3* ana::ToTH3 ( const Ratio &  r,
const Binning &  binsx,
const Binning &  binsy,
const Binning &  binsz 
)

Definition at line 467 of file sbnana/sbnana/CAFAna/Core/Utilities.cxx.

469  {
470  DontAddDirectory guard;
471 
472  std::unique_ptr<TH1> h1(r.ToTH1());
473 
474  return ToTH3Helper(std::move(h1), binsx, binsy, binsz);
475  }
TH3 * ToTH3Helper(std::unique_ptr< TH1 > h1, const Binning &binsx, const Binning &binsy, const Binning &binsz, ana::EBinType bintype)
esac echo uname r
TH3* ana::ToTH3Helper ( std::unique_ptr< TH1 >  h1,
const Binning &  binsx,
const Binning &  binsy,
const Binning &  binsz,
ana::EBinType  bintype 
)

Definition at line 478 of file sbnana/sbnana/CAFAna/Core/Utilities.cxx.

483  {
484 
485  const int nx = binsx.NBins();
486  const int ny = binsy.NBins();
487  const int nz = binsz.NBins();
488 
489  // Make sure it's compatible with having been made with this binning
490  assert(h1->GetNbinsX() == nx*ny*nz);
491 
492  TH3* ret;
493 
494  // If all three axes are simple, we can call a simpler constructor
495  if(binsx.IsSimple() && binsy.IsSimple() && binsz.IsSimple()){
496  ret = new TH3F(UniqueName().c_str(), "",
497  nx, binsx.Min(), binsx.Max(),
498  ny, binsy.Min(), binsy.Max(),
499  nz, binsz.Min(), binsz.Max());
500 
501  if(!binsx.IsSimple() || !binsy.IsSimple() || !binsz.IsSimple()){
502  // TH3 doesn't have the constructors for mixed simple and custom
503  std::cerr << "ToTH3: one or more axes is custom, but not all three. Applying Simple binning to all three axes" << std::endl;
504  }
505  }
506  else{
507  ret = new TH3F(UniqueName().c_str(), "",
508  nx, &binsx.Edges().front(),
509  ny, &binsy.Edges().front(),
510  nz, &binsz.Edges().front());
511  }
512 
513  for(int i = 0; i < h1->GetNbinsX(); ++i){
514  const double val = h1->GetBinContent(i+1);
515  const double err = h1->GetBinError(i+1);
516 
517  const int nynz = ny*nz;
518  const int nmodnynz = i%nynz;
519  const int ix = i/nynz;
520  const int iy = nmodnynz/nz;
521  const int iz = i%nz;
522 
523  ret->SetBinContent(ix+1, iy+1, iz+1, val);
524  ret->SetBinError (ix+1, iy+1, iz+1, err);
525  }
526 
527  if(bintype == ana::EBinType::kBinDensity) ret->Scale(1, "width");
528 
529  return ret;
530 
531  }
BEGIN_PROLOG could also be cerr
EResult err(const char *call)
Divide bin contents by bin widths.
std::string UniqueName()
Return a different string each time, for creating histograms.
THStack * ana::ToTHStack ( const std::vector< std::pair< Spectrum, Color_t >> &  s,
double  pot 
)

Can call like ToTHStack({{h1, kRed}, {h2, kBlue}}, pot)

Definition at line 469 of file Plots.cxx.

471  {
472  THStack* ret = new THStack;
473  for(auto it: s){
474  TH1* h = it.first.ToTH1(pot);
475  h->SetFillColor(it.second);
476  ret->Add(h, "hist");
477  }
478  return ret;
479  }
while getopts h
Binning ana::TrueEnergyBins ( )

Default true-energy bin edges.

Definition at line 152 of file Binning.cxx.

153  {
154  // Osc P is ~sin^2(1/E). Difference in prob across a bin is ~dP/dE which
155  // goes as 1/E^2 times a trigonometric term depending on the parameters but
156  // bounded between -1 and +1. So bins should have width ~1/E^2. E_i~1/i
157  // achieves that.
158 
159  // Binning roughly re-optimized for SBN sterile analyses
160 
161  const int kNumTrueEnergyBins = 80;
162 
163  // N+1 bin low edges
164  std::vector<double> edges(kNumTrueEnergyBins+1);
165 
166  const double Emin = .2; // 200 MeV
167 
168  // How many edges to generate. Allow room for 0-Emin bin
169  const double N = kNumTrueEnergyBins-1;
170  const double A = N*Emin;
171 
172  edges[0] = 0;
173 
174  for(int i = 1; i <= N; ++i){
175  edges[kNumTrueEnergyBins-i] = A/i;
176  }
177 
178  edges[kNumTrueEnergyBins] = 20; // Replace the infinity that would be here
179 
180  return Binning::Custom(edges);
181  }
process_name largeant stream1 can override from command line with o or output physics producers generator N
float A
Definition: dedx.py:137
Binning ana::TrueLOverTrueEBins ( )

Definition at line 185 of file Binning.cxx.

186  {
187  // constant binnig
188 
189  const int kNumTrueLOverTrueEBins = 2000;
190  const double klow = 0.0;
191  const double khigh = 5.0;
192 
193  return Binning::Simple(kNumTrueLOverTrueEBins, klow, khigh);
194  }
Spectrum ana::UnfoldIterative ( const Spectrum &  reco,
const ReweightableSpectrum &  recoVsTrue,
unsigned int  nIterations 
)

Definition at line 8 of file UnfoldIterative.cxx.

11  {
12  assert(nIterations > 0);
13 
14  // Working copy
15  ReweightableSpectrum rt = recoVsTrue;
16 
17  rt.ReweightToRecoSpectrum(reco);
18 
19  // First result after one iteration
20  Spectrum truth = rt.WeightingVariable();
21 
22  for(unsigned int i = 2; i <= nIterations; ++i){
23  rt = recoVsTrue; // put it back how it started
24  rt.ReweightToTrueSpectrum(truth); // project back the other way
25  rt.ReweightToRecoSpectrum(reco); // and then forward again
26  truth = rt.WeightingVariable();
27  }
28 
29  return truth.FakeData(reco.POT());
30  }
process_name standard_reco_uboone reco
Spectrum ana::UnfoldSVD ( const Spectrum &  reco,
const ReweightableSpectrum &  recoVsTrue,
unsigned int  reg 
)

Singular value decomposition unfolding using ROOT's TSVDDecomp.

SVD decomposition requires the reco and true spectra to have the same number of bins (recoVsTrue must be square).

Lower values of reg are more regularized

Definition at line 12 of file UnfoldSVD.cxx.

15  {
16  const double pot = reco.POT();
17 
18  DontAddDirectory guard;
19 
20  std::unique_ptr<TH1D> hReco(reco.ToTH1(pot));
21  std::unique_ptr<TH1D> hMCReco(recoVsTrue.UnWeighted().ToTH1(pot));
22  std::unique_ptr<TH1D> hMCTrue(recoVsTrue.WeightingVariable().ToTH1(pot));
23  std::unique_ptr<TH2D> hRT(recoVsTrue.ToTH2(pot));
24 
25  TSVDUnfold uf(hReco.get(), hMCReco.get(), hMCTrue.get(), hRT.get());
26 
27  std::unique_ptr<TH1D> h_unf(uf.Unfold(reg));
28 
29  // Enforce matching normalization
30  h_unf->Scale(reco.Integral(pot)/h_unf->Integral(0, -1));
31 
32  // TODO in principle these should be the true labels and bins. Will be
33  // easier with cafanacore
34  return Spectrum(std::move(h_unf), reco.GetLabels(), reco.GetBinnings(),
35  pot, reco.Livetime());
36  }
process_name standard_reco_uboone reco
Spectrum ana::UnfoldTikhonov ( const Spectrum &  reco,
const ReweightableSpectrum &  recoVsTrue,
double  regStrength 
)

Unfolding using Tikhonov regularization (penalizing true spectra with large second derivatives)

Currently requires 1D reco and true axes, but that is not a fundamental restriction of the method and could be lifted in future versions.

Large regStrength corresponds to more regularization (biased towards smooth results), small strength suffers more from statistical fluctuations.

Definition at line 16 of file UnfoldTikhonov.cxx.

19  {
20  assert(regStrength >= 0);
21 
22  if(recoVsTrue.NDimensions() != 1){
23  std::cout << "UnfoldTikhonov: must use 1D reco axis. This is not a fundamental limitation. The code could be improved relatively easily." << std::endl;
24  abort();
25  }
26 
27  DontAddDirectory guard;
28 
29  // This is where that requirement comes in
30  const unsigned int Nreco = recoVsTrue.GetBinnings()[0].NBins();
31  const unsigned int Ntrue = recoVsTrue.GetBinnings()[1].NBins();
32 
33  // Smearing matrix from true to reco
34  Eigen::MatrixXd M(Nreco, Ntrue);
35 
36  TH2D* m = recoVsTrue.ToTH2(1);
37  for(unsigned int j = 0; j < Ntrue; ++j){
38  double tot = 0;
39  for(unsigned int i = 0; i < Nreco; ++i){
40  const double mij = m->GetBinContent(i+1, j+1);
41  M(i, j) = mij;
42  tot += mij;
43  }
44  // Normalize each column of true energy. One true event smears to one
45  // reco event total.
46  if(tot != 0) for(unsigned int i = 0; i < Nreco; ++i) M(i, j) /= tot;
47  } // end for j
48  delete m;
49 
50  // Data vector
51  TH1D* hy = reco.ToTH1(reco.POT());
52  Eigen::VectorXd y(Nreco);
53  for(unsigned int i = 0; i < Nreco; ++i) y[i] = hy->GetBinContent(i+1);
54  HistCache::Delete(hy);
55 
56  // Matrix penalizing true distributions with large second derivative. Would
57  // also need an update here for multi-dimensional distribution. I think you
58  // would add an extra P term to the equations for each dimension.
59  Eigen::MatrixXd P = Eigen::MatrixXd::Zero(Ntrue, Ntrue);
60  for(unsigned int i = 1; i+1 < Ntrue; ++i){
61  P(i, i) = -2;
62  P(i, i-1) = P(i, i+1) = 1;
63  }
64 
65  // We are trying to minimize a chisq
66  //
67  // chisq = (M*x-y)^2 + lambda*(P*x)^2
68  //
69  // to solve for the best true distribution x.
70  //
71  // This results in needing to solve
72  //
73  // (M^T*M + lambda*P^T*P)*x = M^T*y
74 
75  const Eigen::MatrixXd lhs = M.transpose()*M + regStrength*P.transpose()*P;
76  const Eigen::VectorXd rhs = M.transpose()*y;
77 
78  // https://eigen.tuxfamily.org/dox/group__TutorialLinearAlgebra.html
79  Eigen::ColPivHouseholderQR<Eigen::MatrixXd> dec(lhs);
80  const Eigen::VectorXd ret = dec.solve(rhs);
81 
82 
83  // To get the correct binning
84  std::unique_ptr<TH1D> hret(recoVsTrue.WeightingVariable().ToTH1(reco.POT()));
85  hret->Reset();
86  for(unsigned int i = 0; i < Ntrue; ++i) hret->SetBinContent(i+1, ret[i]);
87 
88  // TODO in principle these should be the true labels and bins. Will be
89  // easier with cafanacore
90  return Spectrum(std::move(hret), {""}, {recoVsTrue.GetBinnings()[1]},
91  reco.POT(), reco.Livetime());
92  }
tuple m
now if test mode generate materials, CRT shell, world, gdml header else just generate CRT shell for u...
process_name standard_reco_uboone reco
process_name opflash particleana ie ie y
BEGIN_PROLOG could also be cout
std::string ana::UniqueName ( )

Return a different string each time, for creating histograms.

Definition at line 32 of file sbnana/sbnana/CAFAna/Core/Utilities.cxx.

33  {
34  static int N = 0;
35  return TString::Format("cafanauniq%d", N++).Data();
36  }
process_name largeant stream1 can override from command line with o or output physics producers generator N
template<class T >
_Var< T > ana::Var2D ( const _Var< T > &  a,
const Binning &  binsa,
const _Var< T > &  b,
const Binning &  binsb 
)

Variable formed from two input variables.

The binning of each variable has to be given to allow conversion into a 1D binned representation.

Definition at line 109 of file Var.cxx.

111  {
112  return _Var<T>(Var2DFunc<T>(a, binsa, b, binsb));
113  }
process_name gaushit a
template<class T >
_Var< T > ana::Var2D ( const _Var< T > &  a,
int  na,
double  a0,
double  a1,
const _Var< T > &  b,
int  nb,
double  b0,
double  b1 
)

Variable formed from two input variables.

The binning of each variable has to be given to allow conversion into a 1D binned representation.

Definition at line 117 of file Var.cxx.

119  {
120  return Var2D(a, Binning::Simple(na, a0, a1),
121  b, Binning::Simple(nb, b0, b1));
122  }
#define a0
_Var< T > Var2D(const _Var< T > &a, const Binning &binsa, const _Var< T > &b, const Binning &binsb)
Variable formed from two input variables.
Definition: Var.cxx:109
process_name gaushit a
#define a1
template Var ana::Var2D ( const Var &  ,
const Binning &  ,
const Var &  ,
const Binning &   
)
template Var ana::Var2D ( const Var &  ,
int  ,
double  ,
double  ,
const Var &  ,
int  ,
double  ,
double   
)
template<class T >
_Var< T > ana::Var3D ( const _Var< T > &  a,
const Binning &  binsa,
const _Var< T > &  b,
const Binning &  binsb,
const _Var< T > &  c,
const Binning &  binsc 
)

This is just like a Var2D, but useful for 3D Spectra.

Definition at line 133 of file Var.cxx.

136  {
137  return _Var<T>(Var3DFunc<T>(a, binsa, b, binsb, c, binsc));
138  }
process_name gaushit a
template<class T >
_Var< T > ana::Var3D ( const _Var< T > &  a,
int  na,
double  a0,
double  a1,
const _Var< T > &  b,
int  nb,
double  b0,
double  b1,
const _Var< T > &  c,
int  nc,
double  c0,
double  c1 
)

This is just like a Var2D, but useful for 3D Spectra.

Definition at line 142 of file Var.cxx.

145  {
146  return Var3D(a, Binning::Simple(na, a0, a1),
147  b, Binning::Simple(nb, b0, b1),
148  c, Binning::Simple(nc, c0, c1));
149  }
#define a0
_Var< T > Var3D(const _Var< T > &a, const Binning &binsa, const _Var< T > &b, const Binning &binsb, const _Var< T > &c, const Binning &binsc)
This is just like a Var2D, but useful for 3D Spectra.
Definition: Var.cxx:133
process_name gaushit a
#define a1
template Var ana::Var3D ( const Var &  ,
const Binning &  ,
const Var &  ,
const Binning &  ,
const Var &  ,
const Binning &   
)
template Var ana::Var3D ( const Var &  ,
int  ,
double  ,
double  ,
const Var &  ,
int  ,
double  ,
double  ,
const Var &  ,
int  ,
double  ,
double   
)
std::vector<std::string> ana::Wildcard ( const std::string &  wildcardString)

Definition at line 534 of file sbnana/sbnana/CAFAna/Core/Utilities.cxx.

535  {
536  // Expand environment variables and wildcards like the shell would
537  wordexp_t p;
538  const int status = wordexp(wildcardString.c_str(), &p, WRDE_SHOWERR);
539 
540  if(status != 0){
541  std::cerr << "Wildcard string '" << wildcardString
542  << "' returned error " << status << " from wordexp()."
543  << std::endl;
544  return {};
545  }
546 
547  std::vector<std::string> fileList;
548 
549  for(unsigned int i = 0; i < p.we_wordc; ++i){
550  // Check the file exists before adding it
551  struct stat sb;
552  if(stat(p.we_wordv[i], &sb) == 0)
553  fileList.push_back(p.we_wordv[i]);
554  }
555 
556  wordfree(&p);
557 
558  return fileList;
559  }
BEGIN_PROLOG could also be cerr
pdgs p
Definition: selectors.fcl:22
const ReactorExperiment * ana::WorldReactorConstraint2015 ( )

Weighted average of all experiments as of first nue paper writing.

Definition at line 64 of file ReactorExperiment.cxx.

65  {
66  // Weighted average of
67  // Daya Bay: arXiv:1505.03456
68  // RENO: arXiv:1410.7987
69  // Double Chooz: 1406.7763
70  return new ReactorExperiment(.086, .005);
71  }
const ReactorExperiment * ana::WorldReactorConstraint2016 ( )

Updated value for SecondAna based on the latest PDG.

Definition at line 74 of file ReactorExperiment.cxx.

75  {
76  // PDG website as of Jun 2016
77  return new ReactorExperiment(.085, .005);
78  }
const ReactorExperiment * ana::WorldReactorConstraint2017 ( )

Reactor constraint from PDG 2017 update.

Definition at line 81 of file ReactorExperiment.cxx.

82  {
83  // http://pdg.lbl.gov/2017/tables/rpp2017-sum-leptons.pdf
84  // ssth13=0.021+/-0.0011 -> ss2th13=0.082+/-0.004
85  return new ReactorExperiment(.082, .004);
86  }
void ana::WriteCAFMetadata ( TDirectory *  dir,
const std::map< std::string, std::string > &  meta 
)

Definition at line 674 of file sbnana/sbnana/CAFAna/Core/Utilities.cxx.

676  {
677  TDirectory* tmp = gDirectory;
678  dir->cd();
679 
680  TTree* trmeta = new TTree("metatree", "metatree");
681  std::string key, value;
682  trmeta->Branch("key", &key);
683  trmeta->Branch("value", &value);
684  for(const auto& keyval: meta){
685  key = keyval.first;
686  value = keyval.second;
687  trmeta->Fill();
688  }
689  trmeta->Write();
690 
691  dir->Save();
692 
693  tmp->cd();
694  }
tuple dir
Definition: dropbox.py:28
temporary value

Variable Documentation

std::map<const ISyst*, TGraph*> ana::empty_syst_map
static

Definition at line 206 of file Fit.h.

std::map<const IFitVar*, TGraph*> ana::empty_vars_map
static

Definition at line 205 of file Fit.h.

InstallHandlers ana::gHandlerInstaller
static

Definition at line 89 of file DebugHelpers.cxx.

bool ana::gIsException = false

Definition at line 25 of file DebugHelpers.cxx.

const Color_t ana::k1SigmaConfidenceColorIH = kOrange+9

Definition at line 54 of file sbnana/sbnana/CAFAna/Analysis/Style.h.

const Color_t ana::k1SigmaConfidenceColorNH = kAzure+3

Definition at line 48 of file sbnana/sbnana/CAFAna/Analysis/Style.h.

const Style_t ana::k1SigmaConfidenceStyle = 7

Definition at line 43 of file sbnana/sbnana/CAFAna/Analysis/Style.h.

const Color_t ana::k2SigmaConfidenceColorIH = kOrange+10

Definition at line 55 of file sbnana/sbnana/CAFAna/Analysis/Style.h.

const Color_t ana::k2SigmaConfidenceColorNH = kAzure+2

Definition at line 50 of file sbnana/sbnana/CAFAna/Analysis/Style.h.

const Style_t ana::k2SigmaConfidenceStyle = 9

Definition at line 44 of file sbnana/sbnana/CAFAna/Analysis/Style.h.

const Color_t ana::k3SigmaConfidenceColorIH = kOrange+8

Definition at line 56 of file sbnana/sbnana/CAFAna/Analysis/Style.h.

const Color_t ana::k3SigmaConfidenceColorNH = kAzure+1

Definition at line 51 of file sbnana/sbnana/CAFAna/Analysis/Style.h.

const Style_t ana::k3SigmaConfidenceStyle = 10

Definition at line 45 of file sbnana/sbnana/CAFAna/Analysis/Style.h.

const Style_t ana::k68PercentConfidenceStyle = 7

Dashed.

Definition at line 31 of file sbnana/sbnana/CAFAna/Analysis/Style.h.

const Color_t ana::k90PercConfidenceColorIH = kOrange+10

Definition at line 57 of file sbnana/sbnana/CAFAna/Analysis/Style.h.

const Color_t ana::k90PercConfidenceColorNH = kAzure+2

Definition at line 49 of file sbnana/sbnana/CAFAna/Analysis/Style.h.

const Style_t ana::k90PercentConfidenceStyle = 9

Definition at line 30 of file sbnana/sbnana/CAFAna/Analysis/Style.h.

const Cut ana::kActiveVolumeFDCryo1

Definition at line 19 of file SBNAna/Cuts/Cuts.h.

const Cut ana::kActiveVolumeFDCryo2

Definition at line 20 of file SBNAna/Cuts/Cuts.h.

const Cut ana::kActiveVolumeND

Definition at line 16 of file SBNAna/Cuts/Cuts.h.

const Var ana::kBaseline([](const caf::SRSliceProxy *slc) -> double{return slc->truth.baseline *1e-3;}) = 1284.9

Definition at line 41 of file CalcsNuFit.h.

const double ana::kBaselineIcarus = 0.6

Definition at line 10 of file ExpInfo.h.

const double ana::kBaselineMicroBoone = 0.47

Definition at line 9 of file ExpInfo.h.

const double ana::kBaselineSBND = 0.11

Definition at line 8 of file ExpInfo.h.

const Binning ana::kBDTBinning = Binning::Simple(50,0, 1.0)

Definition at line 40 of file Binnings.cxx.

const Color_t ana::kBeamNueBackgroundColor = kPink+9

Definition at line 18 of file sbnana/sbnana/CAFAna/Analysis/Style.h.

const Float_t ana::kBlessedLabelFontSize = 0.06

Definition at line 63 of file sbnana/sbnana/CAFAna/Analysis/Style.h.

const Float_t ana::kBlessedTitleFontSize = 0.08

Definition at line 62 of file sbnana/sbnana/CAFAna/Analysis/Style.h.

const std::vector<double> ana::kBLs = {kBaselineSBND, kBaselineMicroBoone, kBaselineIcarus}

Definition at line 14 of file ExpInfo.h.

const Color_t ana::kCentralValueColor = kGray+2

Definition at line 59 of file sbnana/sbnana/CAFAna/Analysis/Style.h.

const Color_t ana::kCentralValueColorIH = kOrange+9

Definition at line 53 of file sbnana/sbnana/CAFAna/Analysis/Style.h.

const Color_t ana::kCentralValueColorNH = kAzure+3

Definition at line 47 of file sbnana/sbnana/CAFAna/Analysis/Style.h.

const Style_t ana::kCentralValueStyle = kSolid

Definition at line 60 of file sbnana/sbnana/CAFAna/Analysis/Style.h.

const Var ana::kCompletness

Definition at line 8 of file TruthVars.h.

const Cut ana::kContainedFD = kFiducialVolumeFDCryo1 || kFiducialVolumeFDCryo2

Definition at line 30 of file SBNAna/Cuts/Cuts.h.

const Cut ana::kCosmic_ClearCos = ( kCosmic_RFiducial && kNotClearCosmic )

Definition at line 112 of file NumuCutsIcarus202106.cxx.

const Cut ana::kCosmic_Cryo0 = ( kIsCosmic && kCryo0 )

Definition at line 94 of file NumuCutsIcarus202106.cxx.

const Cut ana::kCosmic_FMScore = ( kCosmic_NuScore && kFMScore )

Definition at line 124 of file NumuCutsIcarus202106.cxx.

const Cut ana::kCosmic_NuScore = ( kCosmic_ClearCos && kNuScore )

Definition at line 118 of file NumuCutsIcarus202106.cxx.

const Cut ana::kCosmic_PTrack = ( kCosmic_FMScore && kPTrack )

Definition at line 130 of file NumuCutsIcarus202106.cxx.

const Cut ana::kCosmic_RFiducial = ( kCosmic_Cryo0 && kRFiducial )

Definition at line 104 of file NumuCutsIcarus202106.cxx.

const Cut ana::kCosmic_TFiducial = ( kCosmic_Cryo0 && kTFiducial )

Definition at line 102 of file NumuCutsIcarus202106.cxx.

const Color_t ana::kCosmicBackgroundColor = kAzure+1

Definition at line 19 of file sbnana/sbnana/CAFAna/Analysis/Style.h.

const Var ana::kCounting = kUnweighted

Definition at line 19 of file Vars.cxx.

const Var ana::kCRLongestTrackDirY = SIMPLEVAR(nuid.crlongtrkdiry)

Definition at line 11 of file NumuVarsIcarus202208.cxx.

const Var ana::kCRTHitDist

Definition at line 16 of file NumuVarsSBND202106.h.

const Cut ana::kCRTHitDistanceCut

Definition at line 13 of file NumuCutsSBND202106.h.

const SpillMultiVar ana::kCRTHitPE

Definition at line 18 of file Vars.h.

const SpillMultiVar ana::kCRTHitTime

Definition at line 19 of file Vars.h.

const SpillMultiVar ana::kCRTHitTimeFD

Definition at line 20 of file Vars.h.

const SpillCut ana::kCRTHitVetoFD

Definition at line 14 of file SBNAna/Cuts/Cuts.h.

const SpillCut ana::kCRTHitVetoND

Definition at line 13 of file SBNAna/Cuts/Cuts.h.

const SpillMultiVar ana::kCRTHitX

Definition at line 15 of file Vars.h.

const SpillMultiVar ana::kCRTHitY

Definition at line 16 of file Vars.h.

const SpillMultiVar ana::kCRTHitZ

Definition at line 17 of file Vars.h.

const Cut ana::kCRTTrackAngleCut

Definition at line 12 of file NumuCutsSBND202106.h.

const Var ana::kCRTTrkAngle

Definition at line 14 of file NumuVarsSBND202106.h.

const Var ana::kCRTTrkTime

Definition at line 15 of file NumuVarsSBND202106.h.

const Binning ana::kCRTXFDBinning = Binning::Simple(60, crtfd.xmin, crtfd.xmax)

Definition at line 36 of file Binnings.cxx.

const Binning ana::kCRTYFDBinning = Binning::Simple(100, crtfd.ymin, crtfd.ymax)

Definition at line 37 of file Binnings.cxx.

const Binning ana::kCRTZFDBinning = Binning::Simple(130, crtfd.zmin, crtfd.zmax)

Definition at line 38 of file Binnings.cxx.

const Cut ana::kCryo0

Definition at line 18 of file NumuCutsIcarus202106.h.

const double ana::kEarthDensity = 2.848

Definition at line 42 of file CalcsNuFit.h.

const EnergyScaleSyst ana::kEnergyScaleHadron

Definition at line 64 of file EnergySysts.h.

const EnergyScaleSyst ana::kEnergyScaleHadronBig

Definition at line 96 of file EnergySysts.h.

const EnergyScaleSyst ana::kEnergyScaleHadronFD

Definition at line 76 of file EnergySysts.h.

const EnergyScaleSyst ana::kEnergyScaleHadronFDBig

Definition at line 108 of file EnergySysts.h.

const EnergyScaleSyst ana::kEnergyScaleHadronInvSqrt

Definition at line 66 of file EnergySysts.h.

const EnergyScaleSyst ana::kEnergyScaleHadronInvSqrtBig

Definition at line 98 of file EnergySysts.h.

const EnergyScaleSyst ana::kEnergyScaleHadronInvSqrtFD

Definition at line 78 of file EnergySysts.h.

const EnergyScaleSyst ana::kEnergyScaleHadronInvSqrtFDBig

Definition at line 110 of file EnergySysts.h.

const EnergyScaleSyst ana::kEnergyScaleHadronInvSqrtND

Definition at line 70 of file EnergySysts.h.

const EnergyScaleSyst ana::kEnergyScaleHadronInvSqrtNDBig

Definition at line 102 of file EnergySysts.h.

const EnergyScaleSyst ana::kEnergyScaleHadronInvSqrtUB

Definition at line 74 of file EnergySysts.h.

const EnergyScaleSyst ana::kEnergyScaleHadronInvSqrtUBBig

Definition at line 106 of file EnergySysts.h.

const EnergyScaleSyst ana::kEnergyScaleHadronND

Definition at line 68 of file EnergySysts.h.

const EnergyScaleSyst ana::kEnergyScaleHadronNDBig

Definition at line 100 of file EnergySysts.h.

const EnergyScaleSyst ana::kEnergyScaleHadronSqrt

Definition at line 65 of file EnergySysts.h.

const EnergyScaleSyst ana::kEnergyScaleHadronSqrtBig

Definition at line 97 of file EnergySysts.h.

const EnergyScaleSyst ana::kEnergyScaleHadronSqrtFD

Definition at line 77 of file EnergySysts.h.

const EnergyScaleSyst ana::kEnergyScaleHadronSqrtFDBig

Definition at line 109 of file EnergySysts.h.

const EnergyScaleSyst ana::kEnergyScaleHadronSqrtND

Definition at line 69 of file EnergySysts.h.

const EnergyScaleSyst ana::kEnergyScaleHadronSqrtNDBig

Definition at line 101 of file EnergySysts.h.

const EnergyScaleSyst ana::kEnergyScaleHadronSqrtUB

Definition at line 73 of file EnergySysts.h.

const EnergyScaleSyst ana::kEnergyScaleHadronSqrtUBBig

Definition at line 105 of file EnergySysts.h.

const EnergyScaleSyst ana::kEnergyScaleHadronUB

Definition at line 72 of file EnergySysts.h.

const EnergyScaleSyst ana::kEnergyScaleHadronUBBig

Definition at line 104 of file EnergySysts.h.

const EnergyScaleSyst ana::kEnergyScaleMuon

Definition at line 48 of file EnergySysts.h.

const EnergyScaleSyst ana::kEnergyScaleMuonBig

Definition at line 80 of file EnergySysts.h.

const EnergyScaleSyst ana::kEnergyScaleMuonFD

Definition at line 60 of file EnergySysts.h.

const EnergyScaleSyst ana::kEnergyScaleMuonFDBig

Definition at line 92 of file EnergySysts.h.

const EnergyScaleSyst ana::kEnergyScaleMuonInvSqrt

Definition at line 50 of file EnergySysts.h.

const EnergyScaleSyst ana::kEnergyScaleMuonInvSqrtBig

Definition at line 82 of file EnergySysts.h.

const EnergyScaleSyst ana::kEnergyScaleMuonInvSqrtFD

Definition at line 62 of file EnergySysts.h.

const EnergyScaleSyst ana::kEnergyScaleMuonInvSqrtFDBig

Definition at line 94 of file EnergySysts.h.

const EnergyScaleSyst ana::kEnergyScaleMuonInvSqrtND

Definition at line 54 of file EnergySysts.h.

const EnergyScaleSyst ana::kEnergyScaleMuonInvSqrtNDBig

Definition at line 86 of file EnergySysts.h.

const EnergyScaleSyst ana::kEnergyScaleMuonInvSqrtUB

Definition at line 58 of file EnergySysts.h.

const EnergyScaleSyst ana::kEnergyScaleMuonInvSqrtUBBig

Definition at line 90 of file EnergySysts.h.

const EnergyScaleSyst ana::kEnergyScaleMuonND

Definition at line 52 of file EnergySysts.h.

const EnergyScaleSyst ana::kEnergyScaleMuonNDBig

Definition at line 84 of file EnergySysts.h.

const EnergyScaleSyst ana::kEnergyScaleMuonSqrt

Definition at line 49 of file EnergySysts.h.

const EnergyScaleSyst ana::kEnergyScaleMuonSqrtBig

Definition at line 81 of file EnergySysts.h.

const EnergyScaleSyst ana::kEnergyScaleMuonSqrtFD

Definition at line 61 of file EnergySysts.h.

const EnergyScaleSyst ana::kEnergyScaleMuonSqrtFDBig

Definition at line 93 of file EnergySysts.h.

const EnergyScaleSyst ana::kEnergyScaleMuonSqrtND

Definition at line 53 of file EnergySysts.h.

const EnergyScaleSyst ana::kEnergyScaleMuonSqrtNDBig

Definition at line 85 of file EnergySysts.h.

const EnergyScaleSyst ana::kEnergyScaleMuonSqrtUB

Definition at line 57 of file EnergySysts.h.

const EnergyScaleSyst ana::kEnergyScaleMuonSqrtUBBig

Definition at line 89 of file EnergySysts.h.

const EnergyScaleSyst ana::kEnergyScaleMuonUB

Definition at line 56 of file EnergySysts.h.

const EnergyScaleSyst ana::kEnergyScaleMuonUBBig

Definition at line 88 of file EnergySysts.h.

const SpillVar ana::kEvt = SIMPLESPILLVAR(hdr.evt)

Definition at line 16 of file Vars.cxx.

const Cut ana::kFiducialVolumeFDCryo1

Definition at line 21 of file SBNAna/Cuts/Cuts.h.

const Cut ana::kFiducialVolumeFDCryo2

Definition at line 22 of file SBNAna/Cuts/Cuts.h.

const Cut ana::kFiducialVolumeND

Definition at line 17 of file SBNAna/Cuts/Cuts.h.

const Style_t ana::kFillStyleIH = 3003

Definition at line 41 of file sbnana/sbnana/CAFAna/Analysis/Style.h.

const Style_t ana::kFillStyleNH = 3013

Definition at line 40 of file sbnana/sbnana/CAFAna/Analysis/Style.h.

const SpillCut ana::kFirstEvents = kEvt < 10

Definition at line 14 of file Cuts.cxx.

const FitDelta13InPiUnitsSterile ana::kFitDelta13InPiUnitsSterile = FitDelta13InPiUnitsSterile()

$ \delta_{CP}/\pi $

Definition at line 66 of file FitVarsSterile.h.

const FitDelta14InPiUnitsSterile ana::kFitDelta14InPiUnitsSterile = FitDelta14InPiUnitsSterile()

$ \delta_{14}/\pi $

Definition at line 81 of file FitVarsSterile.h.

const FitDelta24InPiUnitsSterile ana::kFitDelta24InPiUnitsSterile = FitDelta24InPiUnitsSterile()

$ \delta_{24}/\pi $

Definition at line 96 of file FitVarsSterile.h.

const FitDeltaInPiUnits ana::kFitDeltaInPiUnits = FitDeltaInPiUnits()

$ \delta_{CP}/\pi $

Definition at line 53 of file FitVars.h.

const FitDmSq21 ana::kFitDmSq21 = FitDmSq21()

$ \Delta m^2_{21} $

Definition at line 199 of file FitVars.h.

const FitDmSq32 ana::kFitDmSq32 = FitDmSq32()

$ \Delta m^2_{32} $

Definition at line 123 of file FitVars.h.

const FitDmSq32Scaled ana::kFitDmSq32Scaled = FitDmSq32Scaled()

$ \Delta m^2_{32}\times10^3{\rm eV}^2 $

Definition at line 143 of file FitVars.h.

const FitDmSq32Sterile ana::kFitDmSq32Sterile = FitDmSq32Sterile()

$ \Delta m^2_{32} $

Definition at line 21 of file FitVarsSterile.h.

const FitDmSq41Sterile ana::kFitDmSq41Sterile = FitDmSq41Sterile()

$ \Delta m^2_{41} $

Definition at line 36 of file FitVarsSterile.h.

const FitDmSq43Sterile ana::kFitDmSq43Sterile = FitDmSq43Sterile()

$ \Delta m^2_{43} $

Definition at line 51 of file FitVarsSterile.h.

const FitDmSqSterile ana::kFitDmSqSterile = FitDmSqSterile()

m^2

Definition at line 23 of file FitVarsSterileApprox.h.

const FitRho ana::kFitRho = FitRho()

$ \rho $

Definition at line 217 of file FitVars.h.

const FitSinSq2Theta12 ana::kFitSinSq2Theta12 = FitSinSq2Theta12()

$ \sin^22\theta_{12} $

Definition at line 179 of file FitVars.h.

const FitSinSq2Theta13 ana::kFitSinSq2Theta13 = FitSinSq2Theta13()

$ \sin^22\theta_{13} $

Definition at line 38 of file FitVars.h.

const FitSinSq2Theta14Sterile ana::kFitSinSq2Theta14Sterile = FitSinSq2Theta14Sterile()

$ \sin^22\theta_{14} $

Definition at line 223 of file FitVarsSterile.h.

const FitSinSq2Theta23 ana::kFitSinSq2Theta23 = FitSinSq2Theta23()

$ \sin^22\theta_{23} $

Definition at line 103 of file FitVars.h.

const FitSinSq2Theta24Sterile ana::kFitSinSq2Theta24Sterile = FitSinSq2Theta24Sterile()

$ \sin^22\theta_{24} $

Definition at line 277 of file FitVarsSterile.h.

const FitSinSq2Theta34Sterile ana::kFitSinSq2Theta34Sterile = FitSinSq2Theta34Sterile()

$ \sin^22\theta_{34} $

Definition at line 331 of file FitVarsSterile.h.

const FitSinSqTheta13Sterile ana::kFitSinSqTheta13Sterile = FitSinSqTheta13Sterile()

$ \sin^2\theta_{13} $

Definition at line 132 of file FitVarsSterile.h.

const FitSinSqTheta14Sterile ana::kFitSinSqTheta14Sterile = FitSinSqTheta14Sterile()

$ \sin^2\theta_{14} $

Definition at line 204 of file FitVarsSterile.h.

const FitSinSqTheta23 ana::kFitSinSqTheta23 = FitSinSqTheta23()

$ \sin^2\theta_{23} $

Definition at line 84 of file FitVars.h.

const FitSinSqTheta23Sterile ana::kFitSinSqTheta23Sterile = FitSinSqTheta23Sterile()

$ \sin^2\theta_{23} $

Definition at line 168 of file FitVarsSterile.h.

const FitSinSqTheta24Sterile ana::kFitSinSqTheta24Sterile = FitSinSqTheta24Sterile()

$ \sin^2\theta_{24} $

Definition at line 259 of file FitVarsSterile.h.

const FitSinSqTheta34Sterile ana::kFitSinSqTheta34Sterile = FitSinSqTheta34Sterile()

$ \sin^2\theta_{34} $

Definition at line 313 of file FitVarsSterile.h.

const FitTanSqTheta12 ana::kFitTanSqTheta12 = FitTanSqTheta12()

$ \tan^2\theta_{12} $

Definition at line 161 of file FitVars.h.

const FitTheta13 ana::kFitTheta13 = FitTheta13()

$ \theta_{13} $

Definition at line 20 of file FitVars.h.

const FitTheta13InDegreesSterile ana::kFitTheta13InDegreesSterile = FitTheta13InDegreesSterile()

$ \theta_{13} $

Definition at line 349 of file FitVarsSterile.h.

const FitTheta13Sterile ana::kFitTheta13Sterile = FitTheta13Sterile()

$ \theta_{13} $

Definition at line 114 of file FitVarsSterile.h.

const FitTheta14InDegreesSterile ana::kFitTheta14InDegreesSterile = FitTheta14InDegreesSterile()

$ \theta_{14} $

Definition at line 385 of file FitVarsSterile.h.

const FitTheta14Sterile ana::kFitTheta14Sterile = FitTheta14Sterile()

$ \theta_{14} $

Definition at line 186 of file FitVarsSterile.h.

const FitTheta23 ana::kFitTheta23 = FitTheta23()

$ \theta_{13} $

Definition at line 67 of file FitVars.h.

const FitTheta23InDegreesSterile ana::kFitTheta23InDegreesSterile = FitTheta23InDegreesSterile()

$ \theta_{23} $

Definition at line 367 of file FitVarsSterile.h.

const FitTheta23Sterile ana::kFitTheta23Sterile = FitTheta23Sterile()

$ \theta_{23} $

Definition at line 150 of file FitVarsSterile.h.

const FitTheta24InDegreesSterile ana::kFitTheta24InDegreesSterile = FitTheta24InDegreesSterile()

$ \theta_{24} $

Definition at line 403 of file FitVarsSterile.h.

const FitTheta24Sterile ana::kFitTheta24Sterile = FitTheta24Sterile()

$ \theta_{24} $

Definition at line 241 of file FitVarsSterile.h.

const FitTheta34InDegreesSterile ana::kFitTheta34InDegreesSterile = FitTheta34InDegreesSterile()

$ \theta_{34} $

Definition at line 421 of file FitVarsSterile.h.

const FitTheta34Sterile ana::kFitTheta34Sterile = FitTheta34Sterile()

$ \theta_{34} $

Definition at line 295 of file FitVarsSterile.h.

const Cut ana::kFlashMatchNumuCut = kHasFlashMatch && kFlashMatchScore

Definition at line 29 of file NumuCuts.cxx.

const Cut ana::kFlashMatchScore

Definition at line 11 of file NumuCuts.h.

const SpillCut ana::kFlashTrigger

Definition at line 11 of file SBNAna/Cuts/Cuts.h.

const Cut ana::kFMScore

Definition at line 28 of file NumuCutsIcarus202106.h.

const Var ana::kFMScoreVar = SIMPLEVAR(fmatch.score)

Definition at line 13 of file NumuVarsIcarus202208.cxx.

const Var ana::kFMTimeVar = SIMPLEVAR(fmatch.time)

Definition at line 12 of file NumuVarsIcarus202208.cxx.

Definition at line 38 of file NueCuts.h.

const Cut ana::kHasFlashMatch

Definition at line 9 of file NumuCuts.h.

const Cut ana::kHasMatchedNu

Definition at line 9 of file CAFAna/Cuts/TruthCuts.h.

const Cut ana::kHasNu

Definition at line 10 of file SBNAna/Cuts/TruthCuts.h.

const Cut ana::kHasPrimaryMuonTrk

Definition at line 9 of file NumuCutsSBND202106.h.

const Var ana::kHasTruthMatch

Definition at line 7 of file TruthVars.h.

const int ana::kICARUS = 2

Definition at line 13 of file ExpInfo.h.

const Cut ana::kIcarus202208ContainedHadrons

Definition at line 16 of file NumuCutsIcarus202208.h.

const Cut ana::kIcarus202208ContainedMuon

Definition at line 17 of file NumuCutsIcarus202208.h.

const Cut ana::kIcarus202208ContainedMuonAndHadrons = kIcarus202208ContainedMuon && kIcarus202208ContainedHadrons

Definition at line 47 of file NumuCutsIcarus202208.cxx.

const Cut ana::kIcarus202208FMScoreCut = kFMScoreVar < 9

Definition at line 18 of file NumuCutsIcarus202208.cxx.

const Cut ana::kIcarus202208FMTimeCut = kFMTimeVar > 0 && kFMTimeVar < 1.8

Definition at line 17 of file NumuCutsIcarus202208.cxx.

const Cut ana::kIcarus202208FoundMuon = kIcarus202208MuonIdx >= 0

Definition at line 20 of file NumuCutsIcarus202208.cxx.

const Cut ana::kIcarus202208LongTrackDirCut = kCRLongestTrackDirY > -0.91

Definition at line 19 of file NumuCutsIcarus202208.cxx.

const Var ana::kIcarus202208MuonIdx

Definition at line 11 of file NumuVarsIcarus202208.h.

const Cut ana::kIcarus202208NoPion = kIcarus202208NumPions == 0

Definition at line 33 of file NumuCutsIcarus202208.cxx.

const Var ana::kIcarus202208NumPions

Definition at line 12 of file NumuVarsIcarus202208.h.

Definition at line 31 of file NumuCutsIcarus202208.cxx.

Definition at line 48 of file NumuCutsIcarus202208.cxx.

const Cut ana::kIcarus202208QELikeContainedMuon = kIcarus202208QELike && kIcarus202208ContainedMuon

Definition at line 49 of file NumuCutsIcarus202208.cxx.

const Cut ana::kIcarus202208RecoFiducial

Definition at line 11 of file NumuCutsIcarus202208.h.

const Cut ana::kInBeamSpill

Does the event fall inside the beam spill window.

const Cut ana::kInFV

Definition at line 7 of file NumuCutsSBND202106.h.

const Cut ana::kInTimingSideband

Is the event far from the start and end of the spill window.

const Color_t ana::kInvertedHierarchyColor = kOrange+9

Definition at line 28 of file sbnana/sbnana/CAFAna/Analysis/Style.h.

const Var ana::kInvXSec([](const caf::SRSliceProxy *sr){const double GeV2perm2=2.56819e31;return GeV2perm2/sr->truth.xsec;})
const Cut ana::kIsAntiNu

Is this truly an antineutrino?

Definition at line 70 of file CAFAna/Cuts/TruthCuts.h.

const Cut ana::kIsCC

Definition at line 17 of file CAFAna/Cuts/TruthCuts.h.

const SpillCut ana::kIsCCSpill

Definition at line 37 of file SBNAna/Cuts/TruthCuts.h.

const Cut ana::kIsCosmic = ( !kIsNuSlice )

Definition at line 10 of file NumuCutsIcarus202106.cxx.

const SpillCut ana::kIsCosmicSpill

Definition at line 31 of file SBNAna/Cuts/TruthCuts.h.

const Cut ana::kIsNC

Is this a Neutral Current event?

In this case the selection function is simple enough that we can include it inline as a lambda function.

Definition at line 15 of file CAFAna/Cuts/TruthCuts.h.

const SpillCut ana::kIsNCSpill

Definition at line 38 of file SBNAna/Cuts/TruthCuts.h.

const Cut ana::kIsNu

Definition at line 9 of file SBNAna/Cuts/TruthCuts.h.

const Cut ana::kIsNue

Definition at line 12 of file SBNAna/Cuts/TruthCuts.h.

const SpillCut ana::kIsNueSpill

Definition at line 33 of file SBNAna/Cuts/TruthCuts.h.

const Cut ana::kIsNumu

Definition at line 13 of file SBNAna/Cuts/TruthCuts.h.

const Cut ana::kIsNuMuCC

Definition at line 13 of file NumuCutsIcarus202106.h.

const SpillCut ana::kIsNumuSpill

Definition at line 34 of file SBNAna/Cuts/TruthCuts.h.

const Cut ana::kIsNuOther = ( kIsNuSlice && !kIsNuMuCC )

Definition at line 16 of file NumuCutsIcarus202106.cxx.

const Cut ana::kIsNuSlice = ( kTruthIndex >= 0.f )

Definition at line 8 of file NumuCutsIcarus202106.cxx.

const Cut ana::kIsNutau

Definition at line 14 of file SBNAna/Cuts/TruthCuts.h.

const SpillCut ana::kIsNutauSpill

Definition at line 35 of file SBNAna/Cuts/TruthCuts.h.

const SpillCut ana::kIsSingleNuSpill

Definition at line 32 of file SBNAna/Cuts/TruthCuts.h.

const Var ana::kLargestRecoShowerIdx

Definition at line 9 of file NueVars.h.

const Var ana::kLongestTrackChi2Kaon

Definition at line 37 of file NueVars.h.

const Var ana::kLongestTrackChi2Muon

Definition at line 35 of file NueVars.h.

const Var ana::kLongestTrackChi2Pion

Definition at line 36 of file NueVars.h.

const Var ana::kLongestTrackChi2Proton

Definition at line 38 of file NueVars.h.

const Var ana::kLongestTrackDazzleMuonScore

Definition at line 43 of file NueVars.h.

const Var ana::kLongestTrackDazzlePID

Definition at line 42 of file NueVars.h.

const Var ana::kLongestTrackIdx

Definition at line 33 of file NueVars.h.

const Var ana::kLongestTrackLength

Definition at line 34 of file NueVars.h.

const Var ana::kLongestTrackTruePdg

Definition at line 30 of file NueVars.h.

const SpillCut ana::kLongTrack

Definition at line 83 of file NumuCutsIcarus202106.h.

const Binning ana::kLowEnergyBinning = Binning::Custom( kLowEnergyEdges )

Definition at line 25 of file Binnings.cxx.

const std::vector<double> ana::kLowEnergyEdges
Initial value:
= {100., 200., 300., 400., 500., 750.,
1000., 1250., 1500., 1750.,
2000., 2250., 2500., 2750.,
3000., 3250., 3500., 3750.,
4000., 4250., 4500., 4750., 5000.}

Definition at line 9 of file Binnings.cxx.

const Binning ana::kLowEnergyGeVBinning = Binning::Custom( kLowEnergyGeVEdges )

Definition at line 26 of file Binnings.cxx.

const std::vector<double> ana::kLowEnergyGeVEdges
Initial value:
= {.1, .2, .3, .4, .5, .75,
1., 1.25, 1.5, 1.75,
2., 2.25, 2.5, 2.75,
3., 3.25, 3.5, 3.75,
4., 4.25, 4.5, 4.75, 5.}

Definition at line 15 of file Binnings.cxx.

const int ana::kMicroBoone = 1

Definition at line 12 of file ExpInfo.h.

const Var ana::kMuMaxTrack

Definition at line 11 of file NumuVarsIcarus202106.h.

const Var ana::kMuonTrackLength

Definition at line 40 of file NueVars.h.

const Color_t ana::kNCBackgroundColor = kAzure

Definition at line 17 of file sbnana/sbnana/CAFAna/Analysis/Style.h.

const Color_t ana::kNormalHierarchyColor = kAzure+3

Definition at line 27 of file sbnana/sbnana/CAFAna/Analysis/Style.h.

const SystShifts ana::kNoShift = SystShifts::Nominal()

Definition at line 61 of file SystShifts.h.

const Cut ana::kNotClearCosmic

Definition at line 24 of file NumuCutsIcarus202106.h.

const Cut ana::kNueAllTrackDazzleMuonCut

Definition at line 30 of file NueCuts.h.

const Cut ana::kNueAllTrackDazzleMuonScoreCut

Definition at line 31 of file NueCuts.h.

const Cut ana::kNueBasicCut

Definition at line 9 of file NueCuts.h.

const Cut ana::kNueContainedFD

Definition at line 34 of file NueCuts.h.

const Cut ana::kNueContainedND

Definition at line 33 of file NueCuts.h.

const Binning ana::kNueEnergyBinning = Binning::Simple( 20, 0., 5000.)

Definition at line 22 of file Binnings.cxx.

Definition at line 45 of file NueCuts.h.

const Cut ana::kNueFlashScoreFDCut = kSlcFlashMatchCut

Definition at line 42 of file NueCuts.h.

const Cut ana::kNueHasTrackCut

Definition at line 11 of file NueCuts.h.

const Cut ana::kNueLongestTrackDazzleMuonCut = kLongestTrackDazzlePID != 13

Definition at line 131 of file NueCuts.cxx.

const Cut ana::kNueLongestTrackDazzleMuonScoreCut = kLongestTrackDazzleMuonScore < 0.8

Definition at line 132 of file NueCuts.cxx.

const Cut ana::kNueMuonCut

Definition at line 16 of file NueCuts.h.

const Cut ana::kNueMuonCutNEW
const Cut ana::kNueMuonCutOLD
const Cut ana::kNueNumShowersCut

Definition at line 18 of file NueCuts.h.

const Cut ana::kNuePandoraScoreFDCut = kSlcNuScoreCut

Definition at line 43 of file NueCuts.h.

const Color_t ana::kNueSignalColor = kViolet-5

Definition at line 15 of file sbnana/sbnana/CAFAna/Analysis/Style.h.

const Cut ana::kNueTrackContainmentCut

Definition at line 12 of file NueCuts.h.

const Cut ana::kNueTrackLenCut

Definition at line 13 of file NueCuts.h.

const double ana::kNuFitdCPCVIH = 284 * TMath::Pi()/180

Definition at line 26 of file CalcsNuFit.h.

const double ana::kNuFitdCPCVNH = 215 * TMath::Pi()/180

Definition at line 21 of file CalcsNuFit.h.

const double ana::kNuFitDmsq21CV = 7.39e-5

Definition at line 14 of file CalcsNuFit.h.

const double ana::kNuFitDmsq21Err = ((8.01-6.79)/6)*1e-5

Definition at line 29 of file CalcsNuFit.h.

const double ana::kNuFitDmsq32CVIH = -2.512e-3

Definition at line 23 of file CalcsNuFit.h.

const double ana::kNuFitDmsq32CVNH = +2.525e-3 - kNuFitDmsq21CV

Definition at line 18 of file CalcsNuFit.h.

const double ana::kNuFitDmsq32ErrIH = ((2.611-2.412)/6)*1e-3

Definition at line 36 of file CalcsNuFit.h.

const double ana::kNuFitDmsq32ErrNH = ((2.625-2.427)/6)*1e-3

Definition at line 32 of file CalcsNuFit.h.

const double ana::kNuFitTh12CV = 33.82 * TMath::Pi()/180

Definition at line 15 of file CalcsNuFit.h.

const double ana::kNuFitTh12Err = ((36.27-31.61)/6) * TMath::Pi()/180

Definition at line 30 of file CalcsNuFit.h.

const double ana::kNuFitTh13CVIH = 8.65 * TMath::Pi()/180

Definition at line 25 of file CalcsNuFit.h.

const double ana::kNuFitTh13CVNH = 8.61 * TMath::Pi()/180

Definition at line 20 of file CalcsNuFit.h.

const double ana::kNuFitTh13ErrIH = ((9.03-8.27)/6) * TMath::Pi()/180

Definition at line 38 of file CalcsNuFit.h.

const double ana::kNuFitTh13ErrNH = ((8.99-8.22)/6) * TMath::Pi()/180

Definition at line 34 of file CalcsNuFit.h.

const double ana::kNuFitTh23CVIH = 49.8 * TMath::Pi()/180

Definition at line 24 of file CalcsNuFit.h.

const double ana::kNuFitTh23CVNH = 49.6 * TMath::Pi()/180

Definition at line 19 of file CalcsNuFit.h.

const double ana::kNuFitTh23ErrIH = ((52.5-40.6)/6) * TMath::Pi()/180

Definition at line 37 of file CalcsNuFit.h.

const double ana::kNuFitTh23ErrNH = ((52.4-40.3)/6) * TMath::Pi()/180

Definition at line 33 of file CalcsNuFit.h.

NullLoader ana::kNullLoader
static

Dummy loader that doesn't load any files.

Useful when a loader is required for a component you want to ignore

Definition at line 269 of file SpectrumLoaderBase.h.

const Color_t ana::kNumuBackgroundColor = kGreen+2

This is the color for the numu CC background to the nue analysis. I doubt numu plots will ever use this, preferring to just show the total MC.

Definition at line 22 of file sbnana/sbnana/CAFAna/Analysis/Style.h.

const Cut ana::kNumuBasicQual

Definition at line 7 of file NumuCuts.h.

const Cut ana::kNuMuCC_ClearCos = ( kNuMuCC_TFiducial && kNotClearCosmic )

Definition at line 110 of file NumuCutsIcarus202106.cxx.

const Cut ana::kNuMuCC_Cryo0 = ( kIsNuMuCC && kCryo0 )

Definition at line 92 of file NumuCutsIcarus202106.cxx.

const Cut ana::kNuMuCC_FMScore = ( kNuMuCC_NuScore && kFMScore )

Definition at line 122 of file NumuCutsIcarus202106.cxx.

const Cut ana::kNuMuCC_FullSelection = ( kCryo0 && kRFiducial && kNotClearCosmic && kNuScore && kFMScore && kPTrack )

Definition at line 135 of file NumuCutsIcarus202106.cxx.

const Cut ana::kNuMuCC_NuScore = ( kNuMuCC_ClearCos && kNuScore )

Definition at line 116 of file NumuCutsIcarus202106.cxx.

const Cut ana::kNuMuCC_PTrack = ( kNuMuCC_FMScore && kPTrack )

Definition at line 128 of file NumuCutsIcarus202106.cxx.

const Cut ana::kNuMuCC_RFiducial = ( kNuMuCC_Cryo0 && kRFiducial )

Definition at line 100 of file NumuCutsIcarus202106.cxx.

const Cut ana::kNuMuCC_TFiducial = ( kNuMuCC_Cryo0 && kTFiducial )

Definition at line 98 of file NumuCutsIcarus202106.cxx.

const Binning ana::kNumuEnergyBinning = Binning::Simple( 20, 0., 5000.)

Definition at line 23 of file Binnings.cxx.

const Cut ana::kNumuTrkLen

Definition at line 15 of file NumuCuts.h.

const Cut ana::kNuOther_ClearCos = ( kNuOther_TFiducial && kNotClearCosmic )

Definition at line 114 of file NumuCutsIcarus202106.cxx.

const Cut ana::kNuOther_Cryo0 = ( kIsNuOther && kCryo0 )

Definition at line 96 of file NumuCutsIcarus202106.cxx.

const Cut ana::kNuOther_FMScore = ( kNuOther_NuScore && kFMScore )

Definition at line 126 of file NumuCutsIcarus202106.cxx.

const Cut ana::kNuOther_NuScore = ( kNuOther_ClearCos && kNuScore )

Definition at line 120 of file NumuCutsIcarus202106.cxx.

const Cut ana::kNuOther_PTrack = ( kNuOther_FMScore && kPTrack )

Definition at line 132 of file NumuCutsIcarus202106.cxx.

const Cut ana::kNuOther_RFiducial = ( kNuOther_Cryo0 && kRFiducial )

Definition at line 108 of file NumuCutsIcarus202106.cxx.

const Cut ana::kNuOther_TFiducial = ( kNuOther_Cryo0 && kTFiducial )

Definition at line 106 of file NumuCutsIcarus202106.cxx.

const Var ana::kNuScore

Definition at line 26 of file NumuCutsIcarus202106.h.

const Binning ana::kPositionXFDBinning = Binning::Simple(47, avfd_cryo1.xmin, avfd_cryo1.xmax)

Definition at line 32 of file Binnings.cxx.

const Binning ana::kPositionXNDBinning = Binning::Simple(40, avnd.xmin, avnd.xmax)

Definition at line 29 of file Binnings.cxx.

const Binning ana::kPositionYFDBinning = Binning::Simple(35, avfd_cryo1.ymin, avfd_cryo1.ymax)

Definition at line 33 of file Binnings.cxx.

const Binning ana::kPositionYNDBinning = Binning::Simple(40, avnd.ymin, avnd.ymax)

Definition at line 30 of file Binnings.cxx.

const Binning ana::kPositionZFDBinning = Binning::Simple(90, avfd_cryo1.zmin, avfd_cryo1.zmax)

Definition at line 34 of file Binnings.cxx.

const Binning ana::kPositionZNDBinning = Binning::Simple(50, avnd.zmin, avnd.zmax)

Definition at line 31 of file Binnings.cxx.

const double ana::kPOTnominal = 6.6e20

Definition at line 6 of file ExpInfo.h.

const double ana::kPOTuBoone = 1.3e21

Definition at line 7 of file ExpInfo.h.

const Cut ana::kPreNueSelND = kFiducialVolumeND && kSlcNuScoreCut && kSlcFlashMatchCut

Definition at line 36 of file NueCuts.h.

const Var ana::kPrimaryEnergy = SIMPLEVAR(truth.E)

Definition at line 9 of file NumuVarsIcarus202106.cxx.

const Var ana::kPrimaryMuonTrkIdx

Definition at line 11 of file NumuVarsSBND202106.h.

const Var ana::kPrimaryMuonTrkLen

Definition at line 13 of file NumuVarsSBND202106.h.

const Var ana::kPrimaryMuonTrkP

Definition at line 12 of file NumuVarsSBND202106.h.

const Color_t ana::kPrimColorIH = kOrange+9

Definition at line 37 of file sbnana/sbnana/CAFAna/Analysis/Style.h.

const Color_t ana::kPrimColorNH = kAzure+2

Definition at line 34 of file sbnana/sbnana/CAFAna/Analysis/Style.h.

const Var ana::kPrimMuonIdx

Definition at line 11 of file NumuVars.h.

const Var ana::kPrimTrkLen

Definition at line 9 of file NumuVars.h.

const Cut ana::kPTrack

Definition at line 30 of file NumuCutsIcarus202106.h.

const Cut ana::kPTrackContained

Definition at line 32 of file NumuCutsIcarus202106.h.

const Cut ana::kPTrackExiting

Definition at line 34 of file NumuCutsIcarus202106.h.

const Var ana::kPTrackInd

Definition at line 13 of file NumuVarsIcarus202106.h.

const Cut ana::kRazzleDazzleNueSel = kNueAllTrackDazzleMuonCut && kShowerRazzleElectronScoreCut

Definition at line 39 of file NueCuts.h.

const Var ana::kRecoMuonP

Definition at line 15 of file NumuVarsIcarus202106.h.

const Cut ana::kRecoNueSel = kRecoShower && kShowerEnergyCut

Definition at line 37 of file NueCuts.h.

const Cut ana::kRecoShower

Definition at line 8 of file NueCuts.h.

const Var ana::kRecoShower_BestdEdx

Definition at line 11 of file NueVars.h.

const Var ana::kRecoShower_BestEnergy

Definition at line 10 of file NueVars.h.

const Var ana::kRecoShower_ConversionGap

Definition at line 12 of file NueVars.h.

const Var ana::kRecoShower_Density

Definition at line 13 of file NueVars.h.

const Var ana::kRecoShower_densityGradient

Definition at line 24 of file NueVars.h.

const Var ana::kRecoShower_densityGradientPower

Definition at line 25 of file NueVars.h.

const Var ana::kRecoShower_EndX

Definition at line 20 of file NueVars.h.

const Var ana::kRecoShower_EndY

Definition at line 21 of file NueVars.h.

const Var ana::kRecoShower_EndZ

Definition at line 22 of file NueVars.h.

const Var ana::kRecoShower_Energy

Definition at line 14 of file NueVars.h.

const Var ana::kRecoShower_Length

Definition at line 15 of file NueVars.h.

const Var ana::kRecoShower_OpenAngle

Definition at line 16 of file NueVars.h.

const Var ana::kRecoShower_StartX

Definition at line 17 of file NueVars.h.

const Var ana::kRecoShower_StartY

Definition at line 18 of file NueVars.h.

const Var ana::kRecoShower_StartZ

Definition at line 19 of file NueVars.h.

const Var ana::kRecoShower_trackLength

Definition at line 26 of file NueVars.h.

const Var ana::kRecoShower_trackWidth

Definition at line 27 of file NueVars.h.

const Var ana::kRecoShower_TruePdg

Definition at line 29 of file NueVars.h.

Definition at line 44 of file NueCuts.h.

const Var ana::kRecoShowerRazzleElectronScore

Definition at line 45 of file NueVars.h.

const Var ana::kRecoShowerRazzlePID

Definition at line 44 of file NueVars.h.

const Var ana::kRecoShowers_EnergyCut

Definition at line 31 of file NueVars.h.

const Cut ana::kRFiducial

Definition at line 22 of file NumuCutsIcarus202106.h.

const SpillVar ana::kRun = SIMPLESPILLVAR(hdr.run)

Definition at line 15 of file Vars.cxx.

const int ana::kSBND = 0

Definition at line 11 of file ExpInfo.h.

const Color_t ana::kSecoColorIH = kOrange+10

Definition at line 38 of file sbnana/sbnana/CAFAna/Analysis/Style.h.

const Color_t ana::kSecoColorNH = kAzure+1

Definition at line 35 of file sbnana/sbnana/CAFAna/Analysis/Style.h.

const Cut ana::kShowerConvGapCut

Definition at line 22 of file NueCuts.h.

const Cut ana::kShowerdEdxCut

Definition at line 21 of file NueCuts.h.

const Cut ana::kShowerDensityCut

Definition at line 23 of file NueCuts.h.

const Cut ana::kShowerEnergyCut

Definition at line 20 of file NueCuts.h.

const Cut ana::kShowerOpenAngleCut

Definition at line 24 of file NueCuts.h.

const Cut ana::kShowerRazzleElectronCut = kRecoShowerRazzlePID == 11

Definition at line 128 of file NueCuts.cxx.

const Cut ana::kShowerRazzleElectronScoreCut = kRecoShowerRazzleElectronScore > 0.8

Definition at line 129 of file NueCuts.cxx.

const Cut ana::kSlcCompletenessCut

Definition at line 29 of file SBNAna/Cuts/TruthCuts.h.

const Cut ana::kSlcFlashMatchCut

Definition at line 28 of file SBNAna/Cuts/Cuts.h.

const Cut ana::kSlcFlashMatchScoreCut

Definition at line 15 of file NumuCutsSBND202106.h.

const Cut ana::kSlcFlashMatchTimeCut

Definition at line 14 of file NumuCutsSBND202106.h.

const Var ana::kSlcFlashScore

Definition at line 35 of file Vars.h.

const Var ana::kSlcHasFlash

Definition at line 34 of file Vars.h.

const Cut ana::kSlcHasFlashMatch

Definition at line 27 of file SBNAna/Cuts/Cuts.h.

const Cut ana::kSlcIsRecoNu

Definition at line 24 of file SBNAna/Cuts/Cuts.h.

const Var ana::kSlcNuScore

Definition at line 33 of file Vars.h.

const Cut ana::kSlcNuScoreCut

Definition at line 25 of file SBNAna/Cuts/Cuts.h.

const Var ana::kSlcVtxX

Definition at line 30 of file Vars.h.

const Var ana::kSlcVtxY

Definition at line 31 of file Vars.h.

const Var ana::kSlcVtxZ

Definition at line 32 of file Vars.h.

const SpillVar ana::kSpillCounting = kSpillUnweighted

Definition at line 20 of file Vars.cxx.

const Cut ana::kTFiducial

Definition at line 20 of file NumuCutsIcarus202106.h.

const Color_t ana::kTotalBackgroundColor = kAzure+2

Definition at line 16 of file sbnana/sbnana/CAFAna/Analysis/Style.h.

const Color_t ana::kTotalMCColor = kRed

Definition at line 13 of file sbnana/sbnana/CAFAna/Analysis/Style.h.

const Color_t ana::kTotalMCErrorBandColor = kRed-10

Definition at line 14 of file sbnana/sbnana/CAFAna/Analysis/Style.h.

const Cut ana::kTrueActiveVolumeFDCryo1

Definition at line 21 of file SBNAna/Cuts/TruthCuts.h.

const Cut ana::kTrueActiveVolumeFDCryo2

Definition at line 22 of file SBNAna/Cuts/TruthCuts.h.

const Cut ana::kTrueActiveVolumeND

Definition at line 19 of file SBNAna/Cuts/TruthCuts.h.

const Var ana::kTrueE([](const caf::SRSliceProxy *slc) -> double{return slc->truth.E;})
const Binning ana::kTrueEnergyBins = TrueEnergyBins()

Default true-energy bin edges.

Definition at line 71 of file Binning.h.

const Cut ana::kTrueFiducialVolumeFDCryo1

Definition at line 24 of file SBNAna/Cuts/TruthCuts.h.

const Cut ana::kTrueFiducialVolumeFDCryo2

Definition at line 25 of file SBNAna/Cuts/TruthCuts.h.

const Cut ana::kTrueFiducialVolumeND

Definition at line 20 of file SBNAna/Cuts/TruthCuts.h.

const Var ana::kTrueLOverE = kBaseline / kTrueE

Definition at line 30 of file OscillatableSpectrum.cxx.

const Binning ana::kTrueLOverEBins = Binning::Simple(100, 0, 2)

Definition at line 74 of file Binning.h.

const Var ana::kTrueMuonP

Definition at line 17 of file NumuVarsIcarus202106.h.

const Var ana::kTruthEnergy

Definition at line 10 of file TruthVars.h.

const Var ana::kTruthIndex = SIMPLEVAR(truth.index)

Definition at line 7 of file NumuVarsIcarus202106.cxx.

const SpillVar ana::kTruthLeptonEnergy

Definition at line 23 of file TruthVars.h.

const SpillVar ana::kTruthNuEnergy

Definition at line 22 of file TruthVars.h.

const Var ana::kTruthVtxDistMag

Definition at line 20 of file TruthVars.h.

const Var ana::kTruthVtxDistX

Definition at line 16 of file TruthVars.h.

const Var ana::kTruthVtxDistY

Definition at line 17 of file TruthVars.h.

const Var ana::kTruthVtxDistZ

Definition at line 18 of file TruthVars.h.

const Var ana::kTruthVtxX

Definition at line 12 of file TruthVars.h.

const Var ana::kTruthVtxY

Definition at line 13 of file TruthVars.h.

const Var ana::kTruthVtxZ

Definition at line 14 of file TruthVars.h.

const Cut ana::kVtxDistMagCut

Definition at line 27 of file SBNAna/Cuts/TruthCuts.h.

f sin ana::theta_
Initial value:
{\mu\mu} \f$
class FitSinSq2ThetaMuMu: public IConstrainedFitVar
{
public:
virtual double GetValue(const osc::IOscCalcAdjustable* osc) const;
virtual void SetValue(osc::IOscCalcAdjustable* osc, double val) const;
virtual std::string ShortName() const {return "ss2thmm";}
virtual std::string LatexName() const {return "sin^{2}2#theta_{#mu#mu}";}
virtual double LowLimit() const {return 0;}
virtual double HighLimit() const {return 1;}
}
pdgs mu
Definition: selectors.fcl:22
std::string LatexName(int pdgcode)
Convert PDG code to a latex string (root-style)
Definition: TruthText.cxx:12

Definition at line 27 of file FitVarsSterileApprox.h.