Belle II Software  release-05-02-19
TOPGeoPMTArray.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/TOPGeoPMT.h>
15 #include <vector>
16 
17 namespace Belle2 {
26  class TOPGeoPMTArray: public TOPGeoBase {
27  public:
28 
33  {}
34 
45  TOPGeoPMTArray(unsigned numColumns, unsigned numRows,
46  double gapX, double gapY,
47  const std::string& material,
48  const TOPGeoPMT& pmt,
49  const std::string& name = "TOPPMTArray"):
50  TOPGeoBase(name),
51  m_numRows(numRows), m_numColumns(numColumns), m_dx(gapX), m_dy(gapY),
52  m_gx(gapX), m_gy(gapY), m_material(material), m_pmt(pmt)
53  {
54  m_dx += pmt.getSizeX() * s_unit;
55  m_dy += pmt.getSizeY() * s_unit;
56  }
57 
62  void setAirGap(double gap) {m_airGap = gap;}
63 
68  void setDecoupledPMT(unsigned pmtID) {m_decoupledPMTs.push_back(pmtID);}
69 
75  void setSiliconeCookie(double thickness, const std::string& material)
76  {
77  m_cookieThickness = thickness;
78  m_cookieMaterial = material;
79  }
80 
86  void setWavelengthFilter(double thickness, const std::string& material)
87  {
88  m_filterThickness = thickness;
89  m_filterMaterial = material;
90  }
91 
96  void generateDecoupledPMTs(double fraction);
97 
102  unsigned getNumColumns() const {return m_numColumns;}
103 
108  unsigned getNumRows() const {return m_numRows;}
109 
114  unsigned getSize() const {return m_numRows * m_numColumns;}
115 
120  unsigned getNumPixels() const {return getSize() * m_pmt.getNumPixels();}
121 
126  unsigned getNumPixelColumns() const {return m_numColumns * m_pmt.getNumColumns();}
127 
132  unsigned getNumPixelRows() const {return m_numRows * m_pmt.getNumRows();}
133 
138  double getDx() const {return m_dx / s_unit;}
139 
144  double getDy() const {return m_dy / s_unit;}
145 
150  double getGapX() const {return m_gx / s_unit;}
151 
156  double getGapY() const {return m_gy / s_unit;}
157 
162  double getCookieThickness() const {return m_cookieThickness / s_unit;}
163 
168  const std::string& getCookieMaterial() const {return m_cookieMaterial;}
169 
174  double getFilterThickness() const {return m_filterThickness / s_unit;}
175 
180  const std::string& getFilterMaterial() const {return m_filterMaterial;}
181 
186  double getSizeX() const {return m_numColumns * getDx();}
187 
192  double getSizeY() const {return m_numRows * getDy();}
193 
198  double getSizeZ() const
199  {
201  }
202 
208  double getX(unsigned col) const
209  {
210  return (int)(m_numColumns + 1 - 2 * col) / 2.0 * getDx();
211  }
212 
218  double getY(unsigned row) const
219  {
220  return (int)(2 * row - m_numRows - 1) / 2.0 * getDy();
221  }
222 
227  const std::string& getMaterial() const {return m_material;}
228 
233  const TOPGeoPMT& getPMT() const {return m_pmt;}
234 
241  unsigned getPmtID(unsigned row, unsigned col) const;
242 
248  unsigned getRow(unsigned pmtID) const;
249 
255  unsigned getColumn(unsigned pmtID) const;
256 
264  int getPixelID(double x, double y, unsigned pmtID) const;
265 
272  int getPixelID(unsigned pmtID, unsigned pmtPixelID) const;
273 
278  double getAirGap() const {return m_airGap / s_unit;}
279 
284  const std::vector<unsigned>& getDecoupledPMTs() const {return m_decoupledPMTs;}
285 
290  bool isPMTDecoupled(unsigned pmtID) const;
291 
296  bool isConsistent() const override;
297 
302  void print(const std::string& title = "PMT array geometry parameters") const override;
303 
304  private:
305 
306  unsigned m_numRows = 0;
307  unsigned m_numColumns = 0;
308  float m_dx = 0;
309  float m_dy = 0;
310  float m_gx = 0;
311  float m_gy = 0;
312  std::string m_material;
313  TOPGeoPMT m_pmt;
314  float m_airGap = 0;
315  std::vector<unsigned> m_decoupledPMTs;
316  float m_cookieThickness = 0;
317  std::string m_cookieMaterial;
318  float m_filterThickness = 0;
319  std::string m_filterMaterial;
323  };
324 
326 } // end namespace Belle2
Belle2::TOPGeoPMT::getNumColumns
unsigned getNumColumns() const
Returns number of pixel columns.
Definition: TOPGeoPMT.h:193
Belle2::TOPGeoPMT
Geometry parameters of MCP-PMT.
Definition: TOPGeoPMT.h:34
Belle2::TOPGeoPMTArray::getSize
unsigned getSize() const
Returns array size.
Definition: TOPGeoPMTArray.h:122
Belle2::TOPGeoPMTArray::print
void print(const std::string &title="PMT array geometry parameters") const override
Print the content of the class.
Definition: TOPGeoPMTArray.cc:110
Belle2::TOPGeoPMTArray::getColumn
unsigned getColumn(unsigned pmtID) const
Converts PMT ID to column number (1-based)
Definition: TOPGeoPMTArray.cc:36
Belle2::TOPGeoPMTArray::getNumPixelRows
unsigned getNumPixelRows() const
Returns number of pixel rows.
Definition: TOPGeoPMTArray.h:140
Belle2::TOPGeoPMTArray::getFilterMaterial
const std::string & getFilterMaterial() const
Returns wavelenght filter material.
Definition: TOPGeoPMTArray.h:188
Belle2::TOPGeoPMTArray::generateDecoupledPMTs
void generateDecoupledPMTs(double fraction)
Generate randomly a fraction of PMT's to be optically decoupled.
Definition: TOPGeoPMTArray.cc:76
Belle2::TOPGeoPMTArray::getSizeY
double getSizeY() const
Returns array volume dimension in y.
Definition: TOPGeoPMTArray.h:200
Belle2::TOPGeoPMTArray::setAirGap
void setAirGap(double gap)
Sets air gap for optically decoupled PMT's.
Definition: TOPGeoPMTArray.h:70
Belle2::TOPGeoPMTArray::m_gy
float m_gy
gap between PMT's in y
Definition: TOPGeoPMTArray.h:319
Belle2::TOPGeoBase
Base class for geometry parameters.
Definition: TOPGeoBase.h:35
Belle2::TOPGeoPMTArray::m_airGap
float m_airGap
air gap thickness for decoupled PMT's
Definition: TOPGeoPMTArray.h:322
Belle2::TOPGeoPMTArray::getNumPixelColumns
unsigned getNumPixelColumns() const
Returns number of pixel columns.
Definition: TOPGeoPMTArray.h:134
Belle2::TOPGeoPMT::getNumPixels
unsigned getNumPixels() const
Returns number of pixels.
Definition: TOPGeoPMT.h:205
Belle2::TOPGeoPMT::getSizeY
double getSizeY() const
Returns full size in y.
Definition: TOPGeoPMT.h:145
Belle2::TOPGeoPMT::getSizeX
double getSizeX() const
Returns full size in x.
Definition: TOPGeoPMT.h:139
Belle2::TOPGeoPMTArray::getSizeX
double getSizeX() const
Returns array volume dimension in x.
Definition: TOPGeoPMTArray.h:194
Belle2::TOPGeoPMTArray::getNumRows
unsigned getNumRows() const
Returns number of array rows.
Definition: TOPGeoPMTArray.h:116
Belle2::TOPGeoPMTArray::m_dx
float m_dx
spacing in x
Definition: TOPGeoPMTArray.h:316
Belle2::TOPGeoPMTArray::ClassDefOverride
ClassDefOverride(TOPGeoPMTArray, 3)
ClassDef.
Belle2::TOPGeoPMTArray::isPMTDecoupled
bool isPMTDecoupled(unsigned pmtID) const
Checks if PMT is optically decoupled.
Definition: TOPGeoPMTArray.cc:86
Belle2::TOPGeoPMTArray::getDecoupledPMTs
const std::vector< unsigned > & getDecoupledPMTs() const
Returns ID's of optically decoupled PMT's.
Definition: TOPGeoPMTArray.h:292
Belle2::TOPGeoPMTArray::m_cookieMaterial
std::string m_cookieMaterial
silicone cookie material
Definition: TOPGeoPMTArray.h:325
Belle2::TOPGeoPMTArray::m_filterThickness
float m_filterThickness
wavelength filter thickness
Definition: TOPGeoPMTArray.h:326
Belle2::TOPGeoPMTArray::m_cookieThickness
float m_cookieThickness
silicone cookie thickness
Definition: TOPGeoPMTArray.h:324
Belle2::TOPGeoPMTArray::m_dy
float m_dy
spacing in y
Definition: TOPGeoPMTArray.h:317
Belle2::TOPGeoPMTArray::getGapX
double getGapX() const
Returns gap between PMT's in x.
Definition: TOPGeoPMTArray.h:158
Belle2::TOPGeoPMTArray::getFilterThickness
double getFilterThickness() const
Returns wavelength filter thickness.
Definition: TOPGeoPMTArray.h:182
Belle2::TOPGeoPMTArray::getNumColumns
unsigned getNumColumns() const
Returns number of array columns.
Definition: TOPGeoPMTArray.h:110
Belle2
Abstract base class for different kinds of events.
Definition: MillepedeAlgorithm.h:19
Belle2::TOPGeoPMTArray::getX
double getX(unsigned col) const
Returns x coordinate of column center.
Definition: TOPGeoPMTArray.h:216
Belle2::TOPGeoPMTArray::m_numRows
unsigned m_numRows
number of rows
Definition: TOPGeoPMTArray.h:314
Belle2::TOPGeoPMTArray
Geometry parameters of MCP-PMT array.
Definition: TOPGeoPMTArray.h:34
Belle2::TOPGeoPMTArray::m_filterMaterial
std::string m_filterMaterial
wavelength filter material
Definition: TOPGeoPMTArray.h:327
Belle2::TOPGeoBase::s_unit
static double s_unit
conversion unit for length
Definition: TOPGeoBase.h:96
Belle2::TOPGeoPMTArray::getPixelID
int getPixelID(double x, double y, unsigned pmtID) const
Converts (digitizes) x, y and PMT ID to pixel ID (1-based)
Definition: TOPGeoPMTArray.cc:42
Belle2::TOPGeoPMTArray::getY
double getY(unsigned row) const
Returns the y coordinate of row center.
Definition: TOPGeoPMTArray.h:226
Belle2::TOPGeoPMTArray::getCookieMaterial
const std::string & getCookieMaterial() const
Returns silicone cookie material.
Definition: TOPGeoPMTArray.h:176
Belle2::TOPGeoPMTArray::isConsistent
bool isConsistent() const override
Check for consistency of data members.
Definition: TOPGeoPMTArray.cc:95
Belle2::TOPGeoPMTArray::getNumPixels
unsigned getNumPixels() const
Returns number of pixels.
Definition: TOPGeoPMTArray.h:128
Belle2::TOPGeoPMTArray::setSiliconeCookie
void setSiliconeCookie(double thickness, const std::string &material)
Sets silicone cookie.
Definition: TOPGeoPMTArray.h:83
Belle2::TOPGeoPMTArray::m_decoupledPMTs
std::vector< unsigned > m_decoupledPMTs
ID's of decoupled PMT's.
Definition: TOPGeoPMTArray.h:323
Belle2::TOPGeoPMTArray::m_gx
float m_gx
gap between PMT's in x
Definition: TOPGeoPMTArray.h:318
Belle2::TOPGeoPMTArray::getAirGap
double getAirGap() const
Returns air gap.
Definition: TOPGeoPMTArray.h:286
Belle2::TOPGeoPMTArray::getDx
double getDx() const
Returns spacing in x (column width)
Definition: TOPGeoPMTArray.h:146
Belle2::TOPGeoPMTArray::getCookieThickness
double getCookieThickness() const
Returns silicone cookie thickness.
Definition: TOPGeoPMTArray.h:170
Belle2::TOPGeoPMT::getSizeZ
double getSizeZ() const
Returns full size in z.
Definition: TOPGeoPMT.h:151
Belle2::TOPGeoPMTArray::getMaterial
const std::string & getMaterial() const
Returns material name into which PMT's are inserted.
Definition: TOPGeoPMTArray.h:235
Belle2::TOPGeoPMTArray::getDy
double getDy() const
Returns spacing in y (row height)
Definition: TOPGeoPMTArray.h:152
Belle2::TOPGeoPMTArray::getGapY
double getGapY() const
Returns gap between PMT's in y.
Definition: TOPGeoPMTArray.h:164
Belle2::TOPGeoPMTArray::m_pmt
TOPGeoPMT m_pmt
PMT geometry parameters.
Definition: TOPGeoPMTArray.h:321
Belle2::TOPGeoPMTArray::getRow
unsigned getRow(unsigned pmtID) const
Converts PMT ID to row number (1-based)
Definition: TOPGeoPMTArray.cc:30
Belle2::TOPGeoPMTArray::getSizeZ
double getSizeZ() const
Returns array volume dimension in z.
Definition: TOPGeoPMTArray.h:206
Belle2::TOPGeoPMTArray::getPmtID
unsigned getPmtID(unsigned row, unsigned col) const
Converts row and column numbers to PMT ID (1-based)
Definition: TOPGeoPMTArray.cc:23
Belle2::TOPGeoPMTArray::m_material
std::string m_material
material name into which PMT's are inserted
Definition: TOPGeoPMTArray.h:320
Belle2::TOPGeoPMTArray::TOPGeoPMTArray
TOPGeoPMTArray()
Default constructor.
Definition: TOPGeoPMTArray.h:40
Belle2::TOPGeoPMTArray::setDecoupledPMT
void setDecoupledPMT(unsigned pmtID)
Sets PMT as optically decoupled.
Definition: TOPGeoPMTArray.h:76
Belle2::TOPGeoPMTArray::getPMT
const TOPGeoPMT & getPMT() const
Returns PMT geometry parameters.
Definition: TOPGeoPMTArray.h:241
Belle2::TOPGeoPMT::getNumRows
unsigned getNumRows() const
Returns number of pixel rows.
Definition: TOPGeoPMT.h:199
Belle2::TOPGeoPMTArray::m_numColumns
unsigned m_numColumns
number of columns
Definition: TOPGeoPMTArray.h:315
Belle2::TOPGeoPMTArray::setWavelengthFilter
void setWavelengthFilter(double thickness, const std::string &material)
Sets wavelength filter.
Definition: TOPGeoPMTArray.h:94