ATLAS Offline Software
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 
13 namespace 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) {
51  m_nRepeat = m_record->getInt("NREPEAT");
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) {
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) {
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
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:176
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:176
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