5 #include "CLHEP/Units/GlobalSystemOfUnits.h"
6 #include "CLHEP/Units/GlobalPhysicalConstants.h"
11 Polycone::Polycone (
double startPhi,
double deltaPhi,
12 const std::vector<double> &
z,
13 const std::vector<double> & rmin,
16 p_.push_back(startPhi);
17 p_.push_back(deltaPhi);
18 if((z.size()!=rmin.size()) || (z.size()!=rmax.size()) )
20 throw cms::Exception(
"DDException") <<
"Polycone(..): std::vectors z,rmin,rmax not of same length";
24 for(
unsigned int i=0;
i<z.size(); ++
i)
27 p_.push_back(rmin[i]);
28 p_.push_back(rmax[i]);
35 const std::vector<double> & z,
38 p_.push_back(startPhi);
39 p_.push_back(deltaPhi);
40 if(z.size()!=r.size())
42 throw cms::Exception(
"DDException") <<
"Polycone(..): std::vectors z,rmin,rmax not of same length";
46 for(
unsigned int i = 0;
i < z.size(); ++
i )
59 unsigned int loop = (
p_.size()-2)/3 -1;
62 DCOUT(
'V',
"Polycone::volume(), loop=" << loop);
64 for (
unsigned int j=2;
j<(loop+2); ++
j) {
65 double dz= std::fabs(
p_[i]-
p_[i+3]);
66 DCOUT(
'v',
" dz=" << dz/cm <<
"cm zi=" <<
p_[i] <<
" zii=" <<
p_[i+3] );
67 double v_min = dz *
pi/3. *(
p_[i+1]*
p_[i+1] +
p_[i+4]*
p_[i+4]
69 DCOUT(
'v',
" v_min" << v_min/cm3 <<
"cm3 rmi=" <<
p_[i+1]);
70 double v_max = dz *
pi/3. *(
p_[i+2]*
p_[i+2] +
p_[i+5]*
p_[i+5]
72 DCOUT(
'v',
" v_max" << v_max/cm3 <<
"cm3");
73 double s = v_max - v_min;
78 result = sec * std::fabs(
p_[1])/rad/(2.*
pi);
84 double phiFrom=
p_[0]/rad;
85 double phiTo=(
p_[0]+
p_[1])/rad;
86 double slice=(std::fabs(phiFrom-phiTo))/(2*
pi);
94 while(i<(
p_.size()-2))
103 double volume1=(rEnd*rEnd+rBegin*rBegin+rBegin*rEnd)*z/3;
104 volume=volume+volume1;
116 double volume2=(rEnd*rEnd+rBegin*rBegin+rBegin*rEnd)*z/3;
117 volume=volume+volume2;
118 volume=std::fabs(slice*
pi*volume);
Polycone(double startPhi, double deltaPhi, const std::vector< double > &z, const std::vector< double > &rmin, const std::vector< double > &rmax)
#define DCOUT(M_v_Y, M_v_S)