//*-- AUTHOR : Ilse Koenig //*-- Modified : 11/11/2003 by Ilse Koenig //*-- Modified : 14/05/99 by Ilse Koenig ///////////////////////////////////////////////////////////// // // FairGeoBrik // // class for the GEANT shape BOX // // The intrisic coordinate system of a BOX in GEANT/ROOT has the // same orientation as the volume described by its 8 points // in the technical coordinate system // ///////////////////////////////////////////////////////////// #include "FairGeoBrik.h" #include "FairGeoVolume.h" #include "FairGeoVector.h" #include "TArrayD.h" ClassImp(FairGeoBrik) FairGeoBrik::FairGeoBrik() :FairGeoBasicShape() { // constructor fName="BOX "; nPoints=8; nParam=3; param=new TArrayD(nParam); } FairGeoBrik::~FairGeoBrik() { // destructor if (param) { delete param; param=0; } if (center) { delete center; center=0; } if (position) { delete position; position=0; } } TArrayD* FairGeoBrik::calcVoluParam(FairGeoVolume* volu) { // calculates the parameters needed to create the shape if (!volu) { return 0; } FairGeoVector v=*(volu->getPoint(5)) - *(volu->getPoint(3)); v.abs(); v*=(1/20.); for(Int_t i=0; iAddAt(v(i),i); } return param; } void FairGeoBrik::calcVoluPosition(FairGeoVolume* volu, const FairGeoTransform& dTC,const FairGeoTransform& mTR) { // calls the function posInMother(...) to calculate the position of the // volume in its mother FairGeoVector trans=*(volu->getPoint(5)) + *(volu->getPoint(3)); trans*=0.5; center->clear(); center->setTransVector(trans); posInMother(dTC,mTR); }