Skip to content

Commit f23bd90

Browse files
committed
add primary type info
1 parent 5fe7f9f commit f23bd90

1 file changed

Lines changed: 9 additions & 1 deletion

File tree

src/graphnet/data/extractors/icecube/i3highesteparticleextractor.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,11 +126,17 @@ def __call__(self, frame: "icetray.I3Frame") -> Dict[str, Any]:
126126
)
127127
except IndexError:
128128
parent_type = 0
129-
130129
if primary_energy > 0:
131130
primary_fraction = EonEntrance / primary_energy
132131
else:
133132
primary_fraction = -1
133+
134+
if visible_length != -1:
135+
primary = frame[self.mctree].get_primary(HEParticle.id)
136+
primary_is_nu, primary_type = primary.is_neutrino, primary.type
137+
else:
138+
primary_type = 0
139+
primary_is_nu = False
134140
output.update(
135141
{
136142
"e_fraction_" + self._extractor_name: primary_fraction,
@@ -153,6 +159,8 @@ def __call__(self, frame: "icetray.I3Frame") -> Dict[str, Any]:
153159
"particle_type_" + self._extractor_name: HEParticle.type,
154160
"containment_" + self._extractor_name: containment,
155161
"parent_type_" + self._extractor_name: parent_type,
162+
"primary_type_" + self._extractor_name: primary_type,
163+
"primary_is_nu_" + self._extractor_name: primary_is_nu,
156164
}
157165
)
158166

0 commit comments

Comments
 (0)