Belle II Software prerelease-10-00-00a
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 {
21
28 class PIDNtupleModule : public Module {
29
30 public:
31
36
41 virtual void initialize() override;
42
46 virtual void event() override;
47
52 virtual void terminate() override;
53
54 private:
55
56 std::string m_outputFileName;
58 double m_p1;
59 double m_p2;
60 double m_pMax;
61
62 double m_norm;
63 double m_value;
64
65 TFile* m_file;
66 TTree* m_tree;
68
69
75 double momDistribution(double p) const
76 {
77 double f = 1.0 - exp(-p / m_p1);
78 return m_norm * f * f * f * f * exp(-p / m_p2);
79 };
80
81 };
82
84} // Belle2 namespace
Module()
Constructor.
Definition Module.cc:30
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.
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