Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Redefinition of Physical and Logical detectors #100

Open
wants to merge 10 commits into
base: master
Choose a base branch
from

Conversation

valerioda
Copy link
Member

The dispatcher get goal_state from MongoConnect.get_wanted_state where there is a loop on physical detectors and the latest_status from MongoConnecy.get_update using the current configuration that is coming from MongoConnect.get_super_detector. Then it loops among the latest_status.keys and checks the goal status, the variable detector is used for both physical and logical detectors, the main goal of the performed changes is to avoid this and have a more clear and separate definition of the two chategories of detectors.

Main changes are listed:

  • in MongoConnect.py the logical detector is created with the function get_logical_detector (former get_super_detector) with five possible linking cases that are addressed separately with logical statements, in this way is possible to have proper name for the logical detector (e.g., in case of all physical detectors linked is all_linked instead of tpc). The five cases:

    1. all_linked
    2. tpc_mv + nv
    3. tpc_nv + mv
    4. tpc + mv_nv
    5. tpc + mv + nv
  • in dispatcher.py added new loop: 1st loop on logical detectors using latest_status.keys, 2nd loop on physical detectors using latest_status[log_det]['detectors'].keys, the printed status then reports the aggregate status for both logical and physical detectors

  • in DAQController.py the input detector explicity called logical, in particular in control_detector and check_timeouts; the first physical detector is used as representative of the logical detector, needed to take goal mode and status and count the missed arm cycles and error stops (also functions handle_timeout, stop_detector_gently and check_run_turnover has been changed in order to use both logical and physical detectors); also in MongoConnect.py modified insert_run_doc and and set_stop_time

  • in hypervisor.py changes in linked_nuclear_option: modified loop to check for the status of physical detectors, added debug messages, added check of all hosts (readers and controllers) to see if they are responding, calculated again the aggregate status of the physical detectors and compared with the one from MongoConnect.aggregate_status, if the two status are not matching or the detector is in [ERROR, TIMETOUT, UNKNOWN] the detector is included in timeout_list otherwise in running_list

@@ -763,35 +784,35 @@ def get_run_start(self, number):
return self.run_start_cache[str(number)]
return None

def insert_run_doc(self, detector):
def insert_run_doc(self, logical):

if (number := self.get_next_run_number()) == NO_NEW_RUN:
self.logger.error("DB having a moment")
return -1
# the rundoc gets the physical detectors, not the logical
detectors = self.latest_status[detector]['detectors']
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it's going to complain in this line about detector. Should it be logical?

@mflierm mflierm requested review from RoBGlaBe and removed request for darrylmasson January 19, 2023 09:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants