ATLAS Offline Software
Public Types | Public Member Functions | Private Member Functions | Private Attributes | List of all members
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. More...
 
 ~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. More...
 
MsgStream & msg () const
 The standard message stream. More...
 
MsgStream & msg (const MSG::Level lvl) const
 The standard message stream. More...
 
void setLevel (MSG::Level lvl)
 Change the current logging level. More...
 

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. More...
 

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. More...
 
boost::thread_specific_ptr< MsgStream > m_msg_tls
 MsgStream instance (a std::cout like with print-out levels) More...
 
std::atomic< IMessageSvc * > m_imsg { nullptr }
 MessageSvc pointer. More...
 
std::atomic< MSG::Level > m_lvl { MSG::NIL }
 Current logging level. More...
 
std::atomic_flag m_initialized ATLAS_THREAD_SAFE = ATOMIC_FLAG_INIT
 Messaging initialized (initMessaging) More...
 

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 15 of file ServicesTracker.cxx.

15  :
16  AthMessaging("ServicesTracker"),
17  m_geoMgr(nullptr)
18 {
19  m_barrelLayers.clear();
20  m_barrelPixelLayers.clear();
21  m_endcapPixelLayers.clear();
22  m_barrelStripLayers.clear();
23  m_endcapStripLayers.clear();
24 }

◆ ~ServicesTracker()

ServicesTracker::~ServicesTracker ( )

Definition at line 26 of file ServicesTracker.cxx.

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

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 116 of file ServicesTracker.cxx.

117 {
118  string name;
119  if (vol.name().find("Pixel") != string::npos) {
120  name = "pix::PixelEOS";
121  }
122  else {
123  name = "pix::StripEOS";
124  }
125 
126  const ServicesLayer* layer = vol.layers().front();
127 
128  ServiceMaterial::Entry eos( name, layer->nStaves(), 0);
130  result.emplace_back( name, entries);
131  // msg(MSG::INFO) << "Added EOS material to volume " << vol.name() << endmsg;
132 }

◆ 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 65 of file ServicesTracker.cxx.

66 {
67  Routing2 routing;
68  routing.createRoutingVolumes(*this);
69 }

◆ 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 37 of file ServicesTracker.cxx.

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

◆ 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 51 of file ServicesTracker.cxx.

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

◆ 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 72 of file ServicesTracker.cxx.

73 {
74  msg(MSG::INFO) << "ServicesTracker::finaliseServices called for " << m_volumes.size() << " volumes" << endmsg;
75 
76  ComputeStaveServices staveComputer;
77  ConvertStaveServices staveConverter;
78 
79  std::map<const ServicesLayer*, ServiceMaterial> layerMaterial; // cache the layer services
80 
81  using VolumeIter = std::vector<ServiceVolume *>::iterator;
82  for (VolumeIter iv=m_volumes.begin(); iv!=m_volumes.end(); ++iv) {
83  std::vector<ServiceMaterial> result; // = (**iv).materials(); // preserve already present mat. (EOS)
84  if ((**iv).isEOS()) addEosMaterial(**iv, result);
85 
86  ServiceVolume::LayerContainer layers = (**iv).layers();
87  for (ServiceVolume::LayerContainer::const_iterator il=layers.begin(); il!=layers.end(); ++il) {
88  const ServicesLayer& layer( **il);
89  ServiceMaterial layerMat;
90 
92  if (iMat != layerMaterial.end()) layerMat = iMat->second;
93  else {
94  StaveServices sserv = staveComputer.compute( layer.type(), layer.part(), layer.number(),
95  layer.modulesPerStave(), layer.chipsPerModule(), msg());
96  layerMat = staveConverter.convertStaveServices( sserv);
97 
98  layerMat.multiply( layer.nStaves()); // scale from one stave to full layer
99 
100  // add cooling, with possibility for manifilding
101  staveConverter.addCooling( layer.type(), layer.part(), layer.number(), layer.nStaves(), layerMat);
102 
103  if(msgLvl(MSG::DEBUG)){
104  msg(MSG::DEBUG) <<"Dumping services for layer " << layer.number()<< endmsg;
105  layerMat.dump(cout);
106  }
107  layerMaterial[*il] = layerMat;
108  }
109  result.push_back( layerMat);
110  }
111 
112  (**iv).setMaterials( result);
113  }
114 }

◆ 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  m_lvl = m_imsg ?
43  static_cast<MSG::Level>( m_imsg.load()->outputLevel(m_nm) ) :
44  MSG::INFO;
45 }

◆ 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 164 of file AthMessaging.h.

165 {
166  MsgStream* ms = m_msg_tls.get();
167  if (!ms) {
168  if (!m_initialized.test_and_set()) initMessaging();
169  ms = new MsgStream(m_imsg,m_nm);
170  m_msg_tls.reset( ms );
171  }
172 
173  ms->setLevel (m_lvl);
174  return *ms;
175 }

◆ 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 179 of file AthMessaging.h.

180 { 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_initialized.test_and_set()) initMessaging();
154  if (m_lvl <= lvl) {
155  msg() << lvl;
156  return true;
157  } else {
158  return false;
159  }
160 }

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

56 {m_geoMgr = mgr;}

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

◆ m_lvl

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

Current logging level.

Definition at line 138 of file AthMessaging.h.

◆ 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:
ServicesTracker::m_barrelLayers
LayerContainer m_barrelLayers
Definition: ServicesTracker.h:60
xAOD::iterator
JetConstituentVector::iterator iterator
Definition: JetConstituentVector.cxx:68
AthMessaging::m_lvl
std::atomic< MSG::Level > m_lvl
Current logging level.
Definition: AthMessaging.h:138
PlotCalibFromCool.il
il
Definition: PlotCalibFromCool.py:381
ComputeStaveServices
Definition: ComputeStaveServices.h:11
ConvertStaveServices::addCooling
void addCooling(DetType::Type type, DetType::Part part, int layerNumber, int nStaves, ServiceMaterial &mat)
Definition: ConvertStaveServices.cxx:50
get_generator_info.result
result
Definition: get_generator_info.py:21
hotSpotInTAG.suffix
string suffix
Definition: hotSpotInTAG.py:186
DetType::Endcap
@ Endcap
Definition: DetType.h:14
ServicesTracker::m_geoMgr
const InDetServMatGeometryManager * m_geoMgr
Definition: ServicesTracker.h:68
module_driven_slicing.layers
layers
Definition: module_driven_slicing.py:114
ServicesTracker::m_endcapPixelLayers
LayerContainer m_endcapPixelLayers
Definition: ServicesTracker.h:62
ServicesTracker::m_barrelStripLayers
LayerContainer m_barrelStripLayers
Definition: ServicesTracker.h:63
StaveServices
Class storing all the services of a stave (or a petal, etc...) classifying them by function and by nu...
Definition: StaveServices.h:15
ServicesLayer
Definition: ServicesLayer.h:13
Routing2::createRoutingVolumes
void createRoutingVolumes(ServicesTracker &tracker)
Definition: Routing2.cxx:36
ServiceMaterial::multiply
void multiply(int factor)
Definition: ServiceMaterial.h:57
AthMessaging::m_imsg
std::atomic< IMessageSvc * > m_imsg
MessageSvc pointer.
Definition: AthMessaging.h:135
python.SystemOfUnits.ms
int ms
Definition: SystemOfUnits.py:132
Athena::getMessageSvc
IMessageSvc * getMessageSvc(bool quiet=false)
Definition: getMessageSvc.cxx:20
DetType::Barrel
@ Barrel
Definition: DetType.h:14
ServicesTracker::m_endcapStripLayers
LayerContainer m_endcapStripLayers
Definition: ServicesTracker.h:64
BchCleanup.mgr
mgr
Definition: BchCleanup.py:294
ServiceVolume::LayerContainer
std::vector< const ServicesLayer * > LayerContainer
Definition: InDetServMatGeoModel/src/ServiceVolume.h:19
AthMessaging::AthMessaging
AthMessaging()
Default constructor:
ConvertStaveServices::convertStaveServices
ServiceMaterial convertStaveServices(const StaveServices &stServ) const
Definition: ConvertStaveServices.cxx:11
TrigConf::MSGTC::Level
Level
Definition: Trigger/TrigConfiguration/TrigConfBase/TrigConfBase/MsgStream.h:21
AthMessaging::msgLvl
bool msgLvl(const MSG::Level lvl) const
Test the output level.
Definition: AthMessaging.h:151
DetType::Pixel
@ Pixel
Definition: DetType.h:13
ServiceMaterial::dump
void dump(std::ostream &os) const
Definition: ServiceMaterial.cxx:8
ComputeStaveServices::compute
StaveServices compute(DetType::Type, DetType::Part, int layerNumber, int nModulesPerStave, int nChipsPerModule, MsgStream &msg) const
Definition: ComputeStaveServices.cxx:10
ConvertStaveServices
Definition: ConvertStaveServices.h:14
endmsg
#define endmsg
Definition: AnalysisConfig_Ntuple.cxx:63
ServicesTracker::m_barrelPixelLayers
LayerContainer m_barrelPixelLayers
Definition: ServicesTracker.h:61
TRT::Hit::layer
@ layer
Definition: HitInfo.h:79
AthMessaging::msg
MsgStream & msg() const
The standard message stream.
Definition: AthMessaging.h:164
Routing2
Definition: Routing2.h:15
ServiceMaterial::EntryContainer
std::vector< Entry > EntryContainer
Definition: ServiceMaterial.h:31
ServiceMaterial
Definition: ServiceMaterial.h:12
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:221
ParticleGun_SamplingFraction.radius
radius
Definition: ParticleGun_SamplingFraction.py:96
ServiceVolume::layers
const LayerContainer & layers() const
Definition: InDetServMatGeoModel/src/ServiceVolume.h:69
python.CaloScaleNoiseConfig.type
type
Definition: CaloScaleNoiseConfig.py:78
AthMessaging::m_nm
std::string m_nm
Message source name.
Definition: AthMessaging.h:129
DEBUG
#define DEBUG
Definition: page_access.h:11
ServicesTracker::m_volumes
std::vector< ServiceVolume * > m_volumes
Definition: ServicesTracker.h:66
entries
double entries
Definition: listroot.cxx:49
ServiceVolume::name
const std::string & name() const
Definition: InDetServMatGeoModel/src/ServiceVolume.h:60
AthMessaging::initMessaging
void initMessaging() const
Initialize our message level and MessageSvc.
Definition: AthMessaging.cxx:39
AthMessaging::m_msg_tls
boost::thread_specific_ptr< MsgStream > m_msg_tls
MsgStream instance (a std::cout like with print-out levels)
Definition: AthMessaging.h:132
ServicesTracker::addEosMaterial
void addEosMaterial(const ServiceVolume &vol, std::vector< ServiceMaterial > &result)
Definition: ServicesTracker.cxx:116
ServiceMaterial::Entry
Structure holding one service material.
Definition: ServiceMaterial.h:21