CMS 3D CMS Logo

DDDividedPolyconeZ Class Reference

#include <DetectorDescription/Parser/src/DDDividedPolycone.h>

Inheritance diagram for DDDividedPolyconeZ:

DDDividedGeometryObject

List of all members.

Public Member Functions

virtual void checkParametersValidity ()
 DDDividedPolyconeZ (const DDDivision &div)
virtual double getMaxParameter () const
virtual DDLogicalPart makeDDLogicalPart (const int copyNo) const
virtual DDRotation makeDDRotation (const int copyNo) const
virtual DDTranslation makeDDTranslation (const int copyNo) const
virtual ~DDDividedPolyconeZ ()


Detailed Description

Definition at line 56 of file DDDividedPolycone.h.


Constructor & Destructor Documentation

DDDividedPolyconeZ::DDDividedPolyconeZ ( const DDDivision div  ) 

Definition at line 277 of file DDDividedPolycone.cc.

References DDDividedGeometryObject::calculateNDiv(), checkParametersValidity(), DDDividedGeometryObject::compNDiv_, DDDividedGeometryObject::compWidth_, DCOUT_V, DDDividedGeometryObject::div_, DDDividedGeometryObject::divisionType_, DivNDIV, DivWIDTH, DDDivision::nReplicas(), DDDivision::offset(), DDDivision::parent(), DDPolycone::rMaxVec(), DDPolycone::rMinVec(), DDLogicalPart::solid(), DDDivision::width(), and DDPolycone::zVec().

00278   :  DDDividedGeometryObject::DDDividedGeometryObject (div)
00279 {
00280   checkParametersValidity();
00281   DDPolycone msol = (DDPolycone)(div_.parent().solid());
00282   std::vector<double> localrMaxVec = msol.rMaxVec();
00283   std::vector<double> localrMinVec = msol.rMinVec();
00284   std::vector<double> localzVec = msol.zVec();
00285 
00286   if( divisionType_ == DivWIDTH )
00287     {
00288       compNDiv_ =
00289         calculateNDiv( localzVec[localzVec.size() - 1]
00290                        - localzVec[0] , div_.width(), div_.offset() );
00291     }
00292   else if( divisionType_ == DivNDIV )
00293     {
00294       compWidth_ =
00295         calculateNDiv( localzVec[localzVec.size()-1]
00296                        - localzVec[0] , div_.nReplicas(), div_.offset() );
00297     }
00298   
00299  
00300   DCOUT_V ('P', " DDDividedPolyconeZ - # divisions " << compNDiv_ << " = " << div_.nReplicas() << "/n Offset " << div_.offset() << " Width " << compWidth_ << " = " << div_.width() << "\n");
00301 
00302 }

DDDividedPolyconeZ::~DDDividedPolyconeZ (  )  [virtual]

Definition at line 305 of file DDDividedPolycone.cc.

00306 {
00307 }


Member Function Documentation

void DDDividedPolyconeZ::checkParametersValidity (  )  [virtual]

Reimplemented from DDDividedGeometryObject.

Definition at line 310 of file DDDividedPolycone.cc.

References DDDividedGeometryObject::calculateNDiv(), DDDividedGeometryObject::checkParametersValidity(), DDDividedGeometryObject::div_, DDXMLElement::itostr(), DDDivision::nReplicas(), DDDivision::offset(), DDDivision::parent(), s, DDLogicalPart::solid(), DDDivision::width(), and DDPolycone::zVec().

Referenced by DDDividedPolyconeZ().

00311 {
00312   DDDividedGeometryObject::checkParametersValidity();
00313 
00314   DDPolycone msol = (DDPolycone)(div_.parent().solid());
00315   std::vector<double> localzVec = msol.zVec();
00316   // CHANGE FROM G4 a polycone can be divided in Z by specifying
00317   // nReplicas IF they happen to coincide with the number of 
00318   // z plans.
00319   size_t tempNDiv = div_.nReplicas();
00320   if (tempNDiv == 0)
00321     tempNDiv = calculateNDiv( localzVec[localzVec.size() - 1] - localzVec[0] 
00322                               , div_.width()
00323                               , div_.offset() );
00324   if ((msol.zVec().size() - 1) != tempNDiv)
00325     { 
00326       std::string s = "ERROR - DDDividedPolyconeZ::checkParametersValidity()";
00327       s += "\n\tDivision along Z will be done splitting in the defined";
00328       s += "\n\tz_planes, i.e, the number of division would be :";
00329       s += "\n\t" + DDXMLElement::itostr( msol.zVec().size() - 1 );
00330       s += "\n\tinstead of " + DDXMLElement::itostr(tempNDiv) + " !\n";
00331 
00332       throw DDException(s);
00333     }
00334 }

double DDDividedPolyconeZ::getMaxParameter (  )  const [virtual]

Reimplemented from DDDividedGeometryObject.

Definition at line 337 of file DDDividedPolycone.cc.

References DDDividedGeometryObject::div_, DDDivision::parent(), DDLogicalPart::solid(), and DDPolycone::zVec().

00338 {
00339   DDPolycone msol = (DDPolycone)(div_.parent().solid());
00340   std::vector<double> localzVec = msol.zVec();
00341   // G4: G4PolyconeHistorical* origparamMother = msol->GetOriginalParameters();  
00342   // G4: return (msol->Z_values[msol->Num_z_planes-1]-msol->Z_values[0]);
00343   return (localzVec[ localzVec.size() - 1] - localzVec[0]);
00344 }

DDLogicalPart DDDividedPolyconeZ::makeDDLogicalPart ( const int  copyNo  )  const [virtual]

Reimplemented from DDDividedGeometryObject.

Definition at line 369 of file DDDividedPolycone.cc.

References DDDividedGeometryObject::compWidth_, DDSolidFactory::cons(), DCOUT_V, DDBase< N, C >::ddname(), DDDividedGeometryObject::div_, DDXMLElement::itostr(), DDLogicalPart::material(), DDName::name(), DDName::ns(), DDDivision::parent(), and DDLogicalPart::solid().

00370 {
00371   DDName solname;
00372   DDSolid ddpolycone;
00373   DDMaterial usemat(div_.parent().material());
00374 
00375   DDPolycone msol = (DDPolycone)(div_.parent().solid());
00376   std::vector<double> localrMaxVec = msol.rMaxVec();
00377   std::vector<double> localrMinVec = msol.rMinVec();
00378   std::vector<double> localzVec = msol.zVec();
00379 
00380   //         G4PolyconeHistorical* origparamMother = msol->GetOriginalParameters();
00381   //   G4PolyconeHistorical origparam( *origparamMother );
00382   
00383   //   double posi = (msol.Z_values[copyNo]
00384   //                    + msol.Z_values[copyNo+1])/2;
00385       
00386   //   origparam.Num_z_planes = 2;
00387   //   origparam.Z_values[0] = msol.Z_values[copyNo] - posi;
00388   //   origparam.Z_values[1] = msol.Z_values[copyNo+1] - posi;
00389   //   origparam.rMinVec[0] = msol.rMinVec[copyNo];
00390   //   origparam.rMinVec[1] = msol.rMinVec[copyNo+1];
00391   //   origparam.rMaxVec[0] = msol.rMaxVec[copyNo];
00392   //   origparam.rMaxVec[1] = msol.rMaxVec[copyNo+1];
00393   //      since i am making cons, not polycone, i do not need the posi?
00394   //      double posi = (localzVec[copyNo] + localzVec[copyNo + 1]) / 2;
00395   solname = DDName(div_.parent().ddname().name() + "_DIVCHILD" + DDXMLElement::itostr(copyNo) 
00396                    , div_.parent().ddname().ns());
00397   ddpolycone = DDSolidFactory::cons(solname
00398                                     , compWidth_ / 2
00399                                     , localrMinVec[copyNo]
00400                                     , localrMaxVec[copyNo]
00401                                     , localrMinVec[copyNo+1]
00402                                     , localrMaxVec[copyNo+1]
00403                                     , msol.startPhi()
00404                                     , msol.deltaPhi()
00405                                     );
00406 
00407   DDLogicalPart ddlp = DDLogicalPart(solname, usemat, ddpolycone);
00408   DCOUT_V ('P', " DDDividedPolyconeZ::makeDDLogicalPart() lp:" << ddlp);
00409   return ddlp;
00410 }

DDRotation DDDividedPolyconeZ::makeDDRotation ( const int  copyNo  )  const [virtual]

Reimplemented from DDDividedGeometryObject.

Definition at line 347 of file DDDividedPolycone.cc.

References DCOUT_V.

00348 {
00349   DDRotation myddrot; // sets to identity.
00350   DCOUT_V ('P', "DDDividedPolyconeZ::makeDDRotation : " << myddrot);
00351   return myddrot;
00352 }

DDTranslation DDDividedPolyconeZ::makeDDTranslation ( const int  copyNo  )  const [virtual]

Reimplemented from DDDividedGeometryObject.

Definition at line 355 of file DDDividedPolycone.cc.

References DDDividedGeometryObject::div_, DDDivision::parent(), DDLogicalPart::solid(), and DDPolycone::zVec().

00356 {
00357   DDTranslation translation;
00358   DDPolycone msol = (DDPolycone)(div_.parent().solid());
00359   std::vector<double> localzVec = msol.zVec();
00360   //  G4PolyconeHistorical* origparamMother = msol->GetOriginalParameters();
00361   //  double posi = (msol.Z_values[copyNo]+ msol.Z_values[copyNo+1])/2;
00362   double posi = (localzVec[copyNo] + localzVec[copyNo+1]) / 2;
00363   translation.SetZ(posi);
00364   return translation;
00365 
00366 }


The documentation for this class was generated from the following files:
Generated on Tue Jun 9 18:17:50 2009 for CMSSW by  doxygen 1.5.4