Belle II Software development
TOPGeoPMTArray.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/TOPGeoPMT.h>
13#include <vector>
14
15namespace Belle2 {
24 class TOPGeoPMTArray: public TOPGeoBase {
25 public:
26
31 {}
32
43 TOPGeoPMTArray(unsigned numColumns, unsigned numRows,
44 double gapX, double gapY,
45 const std::string& material,
46 const TOPGeoPMT& pmt,
47 const std::string& name = "TOPPMTArray"):
48 TOPGeoBase(name),
49 m_numRows(numRows), m_numColumns(numColumns), m_dx(gapX), m_dy(gapY),
50 m_gx(gapX), m_gy(gapY), m_material(material), m_pmt(pmt)
51 {
52 m_dx += pmt.getSizeX() * s_unit;
53 m_dy += pmt.getSizeY() * s_unit;
54 }
55
60 void setAirGap(double gap) {m_airGap = gap;}
61
66 void setDecoupledPMT(unsigned pmtID) {m_decoupledPMTs.push_back(pmtID);}
67
73 void setSiliconeCookie(double thickness, const std::string& material)
74 {
75 m_cookieThickness = thickness;
76 m_cookieMaterial = material;
77 }
78
84 void setWavelengthFilter(double thickness, const std::string& material)
85 {
86 m_filterThickness = thickness;
87 m_filterMaterial = material;
88 }
89
94 void generateDecoupledPMTs(double fraction);
95
100 unsigned getNumColumns() const {return m_numColumns;}
101
106 unsigned getNumRows() const {return m_numRows;}
107
112 unsigned getSize() const {return m_numRows * m_numColumns;}
113
118 unsigned getNumPixels() const {return getSize() * m_pmt.getNumPixels();}
119
124 unsigned getNumPixelColumns() const {return m_numColumns * m_pmt.getNumColumns();}
125
130 unsigned getNumPixelRows() const {return m_numRows * m_pmt.getNumRows();}
131
136 double getDx() const {return m_dx / s_unit;}
137
142 double getDy() const {return m_dy / s_unit;}
143
148 double getGapX() const {return m_gx / s_unit;}
149
154 double getGapY() const {return m_gy / s_unit;}
155
160 double getCookieThickness() const {return m_cookieThickness / s_unit;}
161
166 const std::string& getCookieMaterial() const {return m_cookieMaterial;}
167
172 double getFilterThickness() const {return m_filterThickness / s_unit;}
173
178 const std::string& getFilterMaterial() const {return m_filterMaterial;}
179
184 double getSizeX() const {return m_numColumns * getDx();}
185
190 double getSizeY() const {return m_numRows * getDy();}
191
196 double getSizeZ() const
197 {
199 }
200
206 double getX(unsigned col) const
207 {
208 return (int)(m_numColumns + 1 - 2 * col) / 2.0 * getDx();
209 }
210
216 double getY(unsigned row) const
217 {
218 return (int)(2 * row - m_numRows - 1) / 2.0 * getDy();
219 }
220
225 const std::string& getMaterial() const {return m_material;}
226
231 const TOPGeoPMT& getPMT() const {return m_pmt;}
232
239 unsigned getPmtID(unsigned row, unsigned col) const;
240
246 unsigned getRow(unsigned pmtID) const;
247
253 unsigned getColumn(unsigned pmtID) const;
254
262 int getPixelID(double x, double y, unsigned pmtID) const;
263
270 int getPixelID(unsigned pmtID, unsigned pmtPixelID) const;
271
276 double getAirGap() const {return m_airGap / s_unit;}
277
282 const std::vector<unsigned>& getDecoupledPMTs() const {return m_decoupledPMTs;}
283
288 bool isPMTDecoupled(unsigned pmtID) const;
289
294 bool isConsistent() const override;
295
300 void print(const std::string& title = "PMT array geometry parameters") const override;
301
302 private:
303
304 unsigned m_numRows = 0;
305 unsigned m_numColumns = 0;
306 float m_dx = 0;
307 float m_dy = 0;
308 float m_gx = 0;
309 float m_gy = 0;
310 std::string m_material;
312 float m_airGap = 0;
313 std::vector<unsigned> m_decoupledPMTs;
315 std::string m_cookieMaterial;
317 std::string m_filterMaterial;
321 };
322
324} // end namespace Belle2
Base class for geometry parameters.
Definition: TOPGeoBase.h:25
Geometry parameters of MCP-PMT array.
const std::string & getCookieMaterial() const
Returns silicone cookie material.
double getSizeZ() const
Returns array volume dimension in z.
unsigned getNumColumns() const
Returns number of array columns.
void setSiliconeCookie(double thickness, const std::string &material)
Sets silicone cookie.
unsigned m_numColumns
number of columns
std::vector< unsigned > m_decoupledPMTs
ID's of decoupled PMT's.
std::string m_cookieMaterial
silicone cookie material
TOPGeoPMTArray(unsigned numColumns, unsigned numRows, double gapX, double gapY, const std::string &material, const TOPGeoPMT &pmt, const std::string &name="TOPPMTArray")
Full constructor.
void setDecoupledPMT(unsigned pmtID)
Sets PMT as optically decoupled.
double getX(unsigned col) const
Returns x coordinate of column center.
std::string m_material
material name into which PMT's are inserted
double getY(unsigned row) const
Returns the y coordinate of row center.
float m_gx
gap between PMT's in x
double getDx() const
Returns spacing in x (column width)
double getFilterThickness() const
Returns wavelength filter thickness.
float m_dy
spacing in y
std::string m_filterMaterial
wavelength filter material
unsigned m_numRows
number of rows
unsigned getSize() const
Returns array size.
float m_dx
spacing in x
unsigned getNumPixelRows() const
Returns number of pixel rows.
double getDy() const
Returns spacing in y (row height)
void setWavelengthFilter(double thickness, const std::string &material)
Sets wavelength filter.
unsigned getNumPixels() const
Returns number of pixels.
unsigned getNumPixelColumns() const
Returns number of pixel columns.
double getSizeX() const
Returns array volume dimension in x.
const std::string & getFilterMaterial() const
Returns wavelenght filter material.
const TOPGeoPMT & getPMT() const
Returns PMT geometry parameters.
double getSizeY() const
Returns array volume dimension in y.
float m_filterThickness
wavelength filter thickness
TOPGeoPMT m_pmt
PMT geometry parameters.
const std::string & getMaterial() const
Returns material name into which PMT's are inserted.
float m_cookieThickness
silicone cookie thickness
double getGapY() const
Returns gap between PMT's in y.
TOPGeoPMTArray()
Default constructor.
unsigned getNumRows() const
Returns number of array rows.
ClassDefOverride(TOPGeoPMTArray, 3)
ClassDef.
double getCookieThickness() const
Returns silicone cookie thickness.
void setAirGap(double gap)
Sets air gap for optically decoupled PMT's.
float m_gy
gap between PMT's in y
double getAirGap() const
Returns air gap.
const std::vector< unsigned > & getDecoupledPMTs() const
Returns ID's of optically decoupled PMT's.
float m_airGap
air gap thickness for decoupled PMT's
double getGapX() const
Returns gap between PMT's in x.
Geometry parameters of MCP-PMT.
Definition: TOPGeoPMT.h:24
double getSizeZ() const
Returns full size in z.
Definition: TOPGeoPMT.h:141
unsigned getNumColumns() const
Returns number of pixel columns.
Definition: TOPGeoPMT.h:183
unsigned getNumPixels() const
Returns number of pixels.
Definition: TOPGeoPMT.h:195
double getSizeX() const
Returns full size in x.
Definition: TOPGeoPMT.h:129
double getSizeY() const
Returns full size in y.
Definition: TOPGeoPMT.h:135
unsigned getNumRows() const
Returns number of pixel rows.
Definition: TOPGeoPMT.h:189
bool isConsistent() const override
Check for consistency of data members.
static double s_unit
conversion unit for length
Definition: TOPGeoBase.h:86
void generateDecoupledPMTs(double fraction)
Generate randomly a fraction of PMT's to be optically decoupled.
void print(const std::string &title="PMT array geometry parameters") const override
Print the content of the class.
bool isPMTDecoupled(unsigned pmtID) const
Checks if PMT is optically decoupled.
unsigned getRow(unsigned pmtID) const
Converts PMT ID to row number (1-based)
unsigned getColumn(unsigned pmtID) const
Converts PMT ID to column number (1-based)
int getPixelID(double x, double y, unsigned pmtID) const
Converts (digitizes) x, y and PMT ID to pixel ID (1-based)
unsigned getPmtID(unsigned row, unsigned col) const
Converts row and column numbers to PMT ID (1-based)
Abstract base class for different kinds of events.