Skip to content

Commit

Permalink
Merge pull request #76 from nugraph/feature/update-labelling
Browse files Browse the repository at this point in the history
remove delta ray from standard labelling
  • Loading branch information
vhewes authored Jun 11, 2024
2 parents 0b58a22 + fe12cc4 commit 42cd272
Showing 1 changed file with 13 additions and 22 deletions.
35 changes: 13 additions & 22 deletions pynuml/labels/standard.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ def __init__(self,
'hadron',
'shower',
'michel',
'delta',
'diffuse',
'invisible'
]
Expand Down Expand Up @@ -58,10 +57,6 @@ def shower(self):
def michel(self):
return self.index('michel')

@property
def delta(self):
return self.index('delta')

@property
def diffuse(self):
return self.index('diffuse')
Expand All @@ -74,7 +69,7 @@ def __call__(self,
part: pd.DataFrame):
'''Standard labelling function.
Pion, Muon, Kaon, Hadron, EM shower, Michel electron, Delta ray,
Pion, Muon, Kaon, Hadron, EM shower, Michel electron,
diffuse activity.
'''

Expand Down Expand Up @@ -125,23 +120,19 @@ def electron_positron_labeler(part, parent_type):
slc = None
elif part.start_process == 'muIoni' or part.start_process == 'hIoni' \
or part.start_process == 'eIoni':
if part.momentum <= 0.01:
if part.start_process == 'muIoni':
sl = self.muon
slc = None
elif part.start_process == 'hIoni':
if abs(parent_type) == 2212:
sl = self.hadron
if part.momentum <= 0.0015: sl = self.diffuse
else:
sl = self.pion
slc = None
if part.start_process == 'muIoni':
sl = self.muon
slc = None
elif part.start_process == 'hIoni':
if abs(parent_type) == 2212:
sl = self.hadron
if part.momentum <= 0.0015: sl = self.diffuse
else:
sl = self.diffuse
slc = None
sl = self.pion
slc = None
else:
sl = self.delta
slc = self.delta
sl = self.diffuse
slc = None
elif part.end_process == 'StepLimiter' or part.end_process == 'annihil' \
or part.end_process == 'eBrem' or part.start_process == 'hBertiniCaptureAtRest' \
or part.end_process == 'FastScintillation' or part.start_process == 'muPairProd' \
Expand Down Expand Up @@ -223,7 +214,7 @@ def i(part, particles, sl):
il = part.parent_id
elif (sl == self.pion or sl == self.hadron) and part.start_process == 'hIoni':
il = part.parent_id
elif sl != self.diffuse and sl != self.delta and sl != self.invisible:
elif sl != self.diffuse and sl != self.invisible:
il = part.g4_id
if sl == self.shower: ilc = il
if sl == self.michel: ilc = il
Expand Down

0 comments on commit 42cd272

Please # to comment.