Belle II Software development
PIDNtupleModule.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#include <framework/core/Module.h>
12#include <string>
13#include <reconstruction/modules/PIDNtuple/PIDTree.h>
14#include "TFile.h"
15
16namespace Belle2 {
25 class PIDNtupleModule : public Module {
26
27 public:
28
33
38 virtual void initialize() override;
39
43 virtual void event() override;
44
49 virtual void terminate() override;
50
51 private:
52
53 std::string m_outputFileName;
55 double m_p1;
56 double m_p2;
57 double m_pMax;
59 double m_norm;
60 double m_value;
62 TFile* m_file;
63 TTree* m_tree;
72 double momDistribution(double p) const
73 {
74 double f = 1.0 - exp(-p / m_p1);
75 return m_norm * f * f * f * f * exp(-p / m_p2);
76 };
77
78 };
79
81} // Belle2 namespace
Base class for Modules.
Definition: Module.h:72
makes PID ntuple from mdst input
TTree * m_tree
TTree with PIDTree structure.
virtual void initialize() override
Initialize the Module.
virtual void event() override
Event processor.
bool m_makeFlat
if true, make momentum distribution flat up to m_pMax
virtual void terminate() override
Termination action.
double m_p2
parameter of momentum distribution
PID::PIDTree m_pid
PID tree structure.
PIDNtupleModule()
Constructor.
double momDistribution(double p) const
parameterized momentum distribution
double m_pMax
flatten distribution up to this momentum
double m_p1
parameter of momentum distribution
double m_value
distribution value at m_pMax
double m_norm
distribution normalization
std::string m_outputFileName
output file name
Abstract base class for different kinds of events.
Structure for the output of PID log likelihoods + tracking info to a flat ntuple.
Definition: PIDTree.h:52