Models

Particle Beam Models

Module with pydantic models to validate and store data structures relative to particle beams.

class pyhdtoolkit.models.beam.BeamParameters(*, pc_GeV: float | None = None, E_0_GeV: float | None = 0.9382720813, charge: float | None = 1, nemitt_x: float | None = None, nemitt_y: float | None = None, deltap_p: float | None = None)[source]

Added in version 0.12.0.

Class to encompass, validate and manipulate properties of a particle beam. One can find a usage example in the beam enveloppe demo.

property B_rho_Tm: float

Beam rigidity in [T/m].

property E_kin_GeV: float

Total beam energy in [GeV].

property E_tot_GeV: float

Total beam energy in [GeV].

property beta_rel: float

Relativistic beta.

property gamma_rel: float

Relativistic gamma.

property gemitt_x: float

Horizontal geometric emittance in [m].

property gemitt_y: float

Vertical geometric emittance in [m].

model_config: ClassVar[ConfigDict] = {}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

HTCondor Models

Module with pydantic models to validate and store data obtained by querying the HTCondor queue.

class pyhdtoolkit.models.htc.BaseSummary(*, jobs: int, completed: int, removed: int, idle: int, running: int, held: int, suspended: int)[source]

Added in version 0.12.0.

Class to encompass and validate the cluster’s summary line in the condor_q output.

model_config: ClassVar[ConfigDict] = {}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

class pyhdtoolkit.models.htc.ClusterSummary(*, scheduler_id: str, query: BaseSummary, user: BaseSummary, cluster: BaseSummary)[source]

Added in version 0.12.0.

Class to encompass and validate the cluster’s info line in the condor_q output.

model_config: ClassVar[ConfigDict] = {}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

class pyhdtoolkit.models.htc.HTCTaskSummary(*, owner: str, batch_name: int, submitted: DateTime, done: int | str, run: int | str, idle: int | str, total: int, job_ids: str)[source]

Added in version 0.12.0.

Class to encompass and validate a specific job’s line in the condor_q output.

model_config: ClassVar[ConfigDict] = {'arbitrary_types_allowed': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

MAD-X Models

Module with pydantic models to validate and store data obtained by interacting with the MAD-X process through cpymad.

class pyhdtoolkit.models.madx.MADXBeam(*, particle: ParticleEnum, mass: Annotated[float, Gt(gt=0)], charge: float, energy: Annotated[float, Gt(gt=0)], pc: float, gamma: float, beta: float, brho: float, ex: float, ey: float, et: float, exn: float, eyn: float, sigt: float, sige: float, kbunch: Annotated[int, Gt(gt=0)], npart: Annotated[int, Gt(gt=0)], bcurrent: float, bunched: bool, radiate: bool, bv: int)[source]

Added in version 0.12.0.

Class to encompass and validate BEAM attributes from the MAD-X process.

model_config: ClassVar[ConfigDict] = {}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

class pyhdtoolkit.models.madx.ParticleEnum(value, names=<not given>, *values, module=None, qualname=None, type=None, start=1, boundary=None)[source]

Added in version 0.12.0.

Validator Enum defining the accepted particle names in MAD-X beams.