Main Page
Namespaces
Classes
Package Documentation
src
DetectorDescription
Core
src
Torus.cc
Go to the documentation of this file.
1
#include "
DetectorDescription/Core/src/Torus.h
"
2
#include "
DataFormats/Math/interface/GeantUnits.h
"
3
4
#include <cmath>
5
#include <vector>
6
7
#include "
DetectorDescription/Core/interface/DDSolidShapes.h
"
8
#include "
DetectorDescription/Core/src/Solid.h
"
9
10
using
std::sqrt
;
11
using namespace
geant_units
;
12
using namespace
geant_units::operators
;
13
14
DDI::Torus::Torus
(
double
pRMin,
15
double
pRMax,
16
double
pRTor,
17
double
pSPhi,
18
double
pDPhi
19
)
20
:
Solid
(
DDSolidShape
::
ddtorus
)
21
{
22
p_
.emplace_back(pRMin);
// ......... 0
23
p_
.emplace_back(pRMax);
// ......... 1
24
p_
.emplace_back(pRTor);
// ......... 2
25
p_
.emplace_back(pSPhi);
// ......... 3
26
p_
.emplace_back(pDPhi);
// ......... 4
27
}
28
29
30
void
DDI::Torus::stream
(std::ostream & os)
const
31
{
32
os <<
" rMin="
<<
convertMmToCm
(
p_
[0] )
33
<<
" rMax="
<<
convertRadToDeg
(
p_
[1] )
34
<<
" rTor="
<<
convertRadToDeg
(
p_
[2] )
35
<<
" sPhi="
<<
convertMmToCm
(
p_
[3] )
36
<<
" dPhi="
<<
convertMmToCm
(
p_
[4] );
37
}
38
39
double
DDI::Torus::volume
()
const
40
{
41
double
volume
=0;
42
43
/* use notation as described in documentation about geant 4 shapes */
44
45
// From Geant4: { fCubicVolume = fDPhi*pi*fRtor*(fRmax*fRmax-fRmin*fRmin);
46
47
volume =
p_
[4] *
piRadians
*
p_
[2] * (
p_
[1] *
p_
[1] -
p_
[0] *
p_
[0]);
48
49
return
volume
;
50
}
Torus.h
DDSolidShape
DDSolidShape
Definition:
DDSolidShapes.h:6
geant_units::operators::convertRadToDeg
constexpr NumType convertRadToDeg(NumType radians)
Definition:
GeantUnits.h:98
DDI::Torus::volume
double volume() const override
Definition:
Torus.cc:39
geant_units::piRadians
constexpr long double piRadians(M_PI)
DDI::Torus::stream
void stream(std::ostream &) const override
Definition:
Torus.cc:30
mathSSE::sqrt
T sqrt(T t)
Definition:
SSEVec.h:18
DDSolidShapes.h
Solid.h
DDSolidShape::ddtorus
geant_units::operators
Definition:
GeantUnits.h:21
GeantUnits.h
DDI::Torus::Torus
Torus(double pRMin, double pRMax, double pRTor, double pSPhi, double pDPhi)
Definition:
Torus.cc:14
DDI::Solid
Definition:
Solid.h:10
DDI::Solid::p_
std::vector< double > p_
Definition:
Solid.h:32
geant_units::operators::convertMmToCm
constexpr NumType convertMmToCm(NumType millimeters)
Definition:
GeantUnits.h:110
geant_units
Definition:
GeantUnits.h:13
Generated for CMSSW Reference Manual by
1.8.11