Main Page
Namespaces
Classes
Package Documentation
DetectorDescription
Core
src
Tubs.cc
Go to the documentation of this file.
1
#include "
DetectorDescription/Core/src/Tubs.h
"
2
3
#include <cmath>
4
#include <vector>
5
6
#include "CLHEP/Units/GlobalPhysicalConstants.h"
7
#include "CLHEP/Units/GlobalSystemOfUnits.h"
8
#include "CLHEP/Units/SystemOfUnits.h"
9
#include "
DetectorDescription/Core/interface/DDSolidShapes.h
"
10
#include "
DetectorDescription/Core/src/Solid.h
"
11
12
using
std::fabs;
13
14
DDI::Tubs::Tubs
(
double
zhalf,
15
double
rIn,
double
rOut,
16
double
startPhi,
17
double
deltaPhi
)
18
:
Solid
(
DDSolidShape
::
ddtubs
)
19
{
20
p_
.emplace_back(zhalf);
21
p_
.emplace_back(rIn);
22
p_
.emplace_back(rOut);
23
p_
.emplace_back(startPhi);
24
p_
.emplace_back(deltaPhi);
25
}
26
27
28
void
DDI::Tubs::stream
(std::ostream & os)
const
29
{
30
os <<
" zhalf="
<<
p_
[0]/cm
31
<<
" rIn="
<<
p_
[1]/cm
32
<<
" rOut="
<<
p_
[2]/cm
33
<<
" startPhi="
<<
p_
[3]/deg
34
<<
" deltaPhi="
<<
p_
[4]/deg;
35
}
36
37
38
double
DDI::Tubs::volume
()
const
39
{
40
double
volume
=0;
41
double
z=2.*
p_
[0];
42
double
rIn=
p_
[1];
43
double
rOut=
p_
[2];
44
double
phi=
p_
[4]/rad;
45
46
double
volume1=
pi
*rIn*rIn*z;
47
double
volume2=
pi
*rOut*rOut*z;
48
49
double
slice=fabs(phi/(2*
pi
));
50
51
volume=slice*(volume2-volume1);
52
53
return
volume
;
54
}
55
DDI::Tubs::stream
void stream(std::ostream &) const override
Definition:
Tubs.cc:28
DDSolidShape
DDSolidShape
Definition:
DDSolidShapes.h:4
DDI::Tubs::Tubs
Tubs(double zhalf, double rIn, double rOut, double startPhi, double deltaPhi)
Definition:
Tubs.cc:14
pi
const Double_t pi
Definition:
trackSplitPlot.h:36
DDI::Tubs::volume
double volume() const override
Definition:
Tubs.cc:38
DDSolidShapes.h
Solid.h
DDSolidShape::ddtubs
Tubs.h
DDI::Solid
Definition:
Solid.h:10
DDI::Solid::p_
std::vector< double > p_
Definition:
Solid.h:32
hiPixelPairStep_cff.deltaPhi
deltaPhi
Definition:
hiPixelPairStep_cff.py:87
Generated for CMSSW Reference Manual by
1.8.11