FairRoot/PandaRoot
Public Member Functions | Protected Attributes | List of all members
PndGeoHypGeBase Class Reference

#include <PndGeoHypGeBase.h>

Inheritance diagram for PndGeoHypGeBase:
PndGeoHypGeCluster PndGeoHypGeDEGAS PndGeoHypGeDoubleCluster PndGeoHypGeSingleCluster PndGeoHypGeTripleCluster PndGeoHypGeTripleClusterCrystalsOnly

Public Member Functions

 PndGeoHypGeBase ()
 
virtual ~PndGeoHypGeBase ()
 
void BuildTArb8Array (Double_t *OutputArray, Int_t Point1, Int_t Point2, Int_t Offset1, Int_t Offset2, Int_t ShiftValue, Int_t NumberOfPoints)
 
void BuildTArb8Array (Double_t *OutputArray, Int_t Point1, Int_t Point2, Int_t Offset1, Int_t Offset2, Int_t Offset3, Int_t Offset4, Int_t NumberOfPoints)
 
void BuildTArb8FrontArray (Double_t *OutputArray, Int_t Point1, Int_t Point2, Int_t Point3, Int_t Point4, Int_t NumberOfPoints)
 
void BuildTArb8TopArray (Double_t *OutputArray, Int_t Point1, Int_t Point2, Int_t Point3, Int_t Point4, Int_t Offset, Int_t NumberOfPoints)
 
void FillInputArray (Int_t NumberOfPoints, Int_t NumberOfXYInput)
 
void FillZValues (Int_t NumberofDifferentZValues)
 
void ReadCoordinatesAndAngles (string Filename, Int_t NumberOfCluster, Double_t *CoordinatesAndAngles)
 
 ClassDef (PndGeoHypGeBase, 0)
 

Protected Attributes

Double_tCoordinatesInputArray
 
Double_tZValuesInputArray
 
ifstream ParametersInputFile
 

Detailed Description

Definition at line 38 of file PndGeoHypGeBase.h.

Constructor & Destructor Documentation

PndGeoHypGeBase::PndGeoHypGeBase ( )

Definition at line 32 of file PndGeoHypGeBase.cxx.

33 {
34 
35 }
PndGeoHypGeBase::~PndGeoHypGeBase ( )
virtual

Definition at line 38 of file PndGeoHypGeBase.cxx.

39 {
40 
41 }

Member Function Documentation

void PndGeoHypGeBase::BuildTArb8Array ( Double_t OutputArray,
Int_t  Point1,
Int_t  Point2,
Int_t  Offset1,
Int_t  Offset2,
Int_t  ShiftValue,
Int_t  NumberOfPoints 
)

Definition at line 43 of file PndGeoHypGeBase.cxx.

Referenced by PndGeoHypGeDoubleCluster::BuildCryostat().

44 {
45  //Point1(2) are running with every single fragment of the cryostat.
46  //Offset11(2) are increased with every new layer (lower, middle, upper, ...) of the cryostat
47  Int_t Offset3 = Offset1 +ShiftValue;
48  Int_t Offset4 = Offset2 +ShiftValue;
49  OutputArray[0]= CoordinatesInputArray[(Point2-1)* NumberOfPoints+2*Offset1];
50  OutputArray[1]= CoordinatesInputArray[(Point2-1)* NumberOfPoints+2*Offset1+1];
51  OutputArray[2]= CoordinatesInputArray[(Point2-1)* NumberOfPoints+2*Offset3];
52  OutputArray[3]= CoordinatesInputArray[(Point2-1)* NumberOfPoints+2*Offset3+1];
53  OutputArray[4]= CoordinatesInputArray[(Point1-1)* NumberOfPoints+2*Offset3];
54  OutputArray[5]= CoordinatesInputArray[(Point1-1)* NumberOfPoints+2*Offset3+1];
55  OutputArray[6]= CoordinatesInputArray[(Point1-1)* NumberOfPoints+2*Offset1];
56  OutputArray[7]= CoordinatesInputArray[(Point1-1)* NumberOfPoints+2*Offset1+1];
57  OutputArray[8]= CoordinatesInputArray[(Point2-1)* NumberOfPoints+2*Offset2];
58  OutputArray[9]= CoordinatesInputArray[(Point2-1)* NumberOfPoints+2*Offset2+1];
59  OutputArray[10]= CoordinatesInputArray[(Point2-1)* NumberOfPoints+2*Offset4];
60  OutputArray[11]= CoordinatesInputArray[(Point2-1)* NumberOfPoints+2*Offset4+1];
61  OutputArray[12]= CoordinatesInputArray[(Point1-1)* NumberOfPoints+2*Offset4];
62  OutputArray[13]= CoordinatesInputArray[(Point1-1)* NumberOfPoints+2*Offset4+1];
63  OutputArray[14]= CoordinatesInputArray[(Point1-1)* NumberOfPoints+2*Offset2];
64  OutputArray[15]= CoordinatesInputArray[(Point1-1)* NumberOfPoints+2*Offset2+1];
65 }
Double_t * CoordinatesInputArray
void PndGeoHypGeBase::BuildTArb8Array ( Double_t OutputArray,
Int_t  Point1,
Int_t  Point2,
Int_t  Offset1,
Int_t  Offset2,
Int_t  Offset3,
Int_t  Offset4,
Int_t  NumberOfPoints 
)

Definition at line 67 of file PndGeoHypGeBase.cxx.

68 {
69  OutputArray[0]= CoordinatesInputArray[(Point1-1)* NumberOfPoints+2*Offset1];
70  OutputArray[1]= CoordinatesInputArray[(Point1-1)* NumberOfPoints+2*Offset1+1];
71  OutputArray[2]= CoordinatesInputArray[(Point1-1)* NumberOfPoints+2*Offset3];
72  OutputArray[3]= CoordinatesInputArray[(Point1-1)* NumberOfPoints+2*Offset3+1];
73  OutputArray[4]= CoordinatesInputArray[(Point2-1)* NumberOfPoints+2*Offset3];
74  OutputArray[5]= CoordinatesInputArray[(Point2-1)* NumberOfPoints+2*Offset3+1];
75  OutputArray[6]= CoordinatesInputArray[(Point2-1)* NumberOfPoints+2*Offset1];
76  OutputArray[7]= CoordinatesInputArray[(Point2-1)* NumberOfPoints+2*Offset1+1];
77  OutputArray[8]= CoordinatesInputArray[(Point1-1)* NumberOfPoints+2*Offset2];
78  OutputArray[9]= CoordinatesInputArray[(Point1-1)* NumberOfPoints+2*Offset2+1];
79  OutputArray[10]= CoordinatesInputArray[(Point1-1)* NumberOfPoints+2*Offset4];
80  OutputArray[11]= CoordinatesInputArray[(Point1-1)* NumberOfPoints+2*Offset4+1];
81  OutputArray[12]= CoordinatesInputArray[(Point2-1)* NumberOfPoints+2*Offset4];
82  OutputArray[13]= CoordinatesInputArray[(Point2-1)* NumberOfPoints+2*Offset4+1];
83  OutputArray[14]= CoordinatesInputArray[(Point2-1)* NumberOfPoints+2*Offset2];
84  OutputArray[15]= CoordinatesInputArray[(Point2-1)* NumberOfPoints+2*Offset2+1];
85 }
Double_t * CoordinatesInputArray
void PndGeoHypGeBase::BuildTArb8FrontArray ( Double_t OutputArray,
Int_t  Point1,
Int_t  Point2,
Int_t  Point3,
Int_t  Point4,
Int_t  NumberOfPoints 
)

Definition at line 87 of file PndGeoHypGeBase.cxx.

Referenced by PndGeoHypGeDoubleCluster::BuildCryostat().

88 {
89  OutputArray[0]= CoordinatesInputArray[(Point1-1)* NumberOfPoints];
90  OutputArray[1]= CoordinatesInputArray[(Point1-1)* NumberOfPoints+1];
91  OutputArray[2]= CoordinatesInputArray[(Point2-1)* NumberOfPoints];
92  OutputArray[3]= CoordinatesInputArray[(Point2-1)* NumberOfPoints+1];
93  OutputArray[4]= CoordinatesInputArray[(Point3-1)* NumberOfPoints];
94  OutputArray[5]= CoordinatesInputArray[(Point3-1)* NumberOfPoints+1];
95  OutputArray[6]= CoordinatesInputArray[(Point4-1)* NumberOfPoints];
96  OutputArray[7]= CoordinatesInputArray[(Point4-1)* NumberOfPoints+1];
97  OutputArray[8]= CoordinatesInputArray[(Point1-1)* NumberOfPoints+2];
98  OutputArray[9]= CoordinatesInputArray[(Point1-1)* NumberOfPoints+2+1];
99  OutputArray[10]= CoordinatesInputArray[(Point2-1)* NumberOfPoints+2];
100  OutputArray[11]= CoordinatesInputArray[(Point2-1)* NumberOfPoints+2+1];
101  OutputArray[12]= CoordinatesInputArray[(Point3-1)* NumberOfPoints+2];
102  OutputArray[13]= CoordinatesInputArray[(Point3-1)* NumberOfPoints+2+1];
103  OutputArray[14]= CoordinatesInputArray[(Point4-1)* NumberOfPoints+2];
104  OutputArray[15]= CoordinatesInputArray[(Point4-1)* NumberOfPoints+2+1];
105  //for( Int_t i = 0; i < 16; i++)
106  //cout << "Top_" << i <<": " << OutputArray[i] << endl;
107 }
Double_t * CoordinatesInputArray
void PndGeoHypGeBase::BuildTArb8TopArray ( Double_t OutputArray,
Int_t  Point1,
Int_t  Point2,
Int_t  Point3,
Int_t  Point4,
Int_t  Offset,
Int_t  NumberOfPoints 
)

Definition at line 109 of file PndGeoHypGeBase.cxx.

Referenced by PndGeoHypGeDoubleCluster::BuildCryostat().

110 {
111  OutputArray[0]= CoordinatesInputArray[(Point1-1)* NumberOfPoints+2*Offset];
112  OutputArray[1]= CoordinatesInputArray[(Point1-1)* NumberOfPoints+2*Offset+1];
113  OutputArray[2]= CoordinatesInputArray[(Point2-1)* NumberOfPoints+2*Offset];
114  OutputArray[3]= CoordinatesInputArray[(Point2-1)* NumberOfPoints+2*Offset+1];
115  OutputArray[4]= CoordinatesInputArray[(Point3-1)* NumberOfPoints+2*Offset];
116  OutputArray[5]= CoordinatesInputArray[(Point3-1)* NumberOfPoints+2*Offset+1];
117  OutputArray[6]= CoordinatesInputArray[(Point4-1)* NumberOfPoints+2*Offset];
118  OutputArray[7]= CoordinatesInputArray[(Point4-1)* NumberOfPoints+2*Offset+1];
119  OutputArray[8]= CoordinatesInputArray[(Point1-1)* NumberOfPoints+2*Offset];
120  OutputArray[9]= CoordinatesInputArray[(Point1-1)* NumberOfPoints+2*Offset+1];
121  OutputArray[10]= CoordinatesInputArray[(Point2-1)* NumberOfPoints+2*Offset];
122  OutputArray[11]= CoordinatesInputArray[(Point2-1)* NumberOfPoints+2*Offset+1];
123  OutputArray[12]= CoordinatesInputArray[(Point3-1)* NumberOfPoints+2*Offset];
124  OutputArray[13]= CoordinatesInputArray[(Point3-1)* NumberOfPoints+2*Offset+1];
125  OutputArray[14]= CoordinatesInputArray[(Point4-1)* NumberOfPoints+2*Offset];
126  OutputArray[15]= CoordinatesInputArray[(Point4-1)* NumberOfPoints+2*Offset+1];
127  //for( Int_t i = 0; i < 16; i++)
128  // cout << "Top_" << i <<": " << OutputArray[i] << endl;
129 }
Double_t * CoordinatesInputArray
PndGeoHypGeBase::ClassDef ( PndGeoHypGeBase  ,
 
)
void PndGeoHypGeBase::FillInputArray ( Int_t  NumberOfPoints,
Int_t  NumberOfXYInput 
)

Definition at line 130 of file PndGeoHypGeBase.cxx.

Referenced by PndGeoHypGeDoubleCluster::PndGeoHypGeDoubleCluster().

131 {
132  for (Int_t iPoint = 0; iPoint < NumberOfPoints;iPoint++)
133  {
134  if (!ParametersInputFile)
135  {
136  cout << "Inputfile does not exist!" << endl;
137  }
138  else if (ParametersInputFile.good())
139  {
140  string InputBuffer;
141  char* pEnd;
142  getline(ParametersInputFile,InputBuffer);
143  //cout << InputBuffer << endl;
144 
145  CoordinatesInputArray[iPoint*NumberOfXYInput] = strtod(InputBuffer.data(),&pEnd);
146  //cout << "Value_0" <<": " <<CoordinatesInputArray[iPoint*NumberOfXYInput] << endl;
147  for (Int_t iValues = 1; iValues < NumberOfXYInput; iValues++)
148  {
149  CoordinatesInputArray[iPoint*NumberOfXYInput+iValues] = strtod(pEnd,&pEnd);
150  //cout << "Value_" << iValues <<": " <<CoordinatesInputArray[iPoint*NumberOfXYInput+iValues] << endl;
151  }
152  }
153  }
154 }
ifstream ParametersInputFile
Double_t * CoordinatesInputArray
void PndGeoHypGeBase::FillZValues ( Int_t  NumberofDifferentZValues)

Definition at line 156 of file PndGeoHypGeBase.cxx.

Referenced by PndGeoHypGeDoubleCluster::PndGeoHypGeDoubleCluster().

157 {
158  if (!ParametersInputFile)
159  {
160  cout << "Inputfile does not exist!" << endl;
161  }
162  else if (ParametersInputFile.good())
163  {
164  string InputBuffer;
165  char* pEnd;
166  getline(ParametersInputFile,InputBuffer);
167  //cout << InputBuffer << endl;
168 
169  ZValuesInputArray[0] = strtod(InputBuffer.data(),&pEnd);
170  //cout << "Value_0" <<": " <<ZValuesInputArray[0] << endl;
171  for (Int_t iValues = 1; iValues < NumberofDifferentZValues; iValues++)
172  {
173  ZValuesInputArray[iValues] = strtod(pEnd,&pEnd);
174  //cout << "Value_" << iValues <<": " <<ZValuesInputArray[iValues] << endl;
175  }
176  }
177 }
ifstream ParametersInputFile
Double_t * ZValuesInputArray
void PndGeoHypGeBase::ReadCoordinatesAndAngles ( string  Filename,
Int_t  NumberOfCluster,
Double_t CoordinatesAndAngles 
)

Definition at line 179 of file PndGeoHypGeBase.cxx.

Referenced by hypGeGeoBuilderDEGASBall40_6sym_offset20(), hypGeGeoBuilderDEGASStraight40_offset15(), hypGeGeoBuilderDEGASStraight40_offset20(), hypGeGeoBuilderTripleBall40Offset10Geometry(), hypGeGeoBuilderTripleBall40Offset10Geometry_STTFitting(), hypGeGeoBuilderTripleBall40Offset10GeometryCrystalsOnly(), hypGeGeoBuilderTripleBall40Offset20Geometry(), hypGeGeoBuilderTripleBall40Offset20Geometry_STTFitting(), hypGeGeoBuilderTripleBall40Offset20Geometry_STTFittingCrystalsOnly(), hypGeGeoBuilderTripleBall40Offset20GeometryCrystalsOnly(), hypGeGeoBuilderTripleStraightGeometry(), and hypGeGeoBuilderTripleStraightGeometryCrystalsOnly().

180 {
181  string InputBuffer;
182  char* pEnd;
183  ifstream InputFile;
184  InputFile.open(Filename.data());
185  if (!InputFile)
186  {
187  cout << "Inputfile does not exist!" << endl;
188  }
189  else
190  {
191  cout << "Reading coordinates and angles from file" << endl;
192  for(Int_t iCluster = 0; iCluster < NumberOfCluster; iCluster++)
193  {
194  if (InputFile.good())
195  {
196 
197  getline(InputFile,InputBuffer);
198  //cout << InputBuffer << endl;
199  CoordinatesAndAngles[iCluster*6] = strtod(InputBuffer.data(),&pEnd);
200  //cout << "Value_0" <<": " <<CoordinatesAndAngles[iCluster*6] << endl;
201  for (Int_t iValues = 1; iValues < 6; iValues++)
202  {
203  CoordinatesAndAngles[iCluster*6+iValues] = strtod(pEnd,&pEnd);
204  //cout << "Value_" << iValues <<": " <<CoordinatesAndAngles[iCluster*6+iValues] << endl;
205  }
206  }
207  }
208  cout << "All read"<<endl;
209  }
210 }

Member Data Documentation

Double_t* PndGeoHypGeBase::CoordinatesInputArray
protected
ifstream PndGeoHypGeBase::ParametersInputFile
protected
Double_t* PndGeoHypGeBase::ZValuesInputArray
protected

The documentation for this class was generated from the following files: