diff --git a/skymap_scanner/client/prepare.py b/skymap_scanner/client/prepare.py index cd3c2bf14..9c419dc0e 100644 --- a/skymap_scanner/client/prepare.py +++ b/skymap_scanner/client/prepare.py @@ -41,7 +41,7 @@ def main() -> None: # go! RecoAlgo = recos.get_reco_interface_object(args.reco_algo) reco = RecoAlgo() - reco.setup_reco() + reco.setup_reco(LOGGER) LOGGER.critical(f'/dev/shm: {os.listdir("/dev/shm")}') diff --git a/skymap_scanner/client/reco_icetray.py b/skymap_scanner/client/reco_icetray.py index cfdb88692..94a0c351f 100644 --- a/skymap_scanner/client/reco_icetray.py +++ b/skymap_scanner/client/reco_icetray.py @@ -146,7 +146,7 @@ def notifyStart(frame): # create instance of reco_algo object RecoAlgo = recos.get_reco_interface_object(reco_algo) reco = RecoAlgo() - reco.setup_reco() + reco.setup_reco(LOGGER) # perform fit tray.AddSegment( diff --git a/skymap_scanner/recos/__init__.py b/skymap_scanner/recos/__init__.py index 447fc3bdc..bb145fd69 100644 --- a/skymap_scanner/recos/__init__.py +++ b/skymap_scanner/recos/__init__.py @@ -67,10 +67,13 @@ def prepare_frames(self, tray, name, **kwargs) -> None: pass @abstractmethod - def setup_reco(self): - """Performs the necessary operations to prepare the execution of the reconstruction traysegment. + def setup_reco(self, logger): + """Performs the necessary operations to prepare the execution of the + reconstruction traysegment. - This method is expected to perform "expensive" operations such as fetching spline data and initializing IceTray spline services. + This method is expected to perform "expensive" operations such + as fetching spline data and initializing IceTray spline + services. """ pass diff --git a/skymap_scanner/recos/dummy.py b/skymap_scanner/recos/dummy.py index a753ffc09..9277b38ce 100644 --- a/skymap_scanner/recos/dummy.py +++ b/skymap_scanner/recos/dummy.py @@ -34,8 +34,8 @@ def __init__(self): self.refine_time = True self.add_fallback_position = False - def setup_reco(self): - pass + def setup_reco(self, logger): + logger.info("Dummy reco has nothing to setup :)") @staticmethod def get_vertex_variations() -> List[dataclasses.I3Position]: diff --git a/skymap_scanner/recos/millipede_original.py b/skymap_scanner/recos/millipede_original.py index 2ef5cb34f..3f3b859ab 100644 --- a/skymap_scanner/recos/millipede_original.py +++ b/skymap_scanner/recos/millipede_original.py @@ -97,7 +97,7 @@ def __init__(self): self.refine_time = False self.add_fallback_position = False - def setup_reco(self): + def setup_reco(self, logger): datastager = self.get_datastager() datastager.stage_files(self.SPLINE_REQUIREMENTS) @@ -105,7 +105,9 @@ def setup_reco(self): abs_spline = datastager.get_filepath(self.MIE_ABS_SPLINE) prob_spline = datastager.get_filepath(self.MIE_PROB_SPLINE) + logger.info("Starting I3PhotoSplineService...") self.cascade_service = photonics_service.I3PhotoSplineService(abs_spline, prob_spline, timingSigma=0.0) + logger.info("Started I3PhotoSplineService.") self.cascade_service.SetEfficiencies(self.SPEScale) diff --git a/skymap_scanner/recos/millipede_wilks.py b/skymap_scanner/recos/millipede_wilks.py index ee3a970fd..6f7d901c9 100644 --- a/skymap_scanner/recos/millipede_wilks.py +++ b/skymap_scanner/recos/millipede_wilks.py @@ -55,11 +55,11 @@ def __init__(self): @staticmethod def get_vertex_variations() -> List[dataclasses.I3Position]: - """Returns a list of vectors referenced to the origin that will be used to generate the vertex position variations. - """ + """Returns a list of vectors referenced to the origin that will be used + to generate the vertex position variations.""" return VertexGenerator.point() - def setup_reco(self): + def setup_reco(self, logger): datastager = self.get_datastager() datastager.stage_files(self.SPLINE_REQUIREMENTS) @@ -70,6 +70,7 @@ def setup_reco(self): effp_spline: str = datastager.get_filepath(self.FTP_EFFP_SPLINE) tmod_spline: str = datastager.get_filepath(self.FTP_TMOD_SPLINE) + logger.info("Starting I3PhotoSplineService...") self.cascade_service = photonics_service.I3PhotoSplineService( abs_spline, prob_spline, timingSigma=0.0, effectivedistancetable = effd_spline, @@ -78,6 +79,7 @@ def setup_reco(self): effectivedistancetableprob = effp_spline, effectivedistancetabletmod = tmod_spline ) + logger.info("Started I3PhotoSplineService.") self.muon_service = None diff --git a/skymap_scanner/recos/splinempe.py b/skymap_scanner/recos/splinempe.py index 96fda512c..db5d9a824 100644 --- a/skymap_scanner/recos/splinempe.py +++ b/skymap_scanner/recos/splinempe.py @@ -264,7 +264,7 @@ def extract_seed(frame): def get_vertex_variations(self): return VertexGenerator.cylinder() - def setup_reco(self): + def setup_reco(self, logger): datastager = self.get_datastager() datastager.stage_files(self.SPLINE_REQUIREMENTS) @@ -274,6 +274,7 @@ def setup_reco(self): StochTimingSpline: str = datastager.get_filepath(self.MIE_STOCH_PROB) StochAmplitudeSpline: str = datastager.get_filepath(self.MIE_STOCH_ABS) + logger.info("Starting I3PhotoSplineServices...") self.bare_mu_spline = I3PhotoSplineService( BareMuAmplitudeSpline, BareMuTimingSpline, @@ -289,10 +290,11 @@ def setup_reco(self): BareMuTimingSpline, timingSigma=1000, ) + logger.info("Started I3PhotoSplineServices.") @traysegment def traysegment(self, tray, name, logger, **kwargs): - """SplineMPE reco""" + """SplineMPE reco.""" def checkName(frame: I3Frame, name: str) -> None: if name not in frame: