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

Functions

def InBeam
 
def InBeamVeto
 
def InBeamTrue
 
def InFV
 
def get_primary_tracks
 
def get_true_primary_track
 
def crtveto
 
def crttrackveto_perevt
 
def crttrackveto
 
def crttrackveto_nobottom_perevt
 
def crttrackveto_nobottom
 
def fid
 
def nu_score
 
def f_time
 
def f_score
 
def ptrk
 
def crttrack
 
def crthit
 

Function Documentation

def selection.crthit (   data)

Definition at line 78 of file selection.py.

78 
79 def crthit(data):
80  return np.isnan(data["slc.ptrk.crthit.distance"]) | (data["slc.ptrk.crthit.distance"] > 5) | InBeam(data["slc.ptrk.crthit.hit.time"])
def crthit
Definition: selection.py:78
def InBeam
Definition: selection.py:4
def selection.crttrack (   data)

Definition at line 76 of file selection.py.

76 
77 def crttrack(data):
return np.isnan(data["slc.ptrk.crttrack.angle"]) | (data["slc.ptrk.crttrack.angle"] > 0.05)
def crttrack
Definition: selection.py:76
def selection.crttrackveto (   data)

Definition at line 58 of file selection.py.

58 
59 def crttrackveto(data):
60  return broadcast(crttrackveto_perevt(data), data["nslc"])
def crttrackveto_perevt
Definition: selection.py:56
def broadcast
Definition: helpers.py:5
def crttrackveto
Definition: selection.py:58
def selection.crttrackveto_nobottom (   data)

Definition at line 63 of file selection.py.

63 
64 def crttrackveto_nobottom(data):
65  return broadcast(crttrackveto_nobottom_perevt(data), data["nslc"])
def crttrackveto_nobottom
Definition: selection.py:63
def crttrackveto_nobottom_perevt
Definition: selection.py:61
def broadcast
Definition: helpers.py:5
def selection.crttrackveto_nobottom_perevt (   data)

Definition at line 61 of file selection.py.

61 
return np.invert((InBeamVeto(data["crt_tracks.time"]) & (data["crt_tracks.hita.position.y"] > -357.) & (data["crt_tracks.hitb.position.y"] > -357.)).any())
def crttrackveto_nobottom_perevt
Definition: selection.py:61
def InBeamVeto
Definition: selection.py:7
def selection.crttrackveto_perevt (   data)

Definition at line 56 of file selection.py.

56 
57 def crttrackveto_perevt(data):
return np.invert(InBeamVeto(data["crt_tracks.time"]).any())
def crttrackveto_perevt
Definition: selection.py:56
def InBeamVeto
Definition: selection.py:7
def selection.crtveto (   data)

Definition at line 54 of file selection.py.

54 
55 def crtveto(data):
return broadcast(np.invert(InBeamVeto(data["crt_hits.time"]).any()), data["nslc"])
def broadcast
Definition: helpers.py:5
def InBeamVeto
Definition: selection.py:7
def crtveto
Definition: selection.py:54
def selection.f_score (   data)

Definition at line 72 of file selection.py.

72 
73 def f_score(data):
return data["slc.fmatch.score"] < 7
def f_score
Definition: selection.py:72
def selection.f_time (   data)

Definition at line 70 of file selection.py.

70 
71 def f_time(data):
return InBeam(data["slc.fmatch.time"])
def f_time
Definition: selection.py:70
def InBeam
Definition: selection.py:4
def selection.fid (   data)

Definition at line 66 of file selection.py.

66 
67 def fid(data):
return InFV(data["slc.vertex.x"], data["slc.vertex.y"], data["slc.vertex.z"])
def fid
Definition: selection.py:66
def InFV
Definition: selection.py:13
def selection.get_primary_tracks (   data)

Definition at line 24 of file selection.py.

24 
25 def get_primary_tracks(data):
26  # these are the tracks that we consider as coming from the neutrino vertex
27  from_slice = data["slc.reco.trk.atslc"] & data["slc.reco.trk.parent_is_primary"]
28 
29  maybe_muon_exiting = np.invert(data["slc.reco.trk.contained"]) & (data["slc.reco.trk.len"] > 100)
30  maybe_muon_contained = data["slc.reco.trk.contained"] & (data["slc.reco.trk.bestplane.chi2_proton"] > 60) & (data["slc.reco.trk.bestplane.chi2_muon"] < 30) & (data["slc.reco.trk.len"] > 50)
31  # In cases where all the tracks are contained, first apply cuts on the particle ID
32  maybe_muon = from_slice & (maybe_muon_contained | maybe_muon_exiting)
33  has_maybe_muon = maybe_muon.any()
34 
35  # Cases where all the tracks are contained
36  ret = (data["slc.reco.trk.len"]*maybe_muon).argmax().max()
37  # map very small to -1
38  ret[ret < 0] = -1
39  ret[np.invert(has_maybe_muon)] = -1
40  return ret
41 
# Using truth to get the primary track
def get_primary_tracks
Definition: selection.py:24
def selection.get_true_primary_track (   data)

Definition at line 42 of file selection.py.

42 
43 def get_true_primary_track(data):
44  ret = ((np.abs(data["slc.reco.trk.truth.p.pdg"]) == 13) & \
45  (data["slc.reco.trk.truth.bestmatch.energy"] / data["slc.reco.trk.truth.p.planeVisE"] > 0.5)).argmax().max()
46  is_numu_cc = (data["slc.truth.index"] >= 0) & data["slc.truth.iscc"] & (np.abs(data["slc.truth.pdg"]) == 14)
47  # ignore non cc numu cases
48  ret[np.invert(is_numu_cc)] = -1
49  ret[ret<0] = -1
50  # setup for index
51  #ret = group(ret, np.ones(ret.shape, dtype="int"))
52  return ret
53 
# Define the Cuts!!!!!
def get_true_primary_track
Definition: selection.py:42
def selection.InBeam (   t)

Definition at line 4 of file selection.py.

4 
5 def InBeam(t): # us
6  return (t > 0.) & (t < 1.800) # allow some wiggle
def InBeam
Definition: selection.py:4
def selection.InBeamTrue (   t)

Definition at line 10 of file selection.py.

10 
11 def InBeamTrue(t): # us
12  return (t > 0.) & (t < 1.596) # No wiggle!
def InBeamTrue
Definition: selection.py:10
def selection.InBeamVeto (   t)

Definition at line 7 of file selection.py.

7 
8 def InBeamVeto(t): # us
9  return (t > 0.) & (t < 2.200) # allow some wiggle
def InBeamVeto
Definition: selection.py:7
def selection.InFV (   x,
  y,
  z 
)

Definition at line 13 of file selection.py.

13 
14 def InFV(x, y, z): # cm
15  xmin = -199.15 + 10
16  ymin = -200. + 10
17  zmin = 0.0 + 10
18  xmax = 199.15 - 10
19  ymax = 200. - 10
20  zmax = 500. - 50
21 
22  return (x > xmin) & (x < xmax) & (y > ymin) & (y < ymax) & (z > zmin) & (z < zmax)
23 
# Primary track calculation
def InFV
Definition: selection.py:13
def selection.nu_score (   data)

Definition at line 68 of file selection.py.

68 
69 def nu_score(data):
return (data["slc.nu_score"] > 0.4) & np.invert(data["slc.is_clear_cosmic"])
def nu_score
Definition: selection.py:68
def selection.ptrk (   data)

Definition at line 74 of file selection.py.

74 
75 def ptrk(data):
return data["slc.has_ptrk"] & np.invert(np.isnan(data["slc.ptrk.recop"])) & (data["slc.ptrk.recop"] < 7.5) & (data["slc.ptrk.recop"] > 0.)
def ptrk
Definition: selection.py:74