ATLAS Offline Software
Public Types | Public Member Functions | Private Attributes | List of all members
HRoute Class Reference

#include <HRoute.h>

Inheritance diagram for HRoute:
Collaboration diagram for HRoute:

Public Types

typedef std::vector< ServiceVolume * > VolumeContainer
 

Public Member Functions

 HRoute ()
 
 HRoute (double r, double zmi, double zma, double zexit, const std::string &name)
 
double zMin () const
 
double zMax () const
 
double radius () const
 
double zExit () const
 
virtual double position () const
 
virtual double exit () const
 
virtual RoutenextRoute ()
 
const VolumeContainervolumes () const
 
virtual void addVolume (ServiceVolume *vol)
 
virtual void setNextRoute (Route *nr)
 
virtual ServiceVolumeentryVolume (double pos, bool ascending, MsgStream &msg) const
 
virtual ServiceVolumeexitVolume (bool ascending, MsgStream &msg) const
 
const std::string & name () const
 
void setExitVolume (ServiceVolume *vp)
 

Private Attributes

double m_radius {}
 
double m_zMin {}
 
double m_zMax {}
 
double m_zExit {}
 
Routem_next {}
 
VolumeContainer m_volumes
 
ServiceVolumem_exitVolume
 
std::string m_name
 

Detailed Description

Definition at line 13 of file HRoute.h.

Member Typedef Documentation

◆ VolumeContainer

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

Definition at line 16 of file HRoute.h.

Constructor & Destructor Documentation

◆ HRoute() [1/2]

HRoute::HRoute ( )
inline

Definition at line 18 of file HRoute.h.

18 : Route() {}

◆ HRoute() [2/2]

HRoute::HRoute ( double  r,
double  zmi,
double  zma,
double  zexit,
const std::string &  name 
)
inline

Definition at line 19 of file HRoute.h.

19  :
20  Route(name),
21  m_radius(r), m_zMin(zmi), m_zMax(zma), m_zExit(zexit), m_next(0) {}

Member Function Documentation

◆ addVolume()

virtual void HRoute::addVolume ( ServiceVolume vol)
inlinevirtual

Implements Route.

Definition at line 36 of file HRoute.h.

36 {m_volumes.push_back(vol);}

◆ 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 }

◆ exit()

virtual double HRoute::exit ( ) const
inlinevirtual

Implements Route.

Definition at line 30 of file HRoute.h.

30 {return zExit();}

◆ 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 }

◆ name()

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

Definition at line 42 of file Route.h.

42 {return m_name;}

◆ nextRoute()

virtual Route* HRoute::nextRoute ( )
inlinevirtual

Implements Route.

Definition at line 32 of file HRoute.h.

32 {return m_next;}

◆ position()

virtual double HRoute::position ( ) const
inlinevirtual

Implements Route.

Definition at line 28 of file HRoute.h.

28 {return radius();}

◆ radius()

double HRoute::radius ( ) const
inline

Definition at line 25 of file HRoute.h.

25 {return m_radius;}

◆ setExitVolume()

void Route::setExitVolume ( ServiceVolume vp)
inlineinherited

Definition at line 50 of file Route.h.

50  {
51  m_exitVolume = vp;
52  addVolume(vp);
53  }

◆ setNextRoute()

virtual void HRoute::setNextRoute ( Route nr)
inlinevirtual

Implements Route.

Definition at line 38 of file HRoute.h.

38 {m_next = nr;}

◆ volumes()

const VolumeContainer& HRoute::volumes ( ) const
inlinevirtual

Implements Route.

Definition at line 34 of file HRoute.h.

34 {return m_volumes;}

◆ zExit()

double HRoute::zExit ( ) const
inline

Definition at line 26 of file HRoute.h.

26 {return m_zExit;}

◆ zMax()

double HRoute::zMax ( ) const
inline

Definition at line 24 of file HRoute.h.

24 {return m_zMax;}

◆ zMin()

double HRoute::zMin ( ) const
inline

Definition at line 23 of file HRoute.h.

23 {return m_zMin;}

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* HRoute::m_next {}
private

Definition at line 46 of file HRoute.h.

◆ m_radius

double HRoute::m_radius {}
private

Definition at line 42 of file HRoute.h.

◆ m_volumes

VolumeContainer HRoute::m_volumes
private

Definition at line 48 of file HRoute.h.

◆ m_zExit

double HRoute::m_zExit {}
private

Definition at line 45 of file HRoute.h.

◆ m_zMax

double HRoute::m_zMax {}
private

Definition at line 44 of file HRoute.h.

◆ m_zMin

double HRoute::m_zMin {}
private

Definition at line 43 of file HRoute.h.


The documentation for this class was generated from the following file:
beamspotman.r
def r
Definition: beamspotman.py:676
Route::m_exitVolume
ServiceVolume * m_exitVolume
Definition: Route.h:57
HRoute::m_zMax
double m_zMax
Definition: HRoute.h:44
PlotCalibFromCool.begin
begin
Definition: PlotCalibFromCool.py:94
Route::name
const std::string & name() const
Definition: Route.h:42
empty
bool empty(TH1 *h)
Definition: computils.cxx:294
Route::m_name
std::string m_name
Definition: Route.h:58
lumiFormat.i
int i
Definition: lumiFormat.py:92
HRoute::m_radius
double m_radius
Definition: HRoute.h:42
endmsg
#define endmsg
Definition: AnalysisConfig_Ntuple.cxx:63
Route::Route
Route()
Definition: Route.h:25
python.TriggerAPI.TriggerAPISession.ascending
ascending
Definition: TriggerAPISession.py:360
HRoute::m_next
Route * m_next
Definition: HRoute.h:46
HRoute::radius
double radius() const
Definition: HRoute.h:25
python.LumiBlobConversion.pos
pos
Definition: LumiBlobConversion.py:18
HRoute::zExit
double zExit() const
Definition: HRoute.h:26
DEBUG
#define DEBUG
Definition: page_access.h:11
HRoute::m_zMin
double m_zMin
Definition: HRoute.h:43
Route::volumes
virtual const VolumeContainer & volumes() const =0
python.AutoConfigFlags.msg
msg
Definition: AutoConfigFlags.py:7
HRoute::m_zExit
double m_zExit
Definition: HRoute.h:45
Route::addVolume
virtual void addVolume(ServiceVolume *vol)=0
Route::exit
virtual double exit() const =0
HRoute::m_volumes
VolumeContainer m_volumes
Definition: HRoute.h:48