Garfield++ v2r0
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, PassivePtr< 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 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
 

Public Attributes

vfloat prec
 
bool s_sensitive
 

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

78{}

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::box, Heed::manip_box, Heed::sh_manip_box, Heed::ulsvolume, and Heed::manip_ulsvolume.

Definition at line 123 of file volume.h.

123{ 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 from Heed::RegPassivePtr.

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

Definition at line 146 of file volume.cpp.

146 {
147 mcerr << "absvol::copy() not defined\n";
148 spexit(mcerr);
149 return NULL;
150}
#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 79 of file volume.cpp.

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

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

◆ Gamanip_embed()

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

Definition at line 75 of file volume.cpp.

75 {
76 return std::vector<manip_absvol*>();
77}

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

122{}

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

◆ print()

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

Reimplemented from Heed::RegPassivePtr.

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

Definition at line 118 of file volume.cpp.

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

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

◆ range()

int Heed::absvol::range ( trajestep fts,
int  s_ext,
int &  sb,
PassivePtr< 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 98 of file volume.cpp.

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