SQLamarr
The stand-alone ultra-fast simulation option for the LHCb experiment
SQLamarr::PVReconstruction Class Reference

Emulates the reconstruction of the primary vertex. More...

#include <PVReconstruction.h>

Inheritance diagram for SQLamarr::PVReconstruction:

Classes

class  PVReconstruction
 Transform the MCVertices objects identified as primary vertices into Vertices, smearing their position according to a triple-Gaussian, diagonal resolution function. More...
 
struct  SmearingParametrization
 Set of parmeters defining three 3-Gaussian functions for x, y and z. More...
 
struct  SmearingParametrization_1D
 Set of parameters defining a 3-Gaussian resolution function in 1D. More...
 

Public Member Functions

 PVReconstruction (SQLite3DB &db, const SmearingParametrization &parametrization)
 Constructor. More...
 
void execute () override
 Execute the algorithm adding primary vertices to Vertices table. More...
 
- Public Member Functions inherited from SQLamarr::BaseSqlInterface
 BaseSqlInterface (SQLite3DB &db)
 Constructor, acquiring the database without ownership. More...
 
virtual ~BaseSqlInterface ()
 
void sync_database (const std::string &db_uri)
 
void invalidate_cache (void)
 Invalidate the cache of the queries. More...
 

Static Public Member Functions

static SmearingParametrization load_parametrization (const std::string file_path, const std::string table_name, const std::string condition)
 Instanciate a SmearingParametrization object from an SQLite file. More...
 

Public Attributes

 argtypes
 
 restype
 

Additional Inherited Members

- Protected Member Functions inherited from SQLamarr::BaseSqlInterface
sqlite3_stmt * get_statement (const std::string &name, const std::string &query)
 Creates or retrieve from cache a statement. More...
 
void begin_transaction ()
 Begin an SQL transaction stopping update to disk util end_transaction() is issued
More...
 
void end_transaction ()
 End an SQL transaction re-enabling disk updates. More...
 
int last_insert_row ()
 Return the index of the last rows inserted in any table. More...
 
void using_sql_function (const std::string &name, int argc, void(*xFunc)(sqlite3_context *, int, sqlite3_value **))
 Register a static function in DB, enabling usage from SQL. More...
 
bool exec_stmt (sqlite3_stmt *)
 Execute a statement, possibly throwing an exception on failure. More...
 
- Protected Attributes inherited from SQLamarr::BaseSqlInterface
SQLite3DBm_database
 Reference to the SQLite database (not owned). More...
 

Detailed Description

Emulates the reconstruction of the primary vertex.

The position of each primary vertex is smeared according to a parametrization loaded from a configuration file. The covariance matrix defining the uncertainty on the position of the PV is also generated based on a parametrization.

The resolution model used to describe the difference between the true and reconstructed positions of the PV is the sum of three Gaussian distributions sharing their central values.

This simplified model includes two strong assumptions:

  • the resolution function does not depend on the number of tracks from which the PV is obtained;
  • the covariance matrix is approximated with a diagonal matrix neglecting correlations among axes

Using PVReconstruction::load_parametrization(), the parametrization can be loaded from an SQLite table defining the following columns:

  • condition, a string representing the datataking conditions
  • mu, the mean of the Gaussians
  • f1, the core-fraction of the first Gaussian
  • f2, the core-fraction of the second Gaussian
  • sigma1, the standard deviation of the first Gaussian
  • sigma2, the standard deviation of the second Gaussian
  • sigma3, the standard deviation of the third Gaussian

Definition at line 51 of file PVReconstruction.h.

Constructor & Destructor Documentation

◆ PVReconstruction()

Constructor.

Parameters
dbReference to database (not owned)
parametrization3-Gaussian parametrization of the resolution function

Definition at line 62 of file PVReconstruction.cpp.

Member Function Documentation

◆ execute()

void SQLamarr::PVReconstruction::execute ( void  )
overridevirtual

Execute the algorithm adding primary vertices to Vertices table.

Implements SQLamarr::Transformer.

Definition at line 161 of file PVReconstruction.cpp.

◆ load_parametrization()

PVReconstruction::SmearingParametrization SQLamarr::PVReconstruction::load_parametrization ( const std::string  file_path,
const std::string  table_name,
const std::string  condition 
)
static

Instanciate a SmearingParametrization object from an SQLite file.

Parameters
file_pathSQLite database defining the parametrization
table_nameName of the table defining the parametrization
conditionDatataking Condition

Definition at line 112 of file PVReconstruction.cpp.

Member Data Documentation

◆ argtypes

SQLamarr.PVReconstruction.argtypes

Definition at line 16 of file PVReconstruction.py.

◆ restype

SQLamarr.PVReconstruction.restype

Definition at line 19 of file PVReconstruction.py.


The documentation for this class was generated from the following files: