9 #include "CLHEP/Units/GlobalSystemOfUnits.h"
10 #include "CLHEP/Units/SystemOfUnits.h"
27 setType(
"DivisionPolyhedraRho" );
55 <<
"DDDividedPolyhedraRho::checkParametersValidity()"
57 <<
" Solid " << msol << std::endl
58 <<
" Division along R will be done with a width "
59 <<
"different for each solid section." << std::endl
60 <<
" WIDTH will not be used !" << std::endl;
65 <<
"DDDividedPolyhedraRho::checkParametersValidity()"
67 <<
" Solid " << msol << std::endl
68 <<
" Division along R will be done with a width "
69 <<
"different for each solid section." << std::endl
70 <<
" OFFSET will not be used !" << std::endl;
99 std::vector<double> localrMaxVec = msol.
rMaxVec();
100 std::vector<double> localrMinVec = msol.
rMinVec();
101 std::vector<double> localzVec = msol.
zVec();
102 std::vector<double> newrMinVec;
103 std::vector<double> newrMaxVec;
104 int nZplanes = localzVec.size();
107 for(
int ii = 0;
ii < nZplanes; ++
ii)
114 newrMinVec[
ii] = localrMinVec[
ii] +
div_.
offset() + width * copyNo;
115 newrMaxVec[
ii] = localrMaxVec[
ii] +
div_.
offset() + width * (copyNo + 1);
139 setType(
"DivisionPolyhedraPhi" );
181 <<
"DDDividedPolyhedraPhi::checkParametersValidity()"
183 <<
" Solid " << msol << std::endl
184 <<
" Division along PHI will be done splitting "
185 <<
"in the defined numSide." << std::endl
186 <<
" WIDTH will not be used !" << std::endl;
191 <<
"DDDividedPolyhedraPhi::checkParametersValidity()"
193 <<
" Solid " << msol << std::endl
194 <<
" Division along PHI will be done splitting "
195 <<
"in the defined numSide." << std::endl
196 <<
" OFFSET will not be used !" << std::endl;
202 <<
"DDDividedPolyhedraPhi::checkParametersValidity()"
204 <<
" Division along PHI will be done splitting in the defined"
206 <<
" numSide, i.e, the number of division would be :"
207 <<
" " << msol.
sides()
210 std::string s =
"DDDividedPolyhedraPhi::checkParametersValidity() Not supported configuration.";
246 if (!dsol.isDefined().second)
266 setType(
"DivisionPolyhedraZ" );
270 std::vector<double> zvec = msol.
zVec();
292 std::vector<double> zvec = msol.
zVec();
293 return (zvec[zvec.size() - 1] - zvec[0]);
306 <<
"DDDividedPolyhedraZ::checkParametersValidity()"
308 <<
" Solid " << msol << std::endl
309 <<
" Division along Z will be done splitting "
310 <<
"in the defined z_planes." << std::endl
311 <<
" WIDTH will not be used !" << std::endl;
317 <<
"DDDividedPolyhedraZ::checkParametersValidity()"
319 <<
" Solid " << msol << std::endl
320 <<
" Division along Z will be done splitting "
321 <<
"in the defined z_planes." << std::endl
322 <<
" OFFSET will not be used !" << std::endl;
325 std::vector<double> zvec = msol.
zVec();
327 if ( zvec.size() - 1 != size_t(
compNDiv_) )
330 <<
"DDDividedPolyhedraZ::checkParametersValidity()"
332 <<
" Division along Z can only be done by splitting in the defined"
334 <<
" z_planes, i.e, the number of division would be :"
335 <<
" " << zvec.size() - 1
338 std::string s =
"DDDividedPolyhedraZ::checkParametersValidity()";
339 s +=
"Illegal Construct. Not a supported configuration.";
348 std::vector<double> zvec = msol.
zVec();
351 double posi = (zvec[copyNo] + zvec[copyNo+1])/2;
372 std::vector<double> zvec = msol.
zVec();
373 std::vector<double> rminvec = msol.
rMinVec();
374 std::vector<double> rmaxvec = msol.
rMaxVec();
376 double posi = ( zvec[ copyNo ] + zvec[ copyNo + 1 ] ) / 2.0;
380 std::vector<double> newRmin, newRmax, newZ;
381 newZ.push_back( zvec[ copyNo ] - posi );
382 newZ.push_back( zvec[ copyNo + 1 ] - posi );
383 newRmin.push_back( rminvec[ copyNo ]);
384 newRmin.push_back( rminvec[ copyNo + 1 ]);
385 newRmax.push_back( rmaxvec[ copyNo ]);
386 newRmax.push_back( rmaxvec[ copyNo + 1 ]);
double startPhi(void) const
def_type isDefined() const
virtual void checkParametersValidity() override
DDDividedPolyhedraRho(const DDDivision &div, DDCompactView *cpv)
virtual DDTranslation makeDDTranslation(const int copyNo) const override
std::vector< double > rMaxVec(void) const
DDMaterial is used to define and access material information.
int calculateNDiv(double motherDim, double width, double offset) const
const std::string & ns() const
Returns the namespace.
DDName is used to identify DDD entities uniquely.
DDDividedPolyhedraPhi(const DDDivision &div, DDCompactView *cpv)
double calculateWidth(double motherDim, int nDiv, double offset) const
virtual DDLogicalPart makeDDLogicalPart(const int copyNo) const override
const DDSolid & solid(void) const
Returns a reference object of the solid being the shape of this LogicalPart.
type of data representation of DDCompactView
virtual void checkParametersValidity() override
A DDSolid represents the shape of a part.
virtual void checkParametersValidity(void)
virtual DDRotation makeDDRotation(const int copyNo) const override
ROOT::Math::DisplacementVector3D< ROOT::Math::Cartesian3D< double > > DDTranslation
Represents a uniquely identifyable rotation matrix.
virtual DDLogicalPart makeDDLogicalPart(const int copyNo) const override
virtual void checkParametersValidity() override
virtual double getMaxParameter() const override
DivisionType divisionType_
virtual DDRotation makeDDRotation(const int copyNo) const override
virtual DDTranslation makeDDTranslation(const int copyNo) const override
A DDLogicalPart aggregates information concerning material, solid and sensitveness ...
virtual void setType(const std::string &type)
std::vector< double > rMinVec(void) const
virtual double getMaxParameter() const override
std::vector< double > zVec(void) const
virtual double getMaxParameter() const override
double deltaPhi(void) const
const DDLogicalPart & parent() const
virtual DDTranslation makeDDTranslation(const int copyNo) const override
virtual DDRotation makeDDRotation(const int copyNo) const override
ROOT::Math::Rotation3D DDRotationMatrix
A DDRotationMatrix is currently implemented with a ROOT Rotation3D.
DDDividedPolyhedraZ(const DDDivision &div, DDCompactView *cpv)
const std::string & name() const
Returns the name.
static DDSolid polyhedra(const DDName &name, int sides, double startPhi, double deltaPhi, const std::vector< double > &z, const std::vector< double > &rmin, const std::vector< double > &rmax)
Creates a polyhedra (refere to Geant3 or Geant4 documentation)
const DDMaterial & material(void) const
Returns a reference object of the material this LogicalPart is made of.
virtual DDLogicalPart makeDDLogicalPart(const int copyNo) const override
DDRotationMatrix * changeRotMatrix(double rotZ=0.) const