EIC Software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
FairGeoAssembly.cxx
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file FairGeoAssembly.cxx
1 //*-- AUTHOR : M. Al-Turany 21/04/2009
2 
4 //
5 // FairGeoAssmebly
6 //
7 // class for the shape Assembly
9 
10 #include "FairGeoAssembly.h"
11 
12 #include "FairGeoVolume.h"
13 #include "FairGeoVector.h"
14 
15 #include "TArrayD.h"
16 
18 
21 {
22  // constructor
23  fName="ASSEMBLY";
24  nPoints=0;
25  nParam=0;
26  param=new TArrayD(nParam);
27 }
28 
29 
31 {
32  // destructor
33  if (param) {
34  delete param;
35  param=0;
36  }
37  if (center) {
38  delete center;
39  center=0;
40  }
41  if (position) {
42  delete position;
43  position=0;
44  }
45 }
46 
47 Int_t FairGeoAssembly::readPoints(std::fstream* pFile,FairGeoVolume* volu)
48 {
49 
50  //Assemblies has no parameters so just return 1;
51  return 1;
52 }
53 
54 
56 {
57  // nothing to calculate
58 
59  return param;
60 }
61 
62 Bool_t FairGeoAssembly::writePoints(std::fstream* pFile,FairGeoVolume* volu)
63 {
64  // writes the 4 'points' decribed above to ascii file
65  if (!pFile) { return kFALSE; }
66  Text_t buf[155];
67  for(Int_t i=0; i<nPoints; i++) {
68  FairGeoVector& v=*(volu->getPoint(i));
69  sprintf(buf,"%9.3f\n",v(0));
70  pFile->write(buf,strlen(buf));
71  }
72  return kTRUE;
73 }
74 
75 
77 {
78  // prints volume points to screen
79  for(Int_t i=0; i<nPoints; i++) {
80  FairGeoVector& v=*(volu->getPoint(i));
81  printf("%9.3f\n",v(0));
82  }
83 }
84 
85 
86 
88  const FairGeoTransform& dTC,const FairGeoTransform& mTR)
89 {
90  // calls the function posInMother(...) to calculate the position of the
91  // volume in its mother
92  Double_t t[3]= {0.,0.,0.};
94  posInMother(dTC,mTR);
95 }
96