Belle II Software  release-05-02-19
TOPGeoBarSegment.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 <geometry/dbobjects/GeoOpticalSurface.h>
15 #include <string>
16 #include <vector>
17 #include <utility>
18 
19 
20 namespace Belle2 {
29  class TOPGeoBarSegment: public TOPGeoBase {
30  public:
31 
36  {}
37 
46  TOPGeoBarSegment(double width, double thickness, double length,
47  const std::string& material,
48  const std::string& name = "TOPBarSegment"): TOPGeoBase(name),
49  m_width(width), m_thickness(thickness), m_length(length), m_material(material)
50  {}
51 
57  virtual void setGlue(double thickness, const std::string& material)
58  {
59  m_glueThickness = thickness;
60  m_glueMaterial = material;
61  }
62 
69  virtual void setGlueDelamination(double fraction, double angle,
70  const std::string& material)
71  {
72  m_brokenFraction = fraction;
73  m_brokenAngle = angle;
74  m_brokenGlueMaterial = material;
75  }
76 
82  void setSurface(const GeoOpticalSurface& surface, double sigmaAlpha)
83  {
84  m_surface = surface;
85  m_sigmaAlpha = sigmaAlpha;
86  }
87 
93  void setVendorData(const std::string& vendor, const std::string& serialNumber)
94  {
95  m_vendor = vendor;
96  m_serialNumber = serialNumber;
97  }
98 
103  double getWidth() const {return m_width / s_unit;}
104 
109  double getThickness() const {return m_thickness / s_unit;}
110 
115  double getLength() const {return m_length / s_unit;}
116 
121  double getFullLength() const {return (m_length + m_glueThickness) / s_unit;}
122 
127  const std::string& getMaterial() const {return m_material;}
128 
133  virtual double getGlueThickness() const {return m_glueThickness / s_unit;}
134 
139  const std::string& getGlueMaterial() const {return m_glueMaterial;}
140 
145  double getBrokenGlueFraction() const {return m_brokenFraction;}
146 
151  double getBrokenGlueAngle() const {return m_brokenAngle;}
152 
157  const std::string& getBrokenGlueMaterial() const {return m_brokenGlueMaterial;}
158 
162  std::vector<std::pair<double, double> > getBrokenGlueContour() const;
163 
168  const GeoOpticalSurface& getSurface() const {return m_surface;}
169 
175  double getSurfaceReflectivity(double energy) const
176  {
177  return TOPGeoBase::getReflectivity(m_surface, energy);
178  }
179 
184  double getSigmaAlpha() const {return m_sigmaAlpha;}
185 
190  const std::string& getVendor() const {return m_vendor;}
191 
196  const std::string& getSerialNumber() const {return m_serialNumber;}
197 
202  virtual bool isConsistent() const override;
203 
204 
209  virtual void print(const std::string& title = "Bar segment geometry parameters") const override;
210 
211  protected:
212 
221  void constructContour(double A, double B, double fraction, double angle,
222  std::vector<std::pair<double, double> >& contour) const;
223 
224  float m_width = 0;
225  float m_thickness = 0;
226  float m_length = 0;
227  std::string m_material;
228  float m_glueThickness = 0;
229  std::string m_glueMaterial;
231  float m_sigmaAlpha = 0;
232  float m_brokenFraction = 0;
233  float m_brokenAngle = 0;
234  std::string m_brokenGlueMaterial;
235  std::string m_vendor;
236  std::string m_serialNumber;
240  };
241 
243 } // end namespace Belle2
Belle2::TOPGeoBarSegment::getMaterial
const std::string & getMaterial() const
Returns bar segment material name.
Definition: TOPGeoBarSegment.h:135
Belle2::TOPGeoBarSegment::setVendorData
void setVendorData(const std::string &vendor, const std::string &serialNumber)
Sets vendor's name and serial number.
Definition: TOPGeoBarSegment.h:101
Belle2::TOPGeoBarSegment::TOPGeoBarSegment
TOPGeoBarSegment()
Default constructor.
Definition: TOPGeoBarSegment.h:43
Belle2::TOPGeoBarSegment::m_thickness
float m_thickness
bar segment thickness
Definition: TOPGeoBarSegment.h:233
Belle2::TOPGeoBarSegment::getGlueMaterial
const std::string & getGlueMaterial() const
Returns glue material name (glue on -z side)
Definition: TOPGeoBarSegment.h:147
Belle2::TOPGeoBarSegment::ClassDefOverride
ClassDefOverride(TOPGeoBarSegment, 3)
ClassDef.
Belle2::TOPGeoBarSegment::getLength
double getLength() const
Returns bar segment length.
Definition: TOPGeoBarSegment.h:123
Belle2::TOPGeoBarSegment::m_material
std::string m_material
bar segment material name
Definition: TOPGeoBarSegment.h:235
Belle2::TOPGeoBarSegment::m_glueMaterial
std::string m_glueMaterial
glue material name
Definition: TOPGeoBarSegment.h:237
Belle2::TOPGeoBarSegment
Geometry parameters of a quartz bar segment.
Definition: TOPGeoBarSegment.h:37
Belle2::TOPGeoBarSegment::m_surface
GeoOpticalSurface m_surface
optical surface
Definition: TOPGeoBarSegment.h:238
Belle2::TOPGeoBarSegment::m_glueThickness
float m_glueThickness
glue thickness
Definition: TOPGeoBarSegment.h:236
Belle2::TOPGeoBase
Base class for geometry parameters.
Definition: TOPGeoBase.h:35
Belle2::TOPGeoBarSegment::m_length
float m_length
bar segment length
Definition: TOPGeoBarSegment.h:234
Belle2::TOPGeoBarSegment::getBrokenGlueMaterial
const std::string & getBrokenGlueMaterial() const
Returns material name which represents broken glue.
Definition: TOPGeoBarSegment.h:165
Belle2::TOPGeoBarSegment::getFullLength
double getFullLength() const
Returns bar segment length including glue.
Definition: TOPGeoBarSegment.h:129
Belle2::TOPGeoBarSegment::m_brokenGlueMaterial
std::string m_brokenGlueMaterial
broken glue material name
Definition: TOPGeoBarSegment.h:242
Belle2::TOPGeoBarSegment::m_vendor
std::string m_vendor
vendor's name
Definition: TOPGeoBarSegment.h:243
Belle2::TOPGeoBarSegment::setGlueDelamination
virtual void setGlueDelamination(double fraction, double angle, const std::string &material)
Sets glue to be broken (delaminated)
Definition: TOPGeoBarSegment.h:77
Belle2::TOPGeoBarSegment::getSerialNumber
const std::string & getSerialNumber() const
Returns serial number.
Definition: TOPGeoBarSegment.h:204
Belle2::TOPGeoBarSegment::getBrokenGlueFraction
double getBrokenGlueFraction() const
Returns fraction of the delaminated surface.
Definition: TOPGeoBarSegment.h:153
Belle2::TOPGeoBarSegment::m_brokenAngle
float m_brokenAngle
angle of broken (delaminated) glue
Definition: TOPGeoBarSegment.h:241
Belle2::GeoOpticalSurface
Represent an optical finish of a surface.
Definition: GeoOpticalSurface.h:31
Belle2::TOPGeoBarSegment::print
virtual void print(const std::string &title="Bar segment geometry parameters") const override
Print the content of the class.
Definition: TOPGeoBarSegment.cc:40
Belle2
Abstract base class for different kinds of events.
Definition: MillepedeAlgorithm.h:19
Belle2::TOPGeoBarSegment::getSurface
const GeoOpticalSurface & getSurface() const
Returns optical surface.
Definition: TOPGeoBarSegment.h:176
Belle2::TOPGeoBarSegment::m_sigmaAlpha
float m_sigmaAlpha
geant4 parameter for surface roughness
Definition: TOPGeoBarSegment.h:239
Belle2::TOPGeoBase::s_unit
static double s_unit
conversion unit for length
Definition: TOPGeoBase.h:96
Belle2::TOPGeoBarSegment::getGlueThickness
virtual double getGlueThickness() const
Returns glue thickness (glue on -z side)
Definition: TOPGeoBarSegment.h:141
Belle2::TOPGeoBarSegment::getWidth
double getWidth() const
Returns bar segment width.
Definition: TOPGeoBarSegment.h:111
Belle2::TOPGeoBarSegment::setGlue
virtual void setGlue(double thickness, const std::string &material)
Sets glue parameters (for glue on -z side)
Definition: TOPGeoBarSegment.h:65
Belle2::TOPGeoBarSegment::isConsistent
virtual bool isConsistent() const override
Check for consistency of data members.
Definition: TOPGeoBarSegment.cc:25
Belle2::TOPGeoBase::getReflectivity
double getReflectivity(const GeoOpticalSurface &surface, double energy) const
Returns reflectivity of optical surface at given photon energy.
Definition: TOPGeoBase.cc:74
Belle2::TOPGeoBarSegment::m_brokenFraction
float m_brokenFraction
fraction of broken (delaminated) glue
Definition: TOPGeoBarSegment.h:240
Belle2::TOPGeoBarSegment::m_width
float m_width
bar segment width
Definition: TOPGeoBarSegment.h:232
Belle2::TOPGeoBarSegment::m_serialNumber
std::string m_serialNumber
serial number
Definition: TOPGeoBarSegment.h:244
Belle2::TOPGeoBarSegment::setSurface
void setSurface(const GeoOpticalSurface &surface, double sigmaAlpha)
Sets optical surface.
Definition: TOPGeoBarSegment.h:90
Belle2::TOPGeoBarSegment::getBrokenGlueContour
std::vector< std::pair< double, double > > getBrokenGlueContour() const
Returns the x-y contour of broken glue.
Definition: TOPGeoBarSegment.cc:61
Belle2::TOPGeoBarSegment::getBrokenGlueAngle
double getBrokenGlueAngle() const
Returns angle of the delaminated surface.
Definition: TOPGeoBarSegment.h:159
Belle2::TOPGeoBarSegment::getVendor
const std::string & getVendor() const
Returns vendor's name.
Definition: TOPGeoBarSegment.h:198
Belle2::TOPGeoBarSegment::constructContour
void constructContour(double A, double B, double fraction, double angle, std::vector< std::pair< double, double > > &contour) const
Construct a 2D contour.
Definition: TOPGeoBarSegment.cc:72
Belle2::TOPGeoBarSegment::getSurfaceReflectivity
double getSurfaceReflectivity(double energy) const
Returns surface reflectivity at given photon energy.
Definition: TOPGeoBarSegment.h:183
Belle2::TOPGeoBarSegment::getSigmaAlpha
double getSigmaAlpha() const
Returns geant4 parameter describing surface roughness.
Definition: TOPGeoBarSegment.h:192
Belle2::TOPGeoBarSegment::getThickness
double getThickness() const
Returns bar segment thickness.
Definition: TOPGeoBarSegment.h:117