Belle II Software  release-05-02-19
TOPGeoPrism.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/TOPGeoBarSegment.h>
14 #include <string>
15 #include <vector>
16 #include <utility>
17 #include <math.h>
18 
19 namespace Belle2 {
28  class TOPGeoPrism: public TOPGeoBarSegment {
29  public:
30 
34  struct PeelOffRegion {
35  unsigned ID;
36  float fraction;
37  float angle;
38  };
39 
44  {}
45 
56  TOPGeoPrism(double width, double thickness, double length,
57  double exitThickness, double flatLength,
58  const std::string& material,
59  const std::string& name = "TOPPrism"):
60  TOPGeoBarSegment(width, thickness, length, material, name),
61  m_exitThickness(exitThickness), m_flatLength(flatLength)
62  {}
63 
68  void setAngle(double angle)
69  {
70  m_flatLength = m_length - (m_exitThickness - m_thickness) / tan(angle);
71  }
72 
80  void setPeelOffRegions(double size, double offset, double thickness,
81  const std::string& material)
82  {
83  m_peelOffSize = size;
84  m_peelOffOffset = offset;
85  m_peelOffThickness = thickness;
86  m_peelOffMaterial = material;
87  }
88 
95  void appendPeelOffRegion(unsigned ID, double fraction, double angle);
96 
101  double getExitThickness() const {return m_exitThickness / s_unit;}
102 
107  double getFlatLength() const {return m_flatLength / s_unit;}
108 
113  double getFullFlatLength() const {return (m_flatLength + m_glueThickness) / s_unit;}
114 
119  double getAngle() const
120  {
122  }
123 
129  double getFilterThickness() const {return m_glueThickness / s_unit;}
130 
136  const std::string& getFilterMaterial() const {return m_glueMaterial;}
137 
142  double getGlueThickness() const override {return 0;}
143 
148  double getPeelOffSize() const {return m_peelOffSize / s_unit;}
149 
154  double getPeelOffThickness() const {return m_peelOffThickness / s_unit;}
155 
160  const std::string& getPeelOffMaterial() const {return m_peelOffMaterial;}
161 
166  const std::vector<PeelOffRegion>& getPeelOffRegions() const {return m_peelOffRegions;}
167 
173  double getPeelOffCenter(const PeelOffRegion& region) const
174  {
175  return (m_peelOffOffset - (region.ID - 1) * m_peelOffSize) / s_unit;
176  }
177 
183  std::vector<std::pair<double, double> > getPeelOffContour(const PeelOffRegion& region) const;
184 
189  bool isConsistent() const override;
190 
195  void print(const std::string& title = "Prism geometry parameters") const override;
196 
197 
198  private:
199 
203  void setGlue(double, const std::string&) override {}
204 
208  void setGlueDelamination(double, double, const std::string&) override {}
209 
210  float m_exitThickness = 0;
211  float m_flatLength = 0;
213  float m_peelOffSize = 0;
214  float m_peelOffOffset = 0;
215  float m_peelOffThickness = 0;
216  std::string m_peelOffMaterial;
217  std::vector<PeelOffRegion> m_peelOffRegions;
221  };
222 
224 } // end namespace Belle2
Belle2::TOPGeoPrism
Geometry parameters of prism.
Definition: TOPGeoPrism.h:36
Belle2::TOPGeoBarSegment::m_thickness
float m_thickness
bar segment thickness
Definition: TOPGeoBarSegment.h:233
Belle2::TOPGeoPrism::setGlueDelamination
void setGlueDelamination(double, double, const std::string &) override
Disable setting the glue delamination, since there is no glue.
Definition: TOPGeoPrism.h:216
Belle2::TOPGeoPrism::m_peelOffOffset
float m_peelOffOffset
offset in x of the peel-off volume ID = 1
Definition: TOPGeoPrism.h:222
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::TOPGeoPrism::getExitThickness
double getExitThickness() const
Returns prism thickness at PMT side.
Definition: TOPGeoPrism.h:109
Belle2::TOPGeoPrism::PeelOffRegion::ID
unsigned ID
ID of the region (1-based)
Definition: TOPGeoPrism.h:43
Belle2::TOPGeoPrism::getPeelOffMaterial
const std::string & getPeelOffMaterial() const
Returns peel-off material.
Definition: TOPGeoPrism.h:168
Belle2::TOPGeoBarSegment::m_glueThickness
float m_glueThickness
glue thickness
Definition: TOPGeoBarSegment.h:236
Belle2::TOPGeoPrism::m_flatLength
float m_flatLength
length of the flat part at the bottom
Definition: TOPGeoPrism.h:219
Belle2::TOPGeoPrism::ClassDefOverride
ClassDefOverride(TOPGeoPrism, 2)
ClassDef.
Belle2::TOPGeoPrism::m_peelOffMaterial
std::string m_peelOffMaterial
material name of peel-off volume
Definition: TOPGeoPrism.h:224
Belle2::TOPGeoBarSegment::m_length
float m_length
bar segment length
Definition: TOPGeoBarSegment.h:234
Belle2::TOPGeoPrism::getFlatLength
double getFlatLength() const
Returns the length of a flat surface at prism bottom.
Definition: TOPGeoPrism.h:115
Belle2::TOPGeoPrism::setGlue
void setGlue(double, const std::string &) override
Disable setting the glue, since there is none.
Definition: TOPGeoPrism.h:211
Belle2::TOPGeoPrism::appendPeelOffRegion
void appendPeelOffRegion(unsigned ID, double fraction, double angle)
Appends peel-off cookie region.
Definition: TOPGeoPrism.cc:83
Belle2::TOPGeoPrism::m_exitThickness
float m_exitThickness
thickness at PMT side
Definition: TOPGeoPrism.h:218
Belle2::TOPGeoPrism::getPeelOffContour
std::vector< std::pair< double, double > > getPeelOffContour(const PeelOffRegion &region) const
Returns the x-y contour of the peel-off region.
Definition: TOPGeoPrism.cc:107
Belle2::TOPGeoPrism::getPeelOffRegions
const std::vector< PeelOffRegion > & getPeelOffRegions() const
Returns peel-off cookie regions.
Definition: TOPGeoPrism.h:174
Belle2::TOPGeoPrism::getAngle
double getAngle() const
Returns prism angle.
Definition: TOPGeoPrism.h:127
Belle2::TOPGeoPrism::getFilterThickness
double getFilterThickness() const
Returns wavelength filter thickness (filter on -z side).
Definition: TOPGeoPrism.h:137
Belle2::TOPGeoPrism::m_peelOffThickness
float m_peelOffThickness
thickness of peel-off volume
Definition: TOPGeoPrism.h:223
Belle2::TOPGeoPrism::setPeelOffRegions
void setPeelOffRegions(double size, double offset, double thickness, const std::string &material)
Sets parameters of the peel-off cookie volumes.
Definition: TOPGeoPrism.h:88
Belle2::TOPGeoPrism::getFilterMaterial
const std::string & getFilterMaterial() const
Returns wavelength filter material name (filter on -z side) For backward compatibility,...
Definition: TOPGeoPrism.h:144
Belle2::TOPGeoPrism::TOPGeoPrism
TOPGeoPrism()
Default constructor.
Definition: TOPGeoPrism.h:51
Belle2
Abstract base class for different kinds of events.
Definition: MillepedeAlgorithm.h:19
Belle2::TOPGeoPrism::setAngle
void setAngle(double angle)
Recalculates flatLength according to given prism angle.
Definition: TOPGeoPrism.h:76
Belle2::TOPGeoPrism::getPeelOffThickness
double getPeelOffThickness() const
Returns peel-off thickness.
Definition: TOPGeoPrism.h:162
Belle2::TOPGeoPrism::m_peelOffSize
float m_peelOffSize
size in x of peel-off volume
Definition: TOPGeoPrism.h:221
Belle2::TOPGeoBase::s_unit
static double s_unit
conversion unit for length
Definition: TOPGeoBase.h:96
Belle2::TOPGeoPrism::isConsistent
bool isConsistent() const override
Check for consistency of data members.
Definition: TOPGeoPrism.cc:25
Belle2::TOPGeoPrism::PeelOffRegion::fraction
float fraction
fraction of peel-off area
Definition: TOPGeoPrism.h:44
Belle2::TOPGeoPrism::getPeelOffCenter
double getPeelOffCenter(const PeelOffRegion &region) const
Returns peel-off offset in x of the given region.
Definition: TOPGeoPrism.h:181
Belle2::TOPGeoPrism::getFullFlatLength
double getFullFlatLength() const
Returns the length of a flat surface at prism bottom including filter.
Definition: TOPGeoPrism.h:121
Belle2::TOPGeoPrism::m_peelOffRegions
std::vector< PeelOffRegion > m_peelOffRegions
peel-off regions
Definition: TOPGeoPrism.h:225
Belle2::TOPGeoPrism::getPeelOffSize
double getPeelOffSize() const
Returns cookie size in x (corresponding to 2x2 PMT)
Definition: TOPGeoPrism.h:156
Belle2::TOPGeoPrism::print
void print(const std::string &title="Prism geometry parameters") const override
Print the content of the class.
Definition: TOPGeoPrism.cc:49
Belle2::TOPGeoPrism::getGlueThickness
double getGlueThickness() const override
Returns glue thickness (no glue on -z side)
Definition: TOPGeoPrism.h:150
Belle2::TOPGeoPrism::PeelOffRegion::angle
float angle
angle of peel-off area
Definition: TOPGeoPrism.h:45