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::manip_absvol Class Referenceabstract

Abstract base classs for volume "manipulators". More...

#include <volume.h>

+ Inheritance diagram for Heed::manip_absvol:

Public Member Functions

virtual absvolGavol () const =0
 Get the volume.
 
virtual const abssyscoorGasc () const
 Get the coordinate system.
 
virtual int m_check_point_inside (const point &fpt, const vec &dir) const
 
virtual int m_find_embed_vol (const point &fpt, const vec &fdir, manip_absvol_treeid *atid) const
 
virtual int m_range (trajestep &fts, int s_ext, int &sb, manip_absvol *&faeid) const
 
virtual int m_range_ext (trajestep &fts, int s_ext) const
 
void down_absref (absref *f) const
 
void up_absref (absref *f) const
 
void m_chname (char *nm) const
 
virtual void m_print (std::ostream &file, int l) const
 
manip_absvolcopy () const
 
virtual ~manip_absvol ()
 
- 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)
 

Detailed Description

Abstract base classs for volume "manipulators".

Definition at line 128 of file volume.h.

Constructor & Destructor Documentation

◆ ~manip_absvol()

virtual Heed::manip_absvol::~manip_absvol ( )
inlinevirtual

Definition at line 162 of file volume.h.

162{}

Member Function Documentation

◆ copy()

manip_absvol * Heed::manip_absvol::copy ( ) const

Definition at line 250 of file volume.cpp.

250 {
251 mcerr << "manip_absvol_copy() not defined\n";
252 spexit(mcerr);
253 return NULL;
254}
#define spexit(stream)
Definition: FunNameStack.h:256
#define mcerr
Definition: prstream.h:128

◆ down_absref()

void Heed::manip_absvol::down_absref ( absref f) const
inline

Definition at line 151 of file volume.h.

151 {
152 const abssyscoor* asc = Gasc();
153 if (asc) f->down(asc);
154 }
virtual const abssyscoor * Gasc() const
Get the coordinate system.
Definition: volume.h:133

Referenced by m_range(), and m_range_ext().

◆ Gasc()

virtual const abssyscoor * Heed::manip_absvol::Gasc ( ) const
inlinevirtual

Get the coordinate system.

Reimplemented in Heed::sh_manip_absvol.

Definition at line 133 of file volume.h.

133 {
134 // Return NULL if it is the same system
135 return NULL;
136 }

Referenced by down_absref(), m_check_point_inside(), m_print(), and up_absref().

◆ Gavol()

◆ m_check_point_inside()

int Heed::manip_absvol::m_check_point_inside ( const point fpt,
const vec dir 
) const
virtual

Definition at line 155 of file volume.cpp.

156 {
157 const abssyscoor* asc = Gasc();
158 const absvol* avol = Gavol();
159 if (asc) {
160 point pt = fpt;
161 vec dir = fdir;
162 pt.up(asc);
163 dir.up(asc);
164 return avol->check_point_inside(pt, dir);
165 }
166 return avol->check_point_inside(fpt, fdir);
167}
virtual absvol * Gavol() const =0
Get the volume.

◆ m_chname()

void Heed::manip_absvol::m_chname ( char *  nm) const

Definition at line 222 of file volume.cpp.

222 {
223 strcpy(nm, "mvol->");
224 Gavol()->chname(&nm[6]);
225}
virtual void chname(char *nm) const
Definition: volume.h:121

Referenced by m_print(), and Heed::stvpoint::print().

◆ m_find_embed_vol()

int Heed::manip_absvol::m_find_embed_vol ( const point fpt,
const vec fdir,
manip_absvol_treeid atid 
) const
virtual

Definition at line 169 of file volume.cpp.

170 {
171 mfunname("int manip_absvol::m_find_embed_vol(...)");
172 absvol* avol = Gavol();
173 point pt = fpt;
174 up_absref(&pt);
175 vec dir = fdir;
176 up_absref(&dir);
177 // TODO!
178 atid->eid.push_back((manip_absvol*)this);
179 const size_t s = atid->eid.size();
180 int iret = avol->find_embed_vol(pt, dir, atid);
181 if (iret == 0) {
182 if (atid->eid.size() < s) {
183 mcerr << "manip_absvol::m_find_embed_vol: should never happen\n";
184 exit(1);
185 }
186 atid->eid.pop_back();
187 return 0;
188 }
189 if (atid->eid.size() < s) {
190 mcerr << "manip_absvol::m_find_embed_vol: should never happen\n";
191 exit(1);
192 }
193 return 1;
194}
#define mfunname(string)
Definition: FunNameStack.h:45
void up_absref(absref *f) const
Definition: volume.h:155

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

◆ m_print()

void Heed::manip_absvol::m_print ( std::ostream &  file,
int  l 
) const
virtual

Reimplemented in Heed::sh_manip_absvol.

Definition at line 227 of file volume.cpp.

227 {
228 if (l <= 0) return;
229 char s[1000];
230 m_chname(s);
231 Ifile << "manip_absvol::m_print(l=" << l << "): " << s << '\n';
232 --l;
233 if (l > 0) {
234 indn.n += 2;
235 const abssyscoor* asys = Gasc();
236 if (asys)
237 asys->print(file, l - 1);
238 else
239 mcout << "manip_absvol::m_print: system==NULL\n";
240 absvol* avol = Gavol();
241 if (avol)
242 avol->print(file, l - 1);
243 else
244 mcout << "manip_absvol::m_print: avol==NULL\n";
245 indn.n -= 2;
246 }
247 file.flush();
248}
void m_chname(char *nm) const
Definition: volume.cpp:222
indentation indn
Definition: prstream.cpp:15
#define mcout
Definition: prstream.h:126
#define Ifile
Definition: prstream.h:195

◆ m_range()

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

Definition at line 196 of file volume.cpp.

197 {
198 trajestep ts(fts);
199 up_absref(&ts);
200 absvol* avol = Gavol();
201
202 const int s = avol->range(ts, s_ext, sb, faeid);
203 if (s == 1) {
204 down_absref(&ts);
205 fts = ts;
206 }
207 return s;
208}
void down_absref(absref *f) const
Definition: volume.h:151

◆ m_range_ext()

int Heed::manip_absvol::m_range_ext ( trajestep fts,
int  s_ext 
) const
virtual

Definition at line 210 of file volume.cpp.

210 {
211 trajestep ts(fts);
212 up_absref(&ts);
213 absvol* avol = Gavol();
214 int s = avol->range_ext(ts, s_ext);
215 if (s == 1) {
216 down_absref(&ts);
217 fts = ts;
218 }
219 return s;
220}

◆ up_absref()

void Heed::manip_absvol::up_absref ( absref f) const
inline

Definition at line 155 of file volume.h.

155 {
156 const abssyscoor* asc = Gasc();
157 if (asc) f->up(asc);
158 }

Referenced by m_find_embed_vol(), m_range(), and m_range_ext().


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