Belle II Software  release-05-02-19
PIDNtupleModule.h
1 /**************************************************************************
2  * BASF2 (Belle Analysis Framework 2) *
3  * Copyright(C) 2010 - Belle II Collaboration *
4  * *
5  * Author: The Belle II Collaboration *
6  * Contributors: Marko Staric, Jake Bennett *
7  * *
8  * This software is provided "as is" without any warranty. *
9  **************************************************************************/
10 
11 #ifndef PIDNTUPLEMODULE_H
12 #define PIDNTUPLEMODULE_H
13 
14 #include <framework/core/Module.h>
15 #include <string>
16 #include <reconstruction/modules/PIDNtuple/PIDTree.h>
17 #include "TFile.h"
18 
19 namespace Belle2 {
28  class PIDNtupleModule : public Module {
29 
30  public:
31 
36 
40  virtual ~PIDNtupleModule();
41 
46  virtual void initialize() override;
47 
52  virtual void beginRun() override;
53 
57  virtual void event() override;
58 
63  virtual void endRun() override;
64 
69  virtual void terminate() override;
70 
74  void printModuleParams() const;
75 
76  private:
77 
78  std::string m_outputFileName;
79  bool m_makeFlat;
80  double m_p1;
81  double m_p2;
82  double m_pMax;
84  double m_norm;
85  double m_value;
87  TFile* m_file;
88  TTree* m_tree;
97  double momDistribution(double p) const
98  {
99  double f = 1.0 - exp(-p / m_p1);
100  return m_norm * f * f * f * f * exp(-p / m_p2);
101  };
102 
103  };
104 
106 } // Belle2 namespace
107 
108 #endif
Belle2::PIDNtupleModule::beginRun
virtual void beginRun() override
Called when entering a new run.
Definition: PIDNtupleModule.cc:110
Belle2::PIDNtupleModule::m_outputFileName
std::string m_outputFileName
output file name
Definition: PIDNtupleModule.h:86
Belle2::PIDNtupleModule::m_pid
PID::PIDTree m_pid
PID tree structure.
Definition: PIDNtupleModule.h:97
Belle2::PIDNtupleModule::m_value
double m_value
distribution value at m_pMax
Definition: PIDNtupleModule.h:93
Belle2::PIDNtupleModule::~PIDNtupleModule
virtual ~PIDNtupleModule()
Destructor.
Definition: PIDNtupleModule.cc:59
Belle2::PIDNtupleModule::terminate
virtual void terminate() override
Termination action.
Definition: PIDNtupleModule.cc:226
Belle2
Abstract base class for different kinds of events.
Definition: MillepedeAlgorithm.h:19
Belle2::PIDNtupleModule::m_p2
double m_p2
parameter of momentum distribution
Definition: PIDNtupleModule.h:89
Belle2::PIDNtupleModule::m_norm
double m_norm
distribution normalization
Definition: PIDNtupleModule.h:92
Belle2::PIDNtupleModule::endRun
virtual void endRun() override
End-of-run action.
Definition: PIDNtupleModule.cc:224
Belle2::PIDNtupleModule::momDistribution
double momDistribution(double p) const
parameterized momentum distribution
Definition: PIDNtupleModule.h:105
Belle2::PIDNtupleModule::m_makeFlat
bool m_makeFlat
if true, make momentum distribution flat up to m_pMax
Definition: PIDNtupleModule.h:87
Belle2::PIDNtupleModule::initialize
virtual void initialize() override
Initialize the Module.
Definition: PIDNtupleModule.cc:61
Belle2::PIDNtupleModule::printModuleParams
void printModuleParams() const
Prints module parameters.
Definition: PIDNtupleModule.cc:233
Belle2::PIDNtupleModule::m_p1
double m_p1
parameter of momentum distribution
Definition: PIDNtupleModule.h:88
Belle2::PID::PIDTree
Structure for the output of PID log likelihoods + tracking info to a flat ntuple.
Definition: PIDTree.h:67
Belle2::PIDNtupleModule::m_tree
TTree * m_tree
TTree with PIDTree structure.
Definition: PIDNtupleModule.h:96
Belle2::PIDNtupleModule::m_pMax
double m_pMax
flatten distribution up to this momentum
Definition: PIDNtupleModule.h:90
Belle2::PIDNtupleModule::PIDNtupleModule
PIDNtupleModule()
Constructor.
Definition: PIDNtupleModule.cc:42
Belle2::PIDNtupleModule::m_file
TFile * m_file
TFile.
Definition: PIDNtupleModule.h:95
Belle2::PIDNtupleModule::event
virtual void event() override
Event processor.
Definition: PIDNtupleModule.cc:114