Belle II Software  release-08-01-10
TOPGeometry.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 <top/dbobjects/TOPGeoModule.h>
13 #include <top/dbobjects/TOPGeoFrontEnd.h>
14 #include <top/dbobjects/TOPGeoQBB.h>
15 #include <top/dbobjects/TOPNominalQE.h>
16 #include <top/dbobjects/TOPNominalTTS.h>
17 #include <top/dbobjects/TOPNominalTDC.h>
18 #include <top/dbobjects/TOPSignalShape.h>
19 #include <top/dbobjects/TOPWavelengthFilter.h>
20 #include <framework/gearbox/Unit.h>
21 #include <vector>
22 #include <map>
23 
24 
25 namespace Belle2 {
34  class TOPGeometry: public TOPGeoBase {
35  public:
36 
41  {}
42 
47  explicit TOPGeometry(const std::string& name): TOPGeoBase(name)
48  {}
49 
53  static void useBasf2Units() {s_unit = Unit::cm; s_unitName = "cm";}
54 
58  static void useGeantUnits() {s_unit = Unit::mm; s_unitName = "mm";}
59 
64  void appendModule(const TOPGeoModule& module);
65 
71  void setFrontEnd(const TOPGeoFrontEnd& frontEnd, unsigned num = 4)
72  {
73  m_frontEnd = frontEnd;
74  m_numBoardStacks = num;
75  }
76 
81  void setQBB(const TOPGeoQBB& QBB) {m_QBB = QBB;}
82 
87  void setNominalQE(const TOPNominalQE& nominalQE) {m_nominalQE = nominalQE;}
88 
93  void setNominalTTS(const TOPNominalTTS& nominalTTS) {m_nominalTTS = nominalTTS;}
94 
99  void appendTTS(const TOPNominalTTS& tts) {m_tts[tts.getPMTType()] = tts;}
100 
106  void appendPDETuningFactor(unsigned type, double factor) {m_tuneFactorsPDE[type] = factor;}
107 
112  void setNominalTDC(const TOPNominalTDC& nominalTDC) {m_nominalTDC = nominalTDC;}
113 
118  void setSignalShape(const TOPSignalShape& signalShape) {m_signalShape = signalShape;}
119 
124  void setCalPulseShape(const TOPSignalShape& shape) {m_calPulseShape = shape;}
125 
131 
136  unsigned getNumModules() const {return m_modules.size();}
137 
143  const TOPGeoModule& getModule(int moduleID) const;
144 
149  const std::vector<TOPGeoModule>& getModules() const {return m_modules;}
150 
156  bool isModuleIDValid(int moduleID) const;
157 
162  const TOPGeoFrontEnd& getFrontEnd() const {return m_frontEnd;}
163 
168  unsigned getNumBoardStacks() const {return m_numBoardStacks;}
169 
174  const TOPGeoQBB& getQBB() const {return m_QBB;}
175 
180  const TOPNominalQE& getNominalQE() const {return m_nominalQE;}
181 
186  const TOPNominalTTS& getNominalTTS() const {return m_nominalTTS;}
187 
193  const TOPNominalTTS& getTTS(unsigned type) const;
194 
200  double getPDETuningFactor(unsigned type) const;
201 
206  bool arePDETuningFactorsEmpty() const {return m_tuneFactorsPDE.empty();}
207 
212  const std::map<unsigned, TOPNominalTTS>& getTTSes() const {return m_tts;}
213 
218  const TOPNominalTDC& getNominalTDC() const {return m_nominalTDC;}
219 
224  const TOPSignalShape& getSignalShape() const {return m_signalShape;}
225 
231 
237 
242  double getInnerRadius() const;
243 
248  double getOuterRadius() const;
249 
254  double getRadius() const;
255 
260  double getBackwardZ() const;
261 
266  double getForwardZ() const;
267 
272  bool isConsistent() const override;
273 
278  void print(const std::string& title = "TOP geometry parameters") const override;
279 
280 
281  private:
282 
283  std::vector<TOPGeoModule> m_modules;
286  unsigned m_numBoardStacks = 0;
293  std::map<unsigned, TOPNominalTTS> m_tts;
294  std::map<unsigned, float> m_tuneFactorsPDE;
298  };
299 
301 } // end namespace Belle2
Base class for geometry parameters.
Definition: TOPGeoBase.h:25
Geometry parameters of board stack (front-end electronic module)
Geometry parameters of a module (optical components + positioning)
Definition: TOPGeoModule.h:31
Geometry parameters of Quartz Bar Box (mother class)
Definition: TOPGeoQBB.h:30
Geometry parameters of TOP.
Definition: TOPGeometry.h:34
unsigned getNumBoardStacks() const
Returns number of boardstacks per module.
Definition: TOPGeometry.h:168
const TOPNominalTTS & getNominalTTS() const
Returns nominal time transition spread of PMT.
Definition: TOPGeometry.h:186
TOPSignalShape m_calPulseShape
shape of the calibration pulse
Definition: TOPGeometry.h:291
std::map< unsigned, float > m_tuneFactorsPDE
PDE tuning factors of PMT types.
Definition: TOPGeometry.h:294
void setCalPulseShape(const TOPSignalShape &shape)
Sets calibration pulse shape.
Definition: TOPGeometry.h:124
void appendTTS(const TOPNominalTTS &tts)
Appends time transition spread of a particular PMT type.
Definition: TOPGeometry.h:99
void setWavelengthFilter(const TOPWavelengthFilter &filter)
Sets wavelength filter transmittance.
Definition: TOPGeometry.h:130
static void useGeantUnits()
Use Geant units when returning geometry parameters.
Definition: TOPGeometry.h:58
unsigned getNumModules() const
Returns number of modules.
Definition: TOPGeometry.h:136
TOPGeoFrontEnd m_frontEnd
geometry parameters of front-end electronics
Definition: TOPGeometry.h:284
TOPGeoQBB m_QBB
geometry parameters of quartz bar box
Definition: TOPGeometry.h:285
TOPNominalQE m_nominalQE
nominal quantum efficiency of PMT
Definition: TOPGeometry.h:287
const TOPNominalTDC & getNominalTDC() const
Returns nominal time-to-digit conversion parameters.
Definition: TOPGeometry.h:218
TOPGeometry(const std::string &name)
Constructor with name.
Definition: TOPGeometry.h:47
TOPNominalTTS m_nominalTTS
nominal time transition spread of PMT
Definition: TOPGeometry.h:288
const std::map< unsigned, TOPNominalTTS > & getTTSes() const
Returns PMT dependent time transition spreads.
Definition: TOPGeometry.h:212
const TOPSignalShape & getSignalShape() const
Returns single photon signal shape.
Definition: TOPGeometry.h:224
unsigned m_numBoardStacks
number of boardstacks per module
Definition: TOPGeometry.h:286
TOPSignalShape m_signalShape
shape of single photon signal
Definition: TOPGeometry.h:290
const std::vector< TOPGeoModule > & getModules() const
Returns all modules.
Definition: TOPGeometry.h:149
void setNominalTDC(const TOPNominalTDC &nominalTDC)
Sets nominal time-to-digit conversion parameters.
Definition: TOPGeometry.h:112
void setQBB(const TOPGeoQBB &QBB)
Sets quartz bar box.
Definition: TOPGeometry.h:81
const TOPWavelengthFilter & getWavelengthFilter() const
Returns transmittance of wavelength filter.
Definition: TOPGeometry.h:236
const TOPNominalQE & getNominalQE() const
Returns nominal quantum efficiency of PMT.
Definition: TOPGeometry.h:180
TOPNominalTDC m_nominalTDC
nominal time-to-digit conversion parameters
Definition: TOPGeometry.h:289
void setFrontEnd(const TOPGeoFrontEnd &frontEnd, unsigned num=4)
Sets front-end.
Definition: TOPGeometry.h:71
TOPWavelengthFilter m_wavelengthFilter
transmittance of wavelength filter
Definition: TOPGeometry.h:292
static void useBasf2Units()
Use basf2 units when returning geometry parameters.
Definition: TOPGeometry.h:53
std::vector< TOPGeoModule > m_modules
geometry parameters of modules
Definition: TOPGeometry.h:283
std::map< unsigned, TOPNominalTTS > m_tts
TTS of PMT types.
Definition: TOPGeometry.h:293
void setNominalQE(const TOPNominalQE &nominalQE)
Sets nominal quantum efficiency of PMT.
Definition: TOPGeometry.h:87
TOPGeometry()
Default constructor.
Definition: TOPGeometry.h:40
ClassDefOverride(TOPGeometry, 8)
ClassDef.
void appendPDETuningFactor(unsigned type, double factor)
Appends photon detection efficiency tuning factor of a particular PMT type.
Definition: TOPGeometry.h:106
const TOPGeoFrontEnd & getFrontEnd() const
Returns front-end.
Definition: TOPGeometry.h:162
const TOPSignalShape & getCalPulseShape() const
Returns calibration pulse shape.
Definition: TOPGeometry.h:230
void setSignalShape(const TOPSignalShape &signalShape)
Sets single photon signal shape.
Definition: TOPGeometry.h:118
bool arePDETuningFactorsEmpty() const
Check for empty PDE tuning factors.
Definition: TOPGeometry.h:206
void setNominalTTS(const TOPNominalTTS &nominalTTS)
Sets nominal time transition spread of PMT.
Definition: TOPGeometry.h:93
const TOPGeoQBB & getQBB() const
Returns quartz bar box.
Definition: TOPGeometry.h:174
Nominal quantum efficiency of PMT.
Definition: TOPNominalQE.h:24
Nominal time-to-digit conversion parameters (simplified model)
Definition: TOPNominalTDC.h:22
Nominal time transition spread of PMT.
Definition: TOPNominalTTS.h:23
unsigned getPMTType() const
Returns PMT type (see TOPPmtObsoleteData::EType for the defined types)
Definition: TOPNominalTTS.h:78
Normalized shape of single photon pulse (waveform) Pulse must be positive.
Bulk transmittance of wavelength filter.
static const double mm
[millimeters]
Definition: Unit.h:70
static const double cm
Standard units with the value = 1.
Definition: Unit.h:47
bool isConsistent() const override
Check for consistency of data members.
Definition: TOPGeometry.cc:126
static double s_unit
conversion unit for length
Definition: TOPGeoBase.h:86
void appendModule(const TOPGeoModule &module)
Appends module (if its ID differs from already appended modules)
Definition: TOPGeometry.cc:22
void print(const std::string &title="TOP geometry parameters") const override
Print the content of the class.
Definition: TOPGeometry.cc:142
double getForwardZ() const
Returns forward z of the volume devoted to TOP counter.
Definition: TOPGeometry.cc:114
bool isModuleIDValid(int moduleID) const
Checks if module exists in m_modules.
Definition: TOPGeometry.cc:33
const TOPGeoModule & getModule(int moduleID) const
Returns module.
Definition: TOPGeometry.cc:42
double getOuterRadius() const
Returns outer radius of the volume devoted to TOP counter.
Definition: TOPGeometry.cc:77
double getInnerRadius() const
Returns inner radius of the volume devoted to TOP counter.
Definition: TOPGeometry.cc:64
const TOPNominalTTS & getTTS(unsigned type) const
Returns time transition spread of a given PMT type.
Definition: TOPGeometry.cc:50
double getRadius() const
Returns average radius of modules.
Definition: TOPGeometry.cc:91
double getBackwardZ() const
Returns backward z of the volume devoted to TOP counter.
Definition: TOPGeometry.cc:102
static std::string s_unitName
conversion unit name
Definition: TOPGeoBase.h:87
double getPDETuningFactor(unsigned type) const
Returns photon detection efficiency tuning factor of a given PMT type.
Definition: TOPGeometry.cc:57
std::map< ExpRun, std::pair< double, double > > filter(const std::map< ExpRun, std::pair< double, double >> &runs, double cut, std::map< ExpRun, std::pair< double, double >> &runsRemoved)
filter events to remove runs shorter than cut, it stores removed runs in runsRemoved
Definition: Splitter.cc:38
Abstract base class for different kinds of events.