ROOT logo
//*-- AUTHOR : Ilse Koenig
//*-- Modified : 11/11/2003 by Ilse Koenig
//*-- Modified : 16/05/99 by Ilse Koenig

//_HADES_CLASS_DESCRIPTION 
/////////////////////////////////////////////////////////////
//
// HGeomTrd1
//
// class for the GEANT shape TRD1
// 
// The technical coordinate system of a TRD1, which sits in
// CAVE and is not rotated, is the laboratory system.
// The y-axis points from the smaller side to the larger one.
// That's the same definitition as for a TRAP and different from
// the Geant or ROOT definition for a TRD1.
// Therefore a transformation is needed:
//              x-technical = - (x-Geant)
//              y-technical = z-Geant
//              z-technical = y-Geant
// This is stored in the data element intrinsicRot which is
// created in the function calcVoluPosition(...)
// 
/////////////////////////////////////////////////////////////

#include "hgeomtrd1.h"
#include "hgeomvolume.h"
#include "hgeomvector.h"

ClassImp(HGeomTrd1)

HGeomTrd1::HGeomTrd1() {
  // constructor
  fName="TRD1";
  nPoints=8;
  nParam=4;
  param=new TArrayD(nParam);
  intrinsicRot.setZero();
  intrinsicRot.setElement(-1.,0);
  intrinsicRot.setElement(1.,5);
  intrinsicRot.setElement(1.,7);
}


HGeomTrd1::~HGeomTrd1() {
  // destructor
  if (param) {
    delete param;
    param=0;
  }
  if (center) {
    delete center;
    center=0;
  }
  if (position) {
    delete position;
    position=0;
  }
}


TArrayD* HGeomTrd1::calcVoluParam(HGeomVolume* volu) {
  // calculates the parameters needed to create the shape 
  Double_t fac=20.;
  HGeomVector& v0=*(volu->getPoint(0));
  HGeomVector& v1=*(volu->getPoint(1));
  HGeomVector& v2=*(volu->getPoint(2));
  HGeomVector& v3=*(volu->getPoint(3));
  HGeomVector& v4=*(volu->getPoint(4));
  param->AddAt(TMath::Abs((v0(0)-v3(0))/fac),0);
  param->AddAt((v1(0)-v2(0))/fac,1);
  param->AddAt((v4(2)-v0(2))/fac,2);
  param->AddAt((v1(1)-v0(1))/fac,3);
  return param;
} 


void HGeomTrd1::calcVoluPosition(HGeomVolume* volu,
            const HGeomTransform& dTC,const HGeomTransform& mTR) {
  // calls the function posInMother(...) to calculate the position of the
  // volume in its mother 
  Double_t t[3]={0.,0.,0.};
  for(Int_t i=0;i<4;i++) t[0]+=(*(volu->getPoint(i)))(0);
  t[0]/=4.;
  HGeomVector& v0=*(volu->getPoint(0));
  HGeomVector& v1=*(volu->getPoint(1));
  HGeomVector& v4=*(volu->getPoint(4));
  t[1]=(v1(1)+v0(1))/2.;
  t[2]=(v4(2)+v0(2))/2.;
  center->setTransVector(t);
  center->setRotMatrix(intrinsicRot);
  posInMother(dTC,mTR);
}

 hgeomtrd1.cc:1
 hgeomtrd1.cc:2
 hgeomtrd1.cc:3
 hgeomtrd1.cc:4
 hgeomtrd1.cc:5
 hgeomtrd1.cc:6
 hgeomtrd1.cc:7
 hgeomtrd1.cc:8
 hgeomtrd1.cc:9
 hgeomtrd1.cc:10
 hgeomtrd1.cc:11
 hgeomtrd1.cc:12
 hgeomtrd1.cc:13
 hgeomtrd1.cc:14
 hgeomtrd1.cc:15
 hgeomtrd1.cc:16
 hgeomtrd1.cc:17
 hgeomtrd1.cc:18
 hgeomtrd1.cc:19
 hgeomtrd1.cc:20
 hgeomtrd1.cc:21
 hgeomtrd1.cc:22
 hgeomtrd1.cc:23
 hgeomtrd1.cc:24
 hgeomtrd1.cc:25
 hgeomtrd1.cc:26
 hgeomtrd1.cc:27
 hgeomtrd1.cc:28
 hgeomtrd1.cc:29
 hgeomtrd1.cc:30
 hgeomtrd1.cc:31
 hgeomtrd1.cc:32
 hgeomtrd1.cc:33
 hgeomtrd1.cc:34
 hgeomtrd1.cc:35
 hgeomtrd1.cc:36
 hgeomtrd1.cc:37
 hgeomtrd1.cc:38
 hgeomtrd1.cc:39
 hgeomtrd1.cc:40
 hgeomtrd1.cc:41
 hgeomtrd1.cc:42
 hgeomtrd1.cc:43
 hgeomtrd1.cc:44
 hgeomtrd1.cc:45
 hgeomtrd1.cc:46
 hgeomtrd1.cc:47
 hgeomtrd1.cc:48
 hgeomtrd1.cc:49
 hgeomtrd1.cc:50
 hgeomtrd1.cc:51
 hgeomtrd1.cc:52
 hgeomtrd1.cc:53
 hgeomtrd1.cc:54
 hgeomtrd1.cc:55
 hgeomtrd1.cc:56
 hgeomtrd1.cc:57
 hgeomtrd1.cc:58
 hgeomtrd1.cc:59
 hgeomtrd1.cc:60
 hgeomtrd1.cc:61
 hgeomtrd1.cc:62
 hgeomtrd1.cc:63
 hgeomtrd1.cc:64
 hgeomtrd1.cc:65
 hgeomtrd1.cc:66
 hgeomtrd1.cc:67
 hgeomtrd1.cc:68
 hgeomtrd1.cc:69
 hgeomtrd1.cc:70
 hgeomtrd1.cc:71
 hgeomtrd1.cc:72
 hgeomtrd1.cc:73
 hgeomtrd1.cc:74
 hgeomtrd1.cc:75
 hgeomtrd1.cc:76
 hgeomtrd1.cc:77
 hgeomtrd1.cc:78
 hgeomtrd1.cc:79
 hgeomtrd1.cc:80
 hgeomtrd1.cc:81
 hgeomtrd1.cc:82
 hgeomtrd1.cc:83
 hgeomtrd1.cc:84
 hgeomtrd1.cc:85
 hgeomtrd1.cc:86
 hgeomtrd1.cc:87
 hgeomtrd1.cc:88
 hgeomtrd1.cc:89
 hgeomtrd1.cc:90
 hgeomtrd1.cc:91
 hgeomtrd1.cc:92
 hgeomtrd1.cc:93
 hgeomtrd1.cc:94