CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions
DDI::Cons Class Reference

#include <Cons.h>

Inheritance diagram for DDI::Cons:
DDI::Solid

Public Member Functions

 Cons (double zhalf, double rInMinusZ, double rOutMinusZ, double rInPlusZ, double rOutPlusZ, double startPhi, double deltaPhi)
 
void stream (std::ostream &) const
 
double volume () const
 
- Public Member Functions inherited from DDI::Solid
const std::vector< double > & parameters () const
 
void setParameters (std::vector< double > const &p)
 
DDSolidShape shape () const
 
 Solid ()
 
 Solid (DDSolidShape shape)
 
virtual ~Solid ()
 

Additional Inherited Members

- Protected Attributes inherited from DDI::Solid
std::vector< double > p_
 
DDSolidShape shape_
 

Detailed Description

Definition at line 9 of file Cons.h.

Constructor & Destructor Documentation

DDI::Cons::Cons ( double  zhalf,
double  rInMinusZ,
double  rOutMinusZ,
double  rInPlusZ,
double  rOutPlusZ,
double  startPhi,
double  deltaPhi 
)

Definition at line 13 of file Cons.cc.

References DDI::Solid::p_.

20  : Solid(ddcons)
21 {
22  p_.push_back(zhalf);
23  p_.push_back(rInMinusZ);
24  p_.push_back(rOutMinusZ);
25  p_.push_back(rInPlusZ);
26  p_.push_back(rOutPlusZ);
27  p_.push_back(startPhi);
28  p_.push_back(deltaPhi);
29 
30 }
Solid()
Definition: Solid.h:14
std::vector< double > p_
Definition: Solid.h:32

Member Function Documentation

void DDI::Cons::stream ( std::ostream &  os) const
virtual

Reimplemented from DDI::Solid.

Definition at line 33 of file Cons.cc.

34 {
35  os << " zhalf=" << p_[0]/cm
36  << " rIn-Z=" << p_[1]/cm
37  << " rOut-Z=" << p_[2]/cm
38  << " rIn+Z=" << p_[3]/cm
39  << " rOut+Z=" << p_[4]/cm
40  << " startPhi=" << p_[5]/deg
41  << " deltaPhi=" << p_[6]/deg;
42 }
std::vector< double > p_
Definition: Solid.h:32
double DDI::Cons::volume ( void  ) const
virtual

Reimplemented from DDI::Solid.

Definition at line 44 of file Cons.cc.

References SiPixelRawToDigiRegional_cfi::deltaPhi, and pi.

45 {
46  /* zhalf is the half length of the cone,
47  phiTo is always clockwise rotated from phiFrom
48  rInMinusZ is always smaller than rOutMinusZ (same for r*PlusZ)
49  They are the distances relative to the rotation axes */
50 
51  /* calculation normalize from 0 to z */
52 
53  /* The function f=rInMinusZ+((rInPlusZ-rInMinusZ)/z)*x defines
54  the radius of the the rotation from 0 to z. Raised to the power
55  of 2 integrated on x from 0 to z. Multiplied by pi, gives the
56  volume that needs to substracted from the other volume */
57 
58  /* f^2=rInMinusZ*rInMinusZ+2*rInMinusZ*((rInPlusZ-rInMinusZ)/z)*x+((rInPlusZ-rInMinusZ)*(rInPlusZ-rInMinusZ)*x*x)/(z*z) */
59 
60  /* primitive of f^2 is: rInMinusZ*rInMinusZ*x+rInMinusZ*((rInPlusZ-rInMinusZ)/z)*(x*x)+(rInPlusZ-rInMinusZ)*(rInPlusZ-rInMinusZ)*(x*x*x)/(3*z*z) */
61 
62  /*integration from 0 to z yields: pi*( rInMinusZ*rInMinusZ*z+rInMinusZ*(rInPlusZ-rInMinusZ)*z+((rInPlusZ-rInMinusZ)*(rInPlusZ-rInMinusZ)*z)/(3) ) */
63 
64  double zhalf=p_[0];
65  double rInMinusZ=p_[1];
66  double rOutMinusZ=p_[2];
67  double rInPlusZ=p_[3];
68  double rOutPlusZ=p_[4];
69  //double phiFrom=p_[5]/rad;
70  double deltaPhi=fabs(p_[6]/rad);
71  double z=2*zhalf;
72 
73  double volume1=pi*(rInPlusZ*rInPlusZ+rInMinusZ*rInMinusZ+rInMinusZ*rInPlusZ)*z/3;
74 
75  double volume2=pi*(rOutPlusZ*rOutPlusZ+rOutMinusZ*rOutMinusZ+rOutMinusZ*rOutPlusZ)*z/3;
76 
77  double slice=deltaPhi/(2*pi);
78  double volume=slice*(volume2-volume1);
79 
80  return volume;
81 
82 }
float float float z
const Double_t pi
double volume() const
Definition: Cons.cc:44
std::vector< double > p_
Definition: Solid.h:32