BOSS 7.0.2
BESIII Offline Software System
Loading...
Searching...
No Matches
MyMdcGeomSvc.cc
Go to the documentation of this file.
1#include "MyMdcGeomSvc.hh"
2#include <fstream>
3#include <iostream>
4#include <sstream>
5using namespace std;
6#include <stdlib.h>
7#include <assert.h>
8
9
13{
14 std::string geometryFilePath1 = getenv("MDCSIMROOT");
15 geometryFilePath1 +="/dat/MdcElectronics.txt";
16
17 std::ifstream in;
18 in.open(geometryFilePath1.c_str());
19 assert(in);
20 const int maxCharOneLine=255;
21 char temp[maxCharOneLine];
22 int i=0;
23 while(in.peek()!=EOF)
24 {
25 in.getline(temp,maxCharOneLine);
26 i++;
27 if (temp[0]=='#')
28 continue;
29 // i is the row number of MdcElectronics.dat
30 if(i==2) {istringstream(temp)>>fTotalElecLayerNo;
31 continue;
32 }
33 if(i>=4&&i<=26)
34 {
35 istringstream(temp)>>fLayerr[i-4]>>fElecNo[i-4];
36 continue;
37 }
38 if(i>28&&i<=51)
39 {
40 istringstream(temp)>>fX[i-29]>>fY[i-29]>>fZ[i-29]>>fR[i-29];
41 continue;
42 }
43 if(i==55)
44 {
45 istringstream(temp)>>fBoxInStep[0]>>fBoxInStep[1]>>fBoxInStep[2];
46 continue;
47 }
48 if(i==59)
49 {
50 istringstream(temp)>>fBoxEndcape[0]>>fBoxEndcape[1]>>fBoxEndcape[2];
51 continue;
52 }
53 if(i==63){istringstream(temp)>>fFixRing[0]>>fFixRing[1]>>fFixRing[2];}
54 if(i>=76&&i<87)
55 {
56 istringstream(temp)>>fInnerRCableFrame[i-76]>>fOuterRCableFrame[i-76]>>fLengthCableFrame[i-76]>>fZCableFrame[i-76];
57 continue;
58 }
59 if(i==90)
60 {
61 istringstream(temp)>>fThinPlate[0]>>fThinPlate[1]>>fThinPlate[2];
62 continue;
63 }
64
65 if(i>=93&&i<105)
66 {
67 istringstream(temp)>>fXCenThinPlate[i-93]>>fYCenThinPlate[i-93]>> fZCenThinPlate[i-93]>>fRotateXAngle[i-93];
68 continue;
69 }
70
71
72 if(i==107)
73 {
74 istringstream(temp)>>fLengthCableTub[0]>>fLengthCableTub[1]>>fLengthCableTub[2]>>fLengthCableTub[3]>>fLengthCableTub[4]>>fLengthCableTub[5]>>fLengthCableTub[6]>>fLengthCableTub[7]>>fLengthCableTub[8]>>fLengthCableTub[9]>>fLengthCableTub[10]>>fLengthCableTub[11]>>fLengthCableTub[12];
75 continue;
76 }
77 if (i==109)
78 {
79 istringstream(temp)>>fLengthCableTub[13]>>fLengthCableTub[14]>>fLengthCableTub[15]>>fLengthCableTub[16]>>fLengthCableTub[17]>>fLengthCableTub[18]>>fLengthCableTub[19]>>fLengthCableTub[20]>>fLengthCableTub[21]>>fLengthCableTub[22]>>fLengthCableTub[23]>>fLengthCableTub[24];
80 continue;
81 }
82
83 }
84}
85
86
88{
89 return fTotalElecLayerNo;
90}
92{
93 return fLayerr[n];
94}
96{
97 return fElecNo[n];
98}
99double MyMdcGeomSvc::X(int n)
100{
101 return fX[n];
102}
104{
105 return fY[n];
106}
108{
109 return fZ[n];
110}
112{
113 return fR[n];
114}
116{
117 return fBoxInStep[n];
118}
120{
121 return fBoxEndcape[n];
122}
124{
125 return fLengthCableTub[n];
126}
128{
129 return fInnerRCableFrame[n];
130}
132{
133 return fOuterRCableFrame[n];
134}
136{
137 return fLengthCableFrame[n];
138
139}
141{
142 return fZCableFrame[n];
143
144}
145
147{
148 return fThinPlate[n];
149}
151{
152 return fXCenThinPlate[n];
153}
155{
156 return fYCenThinPlate[n];
157}
159{
160 return fZCenThinPlate[n];
161}
163{
164 return fRotateXAngle[n];
165}
166
168{
169 return fFixRing[n];
170}
171
const Int_t n
double R(int n)
double BoxInStep(int n)
double BoxEndcape(int n)
int Layerr(int n)
Definition: MyMdcGeomSvc.cc:91
int ElecNo(int n)
Definition: MyMdcGeomSvc.cc:95
double OuterRCableFrame(int n)
double Y(int n)
double FixRing(int n)
double InnerRCableFrame(int n)
double LengthCableFrame(int n)
double LengthCableTub(int n)
double Z(int n)
int TotalElecLayerNo()
Definition: MyMdcGeomSvc.cc:87
double XCenThinPlate(int n)
double YCenThinPlate(int n)
double ZCenThinPlate(int n)
double RotateXAngle(int n)
double X(int n)
Definition: MyMdcGeomSvc.cc:99
double ThinPlate(int n)
double ZCableFrame(int n)
void ReadFilePar()
Definition: MyMdcGeomSvc.cc:12