Skip to content

Commit ce2704d

Browse files
committed
add prefix to names in global scope - awkward
1 parent e4bf9b9 commit ce2704d

File tree

2 files changed

+10
-9
lines changed

2 files changed

+10
-9
lines changed

src/geant4_python_application/application.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -231,21 +231,21 @@ def run(self, primaries: int | ak.Array):
231231
for key in step_array_dict
232232
}
233233
},
234-
with_name="step",
234+
with_name="geant4_step",
235235
)
236236
}
237237
if len(step_array_dict) > 0
238238
else {}
239239
),
240240
},
241-
with_name="track",
241+
with_name="geant4_track",
242242
)
243243
}
244244
if len(track_array_dict) > 0 or len(step_array_dict) > 0
245245
else {}
246246
),
247247
},
248-
with_name="event",
248+
with_name="geant4_event",
249249
)
250250

251251
# events = ak.str.to_categorical(events)

src/geant4_python_application/events.py

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ def hits(self, volume: str | None = None) -> ak.Array:
2525
hits = hits[hits.volume == volume]
2626
# only keep x,y,z, time, and energy
2727
hits = hits[["position", "time", "energy"]]
28-
return ak.Array(hits, with_name="hits")
28+
return ak.Array(hits, with_name="geant4_hits")
2929

3030

3131
class HitsRecord(ak.Record):
@@ -44,7 +44,7 @@ def electrons(self, work_function: float = 20.0 / 1e3) -> ak.Array:
4444
]
4545
for i in range(len(self.energy))
4646
],
47-
with_name="electrons",
47+
with_name="geant4_tpc_electrons",
4848
)
4949
)
5050

@@ -76,8 +76,9 @@ def drift(
7676
return self
7777

7878

79-
ak.behavior["event"] = EventRecord
80-
ak.behavior["*", "event"] = EventArray
79+
ak.behavior["geant4_event"] = EventRecord
80+
ak.behavior["*", "geant4_event"] = EventArray
8181

82-
ak.behavior["hits"] = HitsRecord
83-
ak.behavior["electrons"] = ElectronsRecord
82+
ak.behavior["geant4_hits"] = HitsRecord
83+
84+
ak.behavior["geant4_tpc_electrons"] = ElectronsRecord

0 commit comments

Comments
 (0)