Belle II Software development
TOPNominalTTS.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 <top/dbobjects/TOPGeoBase.h>
12#include <vector>
13
14namespace Belle2 {
23 class TOPNominalTTS: public TOPGeoBase {
24 public:
25
29 struct Gauss {
30 float fraction = 0;
31 float position = 0;
32 float sigma = 0;
35 };
36
41 {}
42
47 explicit TOPNominalTTS(const std::string& name): TOPGeoBase(name)
48 {}
49
56 void appendGaussian(double norm, double mean, double sigma);
57
62 void setPMTType(unsigned type) {m_type = type;}
63
68 double normalize();
69
74 const std::vector<Gauss>& getTTS() const {return m_tts;}
75
80 unsigned getPMTType() const {return m_type;}
81
86 double generateTTS() const;
87
92 bool isConsistent() const override;
93
98 void print(const std::string& title = "Nominal TTS distribution") const override;
99
100
101 private:
102
103 std::vector<Gauss> m_tts;
104 bool m_normalized = false;
105 unsigned m_type = 0;
109 };
110
112} // end namespace Belle2
Base class for geometry parameters.
Definition: TOPGeoBase.h:25
Nominal time transition spread of PMT.
Definition: TOPNominalTTS.h:23
ClassDefOverride(TOPNominalTTS, 2)
ClassDef.
unsigned getPMTType() const
Returns PMT type (see TOPPmtObsoleteData::EType for the defined types)
Definition: TOPNominalTTS.h:80
const std::vector< Gauss > & getTTS() const
Returns TTS.
Definition: TOPNominalTTS.h:74
void setPMTType(unsigned type)
Set type of PMT (see TOPPmtObsoleteData::EType for the defined types)
Definition: TOPNominalTTS.h:62
bool m_normalized
normalization flag
unsigned m_type
PMT type (see TOPPmtObsoleteData::EType)
TOPNominalTTS(const std::string &name)
Constructor with name.
Definition: TOPNominalTTS.h:47
TOPNominalTTS()
Default constructor.
Definition: TOPNominalTTS.h:40
std::vector< Gauss > m_tts
TTS distribution composed of a sum of Gaussians.
double normalize()
Normalize the distribution (fractions)
bool isConsistent() const override
Check for consistency of data members.
void appendGaussian(double norm, double mean, double sigma)
Append Gaussian.
void print(const std::string &title="Nominal TTS distribution") const override
Print the content of the class.
double generateTTS() const
Generate time according to TTS distribution.
Abstract base class for different kinds of events.
Gaussian distribution parameters.
Definition: TOPNominalTTS.h:29
float fraction
area normalization
Definition: TOPNominalTTS.h:30
float position
peak position [ns]
Definition: TOPNominalTTS.h:31
ClassDef(Gauss, 1)
ClassDef.
float sigma
peak width [ns]
Definition: TOPNominalTTS.h:32