Belle II Software  release-06-00-14
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 
31 namespace Belle2 {
60  class ECLChargedPIDModule : public Module {
61 
62  public:
63 
68 
72  virtual ~ECLChargedPIDModule();
73 
77  void checkPdfsDB();
78 
85  virtual void initialize() override;
86 
92  virtual void beginRun() override;
93 
99  virtual void event() override;
100 
106  virtual void endRun() override;
107 
111  virtual void terminate() override;
112 
113  private:
114 
119 
124 
129 
135  static constexpr double c_dummyLogL = 0.0;
136 
141 
157  std::unordered_map<ECLChargedPidPDFs::InputVar, double> m_variables {
169  };
170 
175 
185  inline int linIndex(int i, int j, int m)
186  {
187  return j + m * i;
188  }
189 
198  void transfoGaussDecorr(const unsigned int pdg, const int charge, const double& p, const double& theta,
199  std::vector<double>& variables);
200 
205  double getPdfVal(const double& x, const TF1* pdf);
206 
210  static constexpr double c_sqrt2 = 1.41421356237309504880;
211 
212  };
213 
215 } //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
Defintion 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 everytime 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:95
Abstract base class for different kinds of events.