PyLamarr
Pythonizations for the ultra-fast simulation option for the LHCb experiment
 
Loading...
Searching...
No Matches
PVReconstruction.py
1from typing import Union, Optional
2from pydantic import validate_arguments, Field
3from dataclasses import dataclass, InitVar
4from PyLamarr import RemoteResource as RemoteRes
5from PyLamarr import Wrapper
6
7PV_LIB = ("https://github.com/LamarrSim/SQLamarr/raw/master/temporary_data/"
8 "PrimaryVertex/PrimaryVertexSmearing.db")
9
10
11@validate_arguments
12@dataclass(frozen=True)
14 """
15 Parametrize the reconstruction of a Primary Vertex.
16
17
18 @param condition: Data-taking condition, e.g. `2016_pp_MagUp`;
19 @param library: RemoteResource (or simply an URL) to the SQLite DB with
20 parametrizations;
21 @param table: name of the SQLite table to read the parametrization from
22
23 ```python
24 db = SQLamarr.SQLite3DB(parsed_fmt)
25 pv_reco = PVReconstruction('2016_pp_MagUp')
26 pv_reco (db)
27 ```
28
29 @see SQLamarr.PVReconstruction: C++ implementation of the algorithm
30
31 """
32
33 condition: str
34 library: Optional[RemoteRes] = Field(default_factory=lambda: RemoteRes(PV_LIB))
35 table: Optional[str] = "PVSmearing"
36
37 implements: str = "PVReconstruction"
38
39 @property
40 def config(self):
41 """@private Call method"""
42 return dict(
43 file_name=self.library.file,
44 table_name=self.table,
45 condition=self.condition
46 )
Parametrize the reconstruction of a Primary Vertex.