Run fails with HE muons: CherenkovGenerator has obsolete code
Currently the simulation of 1TeV muon FAILS:
python3 -m ntsim -l warning\
--generator ToyGen --ToyGen.tot_energy_GeV 1000 \
--telescope BGVDTelescope --detector BGVDSensitiveDetector \
--compute_hits --cherenkov=CherenkovGenerator
produces:
**************************************************************
Geant4 version Name: geant4-11-02-patch-01 [MT] (16-February-2024)
Copyright : Geant4 Collaboration
References : NIM A 506 (2003), 250-303
: IEEE-TNS 53 (2006), 270-278
: NIM A 835 (2016), 186-225
WWW : http://geant4.org/
**************************************************************
Detector volume: H=1360 m, R=1000 m
0%| | 0/1 [00:10<?, ?it/s]
Traceback (most recent call last):
File "<frozen runpy>", line 198, in _run_module_as_main
File "<frozen runpy>", line 88, in _run_code
File "/data/work/work/baikal/ntsim/ntsim/__main__.py", line 200, in <module>
simu.process()
File "/data/work/work/baikal/ntsim/ntsim/utils/report_timing.py", line 11, in func_wrapper
result = func(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^
File "/data/work/work/baikal/ntsim/ntsim/__main__.py", line 119, in process
self.CherenkovGenerator.generate(self.event)
File "/data/work/work/baikal/ntsim/ntsim/utils/report_timing.py", line 11, in func_wrapper
result = func(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^
File "/data/work/work/baikal/ntsim/ntsim/CherenkovGenerators/CherenkovGenerator.py", line 635, in generate
self.cherenkov_bunches(event, particles, self.cherenkov_cascades, f'CherenkovCascades{n_particles}')
File "/data/work/work/baikal/ntsim/ntsim/CherenkovGenerators/CherenkovGenerator.py", line 606, in cherenkov_bunches
tot_cher_phts,ph_pos,ph_t,ph_dir,ph_wavelength,progenitor = generator(data)
^^^^^^^^^^^^^^^
File "/data/work/work/baikal/ntsim/ntsim/utils/report_timing.py", line 11, in func_wrapper
result = func(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^
File "/data/work/work/baikal/ntsim/ntsim/CherenkovGenerators/CherenkovGenerator.py", line 184, in cherenkov_cascades
direction = cascade_starters.momentum_GeV[mask_water]/np.sum(cascade_starters.momentum_GeV[mask_water]**2,axis=1)[:,None]**0.5
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'gParticles' object has no attribute 'momentum_GeV'
The cause is that CherenkovGenerator.cherenkov_cascades and CherenkovGenerator.cherenkov_points use obsolete attributes from gParticles.