Garfield++ v2r0
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 virtual int check_point_inside(const point& fpt, const vec& dir) const;
49
50 /// Range till exit from given volume or to entry only.
51 virtual int range_ext(trajestep& fts, int s_ext) const;
52 virtual void income(gparticle* gp);
53 virtual void chname(char* nm) const;
54 virtual void print(std::ostream& file, int l) const;
55 virtual box* copy() const;
56
57 protected:
58 virtual void get_components(ActivePtr<absref_transmit>& aref_tran);
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 virtual absvol* Gavol() const;
72 virtual void chname(char* nm) const;
73 virtual void print(std::ostream& file, int l) const;
74 virtual manip_box* copy() const;
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 virtual absvol* Gavol() const;
90 virtual void chname(char* nm) const;
91 virtual void print(std::ostream& file, int l) const;
92 virtual sh_manip_box* copy() const;
93
94 protected:
95 virtual void get_components(ActivePtr<absref_transmit>& aref_tran);
96};
97}
98
99#endif
Active pointer or automatic container or controlling pointer.
Definition: AbsPtr.h:199
Definition: box.h:25
void init_planes()
Definition: box.cpp:89
virtual int range_ext(trajestep &fts, int s_ext) const
Range till exit from given volume or to entry only.
Definition: box.cpp:240
virtual box * copy() const
Definition: box.cpp:256
std::string m_name
Definition: box.h:30
vfloat m_dx
Definition: box.h:27
virtual void print(std::ostream &file, int l) const
Definition: box.cpp:221
vfloat m_dy
Definition: box.h:27
virtual ~box()
Destructor.
Definition: box.h:43
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
virtual void get_components(ActivePtr< absref_transmit > &aref_tran)
Definition: box.cpp:16
void init_prec()
Definition: box.cpp:84
vfloat m_dzh
Half-lengths of sides.
Definition: box.h:28
virtual void chname(char *nm) const
Definition: box.cpp:259
virtual int check_point_inside(const point &fpt, const vec &dir) const
Definition: box.cpp:103
box()
Default constructor.
Definition: box.cpp:24
virtual void income(gparticle *gp)
Definition: box.cpp:258
Abstract base classs for volume "manipulators".
Definition: volume.h:178
Box "manipulator".
Definition: box.h:63
virtual void chname(char *nm) const
Definition: box.cpp:268
manip_box()
Constructor.
Definition: box.h:66
manip_box(const box &f)
Definition: box.h:67
virtual manip_box * copy() const
Definition: box.cpp:267
virtual void print(std::ostream &file, int l) const
Definition: box.cpp:273
virtual absvol * Gavol() const
Get the volume.
Definition: box.cpp:266
virtual ~manip_box()
Destructor.
Definition: box.h:69
Point.
Definition: vec.h:374
virtual sh_manip_box * copy() const
Definition: box.cpp:298
virtual void print(std::ostream &file, int l) const
Definition: box.cpp:304
sh_manip_box()
Constructor.
Definition: box.h:82
virtual absvol * Gavol() const
Get the volume.
Definition: box.cpp:290
virtual ~sh_manip_box()
Destructor.
Definition: box.h:87
sh_manip_box(const abssyscoor &fcsys, const box &fbx)
Definition: box.h:84
virtual void chname(char *nm) const
Definition: box.cpp:299
sh_manip_box(const box &f)
Definition: box.h:83
virtual void get_components(ActivePtr< absref_transmit > &aref_tran)
Definition: box.cpp:294
Unlimited surfaces volume.
Definition: surface.h:124
Definition: vec.h:186
Definition: BGMesh.cpp:5
double vfloat
Definition: vfloat.h:16