SQLamarr
The stand-alone ultra-fast simulation option for the LHCb experiment
PVReconstruction.h
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 
11 #pragma once
12 
13 #include <array>
14 
15 #include "SQLamarr/BaseSqlInterface.h"
16 #include "SQLamarr/Transformer.h"
17 
18 namespace SQLamarr
19 {
52  {
53  public:
56  float mu, f1, f2, sigma1, sigma2, sigma3;
57  };
58 
61 
63  std::array<SmearingParametrization_1D, 3> data;
64 
66  SmearingParametrization_1D& x() { return data[0]; }
67 
69  SmearingParametrization_1D& y() { return data[1]; }
70 
72  SmearingParametrization_1D& z() { return data[2]; }
73  };
74 
78  SQLite3DB& db,
79 
81  const SmearingParametrization& parametrization
82  );
83 
85  static SmearingParametrization load_parametrization (
86  const std::string file_path,
88  const std::string table_name,
90  const std::string condition
91  );
92 
94  void execute () override;
95 
96  private: // members
97  SmearingParametrization m_parametrization;
98 
99  private: // methods
100  static void _sql_rnd_ggg (
101  sqlite3_context *context,
102  int argc,
103  sqlite3_value **argv
104  );
105 
106  };
107 }
Abstract interface with helper functions to access an SQLite DB.
Transform the MCVertices objects identified as primary vertices into Vertices, smearing their positio...
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.
void execute() override
Execute the algorithm adding primary vertices to Vertices table.
PVReconstruction(SQLite3DB &db, const SmearingParametrization &parametrization)
Constructor.
Interface to an executable class used for polymorphism.
Definition: Transformer.h:17
A database connection handler easying sharing the DB between C++ and Python.
Definition: db_functions.py:24
Set of parameters defining a 3-Gaussian resolution function in 1D.
Set of parmeters defining three 3-Gaussian functions for x, y and z.
std::array< SmearingParametrization_1D, 3 > data
Access to raw data in array format.
SmearingParametrization_1D & x()
Read/Write access to coordinate parametrization.
SmearingParametrization_1D & y()
Read/Write access to coordinate parametrization.
SmearingParametrization_1D & z()
Read/Write access to coordinate parametrization.