Main Page
Namespaces
Classes
Package Documentation
DetectorDescription
Core
src
Trap.cc
Go to the documentation of this file.
1
#include "
DetectorDescription/Core/src/Trap.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::operators
;
12
13
DDI::Trap::Trap
(
double
pDz,
14
double
pTheta,
15
double
pPhi,
16
double
pDy1,
double
pDx1,
double
pDx2,
17
double
pAlp1,
18
double
pDy2,
double
pDx3,
double
pDx4,
19
double
pAlp2 )
20
:
Solid
(
DDSolidShape
::
ddtrap
)
21
{
22
p_
.emplace_back(pDz);
// ......... 0
23
p_
.emplace_back(pTheta);
// .. 1
24
p_
.emplace_back(pPhi);
// ....... 2
25
p_
.emplace_back(pDy1);
// ........ 3
26
p_
.emplace_back(pDx1);
// ........ 4
27
p_
.emplace_back(pDx2);
// ........ 5
28
p_
.emplace_back(pAlp1);
// ....... 6
29
p_
.emplace_back(pDy2);
// ........ 7
30
p_
.emplace_back(pDx3);
// ......... 8
31
p_
.emplace_back(pDx4);
// ........ 9
32
p_
.emplace_back(pAlp2);
33
}
34
35
36
void
DDI::Trap::stream
(std::ostream & os)
const
37
{
38
os <<
" dz="
<<
convertMmToCm
(
p_
[0] )
39
<<
" theta="
<<
convertRadToDeg
(
p_
[1] )
40
<<
" phi="
<<
convertRadToDeg
(
p_
[2] )
41
<<
" dy1="
<<
convertMmToCm
(
p_
[3] )
42
<<
" dx1="
<<
convertMmToCm
(
p_
[4] )
43
<<
" dx2="
<<
convertMmToCm
(
p_
[5] )
44
<<
" alpha1="
<<
convertRadToDeg
(
p_
[6] )
45
<<
" dy2="
<<
convertMmToCm
(
p_
[7] )
46
<<
" dx3="
<<
convertMmToCm
(
p_
[8] )
47
<<
" dx4="
<<
convertMmToCm
(
p_
[9] )
48
<<
" alpha2="
<<
convertRadToDeg
(
p_
[10] );
49
}
50
51
double
DDI::Trap::volume
()
const
52
{
53
double
volume
= 0;
54
55
double
dz
=
p_
[0]*2.;
56
double
dy1 =
p_
[3]*2.;
57
double
dx1 =
p_
[4]*2.;
58
double
dx2 =
p_
[5]*2.;
59
double
dy2 =
p_
[7]*2.;
60
double
dx3 =
p_
[8]*2.;
61
double
dx4 =
p_
[9]*2.;
62
63
volume = ((dx1 + dx2 + dx3 + dx4)*(dy1 + dy2) +
64
(dx4 + dx3 - dx2 - dx1)*(dy2 - dy1)/3)*dz*0.125;
65
66
return
volume
;
67
}
DDSolidShape
DDSolidShape
Definition:
DDSolidShapes.h:6
PVValHelper::dz
Definition:
PVValidationHelpers.h:46
geant_units::operators::convertRadToDeg
constexpr NumType convertRadToDeg(NumType radians)
Definition:
GeantUnits.h:98
DDI::Trap::Trap
Trap(double pDz, double pTheta, double pPhi, double pDy1, double pDx1, double pDx2, double pAlp1, double pDy2, double pDx3, double pDx4, double pAlp2)
Definition:
Trap.cc:13
DDI::Trap::stream
void stream(std::ostream &) const override
Definition:
Trap.cc:36
mathSSE::sqrt
T sqrt(T t)
Definition:
SSEVec.h:18
DDSolidShapes.h
Solid.h
geant_units::operators
Definition:
GeantUnits.h:21
GeantUnits.h
DDI::Trap::volume
double volume() const override
Definition:
Trap.cc:51
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
Trap.h
DDSolidShape::ddtrap
Generated for CMSSW Reference Manual by
1.8.11