#include <DDDividedTrd.h>
Public Member Functions | |
virtual void | checkParametersValidity () |
DDDividedTrdY (const DDDivision &div, DDCompactView *cpv) | |
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 | ~DDDividedTrdY () |
Definition at line 33 of file DDDividedTrd.h.
DDDividedTrdY::DDDividedTrdY | ( | const DDDivision & | div, |
DDCompactView * | cpv | ||
) |
Definition at line 177 of file DDDividedTrd.cc.
References DDDividedGeometryObject::calculateNDiv(), DDDividedGeometryObject::calculateWidth(), checkParametersValidity(), DDDividedGeometryObject::compNDiv_, DDDividedGeometryObject::compWidth_, DCOUT_V, DDDividedGeometryObject::div_, DDDividedGeometryObject::divisionType_, DivNDIV, DivWIDTH, DDDivision::nReplicas(), DDDivision::offset(), DDDivision::parent(), DDDividedGeometryObject::setType(), DDLogicalPart::solid(), DDDivision::width(), and DDTrap::y1().
: DDDividedGeometryObject( div, cpv ) { checkParametersValidity(); setType( "DivisionTrdY" ); DDTrap mtrd = (DDTrap)(div_.parent().solid()); if( divisionType_ == DivWIDTH ) { compNDiv_ = calculateNDiv( 2 * mtrd.y1(), div_.width(), div_.offset() ); } else if( divisionType_ == DivNDIV ) { compWidth_ = calculateWidth( 2 * mtrd.y1(), div_.nReplicas(), div_.offset() ); } DCOUT_V ('P', " DDDividedTrdY no divisions " << compNDiv_ << " = " << div_.nReplicas() << "\n Offset " << div_.offset() << "\n width " << compWidth_ << " = " << div_.width() << std::endl); }
DDDividedTrdY::~DDDividedTrdY | ( | void | ) | [virtual] |
Definition at line 196 of file DDDividedTrd.cc.
{}
void DDDividedTrdY::checkParametersValidity | ( | void | ) | [virtual] |
Reimplemented from DDDividedGeometryObject.
Definition at line 280 of file DDDividedTrd.cc.
References DDTrap::alpha1(), DDTrap::alpha2(), DDDividedGeometryObject::div_, DDDivision::parent(), DDTrap::phi(), asciidump::s, DDLogicalPart::solid(), DDTrap::theta(), DDDividedGeometryObject::tolerance(), DDTrap::y1(), and DDTrap::y2().
Referenced by DDDividedTrdY().
{ DDDividedGeometryObject::checkParametersValidity(); DDTrap mtrd = (DDTrap)(div_.parent().solid()); double mpDy1 = mtrd.y1(); //->GetYHalfLength1(); double mpDy2 = mtrd.y2(); //->GetYHalfLength2(); double mpTheta = mtrd.theta(); double mpPhi = mtrd.phi(); double mpAlpha1 = mtrd.alpha1(); double mpAlpha2 = mtrd.alpha2(); if( fabs(mpDy1 - mpDy2) > tolerance() ) { std::string s= "ERROR - DDDividedTrdY::checkParametersValidity()"; s += "\n Making a division of a TRD along axis Y while"; s += "\n the Y half lengths are not equal is not (yet)"; s += "\n supported. It will result in non-equal"; s += "\n division solids."; throw DDException(s); } // mec: we only have traps, not trds in DDD, so I added this check // to make sure it is only a trd (I think! :-)) if (mpAlpha1 != 0.*deg || mpAlpha2 != 0.*deg || mpTheta != 0.*deg || mpPhi != 0.*deg) { std::string s = "ERROR - DDDividedTrdY::checkParametersValidity()"; s+= "\n Making a division of a TRD along axis X,"; s+= "\n while the theta, phi and aplhpa2 are not zero,"; s+= "\n is not (yet) supported. It will result"; s+= "\n in non-equal division solids."; throw DDException(s); } }
double DDDividedTrdY::getMaxParameter | ( | void | ) | const [virtual] |
Reimplemented from DDDividedGeometryObject.
Definition at line 200 of file DDDividedTrd.cc.
References DDDividedGeometryObject::div_, DDDivision::parent(), DDLogicalPart::solid(), and DDTrap::y1().
DDLogicalPart DDDividedTrdY::makeDDLogicalPart | ( | const int | copyNo | ) | const [virtual] |
Reimplemented from DDDividedGeometryObject.
Definition at line 241 of file DDDividedTrd.cc.
References DDDividedGeometryObject::compWidth_, DCOUT_V, 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().
{ //---- The division along Y of a Trd will result a Trd, only //--- if Y at -Z and +Z are equal, else use the G4Trap version DDTrap mtrd = (DDTrap)(div_.parent().solid()); DDMaterial usemat = div_.parent().material(); double pDx1 = mtrd.x1(); //->GetXHalfLength1() at Y+; double pDx2 = mtrd.x2(); //->GetXHalfLength2() at Y+; double pDx3 = mtrd.x3(); //->GetXHalfLength1() at Y-; double pDx4 = mtrd.x4(); //->GetXHalfLength2() at Y-; double pDz = mtrd.halfZ(); //->GetZHalfLength(); double pDy = compWidth_/2.; //trd.SetAllParameters ( pDx1, pDx2, pDy, pDy, pDz ); DDName solname(div_.name() ); DDSolid dsol(solname); DDLogicalPart ddlp(solname); if (!dsol.isDefined().second) { dsol = DDSolidFactory::trap(solname , pDz , 0.*deg , 0.*deg , pDy , pDx1 , pDx2 , 0*deg , pDy , pDx3 , pDx4 , 0.*deg); DDLogicalPart ddlp(solname, usemat, dsol); } DCOUT_V ('P', "DDDividedTrdY::makeDDLogicalPart lp = " << ddlp); return ddlp; }
DDRotation DDDividedTrdY::makeDDRotation | ( | const int | copyNo | ) | const [virtual] |
Reimplemented from DDDividedGeometryObject.
Definition at line 235 of file DDDividedTrd.cc.
{ return DDRotation(); }
DDTranslation DDDividedTrdY::makeDDTranslation | ( | const int | copyNo | ) | const [virtual] |
Reimplemented from DDDividedGeometryObject.
Definition at line 207 of file DDDividedTrd.cc.
References DDDivision::axis(), DDDividedGeometryObject::compWidth_, DCOUT_V, DDDividedGeometryObject::div_, AlCaRecoCosmics_cfg::name, DDAxesNames::name(), DDDivision::offset(), DDDivision::parent(), asciidump::s, DDLogicalPart::solid(), ExpressReco_HICollisions_FallBack::y, and DDTrap::y1().
{ DDTrap mtrd = (DDTrap)(div_.parent().solid() ); double mdy = mtrd.y1(); //----- translation double posi = -mdy + div_.offset() + (copyNo+0.5)*compWidth_; DCOUT_V ('P', " DDDividedTrdY: " << copyNo << "\n Position: y=" << posi << " Axis= " << DDAxesNames::name(div_.axis()) << "\n"); if( div_.axis() == y ) { return DDTranslation(0.0, posi, 0.0); } else { std::string s = "ERROR - DDDividedTrdY::makeDDTranslation()"; s += "\n Axis is along "; s += DDAxesNames::name(div_.axis()); s += " !\n" ; s += "DDDividedTrdY::makeDDTranslation()"; s += " IllegalConstruct: Only axes along y are allowed !"; throw DDException(s); } return DDTranslation(); }