ATLAS Offline Software
Loading...
Searching...
No Matches
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
7#include "GaudiKernel/SystemOfUnits.h"
8
9#include <cmath>
10#include <string>
11#include <iostream>
12
13namespace InDetDD {
14 std::string
16 return m_record->getString("MATERIAL");
17 }
18
19 double
21 return std::max(m_rmax1, m_rmax2);
22 }
23
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) {
90 } else if (m_rmin1 == m_rmin2 && m_rmax1 == m_rmax2) {
91 if (fullPhiSector) {
93 } else {
95 }
96 } else {
98 }
99 } else std::cout << "Unexpected ERROR in ExtraMaterial!" << std::endl;
100 }
101} // end namespace
Definition of the abstract IRDBRecord interface.
IRDBRecord is one record in the IRDBRecordset object.
Definition IRDBRecord.h:27
const IRDBRecord * m_record
Definition TubeVolData.h:41
TubeVolData(const IRDBRecord *)
double maxRadius() const
std::string material() const
Message Stream Member.