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(), genie::Registry.GetItemMap(), 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)

Definition at line 64 of file tute_pid_validation.py.

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'])

Definition at line 61 of file tute_pid_validation.py.

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.

PandAna.Demos.tute_pid_validation.weight

Definition at line 150 of file tute_pid_validation.py.