Belle II Software  release-08-01-10
TOPGeoBarSegment.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 <geometry/dbobjects/GeoOpticalSurface.h>
13 #include <string>
14 #include <vector>
15 #include <utility>
16 
17 
18 namespace Belle2 {
27  class TOPGeoBarSegment: public TOPGeoBase {
28  public:
29 
34  {}
35 
44  TOPGeoBarSegment(double width, double thickness, double length,
45  const std::string& material,
46  const std::string& name = "TOPBarSegment"): TOPGeoBase(name),
47  m_width(width), m_thickness(thickness), m_length(length), m_material(material)
48  {}
49 
55  virtual void setGlue(double thickness, const std::string& material)
56  {
57  m_glueThickness = thickness;
58  m_glueMaterial = material;
59  }
60 
67  virtual void setGlueDelamination(double fraction, double angle,
68  const std::string& material)
69  {
70  m_brokenFraction = fraction;
71  m_brokenAngle = angle;
72  m_brokenGlueMaterial = material;
73  }
74 
80  void setSurface(const GeoOpticalSurface& surface, double sigmaAlpha)
81  {
82  m_surface = surface;
83  m_sigmaAlpha = sigmaAlpha;
84  }
85 
91  void setVendorData(const std::string& vendor, const std::string& serialNumber)
92  {
93  m_vendor = vendor;
94  m_serialNumber = serialNumber;
95  }
96 
101  double getWidth() const {return m_width / s_unit;}
102 
107  double getThickness() const {return m_thickness / s_unit;}
108 
113  double getLength() const {return m_length / s_unit;}
114 
119  double getFullLength() const {return (m_length + m_glueThickness) / s_unit;}
120 
125  const std::string& getMaterial() const {return m_material;}
126 
131  virtual double getGlueThickness() const {return m_glueThickness / s_unit;}
132 
137  const std::string& getGlueMaterial() const {return m_glueMaterial;}
138 
143  double getBrokenGlueFraction() const {return m_brokenFraction;}
144 
149  double getBrokenGlueAngle() const {return m_brokenAngle;}
150 
155  const std::string& getBrokenGlueMaterial() const {return m_brokenGlueMaterial;}
156 
160  std::vector<std::pair<double, double> > getBrokenGlueContour() const;
161 
166  const GeoOpticalSurface& getSurface() const {return m_surface;}
167 
173  double getSurfaceReflectivity(double energy) const
174  {
175  return TOPGeoBase::getReflectivity(m_surface, energy);
176  }
177 
182  double getSigmaAlpha() const {return m_sigmaAlpha;}
183 
188  const std::string& getVendor() const {return m_vendor;}
189 
194  const std::string& getSerialNumber() const {return m_serialNumber;}
195 
200  virtual bool isConsistent() const override;
201 
202 
207  virtual void print(const std::string& title = "Bar segment geometry parameters") const override;
208 
209  protected:
210 
219  void constructContour(double A, double B, double fraction, double angle,
220  std::vector<std::pair<double, double> >& contour) const;
221 
222  float m_width = 0;
223  float m_thickness = 0;
224  float m_length = 0;
225  std::string m_material;
226  float m_glueThickness = 0;
227  std::string m_glueMaterial;
229  float m_sigmaAlpha = 0;
230  float m_brokenFraction = 0;
231  float m_brokenAngle = 0;
232  std::string m_brokenGlueMaterial;
233  std::string m_vendor;
234  std::string m_serialNumber;
238  };
239 
241 } // end namespace Belle2
Represent an optical finish of a surface.
Geometry parameters of a quartz bar segment.
void setVendorData(const std::string &vendor, const std::string &serialNumber)
Sets vendor's name and serial number.
double getWidth() const
Returns bar segment width.
const std::string & getBrokenGlueMaterial() const
Returns material name which represents broken glue.
ClassDefOverride(TOPGeoBarSegment, 3)
ClassDef.
float m_glueThickness
glue thickness
virtual void setGlue(double thickness, const std::string &material)
Sets glue parameters (for glue on -z side)
std::string m_material
bar segment material name
double getBrokenGlueAngle() const
Returns angle of the delaminated surface.
TOPGeoBarSegment(double width, double thickness, double length, const std::string &material, const std::string &name="TOPBarSegment")
Useful constructor.
std::string m_brokenGlueMaterial
broken glue material name
const std::string & getVendor() const
Returns vendor's name.
double getFullLength() const
Returns bar segment length including glue.
const std::string & getGlueMaterial() const
Returns glue material name (glue on -z side)
std::string m_serialNumber
serial number
GeoOpticalSurface m_surface
optical surface
double getThickness() const
Returns bar segment thickness.
float m_brokenFraction
fraction of broken (delaminated) glue
float m_thickness
bar segment thickness
std::string m_glueMaterial
glue material name
double getSigmaAlpha() const
Returns geant4 parameter describing surface roughness.
const std::string & getSerialNumber() const
Returns serial number.
double getBrokenGlueFraction() const
Returns fraction of the delaminated surface.
TOPGeoBarSegment()
Default constructor.
const std::string & getMaterial() const
Returns bar segment material name.
double getSurfaceReflectivity(double energy) const
Returns surface reflectivity at given photon energy.
float m_sigmaAlpha
geant4 parameter for surface roughness
void setSurface(const GeoOpticalSurface &surface, double sigmaAlpha)
Sets optical surface.
const GeoOpticalSurface & getSurface() const
Returns optical surface.
float m_length
bar segment length
std::string m_vendor
vendor's name
virtual void setGlueDelamination(double fraction, double angle, const std::string &material)
Sets glue to be broken (delaminated)
double getLength() const
Returns bar segment length.
float m_width
bar segment width
virtual double getGlueThickness() const
Returns glue thickness (glue on -z side)
float m_brokenAngle
angle of broken (delaminated) glue
Base class for geometry parameters.
Definition: TOPGeoBase.h:25
virtual bool isConsistent() const override
Check for consistency of data members.
static double s_unit
conversion unit for length
Definition: TOPGeoBase.h:86
virtual void print(const std::string &title="Bar segment geometry parameters") const override
Print the content of the class.
double getReflectivity(const GeoOpticalSurface &surface, double energy) const
Returns reflectivity of optical surface at given photon energy.
Definition: TOPGeoBase.cc:72
void constructContour(double A, double B, double fraction, double angle, std::vector< std::pair< double, double > > &contour) const
Construct a 2D contour.
std::vector< std::pair< double, double > > getBrokenGlueContour() const
Returns the x-y contour of broken glue.
Abstract base class for different kinds of events.