Functions | Variables
PandAna.Demos.tute_pid_validation Namespace Reference

Functions

def kNewCVNe (tables)
 
def kNewCVNm (tables)
 
def kNewCVNnc (tables)
 
def kWoscDumb (tables, weight)
 
def SigCuts (idx='nueid')
 
def BkgCuts (idx='nueid')
 
def ModeCuts (mode=-1)
 

Variables

string definition = 'def_snapshot karlwarb-MLTute2019-HDF5_R19-11-18-prod5reco.n_fluxswap'
 
list var = ['rec.sel.cvnloosepreselptp', 'rec.sel.cvnoldpresel']
 
 kNewCVNe = Var(kNewCVNe)
 
 kNewCVNm = Var(kNewCVNm)
 
 kNewCVNnc = Var(kNewCVNnc)
 
dictionary cvn_vars = {}
 
 kInelasticity = Var(lambda tables: tables['rec.mc.nu']['y'])
 
 kTrueE = Var(lambda tables: tables['rec.mc.nu']['E'])
 
 kPDG = Var(lambda tables: tables['rec.mc.nu']['pdg'])
 
 kPDGAbs = Var(lambda tables: abs(tables['rec.mc.nu']['pdg']))
 
 kMode = Var(lambda tables: tables['rec.mc.nu']['mode'])
 
 kIsCC = Cut(lambda tables: tables['rec.mc.nu']['iscc'] == 1)
 
 kIsNC = Cut(lambda tables: tables['rec.mc.nu']['iscc'] == 0)
 
 kNueFDSel = kNueProngContainment&kVeto
 
 kNumuFDSel = kNumuBasicQuality&kNumuContainFD
 
 kNusFDSel = kNusFDContain&kVeto
 
list ids = ['nueid', 'numuid', 'ncid']
 
dictionary sel_cuts = {}
 
dictionary truth_cuts = {}
 
dictionary mode_cuts = {}
 
 parser
 
 help
 
 type
 
 int
 
 default
 
 action
 
 args = parser.parse_args()
 
string filename = 'cvn_truth_dist.h5'
 
 tables = loader(definition, limit=args.limit, stride=args.stride, offset=args.offset)
 
dictionary specs = {}
 
 cut = sel_cut&pcut&mcut
 
string specid = 'cvn_%s_%s_%s'
 
 weight
 
string trueEid = 'trueE_%s_%s_%s'
 
string trueYid = 'trueY_%s_%s_%s'
 
dictionary combined = {}
 
string cid = '%s_%s_%s'
 
string cvnid = 'cvn_%s_%s_%s'
 
 title
 
 folder
 
 slc
 

Function Documentation

def PandAna.Demos.tute_pid_validation.BkgCuts (   idx = 'nueid')

Definition at line 78 of file tute_pid_validation.py.

78 def BkgCuts(idx='nueid'):
79  cut = Cut(lambda tables: tables['rec.mc']['nnu'] == 1)
80  if 'nue' in idx:
81  cut = cut & ((kPDGAbs != 12) | ~kIsCC)
82  if 'numu' in idx:
83  cut = cut & ((kPDGAbs != 14) | ~kIsCC)
84  if 'nc' in idx:
85  cut = cut & (~kIsNC)
86  return cut
87 
88 # some basic preselections for each analysis
def PandAna.Demos.tute_pid_validation.kNewCVNe (   tables)

Definition at line 18 of file tute_pid_validation.py.

References PandAna.Demos.tute_pid_validation.kNewCVNe.

18 def kNewCVNe(tables):
19  df = []
20  for v in var:
21  df.append(tables[v]['nueid'])
22  ret = pd.concat(df, axis=1)
23  ret.columns = [re.sub(r'rec.sel.', '', v) for v in var]
24  return ret
def PandAna.Demos.tute_pid_validation.kNewCVNm (   tables)

Definition at line 27 of file tute_pid_validation.py.

References PandAna.Demos.tute_pid_validation.kNewCVNm.

27 def kNewCVNm(tables):
28  df = []
29  for v in var:
30  df.append(tables[v]['numuid'])
31  ret = pd.concat(df, axis=1)
32  ret.columns = [re.sub(r'rec.sel.', '', v) for v in var]
33  return ret
def PandAna.Demos.tute_pid_validation.kNewCVNnc (   tables)

Definition at line 36 of file tute_pid_validation.py.

References PandAna.Demos.tute_pid_validation.kNewCVNnc.

36 def kNewCVNnc(tables):
37  df = []
38  for v in var:
39  df.append(tables[v]['ncid'])
40  ret = pd.concat(df, axis=1)
41  ret.columns = [re.sub(r'rec.sel.', '', v) for v in var]
42  return ret
def PandAna.Demos.tute_pid_validation.kWoscDumb (   tables,
  weight 
)

Definition at line 55 of file tute_pid_validation.py.

55 def kWoscDumb(tables, weight):
56  sel = (tables['rec.mc']['nnu'] == 1)
57  weight[sel] *= tables['rec.mc.nu']['woscdumb']
58  return weight
59 
60 # now define some truth cuts
def PandAna.Demos.tute_pid_validation.ModeCuts (   mode = -1)

Definition at line 109 of file tute_pid_validation.py.

109 def ModeCuts(mode=-1):
110  cut = Cut(lambda tables: tables['rec.mc']['nnu'] == 1)
111  if mode >= 0:
112  cut = cut & (kMode == mode)
113  return cut
114 
def PandAna.Demos.tute_pid_validation.SigCuts (   idx = 'nueid')

Definition at line 68 of file tute_pid_validation.py.

68 def SigCuts(idx='nueid'):
69  cut = Cut(lambda tables: tables['rec.mc']['nnu'] == 1)
70  if 'nue' in idx:
71  cut = cut & (kPDGAbs == 12) & kIsCC
72  if 'numu' in idx:
73  cut = cut & (kPDGAbs == 14) & kIsCC
74  if 'nc' in idx:
75  cut = cut & (~kIsCC)
76  return cut
77 

Variable Documentation

PandAna.Demos.tute_pid_validation.action

Definition at line 135 of file tute_pid_validation.py.

PandAna.Demos.tute_pid_validation.args = parser.parse_args()

Definition at line 137 of file tute_pid_validation.py.

string PandAna.Demos.tute_pid_validation.cid = '%s_%s_%s'
dictionary PandAna.Demos.tute_pid_validation.combined = {}

Definition at line 167 of file tute_pid_validation.py.

PandAna.Demos.tute_pid_validation.cut = sel_cut&pcut&mcut

Definition at line 148 of file tute_pid_validation.py.

dictionary PandAna.Demos.tute_pid_validation.cvn_vars = {}

Definition at line 45 of file tute_pid_validation.py.

string PandAna.Demos.tute_pid_validation.cvnid = 'cvn_%s_%s_%s'

Definition at line 172 of file tute_pid_validation.py.

PandAna.Demos.tute_pid_validation.default

Definition at line 126 of file tute_pid_validation.py.

string PandAna.Demos.tute_pid_validation.definition = 'def_snapshot karlwarb-MLTute2019-HDF5_R19-11-18-prod5reco.n_fluxswap'
string PandAna.Demos.tute_pid_validation.filename = 'cvn_truth_dist.h5'

Definition at line 139 of file tute_pid_validation.py.

PandAna.Demos.tute_pid_validation.folder

Definition at line 180 of file tute_pid_validation.py.

Referenced by bicount(), bicount_2018(), BlessedPlotsAna(), BlessedPlotsAnaByPeriod(), CalcRWithSysts(), CalcRWithSystsNus17(), CutTableAna(), DataVtxDistributionAna(), ExtendedAxesAna(), FDDataMCSystBandAna(), FillMaps(), FitParamEffectsAna(), FitSystEffectsAna(), get_file_name(), genie::Registry.GetItemMap(), is_parsable_folder(), LOverEPlot(), make_nus17_fc_surfs(), median_contours(), NDDataMCSystBandAna(), Nus18SystsBeamTranspLoad(), Nus18SystsCalibAbsLoad(), Nus18SystsCalibRelLoad(), Nus18SystsGENIELoad(), Nus18SystsKaonLoad(), Nus18SystsLightLevelLoad(), Nus18SystsLLMethodLoad(), Nus18SystsNeutronLoad(), Nus18SystsPPFXLoad(), Nus18SystsTauLoad(), Nus18SystsXSecOnOffLoad(), NusSystMaker(), PlotNus17Prediction(), PlotNus17PredSystsData(), reduce_the_predfile_nue_numu(), SideBandAna(), SpectrumParamEffectsAna(), SystsAcceptanceAna17(), SystsAcceptanceLoad17(), SystsBeamAna(), SystsBeamLoad(), SystsBeamTranspAna(), SystsBeamTranspLoad17(), SystsBirksAna(), SystsBirksLoad(), SystsCalibAbsAna(), SystsCalibAbsAna17(), SystsCalibAbsLoad(), SystsCalibAbsLoad17(), SystsCalibAbsMethod17(), SystsCalibRelAna(), SystsCalibRelAna17(), SystsCalibRelLoad(), SystsCalibRelLoad17(), SystsDecompAna(), SystsDecompAna17(), SystsDecompLoad(), SystsDecompLoad17(), SystsFidContAna(), SystsFidContLoad(), SystsGENIEAna(), SystsGENIEAna17(), SystsGENIELoad(), SystsGENIELoad17(), SystsMCStatsAna(), SystsMCStatsLoad(), SystsNDRockAna(), SystsNDRockLoad(), SystsNoiseAna(), SystsNoiseLoad(), SystsOscParamAna(), SystsPPFXAna17(), and SystsPPFXLoad17().

PandAna.Demos.tute_pid_validation.help

Definition at line 125 of file tute_pid_validation.py.

list PandAna.Demos.tute_pid_validation.ids = ['nueid', 'numuid', 'ncid']
PandAna.Demos.tute_pid_validation.int

Definition at line 126 of file tute_pid_validation.py.

PandAna.Demos.tute_pid_validation.kInelasticity = Var(lambda tables: tables['rec.mc.nu']['y'])

Definition at line 51 of file tute_pid_validation.py.

PandAna.Demos.tute_pid_validation.kIsCC = Cut(lambda tables: tables['rec.mc.nu']['iscc'] == 1)
PandAna.Demos.tute_pid_validation.kIsNC = Cut(lambda tables: tables['rec.mc.nu']['iscc'] == 0)

Definition at line 65 of file tute_pid_validation.py.

PandAna.Demos.tute_pid_validation.kMode = Var(lambda tables: tables['rec.mc.nu']['mode'])

Definition at line 63 of file tute_pid_validation.py.

PandAna.Demos.tute_pid_validation.kNewCVNe = Var(kNewCVNe)

Definition at line 25 of file tute_pid_validation.py.

Referenced by PandAna.Demos.tute_pid_validation.kNewCVNe().

PandAna.Demos.tute_pid_validation.kNewCVNm = Var(kNewCVNm)

Definition at line 34 of file tute_pid_validation.py.

Referenced by PandAna.Demos.tute_pid_validation.kNewCVNm().

PandAna.Demos.tute_pid_validation.kNewCVNnc = Var(kNewCVNnc)

Definition at line 43 of file tute_pid_validation.py.

Referenced by PandAna.Demos.tute_pid_validation.kNewCVNnc().

PandAna.Demos.tute_pid_validation.kNueFDSel = kNueProngContainment&kVeto

Definition at line 89 of file tute_pid_validation.py.

PandAna.Demos.tute_pid_validation.kNumuFDSel = kNumuBasicQuality&kNumuContainFD

Definition at line 91 of file tute_pid_validation.py.

PandAna.Demos.tute_pid_validation.kNusFDSel = kNusFDContain&kVeto

Definition at line 93 of file tute_pid_validation.py.

PandAna.Demos.tute_pid_validation.kPDG = Var(lambda tables: tables['rec.mc.nu']['pdg'])
PandAna.Demos.tute_pid_validation.kPDGAbs = Var(lambda tables: abs(tables['rec.mc.nu']['pdg']))

Definition at line 62 of file tute_pid_validation.py.

PandAna.Demos.tute_pid_validation.kTrueE = Var(lambda tables: tables['rec.mc.nu']['E'])

Definition at line 52 of file tute_pid_validation.py.

dictionary PandAna.Demos.tute_pid_validation.mode_cuts = {}

Definition at line 115 of file tute_pid_validation.py.

PandAna.Demos.tute_pid_validation.parser
Initial value:
1 = argparse.ArgumentParser(
2  description='Save CVN distributions for various truth cuts')

Definition at line 122 of file tute_pid_validation.py.

dictionary PandAna.Demos.tute_pid_validation.sel_cuts = {}

Definition at line 97 of file tute_pid_validation.py.

PandAna.Demos.tute_pid_validation.slc
string PandAna.Demos.tute_pid_validation.specid = 'cvn_%s_%s_%s'

Definition at line 149 of file tute_pid_validation.py.

PandAna.Demos.tute_pid_validation.specs = {}
PandAna.Demos.tute_pid_validation.tables = loader(definition, limit=args.limit, stride=args.stride, offset=args.offset)

Definition at line 141 of file tute_pid_validation.py.

PandAna.Demos.tute_pid_validation.title

Definition at line 180 of file tute_pid_validation.py.

string PandAna.Demos.tute_pid_validation.trueEid = 'trueE_%s_%s_%s'

Definition at line 151 of file tute_pid_validation.py.

string PandAna.Demos.tute_pid_validation.trueYid = 'trueY_%s_%s_%s'

Definition at line 153 of file tute_pid_validation.py.

dictionary PandAna.Demos.tute_pid_validation.truth_cuts = {}

Definition at line 102 of file tute_pid_validation.py.

PandAna.Demos.tute_pid_validation.type

Definition at line 126 of file tute_pid_validation.py.

list PandAna.Demos.tute_pid_validation.var = ['rec.sel.cvnloosepreselptp', 'rec.sel.cvnoldpresel']

Definition at line 17 of file tute_pid_validation.py.

Referenced by stan::math.acos(), stan::math.acosh(), ana::SpectrumLoaderBase.AddReweightableSpectrum(), ana::SpectrumLoaderBase.AddSpectrum(), Analyse_GetEfficiency(), Analyse_GetEfficiency_UseNEntries(), Analyse_OverlayStudies(), stan::math.asin(), stan::math.asinh(), stan::math.atan(), stan::math.atan2(), stan::math.atanh(), attenuation_calibration_comparisons(), attenuation_calibration_comparisons_withfb(), stan::math.autocovariance(), lem::MakePID.AvgAndFit(), avgefficiency(), ana::BayesianMarginal.BayesianMarginal(), stan::math.bessel_first_kind(), stan::math.bessel_second_kind(), stan::math.binary_log_loss(), stan::math::operands_and_partials< Op1, Op2, Op3, Op4, Op5, var >.build(), caf_numu_fd_validation_data(), caf_numu_fd_validation_MC(), caf_numu_fd_validation_MC_no_tau(), CalculateSyst(), stan::math.cbrt(), stan::math.ceil(), ana::SpectrumStan.Clear(), ana::MCMCSamples.Clear(), stan::math.columns_dot_product(), stan::math.columns_dot_self(), calib::AttenuationFit.ConsolidateViews(), stan::math.cos(), stan::math.cosh(), ana::CovMxSurface.CovMxSurface(), ana::StanFitter.DecodePars(), demoFitContours(), demoFitSlices(), stan::math.determinant(), DiagonalErrors(), stan::math.digamma(), Eigen::NumTraits< stan::math::var >.digits10(), stan::math.dot_product(), stan::math.dot_self(), drawLongTerm(), drawTimePlots(), drawVsPOT(), eff_plots(), ana.Efficiency(), efficiency(), efficiencySA(), stan::math.erf(), stan::math.erfc(), stan::math.exp(), stan::math.exp2(), stan::math.expm1(), stan::math.fabs(), fake_future_data(), FD_plots(), stan::math.fdim(), beamlinereco::WCTrackAlg.findTheHitPositions(), ana::StanFitter.FitHelperSeeded(), stan::math.floor(), stan::math.fma(), stan::math.fmax(), stan::math.fmin(), stan::math.fmod(), stan::math.gamma_p(), stan::math.gamma_q(), ana::CutVarCache< T, U >.Get(), ana::StanFitter.get_param_names(), getBatch(), getBNBPlots(), ana::SystShifts.GetShift(), rsim::ReadoutSim.GetSmearedPE(), ifdb::IFDBSpillInfo.GetStats(), GetSurf(), goodness_of_fit(), stan::math.grad_inc_beta(), ana::SpectrumLoader.HandleRecord(), ana.HistAxisFromNuTruthHistAxis(), stan::math.hypot(), stan::math.ibeta(), stan::math.if_else(), stan::math.inc_beta(), caf::CAFMaker.InitializeOutfile(), stan::math.integrate_1d(), stan::math.inv(), stan::math.inv_cloglog(), stan::math.inv_logit(), stan::math.inv_Phi(), stan::math.inv_sqrt(), stan::math.inv_square(), joint_fit_2017_slices(), joint_fit_2018_contours(), joint_fit_2018_slices(), joint_fit_2019_bestfit(), joint_fit_2019_contours(), joint_fit_2019_slices(), joint_fit_future_bestfit_univ(), joint_fit_future_contour_univ(), jointsensitivity(), stan::math.lgamma(), stan::math.lmgamma(), ana::PredictionSyst3Flavor2020.LoadNuePtExtrapPred(), stan::math.log(), stan::math.log10(), stan::math.log1m(), stan::math.log1m_exp(), stan::math.log1m_inv_logit(), stan::math.log1p(), stan::math.log1p_exp(), stan::math.log2(), stan::math.log_determinant(), stan::math.log_determinant_ldlt(), stan::math.log_determinant_spd(), stan::math.log_diff_exp(), stan::math.log_falling_factorial(), stan::math.log_inv_logit(), stan::math.log_inv_logit_diff(), ana::StanFitter.log_prob(), stan::model.log_prob_grad(), stan::model.log_prob_propto(), stan::math.log_rising_factorial(), stan::math.log_softmax(), stan::math.log_sum_exp(), stan::math.logit(), make_DataMCComp_numu(), make_eff_plots_areaNorm(), make_mass_and_oct_fc_input_2019(), Make_NuMuCC_Inc_XS_v2(), make_pi0_xcheck(), make_pid(), MakeLegend(), MakeMaps(), makePIDCutTuning(), ana::MCMCSamples.MarginalizeTo(), MarshaledG4VHitsCollection.marshal1(), MarshaledG4VHitsCollection.marshal2(), stan::math.modified_bessel_first_kind(), stan::math.modified_bessel_second_kind(), MRDiFStudy_FHC_Step2(), MRDiFStudy_RHC_Step2(), stan::math.multiply_log(), stan::math.multiply_lower_tri_self_transpose(), ND_DataMC(), nuCrystalBall(), stan::math.operator*(), stan::math.operator+(), stan::math.operator-(), stan::math.operator/(), OverlayGenerators(), stan::math.owens_t(), stan::math.Phi(), stan::math.Phi_approx(), pi0_xcheck(), plot_DataMCComp_numu(), plot_joint_fit_2020_slices(), plot_ND_DataMC(), plot_ND_DataMC_energybinning(), plot_prediction_systs(), PlotCovariance(), PlotGenRatios(), PlotUnfolding(), stan::math.pow(), prod4_pid(), ana.Profile(), stan::math.round(), stan::math.rows_dot_product(), Eigen::internal::general_matrix_vector_product< Index, stan::math::var, ColMajor, ConjugateLhs, stan::math::var, ConjugateRhs >.run(), Eigen::internal::general_matrix_vector_product< Index, stan::math::var, RowMajor, ConjugateLhs, stan::math::var, ConjugateRhs >.run(), run_joint_fit_2020_bestfit(), run_joint_fit_2020_contours(), run_joint_fit_2020_slices(), ana::MCMCSamples.SampleValue(), ana::BayesianMarginal.SaveTo(), ana::MCMCSamples.SaveTo(), sensitivity2018(), sensitivity2020(), mono::Track.set(), ana::BayesianMarginal.SetupKNN(), ana::MCMCSamples.SetupTree(), stan::math.sin(), stan::math.sinh(), stan::math.softmax(), specprod_numuccinc(), specprod_systematics(), ana::SpectrumLoaderNuTreeSpillCuts.SpectrumLoaderNuTreeSpillCuts(), stan::math.sqrt(), stan::math.square(), stan::math.squared_distance(), stan::math.step(), genie::NtpMCJobEnv.TakeSnapshot(), stan::math.tan(), stan::math.tanh(), stan::math.tcrossprod(), TEST(), test_stanfit_withsysts(), stan::math.tgamma(), timingPeak(), stan::math.to_var(), ana::BayesianMarginal.ToHistogram(), stan::math.trace_gen_inv_quad_form_ldlt(), stan::math.trace_gen_quad_form(), stan::math.trace_inv_quad_form_ldlt(), stan::math.trace_quad_form(), ana::StanFitter.transform_inits(), stan::math.trunc(), Tutorial2019Fit(), Tutorial2019FitContours(), Tutorial2019FitSlices(), stan::math.unit_vector_constrain(), MarshaledG4VHitsCollection.unmarshal1(), MarshaledG4VHitsCollection.unmarshal2(), validationscript(), ana::MCMCSamples.VarOffset(), and ana::CovMxSurface.~CovMxSurface().

PandAna.Demos.tute_pid_validation.weight

Definition at line 150 of file tute_pid_validation.py.