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

#include <Routing2.h>

Inheritance diagram for Routing2:
Collaboration diagram for Routing2:

Public Types

typedef ServicesTracker::LayerContainer LayerContainer

Public Member Functions

 Routing2 ()
void createRoutingVolumes (ServicesTracker &tracker)
const std::vector< ServiceVolume * > & volumes () const
bool msgLvl (const MSG::Level lvl) const
 Test the output level.
MsgStream & msg () const
 The standard message stream.
MsgStream & msg (const MSG::Level lvl) const
 The standard message stream.
void setLevel (MSG::Level lvl)
 Change the current logging level.

Private Member Functions

double eosTolerance (DetType::Type type, DetType::Part part) const
double eosLength (DetType::Type type, DetType::Part part) const
double eosHalfThickness (DetType::Type type, DetType::Part part) const
void connect (ServiceVolume *prev, ServiceVolume *newv)
void routeBarrelLayer (LayerContainer::const_iterator bl, LayerContainer::const_iterator blend, ServicesTracker &tracker, VRoute &route)
void routeEndcapLayer (LayerContainer::const_iterator bl, LayerContainer::const_iterator blend, ServicesTracker &tracker, HRoute &route)
bool isRoutedOutsideSupportTube (LayerContainer::const_iterator bl, HRoute &route)
void routeOuterBarrelPixel (ServicesTracker &tracker)
void routeEndcapPixel (ServicesTracker &tracker)
void routeBarrelStrip (ServicesTracker &tracker)
void routeInnerBarrelPixel (ServicesTracker &tracker)
void createRoutes (ServicesTracker &tracker)
void createRoutesInIST (ServicesTracker &tracker)
void createOuterPixelRoutes (ServicesTracker &tracker)
void addVolume (ServiceVolume *v)
ServiceVolumecreateSingleRouteVolume (Route &rt)
void connectRoutes (Route &in, Route &out)
void dumpRoute (const Route &route)
std::string nextVolumeName (const Route &route) const
void initMessaging () const
 Initialize our message level and MessageSvc.

Private Attributes

bool m_routePixelBarrelOnPST
bool m_pixelAlongBarrelStrip
bool m_ISTexists
int m_c_nInnerPixelLayers
double m_c_bpEosLength
double m_c_epEosLength
double m_c_bsEosLength
double m_c_safetyGap
double m_c_EosTolerance
double m_c_halfEosThick
double m_c_EosTolerance2
double m_c_ServiceDiskThickness
double m_c_ServiceCylinderThickness
double m_c_LayerLengthTolerance
std::vector< ServiceVolume * > m_volumes
VRoute m_bpVRoute
HRoute m_bpHRoute
HRoute m_epHRoute
VRoute m_pixelV2Route
HRoute m_pixelH2Route
VRoute m_bsVRoute
VRoute m_istVRoute
HRoute m_istHRoute
HRoute m_ISTouter_HRoute
HRoute m_MSTinside_HRoute
HRoute m_MSTO_HRoute
HRoute m_MSTM_HRoute
HRoute m_MSTM_HRouteInner
HRoute m_MSTI_HRoute
std::string m_nm
 Message source name.
boost::thread_specific_ptr< MsgStream > m_msg_tls
 MsgStream instance (a std::cout like with print-out levels)
std::atomic< IMessageSvc * > m_imsg { nullptr }
 MessageSvc pointer.
std::atomic< MSG::Level > m_lvl { MSG::NIL }
 Current logging level.
std::atomic_flag m_initialized ATLAS_THREAD_SAFE = ATOMIC_FLAG_INIT
 Messaging initialized (initMessaging)

Detailed Description

Definition at line 15 of file Routing2.h.

Member Typedef Documentation

◆ LayerContainer

Constructor & Destructor Documentation

◆ Routing2()

Routing2::Routing2 ( )

Definition at line 12 of file Routing2.cxx.

12 :
13 AthMessaging("Routing2")
14{
18
19 m_c_bpEosLength = 40; // mm
20 m_c_epEosLength = 30;
21 m_c_bsEosLength = 50;
22 m_c_safetyGap = 0.001;
23
24 // all units in cm
25 m_c_EosTolerance = 1.; // mm
31
32 m_ISTexists = false;
33
34}
AthMessaging()
Default constructor:
double m_c_bsEosLength
Definition Routing2.h:36
bool m_ISTexists
Definition Routing2.h:30
double m_c_epEosLength
Definition Routing2.h:35
double m_c_EosTolerance
Definition Routing2.h:39
double m_c_EosTolerance2
Definition Routing2.h:41
bool m_routePixelBarrelOnPST
Definition Routing2.h:28
double m_c_halfEosThick
Definition Routing2.h:40
double m_c_ServiceCylinderThickness
Definition Routing2.h:43
double m_c_bpEosLength
Definition Routing2.h:34
double m_c_safetyGap
Definition Routing2.h:37
bool m_pixelAlongBarrelStrip
Definition Routing2.h:29
int m_c_nInnerPixelLayers
Definition Routing2.h:32
double m_c_LayerLengthTolerance
Definition Routing2.h:44
double m_c_ServiceDiskThickness
Definition Routing2.h:42

Member Function Documentation

◆ addVolume()

void Routing2::addVolume ( ServiceVolume * v)
inlineprivate

Definition at line 85 of file Routing2.h.

85{ m_volumes.push_back( v);}
std::vector< ServiceVolume * > m_volumes
Definition Routing2.h:46

◆ connect()

void Routing2::connect ( ServiceVolume * prev,
ServiceVolume * newv )
private

Definition at line 505 of file Routing2.cxx.

506{
507 // checks on geometrical compatibility should be done by the caller
508 newv->addPrevious(prev);
509 prev->setNext(newv);
510 newv->addLayers(prev->layers());
511}
void setNext(ServiceVolume *next)
const LayerContainer & layers() const
void addLayers(const LayerContainer &lc)
void addPrevious(ServiceVolume *prev)

◆ connectRoutes()

void Routing2::connectRoutes ( Route & in,
Route & out )
private

Definition at line 513 of file Routing2.cxx.

514{
515 // choose volume to connect to
516 ServiceVolume* entryVol = out.entryVolume(in.position(),true,msg());
517 if (entryVol == nullptr) entryVol = createSingleRouteVolume( out);
518 ServiceVolume* exitVol = in.exitVolume(true,msg());
519 // maybe check volumes are connectable?
520 entryVol->addPrevious(exitVol);
521 exitVol->setNext(entryVol);
522
523 // add the services of the in route to all volumes of out route, up to it's exit
524 ServiceVolume* nextVol = entryVol;
525 while (true) {
526 nextVol->addLayers( exitVol->layers());
527 nextVol = nextVol->next();
528 if (nextVol == nullptr) break;
529 }
530}
MsgStream & msg() const
The standard message stream.
virtual double position() const =0
virtual ServiceVolume * exitVolume(bool ascending, MsgStream &msg) const
Definition Route.cxx:51
ServiceVolume * createSingleRouteVolume(Route &rt)
Definition Routing2.cxx:532

◆ createOuterPixelRoutes()

void Routing2::createOuterPixelRoutes ( ServicesTracker & tracker)
private

Definition at line 172 of file Routing2.cxx.

173{
174 if (!m_ISTexists) { // PST is actually IST, and there is no PST
175 // we need to reduce the route radius after the pixel disks to avoid conflict with SCT disks
176 double routeRadius = tracker.geoMgr()->pixelEnvelopeRMax() - m_c_safetyGap - m_c_ServiceCylinderThickness/2;
177 //double zpos = 0.5 * (tracker.endcapPixelLayers().back()->zPos() + tracker.endcapStripLayers().front()->zPos());
178 double zpos = m_epHRoute.zMax() + m_c_ServiceDiskThickness/2 + m_c_safetyGap;
179
180 m_pixelV2Route = VRoute( zpos, routeRadius, m_bpHRoute.radius(), routeRadius, "OuterPixelRPath2");
181
182 double pstLen = tracker.geoMgr()->SupportTubeZMax("PST");
183 m_pixelH2Route = HRoute( routeRadius, zpos + m_c_ServiceDiskThickness/2 + m_c_safetyGap, pstLen, pstLen,"OuterPixelZPath2");
184 m_epHRoute.setNextRoute( &m_pixelV2Route);
185 m_pixelV2Route.setNextRoute( &m_pixelH2Route);
186 }
187}
double SupportTubeZMax(const std::string &name) const
HRoute m_epHRoute
Definition Routing2.h:50
HRoute m_pixelH2Route
Definition Routing2.h:53
HRoute m_bpHRoute
Definition Routing2.h:49
VRoute m_pixelV2Route
Definition Routing2.h:52
const InDetServMatGeometryManager * geoMgr() const

◆ createRoutes()

void Routing2::createRoutes ( ServicesTracker & tracker)
private

Assume same length barrel, the loop is to make sure there are no volume overlaps in case strip barrel layers are slightly different

Definition at line 75 of file Routing2.cxx.

76{
77 // barrel pixel vertical route
78 const LayerContainer& bplc = tracker.barrelPixelLayers();
79 const LayerContainer& eplc = tracker.endcapPixelLayers();
80 const LayerContainer& bslc = tracker.barrelStripLayers();
81
82 double bpZmax = 0;
83 for (LayerContainer::const_iterator bl=bplc.begin()+m_c_nInnerPixelLayers; bl!=bplc.end(); ++bl)
84 bpZmax = std::max( bpZmax, (**bl).zPos() + (**bl).halfLength());
85
86 double bpVertRouteZpos = bpZmax+m_c_EosTolerance+m_c_bpEosLength + 0.5*m_c_ServiceDiskThickness + m_c_safetyGap;
87 double bpVertRouteRmin = bplc[m_c_nInnerPixelLayers]->radius(); // change if along PST
88
89 // Find max endcap pixel layer radius
90 double epRmax = 0;
91 for (LayerContainer::const_iterator i=eplc.begin(); i!=eplc.end(); ++i)
92 epRmax = std::max( epRmax, (**i).rMax());
93
94 // Find max radius for vertical route
95 double bpVertRouteRmax;
96 if (!m_ISTexists) {
97 bpVertRouteRmax = 0.5*(epRmax + m_c_epEosLength + tracker.geoMgr()->sctInnerSupport());
98 // Pixel horizontal route in the middle between pixel disks and first strip layer
100 ATH_MSG_WARNING("No space for services between pixel diskd and sct support");
101 }
102 else {
103 // services along PST, as close as they can get
104 bpVertRouteRmax = tracker.geoMgr()->SupportTubeRMin("PST") - m_c_safetyGap - 0.5*m_c_ServiceCylinderThickness;
105 }
106
107 double bpHorRouteR = bpVertRouteRmax;
108 double bpHRouteZmin = bpVertRouteZpos + 0.5*m_c_ServiceDiskThickness + m_c_safetyGap;
109 double bpHRouteZmax = eplc.back()->zPos(); // prolong if along PST ?
110 ATH_MSG_INFO("Route2: setting bpHRouteZmax to " << bpHRouteZmax);
111
114 double bsZmax = 0;
115 for (LayerContainer::const_iterator i=bslc.begin(); i!=bslc.end(); ++i)
116 bsZmax = std::max( bsZmax, (**i).zPos() + (**i).halfLength());
117
118 double bsVertRouteZpos = bsZmax+m_c_EosTolerance+m_c_bsEosLength + 0.5*m_c_ServiceDiskThickness + m_c_safetyGap;
119
120 bpHRouteZmax = tracker.geoMgr()->SupportTubeZMax("PST");
121
122 double bpHRouteZmax_mode = tracker.geoMgr()->SupportTubeZMin("mode");
123
124 bool bMSTI = tracker.geoMgr()->SupportTubeExists("MSTI");
125 bool bMSTM = tracker.geoMgr()->SupportTubeExists("MSTM");
126 bool bMSTO = tracker.geoMgr()->SupportTubeExists("MSTO");
127 if(bMSTI||bMSTM||bMSTO)
128 if(bpHRouteZmax_mode>0.1&&bpHRouteZmax_mode<bpHRouteZmax) bpHRouteZmax = bpHRouteZmax_mode-0.001;
129
130 ATH_MSG_INFO("Changing bpHRouteZmax to " << bpHRouteZmax);
131
132 double bsVertRouteRmin = bpHorRouteR + 0.5*m_c_ServiceCylinderThickness + m_c_safetyGap;
133 double bsVertRouteRmax = bslc.back()->radius() + m_c_ServiceCylinderThickness; // approx
134
135 m_bpVRoute = VRoute( bpVertRouteZpos, bpVertRouteRmin, bpVertRouteRmax, bpVertRouteRmax, "OuterPixelRPath");
136
138 m_bpHRoute = HRoute( bpHorRouteR, bpHRouteZmin, bpHRouteZmax, bsVertRouteZpos,"OuterPixelZPath"); // different if along PST
139 else
140 m_bpHRoute = HRoute( bpHorRouteR, bpHRouteZmin, bpHRouteZmax, bpHRouteZmax,"OuterPixelZPath");
141
142 m_epHRoute = m_bpHRoute; // different if along PST
143 m_bsVRoute = VRoute( bsVertRouteZpos, bsVertRouteRmin, bsVertRouteRmax, bsVertRouteRmax,"BarrelStripRPath");
144
145 m_bpVRoute.setNextRoute(&m_bpHRoute);
147
148 // Additional Routes:
149 // Outside MSTOuter
150 double bpMSTO_R = tracker.geoMgr()->SupportTubeRMax("MSTO") + m_c_safetyGap + 0.5*m_c_ServiceCylinderThickness;
151 m_MSTO_HRoute = HRoute( bpMSTO_R, bpHRouteZmin, bpHRouteZmax, bpHRouteZmax, "MSTOPixelZPath");
152
153 // Outside MSTMiddle
154 double bpMSTM_R = tracker.geoMgr()->SupportTubeRMax("MSTM") + m_c_safetyGap + 0.5*m_c_ServiceCylinderThickness;
155 m_MSTM_HRoute = HRoute( bpMSTM_R, bpHRouteZmin, bpHRouteZmax, bpHRouteZmax, "MSTMPixelZPath");
156
157 // Outside MSTInner
158 double bpMSTI_R = tracker.geoMgr()->SupportTubeRMax("MSTI") + m_c_safetyGap + 0.5*m_c_ServiceCylinderThickness;
159 m_MSTI_HRoute = HRoute( bpMSTI_R, bpHRouteZmin, bpHRouteZmax, bpHRouteZmax, "MSTIPixelZPath");
160
161 // Inside MSTMiddle
162 double bpMSTM_RI = tracker.geoMgr()->SupportTubeRMin("MSTM") - m_c_safetyGap - 0.5*m_c_ServiceCylinderThickness;
163 m_MSTM_HRouteInner = HRoute( bpMSTM_RI, bpHRouteZmin, bpHRouteZmax, bpHRouteZmax, "MSTMPixelZPathInner");
164
165 // Exit route for pixel
167
168 // route inside PST
169 createRoutesInIST(tracker);
170}
#define ATH_MSG_INFO(x)
#define ATH_MSG_WARNING(x)
int SupportTubeExists(const std::string &name) const
double SupportTubeZMin(const std::string &name) const
double SupportTubeRMax(const std::string &name) const
double SupportTubeRMin(const std::string &name) const
VRoute m_bpVRoute
Definition Routing2.h:48
void createRoutesInIST(ServicesTracker &tracker)
Definition Routing2.cxx:189
HRoute m_MSTI_HRoute
Definition Routing2.h:65
HRoute m_MSTM_HRouteInner
Definition Routing2.h:64
HRoute m_MSTM_HRoute
Definition Routing2.h:63
ServicesTracker::LayerContainer LayerContainer
Definition Routing2.h:18
VRoute m_bsVRoute
Definition Routing2.h:55
HRoute m_MSTO_HRoute
Definition Routing2.h:62
void createOuterPixelRoutes(ServicesTracker &tracker)
Definition Routing2.cxx:172
LayerContainer & barrelStripLayers()
LayerContainer & endcapPixelLayers()
LayerContainer & barrelPixelLayers()

◆ createRoutesInIST()

void Routing2::createRoutesInIST ( ServicesTracker & tracker)
private

Definition at line 189 of file Routing2.cxx.

190{
191 const LayerContainer& bplc = tracker.barrelPixelLayers();
192 double bpZmax = 0;
193 for (LayerContainer::const_iterator bl=bplc.begin(); bl!=bplc.begin()+m_c_nInnerPixelLayers; ++bl) {
194 bpZmax = std::max( bpZmax, (**bl).zPos() + (**bl).halfLength());
195 }
196
197 double istVRouteZpos = bpZmax+m_c_EosTolerance+m_c_bpEosLength +
199 double istVRouteRmin = bplc.front()->radius();
200
201 double istRmin;
202 double istZmax;
203 if (m_ISTexists) {
204 // use IST if it exists
205 // use IST if it exists
206 istRmin = tracker.geoMgr()->SupportTubeRMin("IST");
207 istZmax = tracker.geoMgr()->SupportTubeZMax("IST");
208 }
209 else {
210 // use PST as IST for backward compatibility
211 // use PST as IST for backward compatibility
212 istRmin = tracker.geoMgr()->SupportTubeRMin("PST");
213 istZmax = tracker.geoMgr()->SupportTubeZMax("PST");
214 }
215
216 double istVRouteRmax = istRmin - 0.5*m_c_ServiceCylinderThickness - m_c_safetyGap;
217 m_istVRoute = VRoute( istVRouteZpos, istVRouteRmin, istVRouteRmax, istVRouteRmax, "InnerPixelRPath");
218
219 double istHRouteZmin = istVRouteZpos + 0.5*m_c_ServiceDiskThickness + m_c_safetyGap;
220 double istHRouteZmax = istZmax;
221 m_istHRoute = HRoute( istVRouteRmax, istHRouteZmin, istHRouteZmax, istHRouteZmax, "InnerPixelZPath");
222 m_istVRoute.setNextRoute(&m_istHRoute);
223}
HRoute m_istHRoute
Definition Routing2.h:57
VRoute m_istVRoute
Definition Routing2.h:56

◆ createRoutingVolumes()

void Routing2::createRoutingVolumes ( ServicesTracker & tracker)

Definition at line 36 of file Routing2.cxx.

37{
38 m_ISTexists = (tracker.geoMgr()->SupportTubeRMin("IST") > 0.1);
39
40 createRoutes(tracker);
41
42 routeOuterBarrelPixel(tracker);
43 routeEndcapPixel( tracker);
44
45 // Link routes
50 }
51
52 // Create Strip layer routes
53 routeBarrelStrip( tracker);
55
56 // Create pixel layer routes
57 routeInnerBarrelPixel(tracker);
59
60 // Output route details in debug mode
61 if(msgLvl(MSG::DEBUG)){
70 }
71 }
73}
bool msgLvl(const MSG::Level lvl) const
Test the output level.
void routeOuterBarrelPixel(ServicesTracker &tracker)
Definition Routing2.cxx:225
void routeInnerBarrelPixel(ServicesTracker &tracker)
Definition Routing2.cxx:295
void connectRoutes(Route &in, Route &out)
Definition Routing2.cxx:513
void routeEndcapPixel(ServicesTracker &tracker)
Definition Routing2.cxx:242
void dumpRoute(const Route &route)
Definition Routing2.cxx:577
void routeBarrelStrip(ServicesTracker &tracker)
Definition Routing2.cxx:234
void createRoutes(ServicesTracker &tracker)
Definition Routing2.cxx:75
void setServiceVolumes(const std::vector< ServiceVolume * > &vc)

◆ createSingleRouteVolume()

ServiceVolume * Routing2::createSingleRouteVolume ( Route & rt)
private

Definition at line 532 of file Routing2.cxx.

533{
534 ServiceVolume* vol(nullptr);
535 HRoute* hrt = dynamic_cast<HRoute*>(&rt);
536 if (hrt != nullptr) {
537 vol = new ServiceVolume( ServiceVolume::Cylinder,
540 hrt->zMin(), hrt->zMax(), rt.name());
541 }
542 else {
543 VRoute* vrt = dynamic_cast<VRoute*>(&rt);
544 if(vrt) vol = new ServiceVolume( ServiceVolume::Disk, vrt->rMin(), vrt->rMax(),
546 rt.position()+0.5*m_c_ServiceDiskThickness, rt.name());
547 }
548 rt.addVolume( vol);
549 addVolume(vol);
550 return vol;
551}
double zMin() const
Definition HRoute.h:23
double zMax() const
Definition HRoute.h:24
const std::string & name() const
Definition Route.h:42
virtual void addVolume(ServiceVolume *vol)=0
void addVolume(ServiceVolume *v)
Definition Routing2.h:85
double rMin() const
Definition VRoute.h:23
double rMax() const
Definition VRoute.h:24

◆ dumpRoute()

void Routing2::dumpRoute ( const Route & route)
private

Definition at line 577 of file Routing2.cxx.

578{
579 ATH_MSG_INFO("Dumping route at pos " << route.position() << " with exit at " << route.exit());
580 for ( Route::VolumeContainer::const_iterator iv = route.volumes().begin();
581 iv != route.volumes().end(); ++iv) {
582 (**iv).dump(false);
583 }
584}
virtual double exit() const =0
virtual const VolumeContainer & volumes() const =0

◆ eosHalfThickness()

double Routing2::eosHalfThickness ( DetType::Type type,
DetType::Part part ) const
private

Definition at line 572 of file Routing2.cxx.

573{
574 return m_c_halfEosThick;
575}

◆ eosLength()

double Routing2::eosLength ( DetType::Type type,
DetType::Part part ) const
private

Definition at line 558 of file Routing2.cxx.

559{
560 using namespace DetType;
561 if (type == Pixel) {
562 if (part == Barrel) return m_c_bpEosLength;
563 else return m_c_epEosLength;
564 }
565 else {
566 return m_c_bsEosLength;
567 // FIXME add part for endcap strip
568 }
569}

◆ eosTolerance()

double Routing2::eosTolerance ( DetType::Type type,
DetType::Part part ) const
private

Definition at line 553 of file Routing2.cxx.

554{
555 return m_c_EosTolerance;
556}

◆ initMessaging()

void AthMessaging::initMessaging ( ) const
privateinherited

Initialize our message level and MessageSvc.

This method should only be called once.

Definition at line 39 of file AthMessaging.cxx.

40{
42 // If user did not set an explicit level, set a default
43 if (m_lvl == MSG::NIL) {
44 m_lvl = m_imsg ?
45 static_cast<MSG::Level>( m_imsg.load()->outputLevel(m_nm) ) :
46 MSG::INFO;
47 }
48}
std::string m_nm
Message source name.
std::atomic< IMessageSvc * > m_imsg
MessageSvc pointer.
std::atomic< MSG::Level > m_lvl
Current logging level.
IMessageSvc * getMessageSvc(bool quiet=false)

◆ isRoutedOutsideSupportTube()

bool Routing2::isRoutedOutsideSupportTube ( LayerContainer::const_iterator bl,
HRoute & route )
private

Definition at line 290 of file Routing2.cxx.

291{
292 return (**bl).rMax() > route.radius();
293}
double radius() const
Definition HRoute.h:25

◆ msg() [1/2]

MsgStream & AthMessaging::msg ( ) const
inlineinherited

The standard message stream.

Returns a reference to the default message stream May not be invoked before sysInitialize() has been invoked.

Definition at line 163 of file AthMessaging.h.

164{
165 MsgStream* ms = m_msg_tls.get();
166 if (!ms) {
167 if (!m_initialized.test_and_set()) initMessaging();
168 ms = new MsgStream(m_imsg,m_nm);
169 m_msg_tls.reset( ms );
170 }
171
172 ms->setLevel (m_lvl);
173 return *ms;
174}
boost::thread_specific_ptr< MsgStream > m_msg_tls
MsgStream instance (a std::cout like with print-out levels)
void initMessaging() const
Initialize our message level and MessageSvc.

◆ msg() [2/2]

MsgStream & AthMessaging::msg ( const MSG::Level lvl) const
inlineinherited

The standard message stream.

Returns a reference to the default message stream May not be invoked before sysInitialize() has been invoked.

Definition at line 178 of file AthMessaging.h.

179{ return msg() << lvl; }

◆ msgLvl()

bool AthMessaging::msgLvl ( const MSG::Level lvl) const
inlineinherited

Test the output level.

Parameters
lvlThe message level to test against
Returns
boolean Indicating if messages at given level will be printed
Return values
trueMessages at level "lvl" will be printed

Definition at line 151 of file AthMessaging.h.

152{
153 if (m_lvl <= lvl) {
154 msg() << lvl;
155 return true;
156 } else {
157 return false;
158 }
159}

◆ nextVolumeName()

std::string Routing2::nextVolumeName ( const Route & route) const
private

Definition at line 586 of file Routing2.cxx.

587{
588 ostringstream os;
589 os << route.volumes().size();
590 return route.name() + "Vol" + os.str();
591}

◆ routeBarrelLayer()

void Routing2::routeBarrelLayer ( LayerContainer::const_iterator bl,
LayerContainer::const_iterator blend,
ServicesTracker & tracker,
VRoute & route )
private

Definition at line 303 of file Routing2.cxx.

306{
307 // 1. construct end-of-stave volume
308 double zEosMin = (*bl)->halfLength() + eosTolerance( (*bl)->type(), DetType::Barrel);
309 double zEosMax = zEosMin + eosLength( (*bl)->type(), DetType::Barrel);
310
311 if (zEosMax < route.position() - 0.5*m_c_ServiceDiskThickness) {
312 zEosMax = route.position() - 0.5*m_c_ServiceDiskThickness - m_c_safetyGap;
313 }
314 else {
315 ATH_MSG_WARNING("not enough space for end of stave of barrel layer at radius "
316 << (**bl).radius());
317 }
318 double halfEosThick = eosHalfThickness( (*bl)->type(), DetType::Barrel);
319 ServiceVolume* eosCylinder = new ServiceVolume( ServiceVolume::Cylinder,
320 (*bl)->radius()-halfEosThick,
321 (*bl)->radius()+halfEosThick,
322 zEosMin, zEosMax, (**bl).name() + "EOS");
323 eosCylinder->addLayer(*bl);
324 addVolume( eosCylinder);
325 eosCylinder->addEosServices(*bl); // add all the stave EOS stuff
326
327 // 2. Connect to route
328 double rMin, rMax;
329 if (route.volumes().empty()) rMin = route.rMin();
330 else rMin = route.volumes().back()->rMax() + m_c_safetyGap;
331
332 if (bl+1 != blend) {
333 rMax = std::min((**(bl+1)).radius(), route.rExit());
334 }
335 else rMax = route.rExit();
336
337 ServiceVolume* newDisk = new ServiceVolume( ServiceVolume::Disk, rMin, rMax,
338 route.zPos()-0.5*m_c_ServiceDiskThickness,
339 route.zPos()+0.5*m_c_ServiceDiskThickness,
340 nextVolumeName(route));
341 newDisk->dump(true);
342 // newDisk->addLayer(*bl); // done by connect()
343 connect( eosCylinder, newDisk);
344 if (!route.volumes().empty()) connect( route.volumes().back(), newDisk);
345 route.addVolume( newDisk);
346 addVolume( newDisk);
347}
std::string nextVolumeName(const Route &route) const
Definition Routing2.cxx:586
double eosHalfThickness(DetType::Type type, DetType::Part part) const
Definition Routing2.cxx:572
void connect(ServiceVolume *prev, ServiceVolume *newv)
Definition Routing2.cxx:505
double eosLength(DetType::Type type, DetType::Part part) const
Definition Routing2.cxx:558
double eosTolerance(DetType::Type type, DetType::Part part) const
Definition Routing2.cxx:553
void addLayer(const ServicesLayer *l)
Add a layer the services of which are routed through this volume.
void addEosServices(const ServicesLayer *l)
void dump(bool dumpMaterial=true) const
virtual const VolumeContainer & volumes() const
Definition VRoute.h:34
double rExit() const
Definition VRoute.h:26
virtual double position() const
Definition VRoute.h:28
double zPos() const
Definition VRoute.h:25
virtual void addVolume(ServiceVolume *vol)
Definition VRoute.h:36
@ Barrel
Definition DetType.h:14

◆ routeBarrelStrip()

void Routing2::routeBarrelStrip ( ServicesTracker & tracker)
private

Definition at line 234 of file Routing2.cxx.

235{
236 const LayerContainer& bls = tracker.barrelStripLayers();
237 for (LayerContainer::const_iterator bl=bls.begin(); bl!=bls.end(); ++bl) {
238 routeBarrelLayer( bl, bls.end(), tracker, m_bsVRoute);
239 }
240}
void routeBarrelLayer(LayerContainer::const_iterator bl, LayerContainer::const_iterator blend, ServicesTracker &tracker, VRoute &route)
Definition Routing2.cxx:303

◆ routeEndcapLayer()

void Routing2::routeEndcapLayer ( LayerContainer::const_iterator bl,
LayerContainer::const_iterator blend,
ServicesTracker & tracker,
HRoute & route )
private

Definition at line 349 of file Routing2.cxx.

352{
353 // 1. construct end-of-stave volume
354// double rEosMin = (*bl)->rMax() + eosTolerance( (*bl)->type(), DetType::Endcap);
355// double rEosMax = rEosMin + eosLength( (*bl)->type(), DetType::Endcap);
356// if (rEosMax > route.position() - 0.5*m_c_ServiceCylinderThickness) {
357// msg(MSG::WARNING) << "not enough space for end of stave of endcap layer at Z = "
358// << (**bl).zPos() << endmsg;
359// }
360// rEosMax = route.position() - 0.5*m_c_ServiceCylinderThickness - m_c_safetyGap;
361// if (rEosMax < rEosMin) {
362// msg(MSG::WARNING) << "no space for routing of endcap layer at Z = "
363// << (**bl).zPos() << endmsg;
364// }
365
366 double rEosMin = 0.0;
367 double rEosMax = 0.0;
368 std::string SupportName = tracker.geoMgr()->pixelDiskServiceRoute( (*bl)->number() );
369 double EOSZOffset = 0.0;
370
371 bool bRoutedOutsideSupport = isRoutedOutsideSupportTube(bl, route);
372
373 if (SupportName == "PST")
374 {
375 rEosMin = (*bl)->rMax() + eosTolerance( (*bl)->type(), DetType::Endcap); // Disk outer edge + safety
376 rEosMax = route.position() - 0.5*m_c_ServiceCylinderThickness - m_c_safetyGap; // support tube - safety
377 EOSZOffset = tracker.geoMgr()->pixelDiskEOSZOffset( (*bl)->number() );
378 if (rEosMax < rEosMin) ATH_MSG_WARNING("No space for routing of endcap layer at Z = " << (**bl).zPos());
379 }
380 else if (SupportName == "MST")
381 {
382 rEosMin = (*bl)->rMin() + eosTolerance( (*bl)->type(), DetType::Endcap); // EOS same size as Disk supports
383 rEosMax = (*bl)->rMax() + eosTolerance( (*bl)->type(), DetType::Endcap);
384 EOSZOffset = tracker.geoMgr()->pixelDiskEOSZOffset( (*bl)->number() );
385 }
386 else if (SupportName == "IST")
387 {
388 rEosMin = route.position() + 0.5*m_c_ServiceCylinderThickness + m_c_safetyGap; // support tube + safety
389 rEosMax = (*bl)->rMin() - eosTolerance( (*bl)->type(), DetType::Endcap); // Disk outer edge - safety
390 EOSZOffset = tracker.geoMgr()->pixelDiskEOSZOffset( (*bl)->number() );
391 if (rEosMax < rEosMin) ATH_MSG_WARNING("No space for routing of endcap layer at Z = " << (**bl).zPos());
392 }
393 else if (SupportName == "MSTO" || SupportName == "MSTM" || SupportName == "MSTI" )
394 {
395 // rEosMin/Max are different if disk runs inside or outside the support tube
396 if (bRoutedOutsideSupport)
397 {
398 rEosMin = route.position() + 0.5*m_c_ServiceCylinderThickness + m_c_safetyGap;
399 rEosMax = (*bl)->rMax() - eosTolerance( (*bl)->type(), DetType::Endcap);
400 }
401 else
402 {
403 rEosMax = route.position() - 0.5*m_c_ServiceCylinderThickness - m_c_safetyGap;
404 rEosMin = (**bl).rMin() - eosTolerance( (**bl).type(), DetType::Endcap);
405 }
406 EOSZOffset = tracker.geoMgr()->pixelDiskEOSZOffset( (*bl)->number() );
407 }
408 else if (SupportName=="StdRoute")
409 {
410 rEosMin = (*bl)->rMax() + eosTolerance( (*bl)->type(), DetType::Endcap);
411 rEosMax = rEosMin + eosLength( (*bl)->type(), DetType::Endcap);
412 EOSZOffset = 0;
413 if (rEosMax > route.position() - 0.5*m_c_ServiceCylinderThickness) {
414 ATH_MSG_WARNING("not enough space for end of stave of endcap layer at Z = " << (**bl).zPos());
415 }
416 rEosMax = route.position() - 0.5*m_c_ServiceCylinderThickness - m_c_safetyGap;
417 if (rEosMax < rEosMin) {
418 ATH_MSG_WARNING("no space for routing of endcap layer at Z = " << (**bl).zPos());
419 }
420 }
421 else
422 {
423 ATH_MSG_ERROR("Specified support name (" << SupportName<< ") not recognised - EOS not created!");
424 return;
425 }
426
427 double halfEosThick = eosHalfThickness( (*bl)->type(), DetType::Endcap);
428 ServiceVolume* eosVol = new ServiceVolume( ServiceVolume::Disk, rEosMin, rEosMax,
429 (*bl)->zPos()-halfEosThick+ EOSZOffset,
430 (*bl)->zPos()+halfEosThick+ EOSZOffset,
431 (**bl).name() + "EOS");
432 eosVol->addLayer(*bl);
433 addVolume( eosVol);
434 eosVol->addEosServices(*bl); // add all the stave EOS stuff
435
436 // 2. Connect to route
437 double zMin, zMax;
438 if (route.volumes().empty()) {
439 zMin = (*bl)->zPos() + EOSZOffset;
440 if ( zMin - route.zMin() > m_c_EosTolerance) { // FIXME use specific tolerance
441 ServiceVolume* beg = new ServiceVolume( ServiceVolume::Cylinder,
444 route.zMin(), zMin - m_c_safetyGap,
445 nextVolumeName(route));
446 route.addVolume( beg); // beg has no services at this time
447 addVolume( beg);
448 }
449 }
450 else zMin = route.volumes().back()->zMax() + m_c_safetyGap;
451
452 // Assume no further elements to link on the route then find next potential link
453 // Make sure next one is on the same support tube, and on the same side (inside or outside)
454 zMax = route.zExit();
455 for (LayerContainer::const_iterator blnext = bl+1; blnext != blend; ++blnext)
456 {
457 if ( tracker.geoMgr()->pixelDiskServiceRoute((*blnext)->number()) == SupportName && isRoutedOutsideSupportTube(blnext, route) == bRoutedOutsideSupport )
458 {
459 zMax = std::min((**blnext).zPos() + EOSZOffset, route.zExit());
460 break;
461 }
462 }
463
464// LayerContainer::const_iterator blnext = bl+1;
465// if (blnext != blend) {
466// zMax = std::min((**blnext).zPos(), route.zExit());
467// }
468// else zMax = route.zExit();
469
470 bool reverse = false;
471 // if (route.zExit() < (**bl).zPos()) {
472 if (route.zExit() < zMin) {
473 // create a dedicated exit volume with zero length
474 ServiceVolume* exitVol = new ServiceVolume( ServiceVolume::Cylinder,
477 route.zExit(), route.zExit(),
478 route.name()+"ExitVol");
479 // connect the last volume to the exit
480 connect( route.volumes().back(), exitVol);
481 route.setExitVolume( exitVol);
482 zMin = max( route.zExit(), route.volumes().back()->zMax());
483 zMax = (**bl).zPos();
484 reverse = true;
485 }
486
487 ServiceVolume* newCyl = new ServiceVolume( ServiceVolume::Cylinder,
490 zMin, zMax, nextVolumeName(route));
491 newCyl->dump();
492 connect( eosVol, newCyl);
493 if (! reverse) {
494 if (!route.volumes().empty()) connect( route.volumes().back(), newCyl);
495 }
496 else {
497 // FIXME: the services of the new layer will not propagate thru all volumes
498 if (!route.volumes().empty()) connect( newCyl, route.volumes().back());
499 }
500 route.addVolume( newCyl);
501 addVolume( newCyl);
502
503}
#define ATH_MSG_ERROR(x)
#define max(a, b)
Definition cfImp.cxx:41
virtual double position() const
Definition HRoute.h:28
double zExit() const
Definition HRoute.h:26
virtual void addVolume(ServiceVolume *vol)
Definition HRoute.h:36
const VolumeContainer & volumes() const
Definition HRoute.h:34
std::string pixelDiskServiceRoute(int disk) const
void setExitVolume(ServiceVolume *vp)
Definition Route.h:50
bool isRoutedOutsideSupportTube(LayerContainer::const_iterator bl, HRoute &route)
Definition Routing2.cxx:290
@ Endcap
Definition DetType.h:14
void reverse(typename DataModel_detail::iterator< DVL > beg, typename DataModel_detail::iterator< DVL > end)
Specialization of reverse for DataVector/List.

◆ routeEndcapPixel()

void Routing2::routeEndcapPixel ( ServicesTracker & tracker)
private

Definition at line 242 of file Routing2.cxx.

243{
244
245// const LayerContainer& lc = tracker.endcapPixelLayers();
246// for (LayerContainer::const_iterator bl=lc.begin(); bl!=lc.end(); ++bl) {
247// routeEndcapLayer( bl, lc.end(), tracker, m_epHRoute);
248// }
249
250 const LayerContainer& lc = tracker.endcapPixelLayers();
251 bool bMSTI = tracker.geoMgr()->SupportTubeExists("MSTI");
252 bool bMSTM = tracker.geoMgr()->SupportTubeExists("MSTM");
253 bool bMSTO = tracker.geoMgr()->SupportTubeExists("MSTO");
254
255 for (LayerContainer::const_iterator bl=lc.begin(); bl!=lc.end(); ++bl)
256 {
257
258 if (bMSTI)
259 {
260 if (tracker.geoMgr()->pixelDiskServiceRoute( (*bl)->number() ) == "MSTI")
261 routeEndcapLayer( bl, lc.end(), tracker, m_MSTI_HRoute);
262 }
263
264 // MSTM can have service on inside or outside
265 if (bMSTM)
266 {
267 if (tracker.geoMgr()->pixelDiskServiceRoute( (*bl)->number() ) == "MSTM")
268 {
270 routeEndcapLayer( bl, lc.end(), tracker, m_MSTM_HRoute);
271 else
272 routeEndcapLayer( bl, lc.end(), tracker, m_MSTM_HRouteInner);
273 }
274 }
275
276 if (bMSTO)
277 {
278 if (tracker.geoMgr()->pixelDiskServiceRoute( (*bl)->number() ) == "MSTO")
279 routeEndcapLayer( bl, lc.end(), tracker, m_MSTO_HRoute);
280 }
281 }
282
283 if(!bMSTI&&!bMSTM&&!bMSTO)
284 for (LayerContainer::const_iterator bl=lc.begin(); bl!=lc.end(); ++bl)
285 routeEndcapLayer( bl, lc.end(), tracker, m_epHRoute);
286
287}
void routeEndcapLayer(LayerContainer::const_iterator bl, LayerContainer::const_iterator blend, ServicesTracker &tracker, HRoute &route)
Definition Routing2.cxx:349

◆ routeInnerBarrelPixel()

void Routing2::routeInnerBarrelPixel ( ServicesTracker & tracker)
private

Definition at line 295 of file Routing2.cxx.

296{
297 const LayerContainer& bls = tracker.barrelPixelLayers();
298 for (LayerContainer::const_iterator bl=bls.begin(); bl!=bls.begin()+m_c_nInnerPixelLayers; ++bl) {
299 routeBarrelLayer( bl, bls.begin()+m_c_nInnerPixelLayers, tracker, m_istVRoute);
300 }
301}

◆ routeOuterBarrelPixel()

void Routing2::routeOuterBarrelPixel ( ServicesTracker & tracker)
private

Definition at line 225 of file Routing2.cxx.

226{
227
228 const LayerContainer& bls = tracker.barrelPixelLayers();
229 for (LayerContainer::const_iterator bl=bls.begin()+m_c_nInnerPixelLayers; bl!=bls.end(); ++bl) {
230 routeBarrelLayer( bl, bls.end(), tracker, m_bpVRoute);
231 }
232}

◆ setLevel()

void AthMessaging::setLevel ( MSG::Level lvl)
inherited

Change the current logging level.

Use this rather than msg().setLevel() for proper operation with MT.

Definition at line 28 of file AthMessaging.cxx.

29{
30 m_lvl = lvl;
31}

◆ volumes()

const std::vector< ServiceVolume * > & Routing2::volumes ( ) const
inline

Definition at line 24 of file Routing2.h.

24{return m_volumes;}

Member Data Documentation

◆ ATLAS_THREAD_SAFE

std::atomic_flag m_initialized AthMessaging::ATLAS_THREAD_SAFE = ATOMIC_FLAG_INIT
mutableprivateinherited

Messaging initialized (initMessaging)

Definition at line 141 of file AthMessaging.h.

◆ m_bpHRoute

HRoute Routing2::m_bpHRoute
private

Definition at line 49 of file Routing2.h.

◆ m_bpVRoute

VRoute Routing2::m_bpVRoute
private

Definition at line 48 of file Routing2.h.

◆ m_bsVRoute

VRoute Routing2::m_bsVRoute
private

Definition at line 55 of file Routing2.h.

◆ m_c_bpEosLength

double Routing2::m_c_bpEosLength
private

Definition at line 34 of file Routing2.h.

◆ m_c_bsEosLength

double Routing2::m_c_bsEosLength
private

Definition at line 36 of file Routing2.h.

◆ m_c_EosTolerance

double Routing2::m_c_EosTolerance
private

Definition at line 39 of file Routing2.h.

◆ m_c_EosTolerance2

double Routing2::m_c_EosTolerance2
private

Definition at line 41 of file Routing2.h.

◆ m_c_epEosLength

double Routing2::m_c_epEosLength
private

Definition at line 35 of file Routing2.h.

◆ m_c_halfEosThick

double Routing2::m_c_halfEosThick
private

Definition at line 40 of file Routing2.h.

◆ m_c_LayerLengthTolerance

double Routing2::m_c_LayerLengthTolerance
private

Definition at line 44 of file Routing2.h.

◆ m_c_nInnerPixelLayers

int Routing2::m_c_nInnerPixelLayers
private

Definition at line 32 of file Routing2.h.

◆ m_c_safetyGap

double Routing2::m_c_safetyGap
private

Definition at line 37 of file Routing2.h.

◆ m_c_ServiceCylinderThickness

double Routing2::m_c_ServiceCylinderThickness
private

Definition at line 43 of file Routing2.h.

◆ m_c_ServiceDiskThickness

double Routing2::m_c_ServiceDiskThickness
private

Definition at line 42 of file Routing2.h.

◆ m_epHRoute

HRoute Routing2::m_epHRoute
private

Definition at line 50 of file Routing2.h.

◆ m_imsg

std::atomic<IMessageSvc*> AthMessaging::m_imsg { nullptr }
mutableprivateinherited

MessageSvc pointer.

Definition at line 135 of file AthMessaging.h.

135{ nullptr };

◆ m_ISTexists

bool Routing2::m_ISTexists
private

Definition at line 30 of file Routing2.h.

◆ m_istHRoute

HRoute Routing2::m_istHRoute
private

Definition at line 57 of file Routing2.h.

◆ m_ISTouter_HRoute

HRoute Routing2::m_ISTouter_HRoute
private

Definition at line 59 of file Routing2.h.

◆ m_istVRoute

VRoute Routing2::m_istVRoute
private

Definition at line 56 of file Routing2.h.

◆ m_lvl

std::atomic<MSG::Level> AthMessaging::m_lvl { MSG::NIL }
mutableprivateinherited

Current logging level.

Definition at line 138 of file AthMessaging.h.

138{ MSG::NIL };

◆ m_msg_tls

boost::thread_specific_ptr<MsgStream> AthMessaging::m_msg_tls
mutableprivateinherited

MsgStream instance (a std::cout like with print-out levels)

Definition at line 132 of file AthMessaging.h.

◆ m_MSTI_HRoute

HRoute Routing2::m_MSTI_HRoute
private

Definition at line 65 of file Routing2.h.

◆ m_MSTinside_HRoute

HRoute Routing2::m_MSTinside_HRoute
private

Definition at line 60 of file Routing2.h.

◆ m_MSTM_HRoute

HRoute Routing2::m_MSTM_HRoute
private

Definition at line 63 of file Routing2.h.

◆ m_MSTM_HRouteInner

HRoute Routing2::m_MSTM_HRouteInner
private

Definition at line 64 of file Routing2.h.

◆ m_MSTO_HRoute

HRoute Routing2::m_MSTO_HRoute
private

Definition at line 62 of file Routing2.h.

◆ m_nm

std::string AthMessaging::m_nm
privateinherited

Message source name.

Definition at line 129 of file AthMessaging.h.

◆ m_pixelAlongBarrelStrip

bool Routing2::m_pixelAlongBarrelStrip
private

Definition at line 29 of file Routing2.h.

◆ m_pixelH2Route

HRoute Routing2::m_pixelH2Route
private

Definition at line 53 of file Routing2.h.

◆ m_pixelV2Route

VRoute Routing2::m_pixelV2Route
private

Definition at line 52 of file Routing2.h.

◆ m_routePixelBarrelOnPST

bool Routing2::m_routePixelBarrelOnPST
private

Definition at line 28 of file Routing2.h.

◆ m_volumes

std::vector<ServiceVolume*> Routing2::m_volumes
private

Definition at line 46 of file Routing2.h.


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