FairRoot
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
FairGeoBrik.cxx
Go to the documentation of this file.
1 /********************************************************************************
2  * Copyright (C) 2014 GSI Helmholtzzentrum fuer Schwerionenforschung GmbH *
3  * *
4  * This software is distributed under the terms of the *
5  * GNU Lesser General Public Licence (LGPL) version 3, *
6  * copied verbatim in the file "LICENSE" *
7  ********************************************************************************/
8 //*-- AUTHOR : Ilse Koenig
9 //*-- Modified : 11/11/2003 by Ilse Koenig
10 //*-- Modified : 14/05/99 by Ilse Koenig
11 
13 //
14 // FairGeoBrik
15 //
16 // class for the GEANT shape BOX
17 //
18 // The intrisic coordinate system of a BOX in GEANT/ROOT has the
19 // same orientation as the volume described by its 8 points
20 // in the technical coordinate system
21 //
23 #include "FairGeoBrik.h"
24 
25 #include "FairGeoTransform.h" // for FairGeoTransform
26 #include "FairGeoVector.h" // for FairGeoVector
27 #include "FairGeoVolume.h" // for FairGeoVolume
28 
29 #include <TArrayD.h> // for TArrayD
30 #include <TString.h> // for TString
31 
33 
36 {
37  // constructor
38  fName = "BOX ";
39  nPoints = 8;
40  nParam = 3;
41  param = new TArrayD(nParam);
42 }
43 
45 {
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 
62 {
63  // calculates the parameters needed to create the shape
64  if (!volu) {
65  return 0;
66  }
67  FairGeoVector v = *(volu->getPoint(5)) - *(volu->getPoint(3));
68  v.abs();
69  v *= (1 / 20.);
70  for (Int_t i = 0; i < nParam; i++) {
71  param->AddAt(v(i), i);
72  }
73  return param;
74 }
75 
77 {
78  // calls the function posInMother(...) to calculate the position of the
79  // volume in its mother
80  FairGeoVector trans = *(volu->getPoint(5)) + *(volu->getPoint(3));
81  trans *= 0.5;
82  center->clear();
83  center->setTransVector(trans);
84  posInMother(dTC, mTR);
85 }
void posInMother(const FairGeoTransform &, const FairGeoTransform &)
void setTransVector(const FairGeoVector &t)
FairGeoTransform * center
ClassImp(FairEventBuilder)
TArrayD * calcVoluParam(FairGeoVolume *)
Definition: FairGeoBrik.cxx:61
FairGeoVector * getPoint(const Int_t n)
Definition: FairGeoVolume.h:85
void calcVoluPosition(FairGeoVolume *, const FairGeoTransform &, const FairGeoTransform &)
Definition: FairGeoBrik.cxx:76
FairGeoTransform * position
FairGeoVector & abs()