EIC Software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
FairGeoBrik.cxx
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file FairGeoBrik.cxx
1 //*-- AUTHOR : Ilse Koenig
2 //*-- Modified : 11/11/2003 by Ilse Koenig
3 //*-- Modified : 14/05/99 by Ilse Koenig
4 
6 //
7 // FairGeoBrik
8 //
9 // class for the GEANT shape BOX
10 //
11 // The intrisic coordinate system of a BOX in GEANT/ROOT has the
12 // same orientation as the volume described by its 8 points
13 // in the technical coordinate system
14 //
16 
17 #include "FairGeoBrik.h"
18 
19 #include "FairGeoVolume.h"
20 #include "FairGeoVector.h"
21 
22 #include "TArrayD.h"
23 
25 
28 {
29  // constructor
30  fName="BOX ";
31  nPoints=8;
32  nParam=3;
33  param=new TArrayD(nParam);
34 }
35 
36 
38 {
39  // destructor
40  if (param) {
41  delete param;
42  param=0;
43  }
44  if (center) {
45  delete center;
46  center=0;
47  }
48  if (position) {
49  delete position;
50  position=0;
51  }
52 }
53 
54 
56 {
57  // calculates the parameters needed to create the shape
58  if (!volu) { return 0; }
59  FairGeoVector v=*(volu->getPoint(5)) - *(volu->getPoint(3));
60  v.abs();
61  v*=(1/20.);
62  for(Int_t i=0; i<nParam; i++) { param->AddAt(v(i),i); }
63  return param;
64 }
65 
66 
68  const FairGeoTransform& dTC,const FairGeoTransform& mTR)
69 {
70  // calls the function posInMother(...) to calculate the position of the
71  // volume in its mother
72  FairGeoVector trans=*(volu->getPoint(5)) + *(volu->getPoint(3));
73  trans*=0.5;
74  center->clear();
75  center->setTransVector(trans);
76  posInMother(dTC,mTR);
77 }
78 
79 
80 
81 
82