PyLamarr
Pythonizations for the ultra-fast simulation option for the LHCb experiment
Loading...
Searching...
No Matches
ParticleMaker.py
1
from
typing
import
Tuple, Optional
2
from
dataclasses
import
dataclass
3
from
pydantic
import
validate_arguments
4
5
from
PyLamarr
import
RemoteResource, Wrapper
6
7
8
@validate_arguments
9
@dataclass(frozen=True)
10
class
ParticleMaker
(
Wrapper
):
11
output_table: Optional[str] =
"particles"
12
output_columns: Optional[Tuple[str, ...]] = (
13
"mcparticle_id"
,
"track_type"
,
14
"dx"
,
"dy"
,
"dz"
,
"dtx"
,
"dty"
,
"dp"
,
15
"chi2PerDoF"
,
"nDoF_f"
,
"ghostProb"
16
)
17
make_persistent: Optional[bool] =
True
18
19
def
query(self):
20
return
"""
21
SELECT
22
reco.mcparticle_id AS mcparticle_id,
23
reco.track_type AS track_type,
24
res.dx, res.dy, res.dz, res.dtx, res.dty, res.dp,
25
res.chi2PerDoF, res.nDoF_f, res.ghostProb
26
FROM tmp_particles_recoed_as AS reco
27
LEFT JOIN tmp_resolution_out AS res ON reco.mcparticle_id == res.mcparticle_id
28
WHERE reco.track_type != 0
29
"""
30
31
implements: str =
"TemporaryTable"
32
33
@property
34
def
config(self):
35
return
dict(
36
output_table=self.
output_table
,
37
outputs=self.
output_columns
,
38
query=self.
query
(),
39
make_persistent=self.
make_persistent
,
40
)
41
PyLamarr.LHCb.Tracking.ParticleMaker.ParticleMaker
Definition
ParticleMaker.py:10
PyLamarr.LHCb.Tracking.ParticleMaker.ParticleMaker.output_columns
tuple output_columns
Definition
ParticleMaker.py:12
PyLamarr.LHCb.Tracking.ParticleMaker.ParticleMaker.make_persistent
Optional make_persistent
Definition
ParticleMaker.py:17
PyLamarr.LHCb.Tracking.ParticleMaker.ParticleMaker.output_table
Optional output_table
Definition
ParticleMaker.py:11
PyLamarr.LHCb.Tracking.ParticleMaker.ParticleMaker.query
query(self)
Definition
ParticleMaker.py:19
PyLamarr.Wrapper.Wrapper
Definition
Wrapper.py:14
PyLamarr
LHCb
Tracking
ParticleMaker.py
Generated by
1.9.8