:py:mod:`km3pipe.calib` ======================= .. py:module:: km3pipe.calib .. autoapi-nested-parse:: Calibration. .. !! processed by numpydoc !! Module Contents --------------- Classes ~~~~~~~ .. autoapisummary:: km3pipe.calib.Calibration km3pipe.calib.CalibrationService Functions ~~~~~~~~~ .. autoapisummary:: km3pipe.calib.apply_t0_nb km3pipe.calib.slew Attributes ~~~~~~~~~~ .. autoapisummary:: km3pipe.calib.log .. py:data:: log .. py:class:: Calibration(name=None, **parameters) A module which applies time, position and rotation corrections to hits. This module also calibrates MC hits, but be aware, t0s are not appended to the MC hit times. Additionally, the global PMT ID is added to regular hits as ``pmt_id`` and in case of MC hits, the ``dom_id`` and ``channel_id`` (DAQ) are set. :Parameters: **apply: bool, optional [default=True]** Apply the calibration to the hits (add position/direction/t0)? **filename: str, optional [default=None]** DetX file with detector description. **det_id: int, optional** .detx ID of detector (when retrieving from database). **t0set: optional** t0set (when retrieving from database). **calibset: optional** calibset (when retrieving from database). **key: str, optional [default="Hits"]** the blob key of the hits **outkey: str, optional [default="CalibHits"]** the output blob key of the calibrated hits **key_mc: str, optional [default="McHits"]** the blob key of the MC hits (if present) **outkey_mc: str, optional [default="CalibMcHits"]** the output blob key of the calibrated MC hits .. !! processed by numpydoc !! .. py:attribute:: name :value: 'Calibration' .. py:method:: configure() Configure module, like instance variables etc. .. !! processed by numpydoc !! .. py:method:: process(blob) Knead the blob and return it .. !! processed by numpydoc !! .. py:method:: get_detector() Return the detector .. !! processed by numpydoc !! .. py:method:: dus(hits) Return the DUs for given hits .. !! processed by numpydoc !! .. py:method:: floors(hits) Return the floors for given hits .. !! processed by numpydoc !! .. py:method:: apply_t0(hits) Apply only t0s .. !! processed by numpydoc !! .. py:method:: apply(hits, no_copy=False, correct_slewing=True, slewing_variant=3) Add x, y, z, t0 (and du, floor if DataFrame) columns to the hits. .. !! processed by numpydoc !! .. py:function:: apply_t0_nb(times, dom_ids, channel_ids, lookup_tables) Apply t0s using a lookup table of tuples (dom_id, calib) .. !! processed by numpydoc !! .. py:class:: CalibrationService(name=None, **parameters) A service which provides calibration routines for hits :Parameters: **filename: str, optional [default=None]** DetX file with detector description. **det_id: int, optional** .detx ID of detector (when retrieving from database). **t0set: optional** t0set (when retrieving from database). **calibset: optional** calibset (when retrieving from database). **detector: kp.hardware.Detector, optional** .. .. !! processed by numpydoc !! .. py:property:: detector .. py:property:: calibration .. py:attribute:: name :value: 'Calibration' .. py:method:: configure() Configure module, like instance variables etc. .. !! processed by numpydoc !! .. py:method:: load_calibration(filename=None, det_id=None, t0set=None, calibset=None) Load another calibration .. !! processed by numpydoc !! .. py:method:: calibrate(hits, correct_slewing=True) .. py:method:: get_detector() Extra getter to be as lazy as possible (expose triggers otherwise .. !! processed by numpydoc !! .. py:method:: get_calibration() Extra getter to be as lazy as possible (expose triggers otherwise .. !! processed by numpydoc !! .. py:method:: correct_slewing(hits) Apply time slewing correction to the hit times .. !! processed by numpydoc !! .. py:function:: slew(tot, variant=3) Calculate the time slewing of a PMT response for a given ToT :Parameters: **tot: int or np.array(int)** Time over threshold value of a hit **variant: int, optional** The variant of the slew calculation. 1: The first parametrisation approach 2: Jannik's improvement of the parametrisation 3: The latest lookup table approach based on lab measurements. :Returns: time: int Time slewing, which has to be subtracted from the original hit time. .. !! processed by numpydoc !!