Main Page
Namespaces
Classes
Package Documentation
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Properties
Friends
Macros
Pages
DetectorDescription
Core
src
Torus.cc
Go to the documentation of this file.
1
#include "
DetectorDescription/Core/src/Torus.h
"
2
#include "CLHEP/Units/GlobalPhysicalConstants.h"
3
#include "CLHEP/Units/GlobalSystemOfUnits.h"
4
#include <cmath>
5
6
using
std::sqrt
;
7
8
9
DDI::Torus::Torus
(
double
pRMin,
10
double
pRMax,
11
double
pRTor,
12
double
pSPhi,
13
double
pDPhi
14
)
15
:
Solid
(
ddtorus
)
16
{
17
p_
.push_back(pRMin);
// ......... 0
18
p_
.push_back(pRMax);
// ......... 1
19
p_
.push_back(pRTor);
// ......... 2
20
p_
.push_back(pSPhi);
// ......... 3
21
p_
.push_back(pDPhi);
// ......... 4
22
}
23
24
25
void
DDI::Torus::stream
(std::ostream & os)
const
26
{
27
os <<
" rMin="
<< p_[0]/cm
28
<<
" rMax="
<< p_[1]/deg
29
<<
" rTor="
<< p_[2]/deg
30
<<
" sPhi="
<< p_[3]/cm
31
<<
" dPhi="
<< p_[4]/cm;
32
}
33
34
double
DDI::Torus::volume
()
const
35
{
36
double
volume=0;
37
38
/* use notation as described in documentation about geant 4 shapes */
39
40
// From Geant4: { fCubicVolume = fDPhi*pi*fRtor*(fRmax*fRmax-fRmin*fRmin);
41
42
volume = p_[4]*
pi
*p_[2]*(p_[1]*p_[1]-p_[0]*p_[0]);
43
44
return
volume;
45
}
Torus.h
ddtorus
Definition:
DDSolidShapes.h:10
DDI::Torus::volume
double volume() const
Definition:
Torus.cc:34
pi
const Double_t pi
Definition:
trackSplitPlot.h:36
mathSSE::sqrt
T sqrt(T t)
Definition:
SSEVec.h:18
DDI::Torus::Torus
Torus(double pRMin, double pRMax, double pRTor, double pSPhi, double pDPhi)
Definition:
Torus.cc:9
DDI::Solid
Definition:
Solid.h:10
DDI::Solid::p_
std::vector< double > p_
Definition:
Solid.h:32
DDI::Torus::stream
void stream(std::ostream &) const
Definition:
Torus.cc:25
Generated for CMSSW Reference Manual by
1.8.5