Main Page
Namespaces
Classes
Package Documentation
DetectorDescription
Core
src
Sphere.cc
Go to the documentation of this file.
1
#include "
DetectorDescription/Core/src/Sphere.h
"
2
3
#include <
DataFormats/GeometryVector/interface/Pi.h
>
4
#include <cmath>
5
#include <ostream>
6
#include <vector>
7
8
#include "CLHEP/Units/GlobalSystemOfUnits.h"
9
#include "CLHEP/Units/SystemOfUnits.h"
10
#include "
DetectorDescription/Core/interface/DDSolidShapes.h
"
11
#include "
DetectorDescription/Core/src/Solid.h
"
12
13
DDI::Sphere::Sphere
(
double
innerRadius
,
14
double
outerRadius
,
15
double
startPhi,
16
double
deltaPhi
,
17
double
startTheta,
18
double
deltaTheta)
19
:
Solid
(
ddsphere
)
20
{
21
p_
.push_back(innerRadius);
22
p_
.push_back(outerRadius);
23
p_
.push_back(startPhi);
24
p_
.push_back(deltaPhi);
25
p_
.push_back(startTheta);
26
p_
.push_back(deltaTheta);
27
}
28
29
30
void
DDI::Sphere::stream
(std::ostream & os)
const
31
{
32
os <<
" innerRadius="
<<
p_
[0]/cm
33
<<
" outerRadius="
<<
p_
[1]/cm
34
<<
" startPhi="
<<
p_
[2]/deg
35
<<
" deltaPhi="
<<
p_
[3]/deg
36
<<
" startTheta="
<<
p_
[4]/deg
37
<<
" deltaTheta="
<<
p_
[5]/deg;
38
}
39
40
double
DDI::Sphere::volume
()
const
41
{
42
double
volume
(0.);
43
if
( std::fabs(
p_
[3]) <= 2.*
Geom::pi
() && std::fabs(
p_
[5]) <=
Geom::pi
() ) {
44
volume = std::fabs((
p_
[1]*
p_
[1]*
p_
[1] -
p_
[0]*
p_
[0]*
p_
[0])/3. * (
std::cos
(p_[4]+p_[5]) -
std::cos
(p_[4]))*p_[3]);
45
}
else
if
(std::fabs(
p_
[3]) <= 2.*
Geom::pi
() && std::fabs(
p_
[5]) >
Geom::pi
() ) {
46
volume = std::fabs((
p_
[1]*
p_
[1]*
p_
[1] -
p_
[0]*
p_
[0]*
p_
[0])/3. * (
std::cos
(p_[4]+p_[5]-180.*deg) -
std::cos
(p_[4]))*p_[3]);
47
}
else
if
(std::fabs(
p_
[3]) > 2.*
Geom::pi
() && std::fabs(
p_
[5]) <=
Geom::pi
() ) {
48
volume = std::fabs((
p_
[1]*
p_
[1]*
p_
[1] -
p_
[0]*
p_
[0]*
p_
[0])/3. * (
std::cos
(p_[4]+p_[5]) -
std::cos
(p_[4]))*(p_[3]-p_[2]));
49
}
50
return
volume
;
51
}
52
53
DDI::Sphere::Sphere
Sphere(double innerRadius, double outerRadius, double startPhi, double deltaPhi, double startZ, double deltaZ)
Definition:
Sphere.cc:13
Sphere.h
interestingEgammaIsoDetIdsSequence_cff.innerRadius
innerRadius
Definition:
interestingEgammaIsoDetIdsSequence_cff.py:15
interestingEgammaIsoDetIdsSequence_cff.outerRadius
outerRadius
Definition:
interestingEgammaIsoDetIdsSequence_cff.py:14
DDSolidShapes.h
DDI::Sphere::volume
double volume() const
Definition:
Sphere.cc:40
Solid.h
funct::cos
Cos< T >::type cos(const T &t)
Definition:
Cos.h:22
Pi.h
ddsphere
Definition:
DDSolidShapes.h:14
DDI::Solid
Definition:
Solid.h:10
DDI::Solid::p_
std::vector< double > p_
Definition:
Solid.h:32
MuonCkfTrajectoryBuilder_cfi.deltaPhi
deltaPhi
Definition:
MuonCkfTrajectoryBuilder_cfi.py:27
DDI::Sphere::stream
void stream(std::ostream &) const
Definition:
Sphere.cc:30
Geom::pi
constexpr double pi()
Definition:
Pi.h:31
Generated for CMSSW Reference Manual by
1.8.11