Belle II Software development
TOPGeoModule.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/TOPGeoBarSegment.h>
13#include <top/dbobjects/TOPGeoMirrorSegment.h>
14#include <top/dbobjects/TOPGeoPrism.h>
15#include <top/dbobjects/TOPGeoPMTArray.h>
16#include <top/dbobjects/TOPGeoPMTArrayDisplacement.h>
17#include <top/dbobjects/TOPGeoModuleDisplacement.h>
18#include <Math/Transform3D.h>
19#include <Math/Vector3D.h>
20#include <Math/Point3D.h>
21
22namespace Belle2 {
31 class TOPGeoModule: public TOPGeoBase {
32 public:
33
38 {}
39
48 TOPGeoModule(int moduleID, double radius, double phi, double backwardZ,
49 const std::string& name = "TOPModule"): TOPGeoBase(name),
50 m_moduleID(moduleID), m_radius(radius), m_phi(phi), m_backwardZ(backwardZ)
51 {}
52
56 TOPGeoModule(const TOPGeoModule& module);
57
61 TOPGeoModule& operator=(const TOPGeoModule& module);
62
67
72 void setModuleCNumber(unsigned moduleCNumber) {m_moduleCNumber = moduleCNumber;}
73
78 void setBarSegment1(const TOPGeoBarSegment& bar) {m_bar1 = bar;}
79
84 void setBarSegment2(const TOPGeoBarSegment& bar) {m_bar2 = bar;}
85
90 void setMirrorSegment(const TOPGeoMirrorSegment& mirror) {m_mirror = mirror;}
91
96 void setPrism(const TOPGeoPrism& prism) {m_prism = prism;}
97
102 void setPMTArray(const TOPGeoPMTArray& array) {m_pmtArray = array;}
103
108 void setDecoupledPMT(unsigned pmtID) {m_pmtArray.setDecoupledPMT(pmtID);}
109
114 void generateDecoupledPMTs(double fraction)
115 {
117 }
118
126 void setBrokenGlue(int glueID, double fraction, double angle,
127 const std::string& material);
128
134 void setPeelOffRegions(double thickness, const std::string& material);
135
142 void appendPeelOffRegion(unsigned ID, double fraction, double angle)
143 {
144 m_prism.appendPeelOffRegion(ID, fraction, angle);
145 }
146
147
153 {
154 m_arrayDisplacement = displ;
155 }
156
162 {
163 m_moduleDisplacement = displ;
164 }
165
170 int getModuleID() const {return m_moduleID;}
171
176 double getRadius() const {return m_radius / s_unit;}
177
182 double getPhi() const {return m_phi;}
183
188 double getBackwardZ() const {return m_backwardZ / s_unit;}
189
194 unsigned getModuleCNumber() const {return m_moduleCNumber;}
195
200 const TOPGeoBarSegment& getBarSegment1() const {return m_bar1;}
201
206 const TOPGeoBarSegment& getBarSegment2() const {return m_bar2;}
207
213
218 const TOPGeoPrism& getPrism() const {return m_prism;}
219
224 const TOPGeoPMTArray& getPMTArray() const {return m_pmtArray;}
225
231 {
232 return m_arrayDisplacement;
233 }
234
240 {
242 }
243
248 double getBarLength() const
249 {
251 }
252
257 double getFullLength() const {return getBarLength() + m_prism.getFullLength();}
258
263 double getForwardZ() const {return getBackwardZ() + getBarLength();}
264
269 double getBarThickness() const
270 {
274 }
275
280 double getBarWidth() const
281 {
282 return (m_bar1.getWidth() * m_bar1.getFullLength() +
285 }
286
292 double getSurfaceReflectivity(double energy) const
293 {
297 }
298
303 double getSigmaAlpha() const
304 {
308 }
309
314 double getZc() const {return (getBackwardZ() + getForwardZ()) / 2;}
315
320 double getInnerRadius() const {return getRadius() - getBarThickness() / 2;}
321
326 const ROOT::Math::Transform3D& getTransformation() const
327 {
329 return *m_transform;
330 }
331
336 const ROOT::Math::Transform3D& getTransformationNominal() const
337 {
339 return *m_transformNominal;
340 }
341
347 ROOT::Math::XYZPoint pointToLocal(const ROOT::Math::XYZPoint& point) const;
348
354 ROOT::Math::XYZVector momentumToLocal(const ROOT::Math::XYZVector& momentum) const;
355
361 ROOT::Math::XYZPoint pointToGlobal(const ROOT::Math::XYZPoint& point) const;
362
368 ROOT::Math::XYZVector momentumToGlobal(const ROOT::Math::XYZVector& momentum) const;
369
375 ROOT::Math::XYZPoint pointGlobalToNominal(const ROOT::Math::XYZPoint& point) const;
376
382 ROOT::Math::XYZVector momentumGlobalToNominal(const ROOT::Math::XYZVector& momentum) const;
383
389 ROOT::Math::XYZPoint pointNominalToGlobal(const ROOT::Math::XYZPoint& point) const;
390
396 ROOT::Math::XYZVector momentumNominalToGlobal(const ROOT::Math::XYZVector& momentum) const;
397
402 bool isConsistent() const override;
403
408 void print(const std::string& title = "Module geometry parameters") const override;
409
410
411 private:
412
416 void setTransformation() const;
417
418 int m_moduleID = 0;
419 float m_radius = 0;
420 float m_phi = 0;
421 float m_backwardZ = 0;
423 unsigned m_moduleCNumber = 0;
433 mutable ROOT::Math::Transform3D* m_transform = 0;
435 mutable ROOT::Math::Transform3D* m_transformNominal = 0;
436
439 };
440
442} // end namespace Belle2
Geometry parameters of a quartz bar segment.
double getWidth() const
Returns bar segment width.
double getFullLength() const
Returns bar segment length including glue.
double getThickness() const
Returns bar segment thickness.
double getSigmaAlpha() const
Returns geant4 parameter describing surface roughness.
double getSurfaceReflectivity(double energy) const
Returns surface reflectivity at given photon energy.
Base class for geometry parameters.
Definition: TOPGeoBase.h:25
Geometry parameters of a mirror segment.
Displacement parameters of a TOP module.
Geometry parameters of a module (optical components + positioning)
Definition: TOPGeoModule.h:31
void appendPeelOffRegion(unsigned ID, double fraction, double angle)
Appends peel-off cookie region.
Definition: TOPGeoModule.h:142
const TOPGeoMirrorSegment & getMirrorSegment() const
Returns mirror segment.
Definition: TOPGeoModule.h:212
ROOT::Math::Transform3D * m_transformNominal
do not write out
Definition: TOPGeoModule.h:435
unsigned getModuleCNumber() const
Returns module construction number (0 = ideal module)
Definition: TOPGeoModule.h:194
TOPGeoPMTArrayDisplacement m_arrayDisplacement
PMT array displacement.
Definition: TOPGeoModule.h:429
const TOPGeoBarSegment & getBarSegment1() const
Returns bar segment No.1 (forward bar)
Definition: TOPGeoModule.h:200
void setDecoupledPMT(unsigned pmtID)
Sets PMT as optically decoupled.
Definition: TOPGeoModule.h:108
const TOPGeoPMTArray & getPMTArray() const
Returns PMT array.
Definition: TOPGeoModule.h:224
float m_backwardZ
z position of prism-bar joint in Belle II frame
Definition: TOPGeoModule.h:421
double getPhi() const
Returns module azimuthal angle in Belle II frame.
Definition: TOPGeoModule.h:182
TOPGeoModule(int moduleID, double radius, double phi, double backwardZ, const std::string &name="TOPModule")
Useful constructor.
Definition: TOPGeoModule.h:48
void setBarSegment2(const TOPGeoBarSegment &bar)
Sets bar segment No.2 (backward bar)
Definition: TOPGeoModule.h:84
float m_phi
azimuthal angle in Belle II frame
Definition: TOPGeoModule.h:420
const TOPGeoModuleDisplacement & getModuleDisplacement() const
Returns module displacement.
Definition: TOPGeoModule.h:239
void setModuleCNumber(unsigned moduleCNumber)
Sets module construction number (0 = ideal module = default)
Definition: TOPGeoModule.h:72
void generateDecoupledPMTs(double fraction)
Generate randomly a fraction of PMT's to be optically decoupled.
Definition: TOPGeoModule.h:114
void setPMTArrayDisplacement(const TOPGeoPMTArrayDisplacement &displ)
Sets PMT array displacement.
Definition: TOPGeoModule.h:152
double getForwardZ() const
Returns the z position of the bar forward end in Belle II frame.
Definition: TOPGeoModule.h:263
void setPrism(const TOPGeoPrism &prism)
Sets prism.
Definition: TOPGeoModule.h:96
void setBarSegment1(const TOPGeoBarSegment &bar)
Sets bar segment No.1 (forward bar)
Definition: TOPGeoModule.h:78
double getZc() const
Returns z of bar center (w/o prism) in Belle II frame.
Definition: TOPGeoModule.h:314
float m_radius
radius of bar central plane in Belle II frame
Definition: TOPGeoModule.h:419
double getFullLength() const
Returns full length (including prism, wavelenght filter and glue joints)
Definition: TOPGeoModule.h:257
ROOT::Math::Transform3D * m_transform
cache for transformation from internal (= nominal & displaced) to Belle II frame
Definition: TOPGeoModule.h:433
int m_moduleID
module ID
Definition: TOPGeoModule.h:418
double getBarWidth() const
Returns average bar width (weigthed by segment lengths)
Definition: TOPGeoModule.h:280
const ROOT::Math::Transform3D & getTransformation() const
Returns transformation from internal (= nominal & displaced) to Belle II frame.
Definition: TOPGeoModule.h:326
void setMirrorSegment(const TOPGeoMirrorSegment &mirror)
Sets mirror segment.
Definition: TOPGeoModule.h:90
int getModuleID() const
Returns module ID.
Definition: TOPGeoModule.h:170
TOPGeoPMTArray m_pmtArray
geometry parameters of PMT array
Definition: TOPGeoModule.h:428
double getInnerRadius() const
Returns inner surface radius in Belle II frame.
Definition: TOPGeoModule.h:320
ClassDefOverride(TOPGeoModule, 3)
do not write out
TOPGeoMirrorSegment m_mirror
mirror segment
Definition: TOPGeoModule.h:426
void setPMTArray(const TOPGeoPMTArray &array)
Sets PMT array.
Definition: TOPGeoModule.h:102
double getSigmaAlpha() const
Returns average surface roughness parameter (weigthed by segment lengths)
Definition: TOPGeoModule.h:303
TOPGeoPrism m_prism
prism
Definition: TOPGeoModule.h:427
const TOPGeoPMTArrayDisplacement & getPMTArrayDisplacement() const
Returns PMT array displacement.
Definition: TOPGeoModule.h:230
double getRadius() const
Returns radius of the bar central plane in Belle II frame.
Definition: TOPGeoModule.h:176
double getBarLength() const
Returns bar length (w/o prism) including glue joints.
Definition: TOPGeoModule.h:248
TOPGeoBarSegment m_bar2
bar segment 2 (backward bar)
Definition: TOPGeoModule.h:425
TOPGeoModuleDisplacement m_moduleDisplacement
module displacement
Definition: TOPGeoModule.h:430
const TOPGeoPrism & getPrism() const
Returns prism.
Definition: TOPGeoModule.h:218
double getSurfaceReflectivity(double energy) const
Returns average surface reflectivity at given photon energy (weigthed by segment lengths)
Definition: TOPGeoModule.h:292
double getBarThickness() const
Returns average bar thickness (weigthed by segment lengths)
Definition: TOPGeoModule.h:269
void setModuleDisplacement(const TOPGeoModuleDisplacement &displ)
Sets module displacement.
Definition: TOPGeoModule.h:161
const TOPGeoBarSegment & getBarSegment2() const
Returns bar segment No.2 (backward bar)
Definition: TOPGeoModule.h:206
TOPGeoModule()
Default constructor.
Definition: TOPGeoModule.h:37
unsigned m_moduleCNumber
module construction number, 0 = ideal module
Definition: TOPGeoModule.h:423
double getBackwardZ() const
Returns the z position of prism-bar joint in Belle II frame.
Definition: TOPGeoModule.h:188
const ROOT::Math::Transform3D & getTransformationNominal() const
Returns transformation from nominal to Belle II frame.
Definition: TOPGeoModule.h:336
TOPGeoBarSegment m_bar1
bar segment 1 (forward bar)
Definition: TOPGeoModule.h:424
Displacement parameters of MCP-PMT array.
Geometry parameters of MCP-PMT array.
void setDecoupledPMT(unsigned pmtID)
Sets PMT as optically decoupled.
Geometry parameters of prism.
Definition: TOPGeoPrism.h:27
ROOT::Math::XYZPoint pointToLocal(const ROOT::Math::XYZPoint &point) const
Transforms 3D point from Belle II to module internal (= nominal & displaced) frame.
void appendPeelOffRegion(unsigned ID, double fraction, double angle)
Appends peel-off cookie region.
Definition: TOPGeoPrism.cc:94
bool isConsistent() const override
Check for consistency of data members.
void print(const std::string &title="Module geometry parameters") const override
Print the content of the class.
static double s_unit
conversion unit for length
Definition: TOPGeoBase.h:86
ROOT::Math::XYZPoint pointGlobalToNominal(const ROOT::Math::XYZPoint &point) const
Transforms 3D point from Belle II to module nominal frame.
~TOPGeoModule()
Destructor.
Definition: TOPGeoModule.cc:58
void generateDecoupledPMTs(double fraction)
Generate randomly a fraction of PMT's to be optically decoupled.
ROOT::Math::XYZPoint pointNominalToGlobal(const ROOT::Math::XYZPoint &point) const
Transforms 3D point from module nominal frame to Belle II frame.
void setTransformation() const
Sets transformation cache.
Definition: TOPGeoModule.cc:64
void setPeelOffRegions(double thickness, const std::string &material)
Sets parameters of the peel-off cookie volumes.
Definition: TOPGeoModule.cc:92
ROOT::Math::XYZPoint pointToGlobal(const ROOT::Math::XYZPoint &point) const
Transforms 3D point from module internal (= nominal & displaced) frame to Belle II frame.
ROOT::Math::XYZVector momentumGlobalToNominal(const ROOT::Math::XYZVector &momentum) const
Transforms momentum vector from Belle II to module nominal frame.
ROOT::Math::XYZVector momentumToLocal(const ROOT::Math::XYZVector &momentum) const
Transforms momentum vector from Belle II to module internal (= nominal & displaced) frame.
void setBrokenGlue(int glueID, double fraction, double angle, const std::string &material)
Sets glue to be broken (delaminated)
Definition: TOPGeoModule.cc:72
ROOT::Math::XYZVector momentumNominalToGlobal(const ROOT::Math::XYZVector &momentum) const
Transforms momentum vector from module nominal frame to Belle II frame.
TOPGeoModule & operator=(const TOPGeoModule &module)
Assignment operator.
Definition: TOPGeoModule.cc:33
ROOT::Math::XYZVector momentumToGlobal(const ROOT::Math::XYZVector &momentum) const
Transforms momentum vector from module internal (= nominal & displaced) frame to Belle II frame.
Abstract base class for different kinds of events.