ATLAS Offline Software
InDetServMatGeoModel/src/ServiceVolume.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 #ifndef INDETSERVMATGEOMODEL_SERVICEVOLUME_H
6 #define INDETSERVMATGEOMODEL_SERVICEVOLUME_H
7 
8 #include "ServiceMaterial.h"
9 #include <vector>
10 #include <string>
11 
12 class ServicesLayer;
13 
15 public:
16 
17  enum Shape {Cylinder, Disk};
18 
19  typedef std::vector<const ServicesLayer*> LayerContainer;
20 
21  ServiceVolume( Shape sh, double rmin, double rmax, double zmin, double zmax, const std::string& name) :
22  m_shape(sh), m_rMin( rmin), m_rMax(rmax), m_zMin(zmin), m_zMax(zmax), m_name(name),
23  m_layers(), m_previous(0), m_next(0) {}
24 
26  void addLayer( const ServicesLayer* l) {
27  m_layers.push_back(l);
28  }
29 
30  void addLayers( const LayerContainer& lc) {
31  m_layers.insert( m_layers.end(), lc.begin(), lc.end());
32  }
33 
34  void addEosServices( const ServicesLayer* l);
35 
36  Shape shape() const {return m_shape;}
37 
38  double zPos() const {return 0.5*(m_zMin+m_zMax);}
39 
40  double rMin() const {return m_rMin;}
41 
42  double rMax() const {return m_rMax;}
43 
44  double zMin() const {return m_zMin;}
45 
46  double zMax() const {return m_zMax;}
47 
48  double radius() const {return 0.5*(rMin() + rMax());}
49 
50  double position() const {
51  if (shape() == Cylinder) return zPos();
52  else return radius();
53  }
54 
55  double length() const {
56  if (shape() == Cylinder) return zMax()-zMin();
57  else return rMax() - rMin();
58  }
59 
60  const std::string& name() const {return m_name;}
61 
62  bool contains( double x) const {
63  // one-dimensional check, radial for disks and along Z for cylinders)
64  double eps = 0.0001; // hard-wired tolerance
65  if (shape()==Disk) return (x > rMin()-eps && x < rMax()+eps);
66  else return (x > zMin()-eps && x < zMax()+eps);
67  }
68 
69  const LayerContainer& layers() const {return m_layers;}
70 
71  ServiceVolume* next() {return m_next;}
72 
73  void addPrevious( ServiceVolume* prev) { m_previous.push_back(prev);}
74 
76 
77  void dump( bool dumpMaterial = true) const;
78 
79  const std::vector<ServiceMaterial>& materials() const {return m_materials;}
80 
81  void setMaterials( const std::vector<ServiceMaterial>& mat) {m_materials = mat;}
82 
83  void addMaterial( const ServiceMaterial& mat) {m_materials.push_back( mat);}
84 
85  bool isEOS() const {
86  if (m_name.size() < 4) return false;
87  if (m_name.substr(m_name.size()-3) == "EOS") return true;
88  return false;
89  }
90 
91 private:
92 
94  double m_rMin;
95  double m_rMax;
96  double m_zMin;
97  double m_zMax;
98  std::string m_name;
99 
100  LayerContainer m_layers; // All layers the services of which are routed through this volume
101 
102  std::vector<ServiceVolume*> m_previous;
104 
105  std::vector<ServiceMaterial> m_materials;
106 
107 };
108 
109 #endif
ServiceVolume
Definition: InDetServMatGeoModel/src/ServiceVolume.h:14
ServiceVolume::setMaterials
void setMaterials(const std::vector< ServiceMaterial > &mat)
Definition: InDetServMatGeoModel/src/ServiceVolume.h:81
ServiceVolume::rMax
double rMax() const
Definition: InDetServMatGeoModel/src/ServiceVolume.h:42
ServiceVolume::m_rMin
double m_rMin
Definition: InDetServMatGeoModel/src/ServiceVolume.h:94
ServiceVolume::rMin
double rMin() const
Definition: InDetServMatGeoModel/src/ServiceVolume.h:40
PixelAthClusterMonAlgCfg.zmin
zmin
Definition: PixelAthClusterMonAlgCfg.py:169
ServiceVolume::addEosServices
void addEosServices(const ServicesLayer *l)
Definition: InDetServMatGeoModel/src/ServiceVolume.cxx:35
mat
GeoMaterial * mat
Definition: LArDetectorConstructionTBEC.cxx:55
ServiceVolume::contains
bool contains(double x) const
Definition: InDetServMatGeoModel/src/ServiceVolume.h:62
ServicesLayer
Definition: ServicesLayer.h:13
ServiceVolume::isEOS
bool isEOS() const
Definition: InDetServMatGeoModel/src/ServiceVolume.h:85
UploadAMITag.l
list l
Definition: UploadAMITag.larcaf.py:158
ServiceVolume::m_next
ServiceVolume * m_next
Definition: InDetServMatGeoModel/src/ServiceVolume.h:103
python.LumiCalcHtml.lc
lc
Definition: LumiCalcHtml.py:579
ServiceVolume::length
double length() const
Definition: InDetServMatGeoModel/src/ServiceVolume.h:55
x
#define x
ServiceVolume::m_zMax
double m_zMax
Definition: InDetServMatGeoModel/src/ServiceVolume.h:97
ServiceVolume::Cylinder
@ Cylinder
Definition: InDetServMatGeoModel/src/ServiceVolume.h:17
ServiceVolume::zMin
double zMin() const
Definition: InDetServMatGeoModel/src/ServiceVolume.h:44
ServiceVolume::LayerContainer
std::vector< const ServicesLayer * > LayerContainer
Definition: InDetServMatGeoModel/src/ServiceVolume.h:19
ServiceVolume::position
double position() const
Definition: InDetServMatGeoModel/src/ServiceVolume.h:50
ServiceVolume::setNext
void setNext(ServiceVolume *next)
Definition: InDetServMatGeoModel/src/ServiceVolume.h:75
ServiceMaterial.h
RCU::Shell
Definition: ShellExec.cxx:28
ServiceVolume::addPrevious
void addPrevious(ServiceVolume *prev)
Definition: InDetServMatGeoModel/src/ServiceVolume.h:73
ServiceVolume::ServiceVolume
ServiceVolume(Shape sh, double rmin, double rmax, double zmin, double zmax, const std::string &name)
Definition: InDetServMatGeoModel/src/ServiceVolume.h:21
PixelAthClusterMonAlgCfg.zmax
zmax
Definition: PixelAthClusterMonAlgCfg.py:169
ServiceVolume::m_rMax
double m_rMax
Definition: InDetServMatGeoModel/src/ServiceVolume.h:95
ServiceVolume::radius
double radius() const
Definition: InDetServMatGeoModel/src/ServiceVolume.h:48
ServiceVolume::zPos
double zPos() const
Definition: InDetServMatGeoModel/src/ServiceVolume.h:38
ServiceVolume::addLayer
void addLayer(const ServicesLayer *l)
Add a layer the services of which are routed through this volume.
Definition: InDetServMatGeoModel/src/ServiceVolume.h:26
ServiceVolume::materials
const std::vector< ServiceMaterial > & materials() const
Definition: InDetServMatGeoModel/src/ServiceVolume.h:79
ServiceVolume::Disk
@ Disk
Definition: InDetServMatGeoModel/src/ServiceVolume.h:17
ServiceMaterial
Definition: ServiceMaterial.h:12
ServiceVolume::zMax
double zMax() const
Definition: InDetServMatGeoModel/src/ServiceVolume.h:46
ServiceVolume::m_previous
std::vector< ServiceVolume * > m_previous
Definition: InDetServMatGeoModel/src/ServiceVolume.h:102
ServiceVolume::Shape
Shape
Definition: InDetServMatGeoModel/src/ServiceVolume.h:17
ServiceVolume::m_zMin
double m_zMin
Definition: InDetServMatGeoModel/src/ServiceVolume.h:96
ServiceVolume::layers
const LayerContainer & layers() const
Definition: InDetServMatGeoModel/src/ServiceVolume.h:69
ServiceVolume::m_layers
LayerContainer m_layers
Definition: InDetServMatGeoModel/src/ServiceVolume.h:100
ServiceVolume::m_shape
Shape m_shape
Definition: InDetServMatGeoModel/src/ServiceVolume.h:93
ServiceVolume::m_materials
std::vector< ServiceMaterial > m_materials
Definition: InDetServMatGeoModel/src/ServiceVolume.h:105
ServiceVolume::name
const std::string & name() const
Definition: InDetServMatGeoModel/src/ServiceVolume.h:60
ServiceVolume::m_name
std::string m_name
Definition: InDetServMatGeoModel/src/ServiceVolume.h:98
ServiceVolume::next
ServiceVolume * next()
Definition: InDetServMatGeoModel/src/ServiceVolume.h:71
ServiceVolume::addMaterial
void addMaterial(const ServiceMaterial &mat)
Definition: InDetServMatGeoModel/src/ServiceVolume.h:83
ServiceVolume::dump
void dump(bool dumpMaterial=true) const
Definition: InDetServMatGeoModel/src/ServiceVolume.cxx:10
ServiceVolume::shape
Shape shape() const
Definition: InDetServMatGeoModel/src/ServiceVolume.h:36
ServiceVolume::addLayers
void addLayers(const LayerContainer &lc)
Definition: InDetServMatGeoModel/src/ServiceVolume.h:30