ATLAS Offline Software
Loading...
Searching...
No Matches
Route Class Referenceabstract

#include <Route.h>

Inheritance diagram for Route:
Collaboration diagram for Route:

Public Types

typedef std::vector< ServiceVolume * > VolumeContainer

Public Member Functions

virtual ServiceVolumeentryVolume (double pos, bool ascending, MsgStream &msg) const
virtual ServiceVolumeexitVolume (bool ascending, MsgStream &msg) const
 Route ()
 Route (const std::string &name)
virtual ~Route ()
virtual double position () const =0
virtual double exit () const =0
virtual RoutenextRoute ()=0
virtual const VolumeContainervolumes () const =0
virtual void setNextRoute (Route *nr)=0
const std::string & name () const
virtual void addVolume (ServiceVolume *vol)=0
void setExitVolume (ServiceVolume *vp)

Private Attributes

ServiceVolumem_exitVolume
std::string m_name

Detailed Description

Definition at line 15 of file Route.h.

Member Typedef Documentation

◆ VolumeContainer

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

Definition at line 18 of file Route.h.

Constructor & Destructor Documentation

◆ Route() [1/2]

Route::Route ( )
inline

Definition at line 25 of file Route.h.

25: m_exitVolume(0) {}
ServiceVolume * m_exitVolume
Definition Route.h:57

◆ Route() [2/2]

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

Definition at line 26 of file Route.h.

26: m_exitVolume(0), m_name(name) {}
const std::string & name() const
Definition Route.h:42
std::string m_name
Definition Route.h:58

◆ ~Route()

virtual Route::~Route ( )
inlinevirtual

Definition at line 28 of file Route.h.

28{}

Member Function Documentation

◆ addVolume()

virtual void Route::addVolume ( ServiceVolume * vol)
pure virtual

Implemented in HRoute, and VRoute.

◆ entryVolume()

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

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 Route::exit ( ) const
pure virtual

Implemented in HRoute, and VRoute.

◆ exitVolume()

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

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}
virtual double exit() const =0

◆ name()

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

Definition at line 42 of file Route.h.

42{return m_name;}

◆ nextRoute()

virtual Route * Route::nextRoute ( )
pure virtual

Implemented in HRoute, and VRoute.

◆ position()

virtual double Route::position ( ) const
pure virtual

Implemented in HRoute, and VRoute.

◆ setExitVolume()

void Route::setExitVolume ( ServiceVolume * vp)
inline

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 Route::setNextRoute ( Route * nr)
pure virtual

Implemented in HRoute, and VRoute.

◆ volumes()

virtual const VolumeContainer & Route::volumes ( ) const
pure virtual

Implemented in HRoute, and VRoute.

Member Data Documentation

◆ m_exitVolume

ServiceVolume* Route::m_exitVolume
private

Definition at line 57 of file Route.h.

◆ m_name

std::string Route::m_name
private

Definition at line 58 of file Route.h.


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