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

#include <ServicesTracker.h>

Inheritance diagram for ServicesTracker:
Collaboration diagram for ServicesTracker:

Public Types

typedef std::vector< ServicesLayer * > LayerContainer

Public Member Functions

 ServicesTracker ()
 Construct an empty tracker, to be filled by Builder.
 ~ServicesTracker ()
void computeServicesPerLayer ()
void finaliseServices ()
const LayerContainerbarrelLayers () const
LayerContainerbarrelLayers ()
LayerContainerbarrelPixelLayers ()
LayerContainerendcapPixelLayers ()
LayerContainerbarrelStripLayers ()
LayerContainerendcapStripLayers ()
const std::vector< ServiceVolume * > & serviceVolumes () const
void setServiceVolumes (const std::vector< ServiceVolume * > &vc)
void constructBarrelLayer (double radius, double zHalfLength, DetType::Type type, int num, int nstaves, const std::string &suffix, int nModulesPerStave, int nChipsPerModule)
void constructEndcapLayer (double zpos, double rmin, double rmax, DetType::Type type, int num, int nstaves, const std::string &suffix, int nModulesPerStave, int nChipsPerModule)
const InDetServMatGeometryManagergeoMgr () const
void setGeoMgr (const InDetServMatGeometryManager *mgr)
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

void add (std::map< std::string, double > &res, const std::string &name, double len)
void addEosMaterial (const ServiceVolume &vol, std::vector< ServiceMaterial > &result)
void initMessaging () const
 Initialize our message level and MessageSvc.

Private Attributes

LayerContainer m_barrelLayers
LayerContainer m_barrelPixelLayers
LayerContainer m_endcapPixelLayers
LayerContainer m_barrelStripLayers
LayerContainer m_endcapStripLayers
std::vector< ServiceVolume * > m_volumes
const InDetServMatGeometryManagerm_geoMgr
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 19 of file ServicesTracker.h.

Member Typedef Documentation

◆ LayerContainer

Definition at line 26 of file ServicesTracker.h.

Constructor & Destructor Documentation

◆ ServicesTracker()

ServicesTracker::ServicesTracker ( )

Construct an empty tracker, to be filled by Builder.

Definition at line 14 of file ServicesTracker.cxx.

14 :
15 AthMessaging("ServicesTracker"),
16 m_geoMgr(nullptr)
17{
18 m_barrelLayers.clear();
19 m_barrelPixelLayers.clear();
20 m_endcapPixelLayers.clear();
21 m_barrelStripLayers.clear();
22 m_endcapStripLayers.clear();
23}
AthMessaging()
Default constructor:
LayerContainer m_barrelStripLayers
LayerContainer m_barrelLayers
LayerContainer m_endcapPixelLayers
LayerContainer m_barrelPixelLayers
const InDetServMatGeometryManager * m_geoMgr
LayerContainer m_endcapStripLayers

◆ ~ServicesTracker()

ServicesTracker::~ServicesTracker ( )

Definition at line 25 of file ServicesTracker.cxx.

26{
27
28 for (std::vector<ServiceVolume *>::iterator iter = m_volumes.begin(); iter != m_volumes.end(); ++iter) delete *iter;
29
30 for (LayerContainer::const_iterator iter=m_barrelLayers.begin(); iter!=m_barrelLayers.end(); ++iter) delete *iter;
31 for (LayerContainer::const_iterator iter=m_endcapPixelLayers.begin(); iter!=m_endcapPixelLayers.end(); ++iter) delete *iter;
32 for (LayerContainer::const_iterator iter=m_endcapStripLayers.begin(); iter!=m_endcapStripLayers.end(); ++iter) delete *iter;
33
34}
std::vector< ServiceVolume * > m_volumes

Member Function Documentation

◆ add()

void ServicesTracker::add ( std::map< std::string, double > & res,
const std::string & name,
double len )
private

◆ addEosMaterial()

void ServicesTracker::addEosMaterial ( const ServiceVolume & vol,
std::vector< ServiceMaterial > & result )
private

Definition at line 115 of file ServicesTracker.cxx.

116{
117 string name;
118 if (vol.name().find("Pixel") != string::npos) {
119 name = "pix::PixelEOS";
120 }
121 else {
122 name = "pix::StripEOS";
123 }
124
125 const ServicesLayer* layer = vol.layers().front();
126
127 ServiceMaterial::Entry eos( name, layer->nStaves(), 0);
129 result.emplace_back( name, entries);
130 // msg(MSG::INFO) << "Added EOS material to volume " << vol.name() << endmsg;
131}
std::vector< Entry > EntryContainer
const LayerContainer & layers() const
const std::string & name() const
double entries
Definition listroot.cxx:49
@ layer
Definition HitInfo.h:79

◆ barrelLayers() [1/2]

LayerContainer & ServicesTracker::barrelLayers ( )
inline

Definition at line 34 of file ServicesTracker.h.

34{return m_barrelLayers;}

◆ barrelLayers() [2/2]

const LayerContainer & ServicesTracker::barrelLayers ( ) const
inline

Definition at line 33 of file ServicesTracker.h.

33{return m_barrelLayers;}

◆ barrelPixelLayers()

LayerContainer & ServicesTracker::barrelPixelLayers ( )
inline

Definition at line 36 of file ServicesTracker.h.

36{return m_barrelPixelLayers;}

◆ barrelStripLayers()

LayerContainer & ServicesTracker::barrelStripLayers ( )
inline

Definition at line 38 of file ServicesTracker.h.

38{return m_barrelStripLayers;}

◆ computeServicesPerLayer()

void ServicesTracker::computeServicesPerLayer ( )

Definition at line 64 of file ServicesTracker.cxx.

65{
66 Routing2 routing;
67 routing.createRoutingVolumes(*this);
68}
void createRoutingVolumes(ServicesTracker &tracker)
Definition Routing2.cxx:36

◆ constructBarrelLayer()

void ServicesTracker::constructBarrelLayer ( double radius,
double zHalfLength,
DetType::Type type,
int num,
int nstaves,
const std::string & suffix,
int nModulesPerStave,
int nChipsPerModule )

Definition at line 36 of file ServicesTracker.cxx.

40{
41 ServicesLayer* nl = new ServicesLayer( radius, zHalfLength, nstaves,
42 type, DetType::Barrel, layerNum, suffix,
43 nModulesPerStave, nChipsPerModule);
44
45 m_barrelLayers.push_back(nl);
46 if (type == DetType::Pixel) m_barrelPixelLayers.push_back(nl);
47 else m_barrelStripLayers.push_back(nl);
48}
@ Pixel
Definition DetType.h:13
@ Barrel
Definition DetType.h:14

◆ constructEndcapLayer()

void ServicesTracker::constructEndcapLayer ( double zpos,
double rmin,
double rmax,
DetType::Type type,
int num,
int nstaves,
const std::string & suffix,
int nModulesPerStave,
int nChipsPerModule )

Definition at line 50 of file ServicesTracker.cxx.

54{
55 ServicesLayer* nl = new ServicesLayer( zpos, rmin, rmax, nstaves,
56 type, DetType::Endcap, layerNum,
57 suffix,
58 nModulesPerStave, nChipsPerModule);
59
60 if (type == DetType::Pixel) m_endcapPixelLayers.push_back(nl);
61 else m_endcapStripLayers.push_back(nl);
62}
@ Endcap
Definition DetType.h:14

◆ endcapPixelLayers()

LayerContainer & ServicesTracker::endcapPixelLayers ( )
inline

Definition at line 37 of file ServicesTracker.h.

37{return m_endcapPixelLayers;}

◆ endcapStripLayers()

LayerContainer & ServicesTracker::endcapStripLayers ( )
inline

Definition at line 39 of file ServicesTracker.h.

39{return m_endcapStripLayers;}

◆ finaliseServices()

void ServicesTracker::finaliseServices ( )

Definition at line 71 of file ServicesTracker.cxx.

72{
73 msg(MSG::INFO) << "ServicesTracker::finaliseServices called for " << m_volumes.size() << " volumes" << endmsg;
74
75 ComputeStaveServices staveComputer;
76 ConvertStaveServices staveConverter;
77
78 std::map<const ServicesLayer*, ServiceMaterial> layerMaterial; // cache the layer services
79
80 using VolumeIter = std::vector<ServiceVolume *>::iterator;
81 for (VolumeIter iv=m_volumes.begin(); iv!=m_volumes.end(); ++iv) {
82 std::vector<ServiceMaterial> result; // = (**iv).materials(); // preserve already present mat. (EOS)
83 if ((**iv).isEOS()) addEosMaterial(**iv, result);
84
85 ServiceVolume::LayerContainer layers = (**iv).layers();
86 for (ServiceVolume::LayerContainer::const_iterator il=layers.begin(); il!=layers.end(); ++il) {
87 const ServicesLayer& layer( **il);
88 ServiceMaterial layerMat;
89
90 std::map<const ServicesLayer*, ServiceMaterial>::iterator iMat = layerMaterial.find(*il);
91 if (iMat != layerMaterial.end()) layerMat = iMat->second;
92 else {
93 StaveServices sserv = staveComputer.compute( layer.type(), layer.part(), layer.number(),
94 layer.modulesPerStave(), layer.chipsPerModule(), msg());
95 layerMat = staveConverter.convertStaveServices( sserv);
96
97 layerMat.multiply( layer.nStaves()); // scale from one stave to full layer
98
99 // add cooling, with possibility for manifilding
100 staveConverter.addCooling( layer.type(), layer.part(), layer.number(), layer.nStaves(), layerMat);
101
102 if(msgLvl(MSG::DEBUG)){
103 msg(MSG::DEBUG) <<"Dumping services for layer " << layer.number()<< endmsg;
104 layerMat.dump(cout);
105 }
106 layerMaterial[*il] = layerMat;
107 }
108 result.push_back( std::move(layerMat));
109 }
110
111 (**iv).setMaterials( result);
112 }
113}
#define endmsg
MsgStream & msg() const
The standard message stream.
bool msgLvl(const MSG::Level lvl) const
Test the output level.
StaveServices compute(DetType::Type, DetType::Part, int layerNumber, int nModulesPerStave, int nChipsPerModule, MsgStream &msg) const
ServiceMaterial convertStaveServices(const StaveServices &stServ) const
void addCooling(DetType::Type type, DetType::Part part, int layerNumber, int nStaves, ServiceMaterial &mat)
void dump(std::ostream &os) const
void multiply(int factor)
std::vector< const ServicesLayer * > LayerContainer
void addEosMaterial(const ServiceVolume &vol, std::vector< ServiceMaterial > &result)
layers(flags, cells_name, *args, **kw)
Here we define wrapper functions to set up all of the standard corrections.

◆ geoMgr()

const InDetServMatGeometryManager * ServicesTracker::geoMgr ( ) const
inline

Definition at line 54 of file ServicesTracker.h.

54{return m_geoMgr;}

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

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

◆ serviceVolumes()

const std::vector< ServiceVolume * > & ServicesTracker::serviceVolumes ( ) const
inline

Definition at line 41 of file ServicesTracker.h.

41{return m_volumes;}

◆ setGeoMgr()

void ServicesTracker::setGeoMgr ( const InDetServMatGeometryManager * mgr)
inline

Definition at line 56 of file ServicesTracker.h.

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

◆ setServiceVolumes()

void ServicesTracker::setServiceVolumes ( const std::vector< ServiceVolume * > & vc)
inline

Definition at line 44 of file ServicesTracker.h.

44{m_volumes=vc;}

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_barrelLayers

LayerContainer ServicesTracker::m_barrelLayers
private

Definition at line 60 of file ServicesTracker.h.

◆ m_barrelPixelLayers

LayerContainer ServicesTracker::m_barrelPixelLayers
private

Definition at line 61 of file ServicesTracker.h.

◆ m_barrelStripLayers

LayerContainer ServicesTracker::m_barrelStripLayers
private

Definition at line 63 of file ServicesTracker.h.

◆ m_endcapPixelLayers

LayerContainer ServicesTracker::m_endcapPixelLayers
private

Definition at line 62 of file ServicesTracker.h.

◆ m_endcapStripLayers

LayerContainer ServicesTracker::m_endcapStripLayers
private

Definition at line 64 of file ServicesTracker.h.

◆ m_geoMgr

const InDetServMatGeometryManager* ServicesTracker::m_geoMgr
private

Definition at line 68 of file ServicesTracker.h.

◆ m_imsg

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

MessageSvc pointer.

Definition at line 135 of file AthMessaging.h.

135{ nullptr };

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

std::string AthMessaging::m_nm
privateinherited

Message source name.

Definition at line 129 of file AthMessaging.h.

◆ m_volumes

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

Definition at line 66 of file ServicesTracker.h.


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