Garfield++ 3.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 147 of file volume.cpp.

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

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

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

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

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

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