Belle II Software  release-08-01-10
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 
14 namespace Belle2 {
23  class TOPNominalTTS: public TOPGeoBase {
24  public:
25 
29  struct Gauss {
30  float fraction = 0;
31  float position = 0;
32  float sigma = 0;
33  };
34 
39  {}
40 
45  explicit TOPNominalTTS(const std::string& name): TOPGeoBase(name)
46  {}
47 
54  void appendGaussian(double norm, double mean, double sigma);
55 
60  void setPMTType(unsigned type) {m_type = type;}
61 
66  double normalize();
67 
72  const std::vector<Gauss>& getTTS() const {return m_tts;}
73 
78  unsigned getPMTType() const {return m_type;}
79 
84  double generateTTS() const;
85 
90  bool isConsistent() const override;
91 
96  void print(const std::string& title = "Nominal TTS distribution") const override;
97 
98 
99  private:
100 
101  std::vector<Gauss> m_tts;
102  bool m_normalized = false;
103  unsigned m_type = 0;
107  };
108 
110 } // end namespace Belle2
Base class for geometry parameters.
Definition: TOPGeoBase.h:25
Nominal time transition spread of PMT.
Definition: TOPNominalTTS.h:23
const std::vector< Gauss > & getTTS() const
Returns TTS.
Definition: TOPNominalTTS.h:72
ClassDefOverride(TOPNominalTTS, 2)
ClassDef.
unsigned getPMTType() const
Returns PMT type (see TOPPmtObsoleteData::EType for the defined types)
Definition: TOPNominalTTS.h:78
void setPMTType(unsigned type)
Set type of PMT (see TOPPmtObsoleteData::EType for the defined types)
Definition: TOPNominalTTS.h:60
bool m_normalized
normalization flag
unsigned m_type
PMT type (see TOPPmtObsoleteData::EType)
TOPNominalTTS(const std::string &name)
Constructor with name.
Definition: TOPNominalTTS.h:45
TOPNominalTTS()
Default constructor.
Definition: TOPNominalTTS.h:38
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
float sigma
peak width [ns]
Definition: TOPNominalTTS.h:32