HYDRA_development_version
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
hgeomtrd1.cc
Go to the documentation of this file.
1 //*-- AUTHOR : Ilse Koenig
2 //*-- Modified : 11/11/2003 by Ilse Koenig
3 //*-- Modified : 16/05/99 by Ilse Koenig
4 
5 //_HADES_CLASS_DESCRIPTION
6 /////////////////////////////////////////////////////////////
7 //
8 // HGeomTrd1
9 //
10 // class for the GEANT shape TRD1
11 //
12 // The technical coordinate system of a TRD1, which sits in
13 // CAVE and is not rotated, is the laboratory system.
14 // The y-axis points from the smaller side to the larger one.
15 // That's the same definitition as for a TRAP and different from
16 // the Geant or ROOT definition for a TRD1.
17 // Therefore a transformation is needed:
18 // x-technical = - (x-Geant)
19 // y-technical = z-Geant
20 // z-technical = y-Geant
21 // This is stored in the data element intrinsicRot which is
22 // created in the function calcVoluPosition(...)
23 //
24 /////////////////////////////////////////////////////////////
25 
26 #include "hgeomtrd1.h"
27 #include "hgeomvolume.h"
28 #include "hgeomvector.h"
29 
31 
33  // constructor
34  fName="TRD1";
35  nPoints=8;
36  nParam=4;
37  param=new TArrayD(nParam);
38  intrinsicRot.setZero();
39  intrinsicRot.setElement(-1.,0);
40  intrinsicRot.setElement(1.,5);
41  intrinsicRot.setElement(1.,7);
42 }
43 
44 
46  // destructor
47  if (param) {
48  delete param;
49  param=0;
50  }
51  if (center) {
52  delete center;
53  center=0;
54  }
55  if (position) {
56  delete position;
57  position=0;
58  }
59 }
60 
61 
63  // calculates the parameters needed to create the shape
64  Double_t fac=20.;
65  HGeomVector& v0=*(volu->getPoint(0));
66  HGeomVector& v1=*(volu->getPoint(1));
67  HGeomVector& v2=*(volu->getPoint(2));
68  HGeomVector& v3=*(volu->getPoint(3));
69  HGeomVector& v4=*(volu->getPoint(4));
70  param->AddAt(TMath::Abs((v0(0)-v3(0))/fac),0);
71  param->AddAt((v1(0)-v2(0))/fac,1);
72  param->AddAt((v4(2)-v0(2))/fac,2);
73  param->AddAt((v1(1)-v0(1))/fac,3);
74  return param;
75 }
76 
77 
79  const HGeomTransform& dTC,const HGeomTransform& mTR) {
80  // calls the function posInMother(...) to calculate the position of the
81  // volume in its mother
82  Double_t t[3]={0.,0.,0.};
83  for(Int_t i=0;i<4;i++) t[0]+=(*(volu->getPoint(i)))(0);
84  t[0]/=4.;
85  HGeomVector& v0=*(volu->getPoint(0));
86  HGeomVector& v1=*(volu->getPoint(1));
87  HGeomVector& v4=*(volu->getPoint(4));
88  t[1]=(v1(1)+v0(1))/2.;
89  t[2]=(v4(2)+v0(2))/2.;
92  posInMother(dTC,mTR);
93 }
94 
void calcVoluPosition(HGeomVolume *, const HGeomTransform &, const HGeomTransform &)
Definition: hgeomtrd1.cc:78
HGeomTransform * center
ClassImp(HGeomTrd1) HGeomTrd1
Definition: hgeomtrd1.cc:30
void posInMother(const HGeomTransform &, const HGeomTransform &)
HGeomRotation intrinsicRot
Definition: hgeomtrd1.h:10
void setTransVector(const HGeomVector &t)
void setRotMatrix(const HGeomRotation &r)
TArrayD * calcVoluParam(HGeomVolume *)
Definition: hgeomtrd1.cc:62
HGeomVector * getPoint(const Int_t n)
Definition: hgeomvolume.h:52
~HGeomTrd1()
Definition: hgeomtrd1.cc:45
HGeomTransform * position