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 {
57 class ECLChargedPIDModule : public Module {
58
59 public:
60
65
69 virtual ~ECLChargedPIDModule();
70
74 void checkPdfsDB();
75
82 virtual void initialize() override;
83
89 virtual void beginRun() override;
90
96 virtual void event() override;
97
103 virtual void endRun() override;
104
108 virtual void terminate() override;
109
110 private:
111
116
121
126
132 static constexpr double c_dummyLogL = 0.0;
133
138
154 std::unordered_map<ECLChargedPidPDFs::InputVar, double> m_variables {
166 };
167
172
182 inline int linIndex(int i, int j, int m)
183 {
184 return j + m * i;
185 }
186
195 void transfoGaussDecorr(const unsigned int pdg, const int charge, const double& p, const double& theta,
196 std::vector<double>& variables);
197
202 double getPdfVal(const double& x, const TF1* pdf);
203
207 static constexpr double c_sqrt2 = 1.41421356237309504880;
208
209 };
210
212} //Belle2
Class for accessing objects in the database.
Definition: DBObjPtr.h:21
The module implements charged particle identification using ECL-related observables.
virtual ~ECLChargedPIDModule()
Destructor, use to clean up anything you created in the constructor.
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.
virtual void endRun() override
Called once when a run ends.
virtual void terminate() override
Clean up anything you created in initialize().
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.
int linIndex(int i, int j, int m)
Get the index corresponding to element i,j in a linearised n*m array.
StoreObjPtr< EventMetaData > m_eventMetaData
The event information.
static constexpr double c_dummyLogL
Dummy value of Log Likelihood for a particle hypothesis.
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.
bool m_applyClusterTimingSel
Apply cluster timing selection.
StoreArray< ECLPidLikelihood > m_eclPidLikelihoods
Array of ECLPidLikelihood objects.
@ c_DeltaL
DeltaL (track depth)
@ c_E
Energy of maxE shower.
@ c_LAT
Lateral shower shape.
Base class for Modules.
Definition: Module.h:72
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.