CMS 3D CMS Logo

List of all members | Public Member Functions
DDDividedTrdY Class Referencefinal

#include <DDDividedTrd.h>

Inheritance diagram for DDDividedTrdY:
DDDividedGeometryObject

Public Member Functions

virtual void checkParametersValidity () override
 
 DDDividedTrdY (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 28 of file DDDividedTrd.h.

Constructor & Destructor Documentation

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

Definition at line 168 of file DDDividedTrd.cc.

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

169  : DDDividedGeometryObject( div, cpv )
170 {
172  setType( "DivisionTrdY" );
173  DDTrap mtrd = (DDTrap)(div_.parent().solid());
174 
175  if( divisionType_ == DivWIDTH )
176  {
177  compNDiv_ = calculateNDiv( 2 * mtrd.y1(), div_.width(), div_.offset() );
178  }
179  else if( divisionType_ == DivNDIV )
180  {
181  compWidth_ = calculateWidth( 2 * mtrd.y1(), div_.nReplicas(), div_.offset() );
182  }
183 }
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)
Interface to a Trapezoid.
Definition: DDSolid.h:79
double y1(void) const
Half-length along y of the face at -pDz.
Definition: DDSolid.cc:171
virtual void setType(const std::string &type)
double width() const
Definition: DDDivision.cc:76
virtual void checkParametersValidity() override
const DDLogicalPart & parent() const
Definition: DDDivision.cc:86

Member Function Documentation

void DDDividedTrdY::checkParametersValidity ( void  )
overridevirtual

Reimplemented from DDDividedGeometryObject.

Definition at line 263 of file DDDividedTrd.cc.

References DDTrap::alpha1(), DDTrap::alpha2(), DDDividedGeometryObject::checkParametersValidity(), DDDividedGeometryObject::div_, Exception, DDDivision::parent(), DDTrap::phi(), alignCSCRings::s, DDLogicalPart::solid(), AlCaHLTBitMon_QueryRunRegistry::string, DDTrap::theta(), DDDividedGeometryObject::tolerance(), DDTrap::y1(), and DDTrap::y2().

Referenced by DDDividedTrdY().

264 {
266 
267  DDTrap mtrd = (DDTrap)(div_.parent().solid());
268 
269  double mpDy1 = mtrd.y1(); //->GetYHalfLength1();
270  double mpDy2 = mtrd.y2(); //->GetYHalfLength2();
271  double mpTheta = mtrd.theta();
272  double mpPhi = mtrd.phi();
273  double mpAlpha1 = mtrd.alpha1();
274  double mpAlpha2 = mtrd.alpha2();
275 
276  if( fabs(mpDy1 - mpDy2) > tolerance() )
277  {
278  std::string s= "ERROR - DDDividedTrdY::checkParametersValidity()";
279  s += "\n Making a division of a TRD along axis Y while";
280  s += "\n the Y half lengths are not equal is not (yet)";
281  s += "\n supported. It will result in non-equal";
282  s += "\n division solids.";
283  throw cms::Exception("DDException") << s;
284  }
285  // mec: we only have traps, not trds in DDD, so I added this check
286  // to make sure it is only a trd (I think! :-))
287  if (mpAlpha1 != 0.*deg || mpAlpha2 != 0.*deg || mpTheta != 0.*deg || mpPhi != 0.*deg)
288  {
289  std::string s = "ERROR - DDDividedTrdY::checkParametersValidity()";
290  s+= "\n Making a division of a TRD along axis X,";
291  s+= "\n while the theta, phi and aplhpa2 are not zero,";
292  s+= "\n is not (yet) supported. It will result";
293  s+= "\n in non-equal division solids.";
294  throw cms::Exception("DDException") << s;
295  }
296 }
double phi(void) const
Azimuthal angle of the line joining the centres of the faces at -/+pDz.
Definition: DDSolid.cc:168
const DDSolid & solid(void) const
Returns a reference object of the solid being the shape of this LogicalPart.
virtual void checkParametersValidity(void)
static const double tolerance(void)
Interface to a Trapezoid.
Definition: DDSolid.h:79
double y1(void) const
Half-length along y of the face at -pDz.
Definition: DDSolid.cc:171
double alpha1(void) const
Angle with respect to the y axis from the centre of the side at y=-pDy1 to the centre at y=+pDy1 of t...
Definition: DDSolid.cc:180
double alpha2(void) const
Angle with respect to the y axis from the centre of the side at y=-pDy2 to the centre at y=+pDy2 of t...
Definition: DDSolid.cc:192
double y2(void) const
Half-length along y of the face at +pDz.
Definition: DDSolid.cc:183
const DDLogicalPart & parent() const
Definition: DDDivision.cc:86
double theta(void) const
Polar angle of the line joining the centres of the faces at -/+pDz.
Definition: DDSolid.cc:165
double DDDividedTrdY::getMaxParameter ( void  ) const
overridevirtual

Reimplemented from DDDividedGeometryObject.

Definition at line 186 of file DDDividedTrd.cc.

References DDDividedGeometryObject::div_, DDDivision::parent(), DDLogicalPart::solid(), and DDTrap::y1().

187 {
188  DDTrap mtrd = (DDTrap)(div_.parent().solid());
189  return 2 * mtrd.y1();
190 }
const DDSolid & solid(void) const
Returns a reference object of the solid being the shape of this LogicalPart.
Interface to a Trapezoid.
Definition: DDSolid.h:79
double y1(void) const
Half-length along y of the face at -pDz.
Definition: DDSolid.cc:171
const DDLogicalPart & parent() const
Definition: DDDivision.cc:86
DDLogicalPart DDDividedTrdY::makeDDLogicalPart ( const int  copyNo) const
overridevirtual

Reimplemented from DDDividedGeometryObject.

Definition at line 225 of file DDDividedTrd.cc.

References DDDividedGeometryObject::compWidth_, DDDividedGeometryObject::div_, DDTrap::halfZ(), DDLogicalPart::material(), DDBase< N, C >::name(), DDDivision::parent(), DDLogicalPart::solid(), DDSolidFactory::trap(), DDTrap::x1(), DDTrap::x2(), DDTrap::x3(), and DDTrap::x4().

226 {
227  //---- The division along Y of a Trd will result a Trd, only
228  //--- if Y at -Z and +Z are equal, else use the G4Trap version
229  DDTrap mtrd = (DDTrap)(div_.parent().solid());
230  DDMaterial usemat = div_.parent().material();
231 
232  double pDx1 = mtrd.x1(); //->GetXHalfLength1() at Y+;
233  double pDx2 = mtrd.x2(); //->GetXHalfLength2() at Y+;
234  double pDx3 = mtrd.x3(); //->GetXHalfLength1() at Y-;
235  double pDx4 = mtrd.x4(); //->GetXHalfLength2() at Y-;
236  double pDz = mtrd.halfZ(); //->GetZHalfLength();
237  double pDy = compWidth_/2.;
238 
239  //trd.SetAllParameters ( pDx1, pDx2, pDy, pDy, pDz );
240  DDName solname(div_.name() );
241  DDSolid dsol(solname);
242  DDLogicalPart ddlp(solname);
243  if (!dsol.isDefined().second)
244  {
245  dsol = DDSolidFactory::trap(solname
246  , pDz
247  , 0.*deg
248  , 0.*deg
249  , pDy
250  , pDx1
251  , pDx2
252  , 0*deg
253  , pDy
254  , pDx3
255  , pDx4
256  , 0.*deg);
257  DDLogicalPart ddlp(solname, usemat, dsol);
258  }
259  return ddlp;
260 }
double halfZ(void) const
half of the z-Axis
Definition: DDSolid.cc:162
double x1(void) const
Half-length along x of the side at y=-pDy1 of the face at -pDz.
Definition: DDSolid.cc:174
const N & name() const
Definition: DDBase.h:78
DDMaterial is used to define and access material information.
Definition: DDMaterial.h:41
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
double x4(void) const
Half-length along x of the side at y=+pDy2 of the face at +pDz.
Definition: DDSolid.cc:189
Interface to a Trapezoid.
Definition: DDSolid.h:79
A DDLogicalPart aggregates information concerning material, solid and sensitveness ...
Definition: DDLogicalPart.h:92
static DDSolid trap(const DDName &name, double pDz, double pTheta, double pPhi, double pDy1, double pDx1, double pDx2, double pAlp1, double pDy2, double pDx3, double pDx4, double pAlp2)
Definition: DDSolid.cc:914
double x2(void) const
Half-length along x of the side at y=+pDy1 of the face at -pDz.
Definition: DDSolid.cc:177
const DDLogicalPart & parent() const
Definition: DDDivision.cc:86
const DDMaterial & material(void) const
Returns a reference object of the material this LogicalPart is made of.
double x3(void) const
Half-length along x of the side at y=-pDy2 of the face at +pDz.
Definition: DDSolid.cc:186
DDRotation DDDividedTrdY::makeDDRotation ( const int  copyNo) const
overridevirtual

Reimplemented from DDDividedGeometryObject.

Definition at line 219 of file DDDividedTrd.cc.

220 {
221  return DDRotation();
222 }
Represents a uniquely identifyable rotation matrix.
Definition: DDTransform.h:64
DDTranslation DDDividedTrdY::makeDDTranslation ( const int  copyNo) const
overridevirtual

Reimplemented from DDDividedGeometryObject.

Definition at line 193 of file DDDividedTrd.cc.

References DDDivision::axis(), DDDividedGeometryObject::compWidth_, DDDividedGeometryObject::div_, Exception, DDAxesNames::name(), DDDivision::offset(), DDDivision::parent(), alignCSCRings::s, DDLogicalPart::solid(), AlCaHLTBitMon_QueryRunRegistry::string, y, and DDTrap::y1().

194 {
195  DDTrap mtrd = (DDTrap)(div_.parent().solid() );
196  double mdy = mtrd.y1();
197 
198  //----- translation
199  double posi = -mdy + div_.offset() + (copyNo+0.5)*compWidth_;
200 
201  if( div_.axis() == DDAxes::y )
202  {
203  return DDTranslation(0.0, posi, 0.0);
204  }
205  else
206  {
207  std::string s = "ERROR - DDDividedTrdY::makeDDTranslation()";
208  s += "\n Axis is along ";
209  s += DDAxesNames::name(div_.axis());
210  s += " !\n" ;
211  s += "DDDividedTrdY::makeDDTranslation()";
212  s += " IllegalConstruct: Only axes along y are allowed !";
213  throw cms::Exception("DDException") << s;
214  }
215  return DDTranslation();
216 }
double offset() const
Definition: DDDivision.cc:81
const DDSolid & solid(void) const
Returns a reference object of the solid being the shape of this LogicalPart.
ROOT::Math::DisplacementVector3D< ROOT::Math::Cartesian3D< double > > DDTranslation
Definition: DDTranslation.h:7
Interface to a Trapezoid.
Definition: DDSolid.h:79
double y1(void) const
Half-length along y of the face at -pDz.
Definition: DDSolid.cc:171
DDAxes axis() const
Definition: DDDivision.cc:66
const DDLogicalPart & parent() const
Definition: DDDivision.cc:86
static const std::string name(const DDAxes &s)
Definition: DDAxes.cc:23