Garfield++ 4.0
A toolkit for the detailed simulation of particle detectors based on ionisation measurement in gases and semiconductors
Loading...
Searching...
No Matches
box.h
Go to the documentation of this file.
1#ifndef BOX_H
2#define BOX_H
3#include <iostream>
8/*
9Copyright (c) 2000 Igor B. Smirnov
10
11The file can be used, copied, modified, and distributed
12according to the terms of GNU Lesser General Public License version 2.1
13as published by the Free Software Foundation,
14and provided that the above copyright notice, this permission notice,
15and notices about any modifications of the original text
16appear in all copies and in supporting documentation.
17The file is provided "as is" without express or implied warranty.
18*/
19
20namespace Heed {
21
22/// Box (three-dimensional rectangle/rectangular parallelogram).
23/// The box is centred with respect to the centre of the coordinate system.
24
25class box : public absvol {
26 public:
27 vfloat m_dx, m_dy, m_dz; ///< Lengths of sides
28 vfloat m_dxh, m_dyh, m_dzh; ///< Half-lengths of sides
30 std::string m_name;
31
32 public:
33 /// Default constructor.
34 box();
35 // Constructor, compute precision from mean of dimensions.
36 box(vfloat fdx, vfloat fdy, vfloat fdz, const std::string& fname);
37 /// Constructor with user-provided precision.
38 box(vfloat fdx, vfloat fdy, vfloat fdz, vfloat fprec,
39 const std::string& fname);
40 box(box& fb);
41 box(const box& fb);
42 /// Destructor
43 virtual ~box() {}
44
45 void init_prec();
46 void init_planes();
47
48 int check_point_inside(const point& fpt, const vec& dir) const override;
49
50 /// Range till exit from given volume or to entry only.
51 int range_ext(trajestep& fts, int s_ext) const override;
52 void income(gparticle* gp) override;
53 void chname(char* nm) const override;
54 void print(std::ostream& file, int l) const override;
55 box* copy() const override;
56
57 protected:
59};
60
61/// Box "manipulator".
62
63class manip_box : public manip_absvol, public box {
64 public:
65 /// Constructor
67 manip_box(const box& f) : manip_absvol(), box(f) {}
68 /// Destructor
69 virtual ~manip_box() {}
70
71 absvol* Gavol() const override;
72 void chname(char* nm) const override;
73 void print(std::ostream& file, int l) const override;
74 manip_box* copy() const override;
75};
76
77// ***** sh_manip_box ********
78
79class sh_manip_box : public sh_manip_absvol, public box {
80 public:
81 /// Constructor
83 sh_manip_box(const box& f) : sh_manip_absvol(), box(f) {}
84 sh_manip_box(const abssyscoor& fcsys, const box& fbx)
85 : sh_manip_absvol(fcsys), box(fbx) {}
86 /// Destructor
87 virtual ~sh_manip_box() {}
88
89 absvol* Gavol() const override;
90 void chname(char* nm) const override;
91 void print(std::ostream& file, int l) const override;
92 sh_manip_box* copy() const override;
93
94 protected:
96};
97}
98
99#endif
Definition: box.h:25
int range_ext(trajestep &fts, int s_ext) const override
Range till exit from given volume or to entry only.
Definition: box.cpp:202
box * copy() const override
Definition: box.cpp:218
absref_transmit get_components() override
Definition: box.cpp:18
void income(gparticle *gp) override
Definition: box.cpp:220
void init_planes()
Definition: box.cpp:92
std::string m_name
Definition: box.h:30
vfloat m_dx
Definition: box.h:27
vfloat m_dy
Definition: box.h:27
virtual ~box()
Destructor.
Definition: box.h:43
void print(std::ostream &file, int l) const override
Definition: box.cpp:183
vfloat m_dxh
Definition: box.h:28
vfloat m_dz
Lengths of sides.
Definition: box.h:27
vfloat m_dyh
Definition: box.h:28
ulsvolume m_ulsv
Definition: box.h:29
void init_prec()
Definition: box.cpp:87
vfloat m_dzh
Half-lengths of sides.
Definition: box.h:28
int check_point_inside(const point &fpt, const vec &dir) const override
Definition: box.cpp:110
void chname(char *nm) const override
Definition: box.cpp:221
box()
Default constructor.
Definition: box.cpp:27
Abstract base classs for volume "manipulators".
Definition: volume.h:128
Box "manipulator".
Definition: box.h:63
manip_box()
Constructor.
Definition: box.h:66
manip_box(const box &f)
Definition: box.h:67
manip_box * copy() const override
Definition: box.cpp:229
void chname(char *nm) const override
Definition: box.cpp:230
absvol * Gavol() const override
Get the volume.
Definition: box.cpp:228
void print(std::ostream &file, int l) const override
Definition: box.cpp:235
virtual ~manip_box()
Destructor.
Definition: box.h:69
Point.
Definition: vec.h:368
absref_transmit get_components() override
Definition: box.cpp:256
sh_manip_box()
Constructor.
Definition: box.h:82
void print(std::ostream &file, int l) const override
Definition: box.cpp:266
virtual ~sh_manip_box()
Destructor.
Definition: box.h:87
sh_manip_box(const abssyscoor &fcsys, const box &fbx)
Definition: box.h:84
void chname(char *nm) const override
Definition: box.cpp:261
absvol * Gavol() const override
Get the volume.
Definition: box.cpp:252
sh_manip_box * copy() const override
Definition: box.cpp:260
sh_manip_box(const box &f)
Definition: box.h:83
Unlimited surfaces volume.
Definition: surface.h:123
Definition: vec.h:179
Definition: BGMesh.cpp:6
double vfloat
Definition: vfloat.h:16