Belle II Software development
ECLChargedPIDModule.h
1/**************************************************************************
2 * basf2 (Belle II Analysis Software Framework) *
3 * Author: The Belle II Collaboration *
4 * *
5 * See git log for contributors and copyright holders. *
6 * This file is licensed under LGPL-3.0, see LICENSE.md. *
7 **************************************************************************/
8
9#pragma once
10
11//FRAMEWORK
12#include <framework/core/Module.h>
13#include <framework/datastore/StoreArray.h>
14#include <framework/datastore/StoreObjPtr.h>
15#include <framework/dataobjects/EventMetaData.h>
16#include <framework/gearbox/Const.h>
17#include <framework/logging/Logger.h>
18#include <framework/utilities/FileSystem.h>
19#include <framework/gearbox/Unit.h>
20#include <framework/database/DBObjPtr.h>
21
22//MDST
23#include <mdst/dataobjects/Track.h>
24
25//ECL
26#include <ecl/dataobjects/ECLShower.h>
27#include <ecl/dataobjects/ECLPidLikelihood.h>
28#include <ecl/dbobjects/ECLChargedPidPDFs.h>
29
30
31namespace Belle2 {
36
57 class ECLChargedPIDModule : public Module {
58
59 public:
60
65
69 virtual ~ECLChargedPIDModule() override;
70
74 void checkPdfsDB();
75
82 virtual void initialize() override;
83
89 virtual void beginRun() override;
90
96 virtual void event() override;
97
98 private:
99
104
109
114
120 static constexpr double c_dummyLogL = 0.0;
121
126
155
160
170 static int linIndex(int i, int j, int m)
171 {
172 return j + m * i;
173 }
174
183 void transfoGaussDecorr(const unsigned int pdg, const int charge, const double& p, const double& theta,
184 std::vector<double>& variables);
185
190 static double getPdfVal(const double& x, const TF1* pdf);
191
195 static constexpr double c_sqrt2 = 1.41421356237309504880;
196
197 };
198
200} //Belle2
Class for accessing objects in the database.
Definition DBObjPtr.h:21
virtual void initialize() override
Use this to initialize resources or memory your module needs.
DBObjPtr< ECLChargedPidPDFs > m_pdfs
Interface to get the DB payload for ECL charged PID PDFs.
virtual void event() override
Called once for each event.
static double getPdfVal(const double &x, const TF1 *pdf)
Extract the PDF value for a given variable from the TF1 object.
static constexpr double c_sqrt2
Definition of sqrt(2)
ECLChargedPIDModule()
Constructor, for setting module description and parameters.
StoreObjPtr< EventMetaData > m_eventMetaData
The event information.
static constexpr double c_dummyLogL
Dummy value of Log Likelihood for a particle hypothesis.
static int linIndex(int i, int j, int m)
Get the index corresponding to element i,j in a linearised n*m array.
void transfoGaussDecorr(const unsigned int pdg, const int charge, const double &p, const double &theta, std::vector< double > &variables)
Transform input variables according to:
void checkPdfsDB()
Check the PDFs payload for consistency every time they change in the database.
virtual void beginRun() override
Called once before a new run begins.
std::unordered_map< ECLChargedPidPDFs::InputVar, double > m_variables
Map to contain ECL shower observables.
StoreArray< Track > m_tracks
Array of Track objects.
virtual ~ECLChargedPIDModule() override
Destructor, use to clean up anything you created in the constructor.
bool m_applyClusterTimingSel
Apply cluster timing selection.
StoreArray< ECLPidLikelihood > m_eclPidLikelihoods
Array of ECLPidLikelihood objects.
Module()
Constructor.
Definition Module.cc:30
Accessor to arrays stored in the data store.
Definition StoreArray.h:113
Type-safe access to single objects in the data store.
Definition StoreObjPtr.h:96
Abstract base class for different kinds of events.