Presentation is loading. Please wait.

Presentation is loading. Please wait.

From LHC to Accelerator class

Similar presentations


Presentation on theme: "From LHC to Accelerator class"— Presentation transcript:

1 From LHC to Accelerator class
Lukáš Malina 29/05/2019 OMC meeting

2 Motivation Measurement algorithms are independent of accelerator
Codes should be as well To measure we need some information about accelerator Type of information is a priori independent of accelerator Container for such information: Accelerator class Classes for specific accelerator should be child classes 29/05/2019 OMC meeting

3 Python 2 state … also python 3 initial state
Abstract accelerator class Methods have to be implemented in child classes Many things implemented for LHC Some things implemented for other machines Independently, accelerator classes are very accelerator dependent Many things not implemented at all 29/05/2019 OMC meeting

4 New Accelerator class Implements default methods and entrypoint wrappers Can be overridden by child classes Content and structure close to union of all accelerator classes Most of stuff comes from LHC Option to initialise from model directory Use in optics measurements Still compatible with model creation through the GUI Inconsistencies to be resolved … will break the compatibility 29/05/2019 OMC meeting

5 Child classes - samples
class Ps(Accelerator): """ Parent Class for Ps-Types. """ NAME = "ps" MACROS_NAME = "ps" YEAR = # Public Methods ########################################################## def verify_object(self): pass @classmethod def get_ps_dir(cls): return os.path.join(PS_DIR, str(cls.YEAR)) @classmethod def get_segment_tmpl(cls): return cls.get_file("segment.madx") @classmethod def get_file(cls, filename): return os.path.join(CURRENT_DIR, "ps", filename) # Private Methods ########################################################## class _PsSegmentMixin(object): def __init__(self): self._start = None self._end = None self.energy = None class Esrf(Accelerator): NAME = "esrf" RE_DICT = {"bpm": r"BPM", "magnet": r".*", "arc_bpm": r"BPM\.(\d*[02468]\.[1-5]|\d*[13579]\.[3-7])", } # bpms 1-5 in even cells and bpms 3-7 in odd cells. class SKekB(Accelerator): """ KEK's SuperKEKB accelerator. Beam direction inverted for now for using with HER. """ NAME = "skekb" MACROS_NAME = "skekb" def verify_object(self): # TODO: Maybe more checks? if self.model_dir is None: # is the class is used to create full response? raise AcceleratorDefinitionError("SuperKEKB doesn't have a model creation, calling it this " "way is most probably wrong.") def get_beam_direction(self): return -1 29/05/2019 OMC meeting

6 New Accelerator class II
We should unify model directory content Partial review/change needed when transfering Segment-by-segment Global correction Model creation works, but waits for the state of sequence files repositories Should be further unified 29/05/2019 OMC meeting

7 Optics measurements in omc3 master
Codes are simplified, modular and more robust Uses accelerator class, i.e. work not only for LHC Except for coupling Simple accuracy test in place 29/05/2019 OMC meeting

8 Conclusions and outlook
Accelerator class is much more generic Optics measurements work not only for LHC First version already available in omc3 master What is the status of sequence files repositories in gitlab? 29/05/2019 OMC meeting


Download ppt "From LHC to Accelerator class"

Similar presentations


Ads by Google