ATLAS Offline Software
InnerDetector
InDetDetDescr
InDetGeoModelUtils
src
TubeVolData.cxx
Go to the documentation of this file.
1
/*
2
Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration
3
*/
4
5
#include "
InDetGeoModelUtils/TubeVolData.h
"
6
#include "
RDBAccessSvc/IRDBRecord.h
"
7
#include "GaudiKernel/SystemOfUnits.h"
8
9
#include <cmath>
10
#include <string>
11
#include <iostream>
12
13
namespace
InDetDD
{
14
std::string
15
TubeVolData::material
()
const
{
16
return
m_record
->
getString
(
"MATERIAL"
);
17
}
18
19
double
20
TubeVolData::maxRadius
()
const
{
21
return
std::max
(
m_rmax1
,
m_rmax2
);
22
}
23
24
TubeVolData::TubeVolData
(
const
IRDBRecord
* record)
25
: m_record(record),
26
m_bothZ(false),
27
m_nRepeat(0),
28
m_radialDiv(0),
29
m_phiStart(0.),
30
m_phiDelta(0.),
31
m_phiStep(0.),
32
m_rmin1(0.),
33
m_rmin2(0.),
34
m_rmax1(0.),
35
m_rmax2(0.),
36
m_length(0.),
37
m_zMid(0.) {
38
// add an 2*epsilon gap between phi sectors.
39
const
double
phiepsilon = 0.001 *
Gaudi::Units::degree
;
40
41
bool
fullPhiSector =
false
;
42
43
44
// Get the parameters which we need to do some preprocessing with.
45
// The rest are obtained directly from RDB.
46
47
if
(
m_record
) {
48
m_phiStart
=
m_record
->
getDouble
(
"PHISTART"
) *
Gaudi::Units::degree
;
49
m_phiDelta
=
m_record
->
getDouble
(
"PHIDELTA"
) *
Gaudi::Units::degree
;
50
m_phiStep
=
m_record
->
getDouble
(
"PHISTEP"
) *
Gaudi::Units::degree
;
51
m_nRepeat
=
m_record
->
getInt
(
"NREPEAT"
);
52
m_rmin1
=
m_record
->
getDouble
(
"RMIN"
) *
Gaudi::Units::mm
;
53
m_rmax1
=
m_record
->
getDouble
(
"RMAX"
) *
Gaudi::Units::mm
;
54
m_rmin2
=
m_record
->
getDouble
(
"RMIN2"
) *
Gaudi::Units::mm
;
55
m_rmax2
=
m_record
->
getDouble
(
"RMAX2"
) *
Gaudi::Units::mm
;
56
m_radialDiv
= 0;
57
if
(!
m_record
->
isFieldNull
(
"RADIAL"
)) {
58
m_radialDiv
=
m_record
->
getInt
(
"RADIAL"
);
59
}
60
m_bothZ
= 0;
61
if
(!
m_record
->
isFieldNull
(
"ZSYMM"
)) {
62
m_bothZ
=
m_record
->
getInt
(
"ZSYMM"
);
63
}
64
65
double
zmin
=
m_record
->
getDouble
(
"ZMIN"
) *
Gaudi::Units::mm
;
66
double
zmax
=
m_record
->
getDouble
(
"ZMAX"
) *
Gaudi::Units::mm
;
67
m_length
= std::abs(
zmax
-
zmin
);
68
m_zMid
= 0.5 * (
zmin
+
zmax
);
69
70
if
(
m_phiDelta
== 0 ||
m_phiDelta
>= 359.9 *
Gaudi::Units::degree
) {
71
m_phiDelta
= 360 *
Gaudi::Units::degree
;
72
fullPhiSector =
true
;
73
}
else
{
74
m_phiDelta
-= 2 * phiepsilon;
75
m_phiStart
+= phiepsilon;
76
}
77
78
// Force nRepeat to be >= 1;
79
if
(
m_nRepeat
<= 0)
m_nRepeat
= 1;
80
// if PHISTEP==0 then set it to be equi-distant steps filling up phi.
81
if
(
m_phiStep
== 0) {
82
m_phiStep
= 360 *
Gaudi::Units::degree
/
m_nRepeat
;
83
}
84
85
if
(
m_rmin2
<= 0)
m_rmin2
=
m_rmin1
;
86
if
(
m_rmax2
<= 0)
m_rmax2
=
m_rmax1
;
87
88
if
(
m_radialDiv
> 0) {
89
m_shape
=
TubeVolData::RADIAL
;
90
}
else
if
(
m_rmin1
==
m_rmin2
&&
m_rmax1
==
m_rmax2
) {
91
if
(fullPhiSector) {
92
m_shape
=
TubeVolData::TUBE
;
93
}
else
{
94
m_shape
=
TubeVolData::TUBS
;
95
}
96
}
else
{
97
m_shape
=
TubeVolData::CONS
;
98
}
99
}
else
std::cout <<
"Unexpected ERROR in ExtraMaterial!"
<< std::endl;
100
}
101
}
// end namespace
IRDBRecord::getInt
virtual int getInt(const std::string &fieldName) const =0
Get int field value.
InDetDD::TubeVolData::m_zMid
double m_zMid
Definition:
TubeVolData.h:53
InDetDD::TubeVolData::CONS
@ CONS
Definition:
TubeVolData.h:19
max
#define max(a, b)
Definition:
cfImp.cxx:41
PixelAthClusterMonAlgCfg.zmin
zmin
Definition:
PixelAthClusterMonAlgCfg.py:169
InDetDD::TubeVolData::m_rmin1
double m_rmin1
Definition:
TubeVolData.h:48
IRDBRecord::getString
virtual const std::string & getString(const std::string &fieldName) const =0
Get string field value.
InDetDD::TubeVolData::TUBS
@ TUBS
Definition:
TubeVolData.h:19
InDetDD::TubeVolData::m_rmin2
double m_rmin2
Definition:
TubeVolData.h:49
InDetDD::TubeVolData::m_radialDiv
int m_radialDiv
Definition:
TubeVolData.h:44
InDetDD::TubeVolData::m_shape
VolShape m_shape
Definition:
TubeVolData.h:54
InDetDD::TubeVolData::TubeVolData
TubeVolData(const IRDBRecord *)
Definition:
TubeVolData.cxx:24
PixelAthClusterMonAlgCfg.zmax
zmax
Definition:
PixelAthClusterMonAlgCfg.py:169
InDetDD::TubeVolData::TUBE
@ TUBE
Definition:
TubeVolData.h:19
InDetDD::TubeVolData::m_phiDelta
double m_phiDelta
Definition:
TubeVolData.h:46
InDetDD::TubeVolData::m_phiStep
double m_phiStep
Definition:
TubeVolData.h:47
InDetDD::TubeVolData::m_record
const IRDBRecord * m_record
Definition:
TubeVolData.h:41
InDetDD::TubeVolData::m_nRepeat
int m_nRepeat
Definition:
TubeVolData.h:43
InDetDD::TubeVolData::RADIAL
@ RADIAL
Definition:
TubeVolData.h:19
InDetDD::TubeVolData::m_rmax1
double m_rmax1
Definition:
TubeVolData.h:50
python.SystemOfUnits.mm
int mm
Definition:
SystemOfUnits.py:83
InDetDD::TubeVolData::m_bothZ
bool m_bothZ
Definition:
TubeVolData.h:42
IRDBRecord.h
Definition of the abstract IRDBRecord interface.
InDetDD
Message Stream Member.
Definition:
FakeTrackBuilder.h:8
IRDBRecord::isFieldNull
virtual bool isFieldNull(const std::string &fieldName) const =0
Check if the field value is NULL.
IRDBRecord
IRDBRecord is one record in the IRDBRecordset object.
Definition:
IRDBRecord.h:27
InDetDD::TubeVolData::m_length
double m_length
Definition:
TubeVolData.h:52
InDetDD::TubeVolData::m_rmax2
double m_rmax2
Definition:
TubeVolData.h:51
InDetDD::TubeVolData::m_phiStart
double m_phiStart
Definition:
TubeVolData.h:45
IRDBRecord::getDouble
virtual double getDouble(const std::string &fieldName) const =0
Get double field value.
InDetDD::TubeVolData::material
std::string material() const
Definition:
TubeVolData.cxx:15
python.SystemOfUnits.degree
tuple degree
Definition:
SystemOfUnits.py:106
InDetDD::TubeVolData::maxRadius
double maxRadius() const
Definition:
TubeVolData.cxx:20
TubeVolData.h
Generated on Thu Nov 7 2024 21:31:13 for ATLAS Offline Software by
1.8.18