Functions | Variables
PandAna.Demos.demo_prong Namespace Reference

Functions

def kNDRockFilter (tables)
 
def kProngDispl (tables)
 
def kIgnoreMuon2018 (tables)
 

Variables

 KLP = KL+['rec.vtx.elastic.fuzzyk.png_idx']
 
 kNDRockFilter = Cut(kNDRockFilter)
 
 kProngNhitsCut = Cut(lambda tables: tables['rec.vtx.elastic.fuzzyk.png']['nhit'] < 6)
 
 kPhotonID2018Cut = Cut(lambda tables: tables['rec.vtx.elastic.fuzzyk.png.cvnpart']['photonid'] < 0.6)
 
 kIsNeutron = Cut(lambda tables: abs(tables['rec.vtx.elastic.fuzzyk.png.truth']['motherpdg']) == 2112)
 
 kIgnoreMuon2018 = Cut(kIgnoreMuon2018)
 
 kProngCuts = kIgnoreMuon2018&kIsNeutron&kProngNhitsCut&kPhotonID2018Cut
 
 kProtonID = Var(lambda tables: abs(tables['rec.vtx.elastic.fuzzyk.png.cvnpart']['protonid']))
 
int limit = 100
 
string filelist = '/pnfs/nova/persistent/users/karlwarb/HDF5-Training-19-02-26/ND-ProngCVN-RHC/*.h5'
 
 tablesProng = pa.loader(filelist,limit=limit, index=KLP)
 
 tablesSlc = pa.loader(filelist, limit=limit)
 
 a = pa.associate([tablesProng, tablesSlc])
 
 specDummySlc = pa.spectrum(tablesSlc, kNDRockFilter & kNumuContainND, kProngDispl)
 
 specProng = pa.spectrum(tablesProng, kProngCuts, kProtonID)
 
 prongdispldf = specDummySlc.df()
 
 vardf = specProng.df()
 
 finaldf = pd.concat([prongdispldf, vardf], axis=1, join='inner')[vardf.name]
 
 finalspec = pa.filledSpectrum(finaldf, specProng.POT())
 
 n
 
 bins
 
 range
 
 weights
 
 histtype
 
 color
 
 label
 
 loc
 

Function Documentation

def PandAna.Demos.demo_prong.kIgnoreMuon2018 (   tables)

Definition at line 51 of file demo_prong.py.

References PandAna.Demos.demo_prong.kIgnoreMuon2018.

51 def kIgnoreMuon2018(tables):
52  dfpng = tables['rec.vtx.elastic.fuzzyk.png.cvnpart']['muonid']
53  dflen = tables['rec.vtx.elastic.fuzzyk.png']['len']
54  if not dfpng.empty:
55  dflen = dflen.reset_index().set_index(KL)
56  dfpng = dfpng.reset_index().set_index(KL)
57  maxid = dfpng['muonid'].groupby(level=KL).agg(np.max)
58  ret = pd.concat([dfpng['muonid'] - maxid, dfpng['rec.vtx.elastic.fuzzyk.png_idx'], dflen['len']], axis=1)
59  ret = ret.reset_index().set_index(KLP)
60  return ((ret['muonid'] < 0) & (ret['len'] <= 500))
61  else:
62  return dfpng
def PandAna.Demos.demo_prong.kNDRockFilter (   tables)

Definition at line 18 of file demo_prong.py.

References PandAna.Demos.demo_prong.kNDRockFilter.

18 def kNDRockFilter(tables):
19  df = tables['rec.vtx.elastic']
20  ret = (df['vtx.x'] > -180) & \
21  (df['vtx.x'] < 180) & \
22  (df['vtx.y'] > -180) & \
23  (df['vtx.y'] < 180) & \
24  (df['vtx.z'] > 20)
25  ret.name = 'rock'
26  return ret
def PandAna.Demos.demo_prong.kProngDispl (   tables)

Definition at line 30 of file demo_prong.py.

30 def kProngDispl(tables):
31  dfvtx = tables['rec.vtx.elastic'][['vtx.x', 'vtx.y', 'vtx.z']]
32  dfpng = tables['rec.vtx.elastic.fuzzyk.png'][['start.x', 'start.y', 'start.z', 'rec.vtx.elastic.fuzzyk.png_idx']]
33 
34  xdiff = dfvtx['vtx.x'] - dfpng['start.x']
35  ydiff = dfvtx['vtx.y'] - dfpng['start.y']
36  zdiff = dfvtx['vtx.z'] - dfpng['start.z']
37  length = np.sqrt(xdiff*xdiff + ydiff*ydiff + zdiff*zdiff)
38  length.name = 'disp'
39  idx = dfpng['rec.vtx.elastic.fuzzyk.png_idx']
40  ret = pd.concat([length, idx], axis=1)
41  ret = ret.reset_index().set_index(KLP)
42 
43  return (ret['disp'] > 20).where(ret['disp'] > 20)
44 
45 
46 # prong cuts that don't need slice indices
def kProngDispl(tables)
Definition: demo_prong.py:30

Variable Documentation

PandAna.Demos.demo_prong.a = pa.associate([tablesProng, tablesSlc])

Definition at line 77 of file demo_prong.py.

PandAna.Demos.demo_prong.bins

Definition at line 100 of file demo_prong.py.

PandAna.Demos.demo_prong.color

Definition at line 104 of file demo_prong.py.

string PandAna.Demos.demo_prong.filelist = '/pnfs/nova/persistent/users/karlwarb/HDF5-Training-19-02-26/ND-ProngCVN-RHC/*.h5'

Definition at line 73 of file demo_prong.py.

Referenced by FileNameToRunSubrun(), SamFileNameToRunSubrun(), and specprod_numuccinc().

PandAna.Demos.demo_prong.finaldf = pd.concat([prongdispldf, vardf], axis=1, join='inner')[vardf.name]

Definition at line 94 of file demo_prong.py.

PandAna.Demos.demo_prong.finalspec = pa.filledSpectrum(finaldf, specProng.POT())

Definition at line 97 of file demo_prong.py.

PandAna.Demos.demo_prong.histtype

Definition at line 104 of file demo_prong.py.

PandAna.Demos.demo_prong.kIgnoreMuon2018 = Cut(kIgnoreMuon2018)

Definition at line 63 of file demo_prong.py.

Referenced by PandAna.Demos.demo_prong.kIgnoreMuon2018().

PandAna.Demos.demo_prong.kIsNeutron = Cut(lambda tables: abs(tables['rec.vtx.elastic.fuzzyk.png.truth']['motherpdg']) == 2112)

Definition at line 49 of file demo_prong.py.

PandAna.Demos.demo_prong.KLP = KL+['rec.vtx.elastic.fuzzyk.png_idx']

Definition at line 15 of file demo_prong.py.

PandAna.Demos.demo_prong.kNDRockFilter = Cut(kNDRockFilter)

Definition at line 27 of file demo_prong.py.

Referenced by PandAna.Demos.demo_prong.kNDRockFilter().

PandAna.Demos.demo_prong.kPhotonID2018Cut = Cut(lambda tables: tables['rec.vtx.elastic.fuzzyk.png.cvnpart']['photonid'] < 0.6)

Definition at line 48 of file demo_prong.py.

PandAna.Demos.demo_prong.kProngCuts = kIgnoreMuon2018&kIsNeutron&kProngNhitsCut&kPhotonID2018Cut

Definition at line 67 of file demo_prong.py.

PandAna.Demos.demo_prong.kProngNhitsCut = Cut(lambda tables: tables['rec.vtx.elastic.fuzzyk.png']['nhit'] < 6)

Definition at line 47 of file demo_prong.py.

PandAna.Demos.demo_prong.kProtonID = Var(lambda tables: abs(tables['rec.vtx.elastic.fuzzyk.png.cvnpart']['protonid']))

Definition at line 70 of file demo_prong.py.

PandAna.Demos.demo_prong.label

Definition at line 104 of file demo_prong.py.

int PandAna.Demos.demo_prong.limit = 100
PandAna.Demos.demo_prong.loc

Definition at line 108 of file demo_prong.py.

PandAna.Demos.demo_prong.n

Definition at line 100 of file demo_prong.py.

PandAna.Demos.demo_prong.prongdispldf = specDummySlc.df()

Definition at line 87 of file demo_prong.py.

PandAna.Demos.demo_prong.range

Definition at line 100 of file demo_prong.py.

PandAna.Demos.demo_prong.specDummySlc = pa.spectrum(tablesSlc, kNDRockFilter & kNumuContainND, kProngDispl)

Definition at line 80 of file demo_prong.py.

PandAna.Demos.demo_prong.specProng = pa.spectrum(tablesProng, kProngCuts, kProtonID)

Definition at line 82 of file demo_prong.py.

PandAna.Demos.demo_prong.tablesProng = pa.loader(filelist,limit=limit, index=KLP)

Definition at line 74 of file demo_prong.py.

PandAna.Demos.demo_prong.tablesSlc = pa.loader(filelist, limit=limit)

Definition at line 75 of file demo_prong.py.

PandAna.Demos.demo_prong.vardf = specProng.df()

Definition at line 88 of file demo_prong.py.

PandAna.Demos.demo_prong.weights

Definition at line 104 of file demo_prong.py.