ATLAS Offline Software
Loading...
Searching...
No Matches
InDetDD::PconZone Class Reference

#include <VolumeSplitterUtils.h>

Inheritance diagram for InDetDD::PconZone:
Collaboration diagram for InDetDD::PconZone:

Public Types

typedef std::vector< constZone * >::const_iterator ChildIterator

Public Member Functions

 PconZone (const std::string &label, bool rotated=false)
 PconZone (const std::string &label, const GeoPcon *shape, bool rotated=false)
void addPlane (double z, double rmin, double rmax)
virtual bool inSide (const Point &point) const
virtual Point findEntry (const Ray &ray) const
virtual Point findExit (const Ray &ray) const
void add (const Zone *)
ChildIterator begin () const
ChildIterator end () const
const std::string & label () const
bool rotated () const

Private Member Functions

bool inR (unsigned int i, double r) const
bool inZ (unsigned int i, double z) const

Private Attributes

std::vector< double > m_z
std::vector< double > m_rmin
std::vector< double > m_rmax
std::string m_label
bool m_rotated
std::vector< const Zone * > m_children

Detailed Description

Definition at line 119 of file VolumeSplitterUtils.h.

Member Typedef Documentation

◆ ChildIterator

typedef std::vector<constZone*>::const_iterator InDetDD::Zone::ChildIterator
inherited

Definition at line 73 of file VolumeSplitterUtils.h.

Constructor & Destructor Documentation

◆ PconZone() [1/2]

InDetDD::PconZone::PconZone ( const std::string & label,
bool rotated = false )

Definition at line 225 of file VolumeSplitterUtils.cxx.

226 : Zone(label, rotated)
227 {}
bool rotated() const
const std::string & label() const
Zone(const std::string &label, bool rotated=false)

◆ PconZone() [2/2]

InDetDD::PconZone::PconZone ( const std::string & label,
const GeoPcon * shape,
bool rotated = false )

Definition at line 229 of file VolumeSplitterUtils.cxx.

230 : Zone(label, rotated) {
231 for (unsigned int i = 0; i < shape->getNPlanes(); ++i) {
232 addPlane(shape->getZPlane(i), shape->getRMinPlane(i), shape->getRMaxPlane(i));
233 }
234 }
void addPlane(double z, double rmin, double rmax)

Member Function Documentation

◆ add()

void InDetDD::Zone::add ( const Zone * zone)
inherited

Definition at line 124 of file VolumeSplitterUtils.cxx.

124 {
125 m_children.push_back(zone);
126 }
std::vector< const Zone * > m_children

◆ addPlane()

void InDetDD::PconZone::addPlane ( double z,
double rmin,
double rmax )

Definition at line 237 of file VolumeSplitterUtils.cxx.

237 {
238 m_z.push_back(z);
239 m_rmin.push_back(rmin);
240 m_rmax.push_back(rmax);
241 }
#define z
std::vector< double > m_z
std::vector< double > m_rmax
std::vector< double > m_rmin

◆ begin()

ChildIterator InDetDD::Zone::begin ( ) const
inlineinherited

Definition at line 80 of file VolumeSplitterUtils.h.

80{return m_children.begin();}

◆ end()

ChildIterator InDetDD::Zone::end ( ) const
inlineinherited

Definition at line 81 of file VolumeSplitterUtils.h.

81{return m_children.end();}

◆ findEntry()

Point InDetDD::PconZone::findEntry ( const Ray & ray) const
virtual

Implements InDetDD::Zone.

Definition at line 266 of file VolumeSplitterUtils.cxx.

266 {
267 if (ray.horizontal()) {
268 for (unsigned int i = 0; i + 1 < m_z.size(); i += 2) {
269 if (inR(i, ray.start().r()) && ray.start().z() < m_z[i] && ray.end().z() > m_z[i]) {
270 Point p(m_z[i], ray.start().r());
271 p.setChild(this);
272 return p;
273 }
274 }
275 } else if (ray.vertical()) {
276 for (unsigned int i = 0; i + 1 < m_z.size(); i += 2) {
277 if (inZ(i, ray.start().z()) && ray.start().r() < m_rmin[i] && ray.end().r() > m_rmin[i]) {
278 Point p(ray.start().z(), m_rmin[i]);
279 p.setChild(this);
280 return p;
281 }
282 }
283 } else {
284 std::cout << "Unexpected case" << std::endl;
285 }
286 // Return invalid point since doesn't intersect.
287 return {}; // invalid point
288 }
ChargedTracksWeightFilter::Spline::Point Point
bool inZ(unsigned int i, double z) const
bool inR(unsigned int i, double r) const

◆ findExit()

Point InDetDD::PconZone::findExit ( const Ray & ray) const
virtual

Implements InDetDD::Zone.

Definition at line 292 of file VolumeSplitterUtils.cxx.

292 {
293 if (ray.horizontal()) {
294 for (unsigned int i = 0; i + 1 < m_z.size(); i += 2) {
295 if (inZ(i, ray.start().z()) && ray.end().z() > m_z[i + 1] && !inR(i + 2, ray.start().r())) {
296 Point p(m_z[i + 1], ray.start().r());
297 p.setExit();
298 return p;
299 }
300 }
301 } else if (ray.vertical()) {
302 for (unsigned int i = 0; i + 1 < m_z.size(); i += 2) {
303 if (inZ(i, ray.start().z()) && ray.end().r() > m_rmax[i]) {
304 Point p(ray.start().z(), m_rmax[i]);
305 p.setExit();
306 return p;
307 }
308 }
309 } else {
310 std::cout << "Unexpected case" << std::endl;
311 }
312 // ends with. Return invalid point.
313 return {};
314 }

◆ inR()

bool InDetDD::PconZone::inR ( unsigned int i,
double r ) const
private

Definition at line 258 of file VolumeSplitterUtils.cxx.

258 {
259 if (i >= m_z.size()) return false;
260
261 return(r >= m_rmin[i] && r < m_rmax[i]);
262 }
int r
Definition globals.cxx:22

◆ inSide()

bool InDetDD::PconZone::inSide ( const Point & point) const
virtual

Implements InDetDD::Zone.

Definition at line 244 of file VolumeSplitterUtils.cxx.

244 {
245 // Assume comes in pairs with same CLHEP::radii.
246 for (unsigned int i = 0; i + 1 < m_z.size(); i += 2) {
247 if (inZ(i, point.z()) && inR(i, point.r())) return true;
248 }
249 return false;
250 }

◆ inZ()

bool InDetDD::PconZone::inZ ( unsigned int i,
double z ) const
private

Definition at line 253 of file VolumeSplitterUtils.cxx.

253 {
254 return(z >= m_z[i] && z < m_z[i + 1]);
255 }

◆ label()

const std::string & InDetDD::Zone::label ( ) const
inlineinherited

Definition at line 82 of file VolumeSplitterUtils.h.

82{return m_label;}

◆ rotated()

bool InDetDD::Zone::rotated ( ) const
inlineinherited

Definition at line 83 of file VolumeSplitterUtils.h.

83{return m_rotated;}

Member Data Documentation

◆ m_children

std::vector<const Zone *> InDetDD::Zone::m_children
privateinherited

Definition at line 87 of file VolumeSplitterUtils.h.

◆ m_label

std::string InDetDD::Zone::m_label
privateinherited

Definition at line 85 of file VolumeSplitterUtils.h.

◆ m_rmax

std::vector<double> InDetDD::PconZone::m_rmax
private

Definition at line 133 of file VolumeSplitterUtils.h.

◆ m_rmin

std::vector<double> InDetDD::PconZone::m_rmin
private

Definition at line 132 of file VolumeSplitterUtils.h.

◆ m_rotated

bool InDetDD::Zone::m_rotated
privateinherited

Definition at line 86 of file VolumeSplitterUtils.h.

◆ m_z

std::vector<double> InDetDD::PconZone::m_z
private

Definition at line 131 of file VolumeSplitterUtils.h.


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