ATLAS Offline Software
Loading...
Searching...
No Matches
VRoute Class Reference

#include <VRoute.h>

Inheritance diagram for VRoute:
Collaboration diagram for VRoute:

Public Types

typedef std::vector< ServiceVolume * > VolumeContainer

Public Member Functions

 VRoute ()
 VRoute (double z, double rmi, double rma, double rexit, const std::string &name)
double rMin () const
double rMax () const
double zPos () const
double rExit () const
virtual double position () const
virtual double exit () const
virtual Route * nextRoute ()
virtual const VolumeContainer & volumes () const
virtual void addVolume (ServiceVolume *vol)
virtual void setNextRoute (Route *nr)
virtual ServiceVolume * entryVolume (double pos, bool ascending, MsgStream &msg) const
virtual ServiceVolume * exitVolume (bool ascending, MsgStream &msg) const
const std::string & name () const
void setExitVolume (ServiceVolume *vp)

Private Attributes

double m_zPos {}
double m_rMin {}
double m_rMax {}
double m_rExit {}
Route * m_next {}
VolumeContainer m_volumes
ServiceVolume * m_exitVolume
std::string m_name

Detailed Description

Definition at line 13 of file VRoute.h.

Member Typedef Documentation

◆ VolumeContainer

typedef std::vector<ServiceVolume*> VRoute::VolumeContainer

Definition at line 16 of file VRoute.h.

Constructor & Destructor Documentation

◆ VRoute() [1/2]

VRoute::VRoute ( )
inline

Definition at line 18 of file VRoute.h.

18: Route() {}
Route()
Definition Route.h:25

◆ VRoute() [2/2]

VRoute::VRoute ( double z,
double rmi,
double rma,
double rexit,
const std::string & name )
inline

Definition at line 19 of file VRoute.h.

19 :
20 Route(name),
21 m_zPos(z), m_rMin(rmi), m_rMax(rma), m_rExit(rexit), m_next(0){}
#define z
const std::string & name() const
Definition Route.h:42
double m_rMin
Definition VRoute.h:56
double m_zPos
Definition VRoute.h:55
double m_rExit
Definition VRoute.h:58
double m_rMax
Definition VRoute.h:57
Route * m_next
Definition VRoute.h:59

Member Function Documentation

◆ addVolume()

virtual void VRoute::addVolume ( ServiceVolume * vol)
inlinevirtual

Implements Route.

Definition at line 36 of file VRoute.h.

36{m_volumes.push_back(vol);}
VolumeContainer m_volumes
Definition VRoute.h:61

◆ entryVolume()

ServiceVolume * Route::entryVolume ( double pos,
bool ascending,
MsgStream & msg ) const
virtualinherited

Definition at line 10 of file Route.cxx.

11{
12 if (msg.level() <= MSG::DEBUG) {
13 msg << MSG::DEBUG << "entering entryVolume with ascending = " << ascending
14 << " and pos = " << pos << endmsg;
15 }
16 if (volumes().empty()) return nullptr;
17
18 // if (volumes().front()->contains(pos)) return volumes().front();
19 // else if (volumes().back()->contains(pos)) return volumes().back();
20 // else {
21 //should iterate to find exit volume
22 if ( ascending) {
23 for (VolumeContainer::const_iterator i=volumes().begin(); i!=volumes().end(); ++i) {
24
25 if (msg.level() <= MSG::DEBUG) {
26 msg << MSG::DEBUG << "Comparing " << pos << " and " << (**i).position() << endmsg;
27 }
28 if (pos < (**i).position()) {
29 if (msg.level() <= MSG::DEBUG) {
30 msg << MSG::DEBUG << "volume at pos " << (**i).radius()
31 << ", " << (**i).zPos() << " contains exit point" << endmsg;
32 }
33 return *i;
34 }
35 else if (msg.level() <= MSG::DEBUG) {
36 msg << MSG::DEBUG << "volume at pos " << (**i).radius()
37 << ", " << (**i).zPos() << " does not contain exit point" << endmsg;
38 }
39 }
40 return volumes().front(); // catch-all
41 }
42 else {
43 for (VolumeContainer::const_reverse_iterator i=volumes().rbegin(); i!=volumes().rend(); ++i) {
44 if ((**i).contains(pos)) return *i;
45 }
46 return volumes().back(); // catch-all
47 }
48 //}
49}
#define endmsg
static const Attributes_t empty
virtual const VolumeContainer & volumes() const =0
MsgStream & msg
Definition testRead.cxx:32

◆ exit()

virtual double VRoute::exit ( ) const
inlinevirtual

Implements Route.

Definition at line 30 of file VRoute.h.

30{return rExit();}
double rExit() const
Definition VRoute.h:26

◆ exitVolume()

ServiceVolume * Route::exitVolume ( bool ascending,
MsgStream & msg ) const
virtualinherited

Definition at line 51 of file Route.cxx.

52{
53 if (msg.level() <= MSG::DEBUG) {
54 msg << MSG::DEBUG << "entering exitVolume with ascending = " << ascending
55 << " and route.exit() = " << exit() << endmsg;
56 }
57 if (m_exitVolume != nullptr) return m_exitVolume;
58
59 // returns the volume closest to the exit point, coming from the given direction
60 if (volumes().empty()) return nullptr;
61 if ( ascending) {
62 for (VolumeContainer::const_iterator i=volumes().begin(); i!=volumes().end(); ++i) {
63 if ((**i).contains(exit())) return *i;
64 else if (msg.level() <= MSG::DEBUG) {
65 msg << MSG::DEBUG << "volume at pos " << (**i).radius()
66 << ", " << (**i).zPos() << " does not contain exit point" << endmsg;
67 }
68 }
69 return volumes().back(); // catch-all
70 }
71 else {
72 for (VolumeContainer::const_reverse_iterator i=volumes().rbegin(); i!=volumes().rend(); ++i) {
73 if ((**i).contains(exit())) return *i;
74 }
75 return volumes().front(); // catch-all
76 }
77}
ServiceVolume * m_exitVolume
Definition Route.h:57
virtual double exit() const =0

◆ name()

const std::string & Route::name ( ) const
inlineinherited

Definition at line 42 of file Route.h.

42{return m_name;}
std::string m_name
Definition Route.h:58

◆ nextRoute()

virtual Route * VRoute::nextRoute ( )
inlinevirtual

Implements Route.

Definition at line 32 of file VRoute.h.

32{return m_next;}

◆ position()

virtual double VRoute::position ( ) const
inlinevirtual

Implements Route.

Definition at line 28 of file VRoute.h.

28{return zPos();}
double zPos() const
Definition VRoute.h:25

◆ rExit()

double VRoute::rExit ( ) const
inline

Definition at line 26 of file VRoute.h.

26{return m_rExit;}

◆ rMax()

double VRoute::rMax ( ) const
inline

Definition at line 24 of file VRoute.h.

24{return m_rMax;}

◆ rMin()

double VRoute::rMin ( ) const
inline

Definition at line 23 of file VRoute.h.

23{return m_rMin;}

◆ setExitVolume()

void Route::setExitVolume ( ServiceVolume * vp)
inlineinherited

Definition at line 50 of file Route.h.

50 {
51 m_exitVolume = vp;
52 addVolume(vp);
53 }
virtual void addVolume(ServiceVolume *vol)=0

◆ setNextRoute()

virtual void VRoute::setNextRoute ( Route * nr)
inlinevirtual

Implements Route.

Definition at line 38 of file VRoute.h.

38{m_next = nr;}

◆ volumes()

virtual const VolumeContainer & VRoute::volumes ( ) const
inlinevirtual

Implements Route.

Definition at line 34 of file VRoute.h.

34{return m_volumes;}

◆ zPos()

double VRoute::zPos ( ) const
inline

Definition at line 25 of file VRoute.h.

25{return m_zPos;}

Member Data Documentation

◆ m_exitVolume

ServiceVolume* Route::m_exitVolume
privateinherited

Definition at line 57 of file Route.h.

◆ m_name

std::string Route::m_name
privateinherited

Definition at line 58 of file Route.h.

◆ m_next

Route* VRoute::m_next {}
private

Definition at line 59 of file VRoute.h.

59{};

◆ m_rExit

double VRoute::m_rExit {}
private

Definition at line 58 of file VRoute.h.

58{};

◆ m_rMax

double VRoute::m_rMax {}
private

Definition at line 57 of file VRoute.h.

57{};

◆ m_rMin

double VRoute::m_rMin {}
private

Definition at line 56 of file VRoute.h.

56{};

◆ m_volumes

VolumeContainer VRoute::m_volumes
private

Definition at line 61 of file VRoute.h.

◆ m_zPos

double VRoute::m_zPos {}
private

Definition at line 55 of file VRoute.h.

55{};

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