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
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::sqrt
;
13
14
15
DDI::Torus::Torus
(
double
pRMin,
16
double
pRMax,
17
double
pRTor,
18
double
pSPhi,
19
double
pDPhi
20
)
21
:
Solid
(
ddtorus
)
22
{
23
p_
.push_back(pRMin);
// ......... 0
24
p_
.push_back(pRMax);
// ......... 1
25
p_
.push_back(pRTor);
// ......... 2
26
p_
.push_back(pSPhi);
// ......... 3
27
p_
.push_back(pDPhi);
// ......... 4
28
}
29
30
31
void
DDI::Torus::stream
(std::ostream & os)
const
32
{
33
os <<
" rMin="
<< p_[0]/cm
34
<<
" rMax="
<< p_[1]/deg
35
<<
" rTor="
<< p_[2]/deg
36
<<
" sPhi="
<< p_[3]/cm
37
<<
" dPhi="
<< p_[4]/cm;
38
}
39
40
double
DDI::Torus::volume
()
const
41
{
42
double
volume=0;
43
44
/* use notation as described in documentation about geant 4 shapes */
45
46
// From Geant4: { fCubicVolume = fDPhi*pi*fRtor*(fRmax*fRmax-fRmin*fRmin);
47
48
volume = p_[4]*
pi
*p_[2]*(p_[1]*p_[1]-p_[0]*p_[0]);
49
50
return
volume;
51
}
Torus.h
ddtorus
Definition:
DDSolidShapes.h:10
DDI::Torus::volume
double volume() const
Definition:
Torus.cc:40
pi
const Double_t pi
Definition:
trackSplitPlot.h:35
mathSSE::sqrt
T sqrt(T t)
Definition:
SSEVec.h:18
DDSolidShapes.h
Solid.h
DDI::Torus::Torus
Torus(double pRMin, double pRMax, double pRTor, double pSPhi, double pDPhi)
Definition:
Torus.cc:15
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:31
Generated for CMSSW Reference Manual by
1.8.5