SQLamarr
The stand-alone ultra-fast simulation option for the LHCb experiment
PVReconstruction.py
1 # (c) Copyright 2022 CERN for the benefit of the LHCb Collaboration.
2 #
3 # This software is distributed under the terms of the GNU General Public
4 # Licence version 3 (GPL Version 3), copied verbatim in the file "LICENCE".
5 #
6 # In applying this licence, CERN does not waive the privileges and immunities
7 # granted to it by virtue of its status as an Intergovernmental Organization
8 # or submit itself to any jurisdiction.
9 
10 import ctypes
11 from ctypes import POINTER
12 from SQLamarr import clib, c_TransformerPtr
13 
14 from SQLamarr.db_functions import SQLite3DB
15 
16 clib.new_PVReconstruction.argtypes = (
17  ctypes.c_void_p, ctypes.c_char_p, ctypes.c_char_p, ctypes.c_char_p
18  )
19 clib.new_PVReconstruction.restype = c_TransformerPtr
20 
22  """
23  Transform the MCVertices objects identified as primary vertices into Vertices,
24  smearing their position according to a triple-Gaussian, diagonal
25  resolution function.
26 
27  Python bindings to SQLamarr::PVReconstruction.
28 
29  The parameters used to parametrize the smearing where obtained from detailed
30  simulation and are stored in an SQLite3 table with the schema documented in
31  SQLamarr::PVReconstruction.
32  """
33  def __init__ (self,
34  db: SQLite3DB,
35  file_name: str,
36  table_name: str,
37  condition: str
38  ):
39  """
40  Acquires the reference to an open connection to the database and
41  connection details to a PV reconstruction database.
42 
43  @param db: An open database connection;
44  @param file_name: string providing the path to a SQLite3 file;
45  @param table_name: string providing the name of the TABLE where the
46  parametrizations for the PV reconstruction are stored;
47  @param condition: string identifier of the row to read the parametrization
48  from.
49  """
50  self._self_self = clib.new_PVReconstruction(db.get(),
51  file_name.encode('ascii'),
52  table_name.encode('ascii'),
53  condition.encode('ascii'),
54  )
55 
56  def __del__(self):
57  """@private: Release the bound class instance"""
58  clib.del_Transformer(self._self_self)
59 
60  @property
61  def raw_pointer(self):
62  """@private: Return the raw pointer to the algorithm."""
63  return self._self_self
64 
Transform the MCVertices objects identified as primary vertices into Vertices, smearing their positio...
def __init__(self, SQLite3DB db, str file_name, str table_name, str condition)
Acquires the reference to an open connection to the database and connection details to a PV reconstru...