Belle II Software development
TOPGeoPrism.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/TOPGeoBarSegment.h>
12#include <string>
13#include <vector>
14#include <utility>
15#include <math.h>
16#include <Math/Vector2D.h>
17
18namespace Belle2 {
28 public:
29
34 unsigned ID;
35 float fraction;
36 float angle;
37 };
38
39
44 double y0 = 0;
45 double z0 = 0;
46 double sy = 0;
47 double sz = 0;
48 double ny = 0;
49 double nz = 0;
50 double nsy[2] = {0, 0};
51 double nsz[2] = {0, 0};
60 UnfoldedWindow(const ROOT::Math::XYVector& orig, const ROOT::Math::XYVector& dir,
61 const ROOT::Math::XYVector& norm, const ROOT::Math::XYVector& slanted);
62 };
63
64
69 {}
70
81 TOPGeoPrism(double width, double thickness, double length,
82 double exitThickness, double flatLength,
83 const std::string& material,
84 const std::string& name = "TOPPrism_"):
85 TOPGeoBarSegment(width, thickness, length, material, name),
86 m_exitThickness(exitThickness), m_flatLength(flatLength)
87 {}
88
93 void setAngle(double angle)
94 {
96 }
97
105 void setPeelOffRegions(double size, double offset, double thickness,
106 const std::string& material)
107 {
108 m_peelOffSize = size;
109 m_peelOffOffset = offset;
110 m_peelOffThickness = thickness;
111 m_peelOffMaterial = material;
112 }
113
120 void appendPeelOffRegion(unsigned ID, double fraction, double angle);
121
126 double getExitThickness() const {return m_exitThickness / s_unit;}
127
132 double getFlatLength() const {return m_flatLength / s_unit;}
133
139
144 double getAngle() const
145 {
147 }
148
154 double getFilterThickness() const {return m_glueThickness / s_unit;}
155
161 const std::string& getFilterMaterial() const {return m_glueMaterial;}
162
167 double getGlueThickness() const override {return 0;}
168
173 double getPeelOffSize() const {return m_peelOffSize / s_unit;}
174
180
185 const std::string& getPeelOffMaterial() const {return m_peelOffMaterial;}
186
191 const std::vector<PeelOffRegion>& getPeelOffRegions() const {return m_peelOffRegions;}
192
198 double getPeelOffCenter(const PeelOffRegion& region) const
199 {
200 return (m_peelOffOffset - (region.ID - 1) * m_peelOffSize) / s_unit;
201 }
202
208 std::vector<std::pair<double, double> > getPeelOffContour(const PeelOffRegion& region) const;
209
215 const std::vector<UnfoldedWindow>& getUnfoldedWindows() const
216 {
217 if (m_unfoldedWindows.empty()) unfold();
218 return m_unfoldedWindows;
219 }
220
225 int getK0() const
226 {
227 if (m_unfoldedWindows.empty()) unfold();
228 return m_k0;
229 }
230
235 bool isConsistent() const override;
236
241 void print(const std::string& title = "Prism geometry parameters") const override;
242
243
244 private:
245
249 void setGlue(double, const std::string&) override {}
250
254 void setGlueDelamination(double, double, const std::string&) override {}
255
259 void unfold() const;
260
272 void reflect(const ROOT::Math::XYVector* points, const ROOT::Math::XYVector* normals,
273 const ROOT::Math::XYVector& orig, const ROOT::Math::XYVector& surf,
274 const ROOT::Math::XYVector& norm, const ROOT::Math::XYVector& slanted, int k,
275 std::vector<UnfoldedWindow>& result) const;
276
277 float m_exitThickness = 0;
278 float m_flatLength = 0;
280 float m_peelOffSize = 0;
281 float m_peelOffOffset = 0;
283 std::string m_peelOffMaterial;
284 std::vector<PeelOffRegion> m_peelOffRegions;
287 mutable std::vector<UnfoldedWindow> m_unfoldedWindows;
289 mutable int m_k0 = 0;
290
293 };
294
296} // end namespace Belle2
Geometry parameters of a quartz bar segment.
float m_glueThickness
glue thickness
float m_thickness
bar segment thickness
std::string m_glueMaterial
glue material name
float m_length
bar segment length
Geometry parameters of prism.
Definition: TOPGeoPrism.h:27
const std::string & getPeelOffMaterial() const
Returns peel-off material.
Definition: TOPGeoPrism.h:185
double getFullFlatLength() const
Returns the length of a flat surface at prism bottom including filter.
Definition: TOPGeoPrism.h:138
double getPeelOffCenter(const PeelOffRegion &region) const
Returns peel-off offset in x of the given region.
Definition: TOPGeoPrism.h:198
float m_flatLength
length of the flat part at the bottom
Definition: TOPGeoPrism.h:278
ClassDefOverride(TOPGeoPrism, 2)
do not write out
void setAngle(double angle)
Recalculates flatLength according to given prism angle.
Definition: TOPGeoPrism.h:93
double getFilterThickness() const
Returns wavelength filter thickness (filter on -z side).
Definition: TOPGeoPrism.h:154
float m_peelOffThickness
thickness of peel-off volume
Definition: TOPGeoPrism.h:282
const std::vector< PeelOffRegion > & getPeelOffRegions() const
Returns peel-off cookie regions.
Definition: TOPGeoPrism.h:191
std::vector< PeelOffRegion > m_peelOffRegions
peel-off regions
Definition: TOPGeoPrism.h:284
float m_peelOffSize
size in x of peel-off volume
Definition: TOPGeoPrism.h:280
double getGlueThickness() const override
Returns glue thickness (no glue on -z side)
Definition: TOPGeoPrism.h:167
const std::vector< UnfoldedWindow > & getUnfoldedWindows() const
Returns unfolded exit windows.
Definition: TOPGeoPrism.h:215
double getExitThickness() const
Returns prism thickness at PMT side.
Definition: TOPGeoPrism.h:126
double getAngle() const
Returns prism angle.
Definition: TOPGeoPrism.h:144
double getPeelOffThickness() const
Returns peel-off thickness.
Definition: TOPGeoPrism.h:179
TOPGeoPrism()
Default constructor.
Definition: TOPGeoPrism.h:68
float m_peelOffOffset
offset in x of the peel-off volume ID = 1
Definition: TOPGeoPrism.h:281
void setPeelOffRegions(double size, double offset, double thickness, const std::string &material)
Sets parameters of the peel-off cookie volumes.
Definition: TOPGeoPrism.h:105
double getPeelOffSize() const
Returns cookie size in x (corresponding to 2x2 PMT)
Definition: TOPGeoPrism.h:173
const std::string & getFilterMaterial() const
Returns wavelength filter material name (filter on -z side) For backward compatibility,...
Definition: TOPGeoPrism.h:161
std::string m_peelOffMaterial
material name of peel-off volume
Definition: TOPGeoPrism.h:283
double getFlatLength() const
Returns the length of a flat surface at prism bottom.
Definition: TOPGeoPrism.h:132
int m_k0
do not write out
Definition: TOPGeoPrism.h:289
int getK0() const
Returns index of true window in a vector of unfolded exit windows.
Definition: TOPGeoPrism.h:225
void setGlueDelamination(double, double, const std::string &) override
Disable setting the glue delamination, since there is no glue.
Definition: TOPGeoPrism.h:254
void setGlue(double, const std::string &) override
Disable setting the glue, since there is none.
Definition: TOPGeoPrism.h:249
TOPGeoPrism(double width, double thickness, double length, double exitThickness, double flatLength, const std::string &material, const std::string &name="TOPPrism_")
Useful constructor.
Definition: TOPGeoPrism.h:81
std::vector< UnfoldedWindow > m_unfoldedWindows
cache for unfolded prism exit windows
Definition: TOPGeoPrism.h:287
float m_exitThickness
thickness at PMT side
Definition: TOPGeoPrism.h:277
double atan(double a)
atan for double
Definition: beamHelpers.h:34
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.
Definition: TOPGeoPrism.cc:36
static double s_unit
conversion unit for length
Definition: TOPGeoBase.h:86
void reflect(const ROOT::Math::XYVector *points, const ROOT::Math::XYVector *normals, const ROOT::Math::XYVector &orig, const ROOT::Math::XYVector &surf, const ROOT::Math::XYVector &norm, const ROOT::Math::XYVector &slanted, int k, std::vector< UnfoldedWindow > &result) const
Do unfolding.
Definition: TOPGeoPrism.cc:152
std::vector< std::pair< double, double > > getPeelOffContour(const PeelOffRegion &region) const
Returns the x-y contour of the peel-off region.
Definition: TOPGeoPrism.cc:118
void unfold() const
Unfold prism exit window.
Definition: TOPGeoPrism.cc:129
void print(const std::string &title="Prism geometry parameters") const override
Print the content of the class.
Definition: TOPGeoPrism.cc:60
Abstract base class for different kinds of events.
Parameters of peel-off cookie region (corresponds to 2x2 PMT's)
Definition: TOPGeoPrism.h:33
float fraction
fraction of peel-off area
Definition: TOPGeoPrism.h:35
float angle
angle of peel-off area
Definition: TOPGeoPrism.h:36
unsigned ID
ID of the region (1-based)
Definition: TOPGeoPrism.h:34
Unfolded prism exit window.
Definition: TOPGeoPrism.h:43
double ny
normal to window surface, y component
Definition: TOPGeoPrism.h:48
double nsz[2]
normals to upper [0] and slanted [1] surfaces, z component
Definition: TOPGeoPrism.h:51
double nz
normal to window surface, z component
Definition: TOPGeoPrism.h:49
double nsy[2]
normals to upper [0] and slanted [1] surfaces, y component
Definition: TOPGeoPrism.h:50
double sz
window surface direction in z
Definition: TOPGeoPrism.h:47
double z0
window origin in z
Definition: TOPGeoPrism.h:45
double sy
window surface direction in y
Definition: TOPGeoPrism.h:46
double y0
window origin in y
Definition: TOPGeoPrism.h:44