CMS 3D CMS Logo

List of all members | Public Member Functions
DDDividedPolyconePhi Class Referencefinal

#include <DDDividedPolycone.h>

Inheritance diagram for DDDividedPolyconePhi:
DDDividedGeometryObject

Public Member Functions

virtual void checkParametersValidity () override
 
 DDDividedPolyconePhi (const DDDivision &div, DDCompactView *cpv)
 
virtual double getMaxParameter () const override
 
virtual DDLogicalPart makeDDLogicalPart (const int copyNo) const override
 
virtual DDRotation makeDDRotation (const int copyNo) const override
 
virtual DDTranslation makeDDTranslation (const int copyNo) const override
 
- Public Member Functions inherited from DDDividedGeometryObject
 DDDividedGeometryObject (const DDDivision &div, DDCompactView *cpv)
 
virtual void execute (void)
 
virtual const std::string & getType (void) const
 
virtual void setType (const std::string &type)
 
int volumeFirstCopyNo (void) const
 
virtual ~DDDividedGeometryObject (void)=default
 

Additional Inherited Members

- Static Public Member Functions inherited from DDDividedGeometryObject
static const double tolerance (void)
 
- Protected Member Functions inherited from DDDividedGeometryObject
int calculateNDiv (double motherDim, double width, double offset) const
 
double calculateWidth (double motherDim, int nDiv, double offset) const
 
DDRotationMatrixchangeRotMatrix (double rotZ=0.) const
 
void checkNDivAndWidth (double maxPar)
 
void checkOffset (double maxPar)
 
- Protected Attributes inherited from DDDividedGeometryObject
int compNDiv_
 
double compWidth_
 
DDCompactViewcpv_
 
DDDivision div_
 
DivisionType divisionType_
 
std::string ftype_
 
int theVoluFirstCopyNo_
 

Detailed Description

Definition at line 33 of file DDDividedPolycone.h.

Constructor & Destructor Documentation

DDDividedPolyconePhi::DDDividedPolyconePhi ( const DDDivision div,
DDCompactView cpv 
)

Definition at line 143 of file DDDividedPolycone.cc.

References DDDividedGeometryObject::calculateNDiv(), DDDividedGeometryObject::calculateWidth(), checkParametersValidity(), DDDividedGeometryObject::compNDiv_, DDDividedGeometryObject::compWidth_, DDPolycone::deltaPhi(), DDDividedGeometryObject::div_, DDDividedGeometryObject::divisionType_, DivNDIV, DivWIDTH, DDDivision::nReplicas(), DDDivision::offset(), DDDivision::parent(), DDDividedGeometryObject::setType(), DDLogicalPart::solid(), and DDDivision::width().

145 {
147  DDPolycone msol = (DDPolycone)(div_.parent().solid());
148  setType( "DivisionPolyconePhi" );
149  // this is the g4. what do we keep??? I think it is deltaPhi
150  // double deltaPhi = msol->GetEndPhi() - msol->GetStartPhi();
151  if( divisionType_ == DivWIDTH )
152  {
153  //If you divide a tube of 360 degrees the offset displaces the starting angle, but you still fill the 360 degrees
154  if( msol.deltaPhi() == 360.*deg ) {
155  compNDiv_ = calculateNDiv( msol.deltaPhi(), div_.width(), 0. );
156  }else {
158  }
159  }
160  else if( divisionType_ == DivNDIV )
161  {
162  if( msol.deltaPhi() == 360.*deg ) {
163  compWidth_ = calculateWidth( msol.deltaPhi(), div_.nReplicas(), 0. );
164  }else {
166  }
167  }
168 }
virtual void checkParametersValidity() override
int nReplicas() const
Definition: DDDivision.cc:71
double offset() const
Definition: DDDivision.cc:81
int calculateNDiv(double motherDim, double width, double offset) const
double calculateWidth(double motherDim, int nDiv, double offset) const
const DDSolid & solid(void) const
Returns a reference object of the solid being the shape of this LogicalPart.
DDDividedGeometryObject(const DDDivision &div, DDCompactView *cpv)
double deltaPhi(void) const
Definition: DDSolid.cc:377
virtual void setType(const std::string &type)
double width() const
Definition: DDDivision.cc:76
const DDLogicalPart & parent() const
Definition: DDDivision.cc:86

Member Function Documentation

void DDDividedPolyconePhi::checkParametersValidity ( void  )
overridevirtual
double DDDividedPolyconePhi::getMaxParameter ( void  ) const
overridevirtual

Reimplemented from DDDividedGeometryObject.

Definition at line 177 of file DDDividedPolycone.cc.

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

178 {
179  DDPolycone msol = (DDPolycone)(div_.parent().solid());
180  return msol.deltaPhi();
181 }
const DDSolid & solid(void) const
Returns a reference object of the solid being the shape of this LogicalPart.
double deltaPhi(void) const
Definition: DDSolid.cc:377
const DDLogicalPart & parent() const
Definition: DDDivision.cc:86
DDLogicalPart DDDividedPolyconePhi::makeDDLogicalPart ( const int  copyNo) const
overridevirtual

Reimplemented from DDDividedGeometryObject.

Definition at line 206 of file DDDividedPolycone.cc.

References DDDividedGeometryObject::compWidth_, DDBase< N, C >::ddname(), DDDividedGeometryObject::div_, DDLogicalPart::material(), DDName::name(), DDName::ns(), DDDivision::offset(), DDDivision::parent(), DDSolidFactory::polycone(), DDPolycone::rMaxVec(), and DDLogicalPart::solid().

207 {
208  DDName solname;
209  DDSolid ddpolycone;
210  DDMaterial usemat(div_.parent().material());
211 
212  DDPolycone msol = (DDPolycone)(div_.parent().solid());
213  std::vector<double> localrMaxVec = msol.rMaxVec();
214  std::vector<double> localrMinVec = msol.rMinVec();
215  std::vector<double> localzVec = msol.zVec();
216 
217  solname = DDName(div_.parent().ddname().name() + "_DIVCHILD",
218  div_.parent().ddname().ns());
219  DDSolid sol( solname );
220  if( !sol.isDefined().second )
221  {
222  ddpolycone = DDSolidFactory::polycone( solname,
223  msol.startPhi()+div_.offset(),
224  compWidth_,
225  localzVec,
226  localrMinVec,
227  localrMaxVec );
228  }
229  DDLogicalPart ddlp( solname );
230  if( !ddlp.isDefined().second )
231  {
232  ddlp = DDLogicalPart( solname, usemat, ddpolycone );
233  }
234 
235  return ddlp;
236 }
DDMaterial is used to define and access material information.
Definition: DDMaterial.h:41
std::vector< double > rMaxVec(void) const
Definition: DDSolid.cc:403
double offset() const
Definition: DDDivision.cc:81
static DDSolid polycone(const DDName &name, double startPhi, double deltaPhi, const std::vector< double > &z, const std::vector< double > &rmin, const std::vector< double > &rmax)
Creates a polycone (refere to Geant3 or Geant4 documentation)
Definition: DDSolid.cc:825
const std::string & ns() const
Returns the namespace.
Definition: DDName.cc:104
DDName is used to identify DDD entities uniquely.
Definition: DDName.h:15
const DDSolid & solid(void) const
Returns a reference object of the solid being the shape of this LogicalPart.
A DDSolid represents the shape of a part.
Definition: DDSolid.h:38
A DDLogicalPart aggregates information concerning material, solid and sensitveness ...
Definition: DDLogicalPart.h:92
const DDLogicalPart & parent() const
Definition: DDDivision.cc:86
const std::string & name() const
Returns the name.
Definition: DDName.cc:90
const DDMaterial & material(void) const
Returns a reference object of the material this LogicalPart is made of.
const N & ddname() const
Definition: DDBase.h:80
DDRotation DDDividedPolyconePhi::makeDDRotation ( const int  copyNo) const
overridevirtual

Reimplemented from DDDividedGeometryObject.

Definition at line 184 of file DDDividedPolycone.cc.

References DDDividedGeometryObject::changeRotMatrix(), DDDividedGeometryObject::compWidth_, DDBase< N, C >::ddname(), DDrot(), DDDividedGeometryObject::div_, DDName::name(), DDName::ns(), and DDDivision::parent().

185 {
186  DDRotation myddrot; // sets to identity.
187  double posi = ( copyNo - 1 ) * compWidth_;
188  DDRotationMatrix* rotMat = changeRotMatrix( posi );
189  // how to name the rotation??
190  // i do not like this
191  DDName ddrotname( div_.parent().ddname().name() + "_DIVCHILD_ROT" + std::to_string( copyNo ),
192  div_.parent().ddname().ns());
193  myddrot = DDrot( ddrotname, rotMat );
194 
195  return myddrot;
196 }
const std::string & ns() const
Returns the namespace.
Definition: DDName.cc:104
DDName is used to identify DDD entities uniquely.
Definition: DDName.h:15
Represents a uniquely identifyable rotation matrix.
Definition: DDTransform.h:64
DDRotation DDrot(const DDName &name, DDRotationMatrix *rot)
Definition of a uniquely identifiable rotation matrix named by DDName name.
Definition: DDRotation.cc:90
const DDLogicalPart & parent() const
Definition: DDDivision.cc:86
ROOT::Math::Rotation3D DDRotationMatrix
A DDRotationMatrix is currently implemented with a ROOT Rotation3D.
const std::string & name() const
Returns the name.
Definition: DDName.cc:90
const N & ddname() const
Definition: DDBase.h:80
DDRotationMatrix * changeRotMatrix(double rotZ=0.) const
DDTranslation DDDividedPolyconePhi::makeDDTranslation ( const int  copyNo) const
overridevirtual

Reimplemented from DDDividedGeometryObject.

Definition at line 199 of file DDDividedPolycone.cc.

200 {
201  DDTranslation translation;
202  return translation;
203 }
ROOT::Math::DisplacementVector3D< ROOT::Math::Cartesian3D< double > > DDTranslation
Definition: DDTranslation.h:7