Belle II Software  release-05-02-19
TOPGeometry.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 <top/dbobjects/TOPGeoModule.h>
15 #include <top/dbobjects/TOPGeoFrontEnd.h>
16 #include <top/dbobjects/TOPGeoQBB.h>
17 #include <top/dbobjects/TOPNominalQE.h>
18 #include <top/dbobjects/TOPNominalTTS.h>
19 #include <top/dbobjects/TOPNominalTDC.h>
20 #include <top/dbobjects/TOPSignalShape.h>
21 #include <top/dbobjects/TOPWavelengthFilter.h>
22 #include <framework/gearbox/Unit.h>
23 #include <vector>
24 #include <map>
25 
26 
27 namespace Belle2 {
36  class TOPGeometry: public TOPGeoBase {
37  public:
38 
42  TOPGeometry()
43  {}
44 
49  explicit TOPGeometry(const std::string& name): TOPGeoBase(name)
50  {}
51 
55  static void useBasf2Units() {s_unit = Unit::cm; s_unitName = "cm";}
56 
60  static void useGeantUnits() {s_unit = Unit::mm; s_unitName = "mm";}
61 
66  void appendModule(const TOPGeoModule& module);
67 
73  void setFrontEnd(const TOPGeoFrontEnd& frontEnd, unsigned num = 4)
74  {
75  m_frontEnd = frontEnd;
76  m_numBoardStacks = num;
77  }
78 
83  void setQBB(const TOPGeoQBB& QBB) {m_QBB = QBB;}
84 
89  void setNominalQE(const TOPNominalQE& nominalQE) {m_nominalQE = nominalQE;}
90 
95  void setNominalTTS(const TOPNominalTTS& nominalTTS) {m_nominalTTS = nominalTTS;}
96 
101  void appendTTS(const TOPNominalTTS& tts) {m_tts[tts.getPMTType()] = tts;}
102 
108  void appendPDETuningFactor(unsigned type, double factor) {m_tuneFactorsPDE[type] = factor;}
109 
114  void setNominalTDC(const TOPNominalTDC& nominalTDC) {m_nominalTDC = nominalTDC;}
115 
120  void setSignalShape(const TOPSignalShape& signalShape) {m_signalShape = signalShape;}
121 
126  void setCalPulseShape(const TOPSignalShape& shape) {m_calPulseShape = shape;}
127 
132  void setWavelengthFilter(const TOPWavelengthFilter& filter) {m_wavelengthFilter = filter;}
133 
138  unsigned getNumModules() const {return m_modules.size();}
139 
145  const TOPGeoModule& getModule(int moduleID) const;
146 
151  const std::vector<TOPGeoModule>& getModules() const {return m_modules;}
152 
158  bool isModuleIDValid(int moduleID) const;
159 
164  const TOPGeoFrontEnd& getFrontEnd() const {return m_frontEnd;}
165 
170  unsigned getNumBoardStacks() const {return m_numBoardStacks;}
171 
176  const TOPGeoQBB& getQBB() const {return m_QBB;}
177 
182  const TOPNominalQE& getNominalQE() const {return m_nominalQE;}
183 
188  const TOPNominalTTS& getNominalTTS() const {return m_nominalTTS;}
189 
195  const TOPNominalTTS& getTTS(unsigned type) const;
196 
202  double getPDETuningFactor(unsigned type) const;
203 
208  bool arePDETuningFactorsEmpty() const {return m_tuneFactorsPDE.empty();}
209 
214  const std::map<unsigned, TOPNominalTTS>& getTTSes() const {return m_tts;}
215 
220  const TOPNominalTDC& getNominalTDC() const {return m_nominalTDC;}
221 
226  const TOPSignalShape& getSignalShape() const {return m_signalShape;}
227 
232  const TOPSignalShape& getCalPulseShape() const {return m_calPulseShape;}
233 
238  const TOPWavelengthFilter& getWavelengthFilter() const {return m_wavelengthFilter;}
239 
244  double getInnerRadius() const;
245 
250  double getOuterRadius() const;
251 
256  double getRadius() const;
257 
262  double getBackwardZ() const;
263 
268  double getForwardZ() const;
269 
274  bool isConsistent() const override;
275 
280  void print(const std::string& title = "TOP geometry parameters") const override;
281 
282 
283  private:
284 
285  std::vector<TOPGeoModule> m_modules;
286  TOPGeoFrontEnd m_frontEnd;
287  TOPGeoQBB m_QBB;
288  unsigned m_numBoardStacks = 0;
289  TOPNominalQE m_nominalQE;
290  TOPNominalTTS m_nominalTTS;
291  TOPNominalTDC m_nominalTDC;
292  TOPSignalShape m_signalShape;
295  std::map<unsigned, TOPNominalTTS> m_tts;
296  std::map<unsigned, float> m_tuneFactorsPDE;
300  };
301 
303 } // end namespace Belle2
Belle2::Unit::cm
static const double cm
Standard units with the value = 1.
Definition: Unit.h:57
Belle2::TOPGeometry::getInnerRadius
double getInnerRadius() const
Returns inner radius of the volume devoted to TOP counter.
Definition: TOPGeometry.cc:66
Belle2::TOPGeometry::appendPDETuningFactor
void appendPDETuningFactor(unsigned type, double factor)
Appends photon detection efficiency tuning factor of a particular PMT type.
Definition: TOPGeometry.h:116
Belle2::TOPGeometry::ClassDefOverride
ClassDefOverride(TOPGeometry, 8)
ClassDef.
Belle2::TOPGeometry
Geometry parameters of TOP.
Definition: TOPGeometry.h:44
Belle2::TOPGeometry::useGeantUnits
static void useGeantUnits()
Use Geant units when returning geometry parameters.
Definition: TOPGeometry.h:68
Belle2::TOPGeometry::appendModule
void appendModule(const TOPGeoModule &module)
Appends module (if its ID differs from already appended modules)
Definition: TOPGeometry.cc:24
Belle2::TOPGeometry::print
void print(const std::string &title="TOP geometry parameters") const override
Print the content of the class.
Definition: TOPGeometry.cc:144
Belle2::TOPGeoBase
Base class for geometry parameters.
Definition: TOPGeoBase.h:35
Belle2::TOPGeoBase::s_unitName
static std::string s_unitName
conversion unit name
Definition: TOPGeoBase.h:97
Belle2::TOPGeometry::arePDETuningFactorsEmpty
bool arePDETuningFactorsEmpty() const
Check for empty PDE tuning factors.
Definition: TOPGeometry.h:216
Belle2::TOPGeometry::m_nominalTDC
TOPNominalTDC m_nominalTDC
nominal time-to-digit conversion parameters
Definition: TOPGeometry.h:299
Belle2::TOPGeometry::getBackwardZ
double getBackwardZ() const
Returns backward z of the volume devoted to TOP counter.
Definition: TOPGeometry.cc:104
Belle2::TOPGeometry::getCalPulseShape
const TOPSignalShape & getCalPulseShape() const
Returns calibration pulse shape.
Definition: TOPGeometry.h:240
Belle2::TOPGeometry::getPDETuningFactor
double getPDETuningFactor(unsigned type) const
Returns photon detection efficiency tuning factor of a given PMT type.
Definition: TOPGeometry.cc:59
Belle2::TOPGeometry::setNominalQE
void setNominalQE(const TOPNominalQE &nominalQE)
Sets nominal quantum efficiency of PMT.
Definition: TOPGeometry.h:97
Belle2::filter
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:43
Belle2::TOPGeometry::getSignalShape
const TOPSignalShape & getSignalShape() const
Returns single photon signal shape.
Definition: TOPGeometry.h:234
Belle2::TOPGeoFrontEnd
Geometry parameters of board stack (front-end electronic module)
Definition: TOPGeoFrontEnd.h:33
Belle2::TOPGeometry::getNominalTDC
const TOPNominalTDC & getNominalTDC() const
Returns nominal time-to-digit conversion parameters.
Definition: TOPGeometry.h:228
Belle2::TOPGeometry::m_numBoardStacks
unsigned m_numBoardStacks
number of boardstacks per module
Definition: TOPGeometry.h:296
Belle2::TOPGeometry::m_nominalQE
TOPNominalQE m_nominalQE
nominal quantum efficiency of PMT
Definition: TOPGeometry.h:297
Belle2::TOPGeometry::getNominalQE
const TOPNominalQE & getNominalQE() const
Returns nominal quantum efficiency of PMT.
Definition: TOPGeometry.h:190
Belle2::TOPGeometry::getModule
const TOPGeoModule & getModule(int moduleID) const
Returns module.
Definition: TOPGeometry.cc:44
Belle2::TOPSignalShape
Normalized shape of single photon pulse (waveform) Pulse must be positive.
Definition: TOPSignalShape.h:35
Belle2::TOPGeometry::getNominalTTS
const TOPNominalTTS & getNominalTTS() const
Returns nominal time transition spread of PMT.
Definition: TOPGeometry.h:196
Belle2::TOPGeometry::setNominalTDC
void setNominalTDC(const TOPNominalTDC &nominalTDC)
Sets nominal time-to-digit conversion parameters.
Definition: TOPGeometry.h:122
Belle2::TOPGeometry::getTTS
const TOPNominalTTS & getTTS(unsigned type) const
Returns time transition spread of a given PMT type.
Definition: TOPGeometry.cc:52
Belle2::TOPGeometry::getQBB
const TOPGeoQBB & getQBB() const
Returns quartz bar box.
Definition: TOPGeometry.h:184
Belle2
Abstract base class for different kinds of events.
Definition: MillepedeAlgorithm.h:19
Belle2::TOPGeometry::setFrontEnd
void setFrontEnd(const TOPGeoFrontEnd &frontEnd, unsigned num=4)
Sets front-end.
Definition: TOPGeometry.h:81
Belle2::TOPGeoBase::s_unit
static double s_unit
conversion unit for length
Definition: TOPGeoBase.h:96
Belle2::TOPGeometry::getNumModules
unsigned getNumModules() const
Returns number of modules.
Definition: TOPGeometry.h:146
Belle2::TOPGeometry::appendTTS
void appendTTS(const TOPNominalTTS &tts)
Appends time transition spread of a particular PMT type.
Definition: TOPGeometry.h:109
Belle2::TOPNominalTDC
Nominal time-to-digit conversion parameters (simplified model)
Definition: TOPNominalTDC.h:32
Belle2::TOPGeometry::isConsistent
bool isConsistent() const override
Check for consistency of data members.
Definition: TOPGeometry.cc:128
Belle2::TOPGeometry::setNominalTTS
void setNominalTTS(const TOPNominalTTS &nominalTTS)
Sets nominal time transition spread of PMT.
Definition: TOPGeometry.h:103
Belle2::TOPGeometry::getTTSes
const std::map< unsigned, TOPNominalTTS > & getTTSes() const
Returns PMT dependent time transition spreads.
Definition: TOPGeometry.h:222
Belle2::TOPGeometry::m_signalShape
TOPSignalShape m_signalShape
shape of single photon signal
Definition: TOPGeometry.h:300
Belle2::TOPGeometry::m_modules
std::vector< TOPGeoModule > m_modules
geometry parameters of modules
Definition: TOPGeometry.h:293
Belle2::TOPGeometry::m_QBB
TOPGeoQBB m_QBB
geometry parameters of quartz bar box
Definition: TOPGeometry.h:295
Belle2::TOPGeometry::m_nominalTTS
TOPNominalTTS m_nominalTTS
nominal time transition spread of PMT
Definition: TOPGeometry.h:298
Belle2::TOPGeometry::m_tts
std::map< unsigned, TOPNominalTTS > m_tts
TTS of PMT types.
Definition: TOPGeometry.h:303
Belle2::TOPGeometry::setQBB
void setQBB(const TOPGeoQBB &QBB)
Sets quartz bar box.
Definition: TOPGeometry.h:91
Belle2::TOPWavelengthFilter
Bulk transmittance of wavelength filter.
Definition: TOPWavelengthFilter.h:33
Belle2::TOPGeometry::useBasf2Units
static void useBasf2Units()
Use basf2 units when returning geometry parameters.
Definition: TOPGeometry.h:63
Belle2::TOPGeometry::m_wavelengthFilter
TOPWavelengthFilter m_wavelengthFilter
transmittance of wavelength filter
Definition: TOPGeometry.h:302
Belle2::Unit::mm
static const double mm
[millimeters]
Definition: Unit.h:80
Belle2::TOPGeometry::getRadius
double getRadius() const
Returns average radius of modules.
Definition: TOPGeometry.cc:93
Belle2::TOPGeometry::setSignalShape
void setSignalShape(const TOPSignalShape &signalShape)
Sets single photon signal shape.
Definition: TOPGeometry.h:128
Belle2::TOPGeometry::getModules
const std::vector< TOPGeoModule > & getModules() const
Returns all modules.
Definition: TOPGeometry.h:159
Belle2::TOPGeometry::getNumBoardStacks
unsigned getNumBoardStacks() const
Returns number of boardstacks per module.
Definition: TOPGeometry.h:178
Belle2::TOPGeometry::m_tuneFactorsPDE
std::map< unsigned, float > m_tuneFactorsPDE
PDE tuning factors of PMT types.
Definition: TOPGeometry.h:304
Belle2::TOPGeometry::getFrontEnd
const TOPGeoFrontEnd & getFrontEnd() const
Returns front-end.
Definition: TOPGeometry.h:172
Belle2::TOPGeometry::getForwardZ
double getForwardZ() const
Returns forward z of the volume devoted to TOP counter.
Definition: TOPGeometry.cc:116
Belle2::TOPGeometry::isModuleIDValid
bool isModuleIDValid(int moduleID) const
Checks if module exists in m_modules.
Definition: TOPGeometry.cc:35
Belle2::TOPGeometry::m_calPulseShape
TOPSignalShape m_calPulseShape
shape of the calibration pulse
Definition: TOPGeometry.h:301
Belle2::TOPGeometry::getWavelengthFilter
const TOPWavelengthFilter & getWavelengthFilter() const
Returns transmittance of wavelength filter.
Definition: TOPGeometry.h:246
Belle2::TOPGeometry::m_frontEnd
TOPGeoFrontEnd m_frontEnd
geometry parameters of front-end electronics
Definition: TOPGeometry.h:294
Belle2::TOPGeometry::setWavelengthFilter
void setWavelengthFilter(const TOPWavelengthFilter &filter)
Sets wavelength filter transmittance.
Definition: TOPGeometry.h:140
Belle2::TOPGeometry::setCalPulseShape
void setCalPulseShape(const TOPSignalShape &shape)
Sets calibration pulse shape.
Definition: TOPGeometry.h:134
Belle2::TOPGeometry::getOuterRadius
double getOuterRadius() const
Returns outer radius of the volume devoted to TOP counter.
Definition: TOPGeometry.cc:79
Belle2::TOPGeometry::TOPGeometry
TOPGeometry()
Default constructor.
Definition: TOPGeometry.h:50