Belle II Software  release-05-02-19
TOPNominalTTS.h
1 /**************************************************************************
2  * BASF2 (Belle Analysis Framework 2) *
3  * Copyright(C) 2016 - Belle II Collaboration *
4  * *
5  * Author: The Belle II Collaboration *
6  * Contributors: Marko Staric *
7  * *
8  * This software is provided "as is" without any warranty. *
9  **************************************************************************/
10 
11 #pragma once
12 
13 #include <top/dbobjects/TOPGeoBase.h>
14 #include <vector>
15 
16 namespace Belle2 {
25  class TOPNominalTTS: public TOPGeoBase {
26  public:
27 
31  struct Gauss {
32  float fraction = 0;
33  float position = 0;
34  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
Belle2::TOPNominalTTS::Gauss::fraction
float fraction
area normalization
Definition: TOPNominalTTS.h:40
Belle2::TOPNominalTTS::m_type
unsigned m_type
PMT type (see TOPPmtObsoleteData::EType)
Definition: TOPNominalTTS.h:113
Belle2::TOPNominalTTS::getPMTType
unsigned getPMTType() const
Returns PMT type (see TOPPmtObsoleteData::EType for the defined types)
Definition: TOPNominalTTS.h:88
Belle2::TOPNominalTTS::normalize
double normalize()
Normalize the distribution (fractions)
Definition: TOPNominalTTS.cc:38
Belle2::TOPNominalTTS::Gauss::position
float position
peak position [ns]
Definition: TOPNominalTTS.h:41
Belle2::TOPGeoBase
Base class for geometry parameters.
Definition: TOPGeoBase.h:35
Belle2::TOPNominalTTS::Gauss::sigma
float sigma
peak width [ns]
Definition: TOPNominalTTS.h:42
Belle2::TOPNominalTTS::ClassDefOverride
ClassDefOverride(TOPNominalTTS, 2)
ClassDef.
Belle2::TOPNominalTTS::setPMTType
void setPMTType(unsigned type)
Set type of PMT (see TOPPmtObsoleteData::EType for the defined types)
Definition: TOPNominalTTS.h:70
Belle2::TOPNominalTTS::appendGaussian
void appendGaussian(double norm, double mean, double sigma)
Append Gaussian.
Definition: TOPNominalTTS.cc:24
Belle2
Abstract base class for different kinds of events.
Definition: MillepedeAlgorithm.h:19
Belle2::TOPNominalTTS::m_normalized
bool m_normalized
normalization flag
Definition: TOPNominalTTS.h:112
Belle2::TOPNominalTTS::TOPNominalTTS
TOPNominalTTS()
Default constructor.
Definition: TOPNominalTTS.h:48
Belle2::TOPNominalTTS::isConsistent
bool isConsistent() const override
Check for consistency of data members.
Definition: TOPNominalTTS.cc:62
Belle2::TOPNominalTTS::generateTTS
double generateTTS() const
Generate time according to TTS distribution.
Definition: TOPNominalTTS.cc:48
Belle2::TOPNominalTTS::getTTS
const std::vector< Gauss > & getTTS() const
Returns TTS.
Definition: TOPNominalTTS.h:82
Belle2::TOPNominalTTS::print
void print(const std::string &title="Nominal TTS distribution") const override
Print the content of the class.
Definition: TOPNominalTTS.cc:70
Belle2::TOPNominalTTS::m_tts
std::vector< Gauss > m_tts
TTS distribution composed of a sum of Gaussians.
Definition: TOPNominalTTS.h:111