Garfield++ v1r0
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 (3-dimensional rectangle (rectangular parallelogram) *******
23// center of coordinate system is meant in the center of the box
24class box : public absvol {
25 public:
26 vfloat dx, dy, dz; // lengths of sides
27 vfloat dxh, dyh, dzh; // half-lengths of sides
30
31
32 public:
33 /// Constructors
34 box(void);
35 // Compute precision as a ratio vprecision from mean of dimensions
36 box(vfloat fdx, vfloat fdy, vfloat fdz, const String& fname);
37 // Use user-provided precision
38 box(vfloat fdx, vfloat fdy, vfloat fdz, vfloat fprec, const String& fname);
39 box(box& fb);
40 box(const box& fb);
42 /// Destructor
43 virtual ~box() {}
44
45 void init_prec(void);
46 void init_planes(void);
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
56 protected:
57 virtual void get_components(ActivePtr<absref_transmit>& aref_tran);
58
59};
60
61// ***** manip_box ********
62
63class manip_box : public manip_absvol, public box {
64 public:
65 /// Constructors
66 manip_box(void) : manip_absvol(), box() {}
67 manip_box(const box& f) : manip_absvol(), box(f) {}
69 /// Destructor
70 virtual ~manip_box() {}
71
72 virtual absvol* Gavol(void) const;
73 virtual void chname(char* nm) const;
74 virtual void print(std::ostream& file, int l) const;
75};
76
77// ***** sh_manip_box ********
78
79class sh_manip_box : virtual public sh_manip_absvol, public box {
80 public:
81 /// Constructors
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) {}
87 /// Dstructor
88 virtual ~sh_manip_box() { ; }
89
90 virtual absvol* Gavol(void) const;
91 virtual void chname(char* nm) const;
92 virtual void print(std::ostream& file, int l) const;
93
94 protected:
95 virtual void get_components(ActivePtr<absref_transmit>& aref_tran);
96
97};
98
99}
100
101#endif
std::string String
Definition: String.h:75
Definition: box.h:24
String name
Definition: box.h:29
vfloat dx
Definition: box.h:26
vfloat dzh
Definition: box.h:27
virtual int range_ext(trajestep &fts, int s_ext) const
Definition: box.cpp:242
vfloat dz
Definition: box.h:26
virtual void income(gparticle *gp)
virtual void print(std::ostream &file, int l) const
Definition: box.cpp:223
vfloat dy
Definition: box.h:26
void init_planes(void)
Definition: box.cpp:90
virtual ~box()
Destructor.
Definition: box.h:43
vfloat dyh
Definition: box.h:27
vfloat dxh
Definition: box.h:27
ulsvolume ulsv
Definition: box.h:28
virtual void get_components(ActivePtr< absref_transmit > &aref_tran)
Definition: box.cpp:18
macro_copy_header(box)
void init_prec(void)
Definition: box.cpp:85
box(void)
Constructors.
Definition: box.cpp:26
virtual void chname(char *nm) const
Definition: box.cpp:260
virtual int check_point_inside(const point &fpt, const vec &dir) const
Definition: box.cpp:105
virtual void chname(char *nm) const
manip_box(const box &f)
Definition: box.h:67
macro_copy_header(manip_box)
virtual absvol * Gavol(void) const
Definition: box.cpp:272
virtual void print(std::ostream &file, int l) const
manip_box(void)
Constructors.
Definition: box.h:66
virtual ~manip_box()
Destructor.
Definition: box.h:70
virtual void get_components(ActivePtr< absref_transmit > &aref_tran)
sh_manip_box(void)
Constructors.
Definition: box.h:82
virtual ~sh_manip_box()
Dstructor.
Definition: box.h:88
sh_manip_box(const abssyscoor &fcsys, const box &fbx)
Definition: box.h:84
virtual void print(std::ostream &file, int l) const
virtual absvol * Gavol(void) const
virtual void chname(char *nm) const
sh_manip_box(const box &f)
Definition: box.h:83
macro_copy_header(sh_manip_box)
Definition: volume.h:91
Definition: vec.h:477
Definition: vec.h:248
Definition: BGMesh.cpp:3
double vfloat
Definition: vfloat.h:15