Garfield++ v2r0
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, PassivePtr< 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
 
virtual 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)
 
- Public Member Functions inherited from Heed::RegPassivePtr
 RegPassivePtr (void)
 
 RegPassivePtr (char fs_ban_del, char fs_ban_sub, char fs_ban_cop=0)
 
 RegPassivePtr (const RegPassivePtr &f)
 
RegPassivePtroperator= (const RegPassivePtr &f)
 
CountPP_ns::CountPassivePtrbook (void) const
 
void clear_pointers (void) const
 
virtual RegPassivePtrcopy () const
 
virtual ~RegPassivePtr ()
 
virtual void print (std::ostream &file, int l=1) const
 
void set_s_ban_del (char fs_ban_del)
 
char get_s_ban_del (void) const
 
void set_s_ban_sub (char fs_ban_sub)
 
char get_s_ban_sub (void) const
 
void set_s_ban_cop (char fs_ban_cop)
 
char get_s_ban_cop (void) const
 
void set_s_allow_del_at_zero_count (char fs_allow_del_at_zero_count)
 
char get_s_allow_del_at_zero_count (void) const
 
long get_total_number_of_references (void) const
 

Additional Inherited Members

- Static Public Member Functions inherited from Heed::RegPassivePtr
static void set_s_ban_del_ignore (char fs_ban_del_ignore)
 
static char get_s_ban_del_ignore (void)
 
static void set_s_print_adr_cpp (char fs_print_adr_cpp)
 
static char get_s_print_adr_cpp (void)
 

Detailed Description

Abstract base classs for volume "manipulators".

Definition at line 178 of file volume.h.

Constructor & Destructor Documentation

◆ ~manip_absvol()

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

Definition at line 212 of file volume.h.

212{}

Member Function Documentation

◆ copy()

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

Reimplemented from Heed::RegPassivePtr.

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

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 201 of file volume.h.

201 {
202 const abssyscoor* asc = Gasc();
203 if (asc) f->down(asc);
204 }
virtual const abssyscoor * Gasc() const
Get the coordinate system.
Definition: volume.h:183

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 183 of file volume.h.

183 {
184 // Return NULL if it is the same system
185 return NULL;
186 }

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 153 of file volume.cpp.

154 {
155 const abssyscoor* asc = Gasc();
156 const absvol* avol = Gavol();
157 if (asc != NULL) {
158 point pt = fpt;
159 vec dir = fdir;
160 pt.up(asc);
161 dir.up(asc);
162 return avol->check_point_inside(pt, dir);
163 }
164 return avol->check_point_inside(fpt, fdir);
165}
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:123

Referenced by m_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 167 of file volume.cpp.

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

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:196

◆ m_range()

int Heed::manip_absvol::m_range ( trajestep fts,
int  s_ext,
int &  sb,
PassivePtr< 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:201

◆ 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 205 of file volume.h.

205 {
206 const abssyscoor* asc = Gasc();
207 if (asc) f->up(asc);
208 }

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


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