Garfield++ 4.0
A toolkit for the detailed simulation of particle detectors based on ionisation measurement in gases and semiconductors
Loading...
Searching...
No Matches
Heed::absvol Class Referenceabstract

#include <volume.h>

+ Inheritance diagram for Heed::absvol:

Public Member Functions

virtual ~absvol ()
 Destructor.
 
virtual int check_point_inside (const point &fpt, const vec &dir) const =0
 
virtual int find_embed_vol (const point &fpt, const vec &dir, manip_absvol_treeid *atid) const
 
virtual int range (trajestep &fts, int s_ext, int &sb, manip_absvol *&faeid) const
 
virtual int range_ext (trajestep &fts, int s_ext) const =0
 
virtual void income (gparticle *)
 
virtual void chname (char *nm) const
 
virtual void print (std::ostream &file, int l) const
 
virtual absvolcopy () const
 
virtual std::vector< manip_absvol * > Gamanip_embed () const
 
- Public Member Functions inherited from Heed::absref
virtual ~absref ()
 Destructor.
 
virtual void down (const abssyscoor *fasc)
 Convert numbering representation of object to basical system of fasc.
 
virtual void up (const abssyscoor *fasc)
 Convert numbering representation of objects to new system.
 
virtual void turn (const vec &dir, vfloat angle)
 Turn around axis doing via center of coordinate system along dir.
 
virtual void shift (const vec &dir)
 

Public Attributes

vfloat prec
 
bool s_sensitive
 

Detailed Description

Abstract base class for volumes. The functions accept and return parameters expressed in the internal coordinate system inherent to this volume. For interface with external system please use manip_absvol.

Definition at line 70 of file volume.h.

Constructor & Destructor Documentation

◆ ~absvol()

virtual Heed::absvol::~absvol ( )
inlinevirtual

Destructor.

Definition at line 76 of file volume.h.

76{}

Member Function Documentation

◆ check_point_inside()

virtual int Heed::absvol::check_point_inside ( const point fpt,
const vec dir 
) const
pure virtual

Check if a point is inside the volume. If two volumes are adjacent, it may happen that a point belongs to both. To avoid this confusion the parameter dir is used. If dir == (0, 0, 0), and the point is exactly on the border, the behaviour is in general not specified. If dir != (0, 0, 0), and the point is on the border with precision prec, the exiting volume is ignored.

Implemented in Heed::box, and Heed::ulsvolume.

Referenced by find_embed_vol(), and Heed::manip_absvol::m_check_point_inside().

◆ chname()

virtual void Heed::absvol::chname ( char *  nm) const
inlinevirtual

Reimplemented in Heed::manip_ulsvolume, Heed::box, Heed::manip_box, Heed::sh_manip_box, and Heed::ulsvolume.

Definition at line 121 of file volume.h.

121{ strcpy(nm, "absvol"); }

Referenced by Heed::manip_absvol::m_chname(), Heed::sh_manip_absvol::m_chname(), and print().

◆ copy()

absvol * Heed::absvol::copy ( ) const
virtual

Reimplemented in Heed::manip_ulsvolume, Garfield::HeedChamber, Heed::box, Heed::manip_box, Heed::sh_manip_box, and Heed::ulsvolume.

Definition at line 148 of file volume.cpp.

148 {
149 mcerr << "absvol::copy() not defined\n";
150 spexit(mcerr);
151 return NULL;
152}
#define spexit(stream)
Definition: FunNameStack.h:256
#define mcerr
Definition: prstream.h:128

◆ find_embed_vol()

int Heed::absvol::find_embed_vol ( const point fpt,
const vec dir,
manip_absvol_treeid atid 
) const
virtual

Return 1 if point in this volume. It starts from embraced manipulators, if any If there are embraced volumes, it add some to namvol, otherwise it does not add namvol==0. The embraced volumes should not cross each other, since this function can return only one chain. But the borders can coincide with precision given to embraced volumes. If the point is on the border, it is considered inside volume only if dir is directed inside it. Also algorithm of volume is effective if it interrupts checking after first volume found.

Definition at line 81 of file volume.cpp.

82 {
83 if (check_point_inside(fpt, dir) == 0) return 0;
84 const size_t s = atid->eid.size();
85 std::vector<manip_absvol*> aman = Gamanip_embed();
86 const size_t qaman = aman.size();
87 for (size_t n = 0; n < qaman; ++n) {
88 const int i = aman[n]->m_find_embed_vol(fpt, dir, atid);
89 if (i == 1) {
90 // TODO!
91 if (s < atid->eid.size()) break;
92 Imcout << "absvol::find_embed_vol:\n";
93 Imcout << " Warning: contradiction between "
94 << " i==1 and s == fnamvol\n";
95 }
96 }
97 return 1;
98}
virtual int check_point_inside(const point &fpt, const vec &dir) const =0
virtual std::vector< manip_absvol * > Gamanip_embed() const
Definition: volume.cpp:77
#define Imcout
Definition: prstream.h:196

Referenced by Heed::manip_absvol::m_find_embed_vol().

◆ Gamanip_embed()

std::vector< manip_absvol * > Heed::absvol::Gamanip_embed ( ) const
virtual

Definition at line 77 of file volume.cpp.

77 {
78 return std::vector<manip_absvol*>();
79}

Referenced by find_embed_vol(), print(), and range().

◆ income()

virtual void Heed::absvol::income ( gparticle )
inlinevirtual

Reimplemented in Heed::ulsvolume, and Heed::box.

Definition at line 120 of file volume.h.

120{}

Referenced by Heed::gparticle::change_vol().

◆ print()

void Heed::absvol::print ( std::ostream &  file,
int  l 
) const
virtual

Reimplemented in Heed::manip_ulsvolume, Heed::box, Heed::manip_box, Heed::sh_manip_box, and Heed::ulsvolume.

Definition at line 120 of file volume.cpp.

120 {
121 if (l <= 0) return;
122 char s[1000];
123 chname(s);
124 Ifile << "absvol::print(l=" << l << "): name=" << s << '\n';
125 --l;
126 if (l > 0) {
127 std::vector<manip_absvol*> embed = Gamanip_embed();
128 indn.n += 2;
129 const int qembed = embed.size();
130 if (qembed > 0) {
131 Ifile << "The following volumes are embraced, q=" << embed.size() << '\n';
132 indn.n += 2;
133 for (int n = 0; n < qembed; ++n) {
134 Ifile << "n=" << n << '\n';
135 indn.n += 2;
136 embed[n]->m_print(file, l);
137 indn.n -= 2;
138 }
139 indn.n -= 2;
140 } else {
141 Ifile << "None of embraced volumes\n";
142 }
143 indn.n -= 2;
144 }
145 file.flush();
146}
virtual void chname(char *nm) const
Definition: volume.h:121
indentation indn
Definition: prstream.cpp:15
#define Ifile
Definition: prstream.h:195

Referenced by Heed::manip_absvol::m_print(), Heed::sh_manip_absvol::m_print(), Heed::HeedParticle_BGM::physics(), Heed::box::print(), and Heed::ulsvolume::print().

◆ range()

int Heed::absvol::range ( trajestep fts,
int  s_ext,
int &  sb,
manip_absvol *&  faeid 
) const
virtual

range considering this volume, all embracing volumes sb=0 range restricted by precision reasons. sb=1 crossing border of this volume sb=2 crossing border of embraced volume s_ext=1 inside, and to check all embraced volumes s_ext=0 outside checks only one level in deep. It is assumed that from current volume the particle can pass either outside or to one of embracing volumes. In the last case *faeid is filled by its id. Otherwise *faeid is filled by NULL.

Definition at line 100 of file volume.cpp.

101 {
102 faeid = nullptr;
103 if (s_ext == 0) {
104 sb = 1;
105 return range_ext(fts, 0);
106 }
107 sb = range_ext(fts, 1) == 1 ? 1 : 0;
108 std::vector<manip_absvol*> aman = Gamanip_embed();
109 const int qaman = aman.size();
110 for (int n = 0; n < qaman; ++n) {
111 if (aman[n]->m_range_ext(fts, 0) == 1) {
112 sb = 2;
113 faeid = aman[n];
114 }
115 }
116 if (sb == 1 || sb == 2) return 1;
117 return 0;
118}
virtual int range_ext(trajestep &fts, int s_ext) const =0

Referenced by Heed::gparticle::calc_step_to_bord(), and Heed::manip_absvol::m_range().

◆ range_ext()

virtual int Heed::absvol::range_ext ( trajestep fts,
int  s_ext 
) const
pure virtual

Find cross with current volume ignoring embraced ones. s_ext=1 exit, now point is inside, but embraced volumes are ingnored. s_ext=0 enter, now point is outside

Implemented in Heed::box, and Heed::ulsvolume.

Referenced by Heed::manip_absvol::m_range_ext(), and range().

Member Data Documentation

◆ prec

◆ s_sensitive

bool Heed::absvol::s_sensitive

The documentation for this class was generated from the following files: