BOSS 7.0.2
BESIII Offline Software System
Loading...
Searching...
No Matches
BesPipParameter.cc
Go to the documentation of this file.
1//BOOST --- BESIII Object_Oriented Simulation Tool //
2//Description:
3//Author: Caogf
4//Created: June, 2008
5//Modified:
6//Comment:
7//---------------------------------------------------------------------//
8//$ID: BesPipParameter.cc
9
10#include "BesPipParameter.hh"
11#include <fstream>
12#include <strstream>
13#include "ReadBoostRoot.hh"
14using namespace std;
15
17{
18}
20{
21}
23{
24 G4String GeometryPath = getenv("BESSIMROOT");
25 if(!GeometryPath){
26 G4Exception("BOOST environment not set!");
27 }
28 GeometryPath += "/dat/BesPip.txt";
29
30 ifstream fin;
31 fin.open(GeometryPath);
32
33 const int maxCharOfOneLine=255;
34 char temp[maxCharOfOneLine],*p;
35 int lineNo=0,inputNo=0;
36 while(fin.peek()!=EOF)
37 {
38 fin.getline(temp,maxCharOfOneLine);
39 p=temp;
40 lineNo++;
41 while(*p!='\0')
42 {
43 if(*p=='#')
44 {
45 *p='\0'; //delete the comments.
46 break;
47 }
48 p++;
49 }
50 p=temp; //reset the pointer to the beginning of the string.
51 while(*p==' '||*p=='\t')p++;
52 if(*p=='\0')continue;
53 inputNo++;
54 switch(inputNo)
55 {
56 case 1:
57 istrstream(p)>>goldLayer[0]>>goldLayer[1]>>goldLayer[2];
58 break;
59 case 2:
60 istrstream(p)>>innerBe[0]>>innerBe[1]>>innerBe[2];
61 break;
62 case 3:
63 istrstream(p)>>oilLayer[0]>>oilLayer[1]>>oilLayer[2];
64 break;
65 case 4:
66 istrstream(p)>>outerBe[0]>>outerBe[1]>>outerBe[2];
67 break;
68 case 5:
69 istrstream(p)>>innerBeSide[0]>>innerBeSide[1]>>innerBeSide[2]>>innerBeSide[3]>>innerBeSide[4];
70 break;
71 case 6:
72 istrstream(p)>>innerAl[0]>>innerAl[1]>>innerAl[2]>>innerAl[3]>>innerAl[4];
73 break;
74 case 7:
75 istrstream(p)>>AlRing[0]>>AlRing[1]>>AlRing[2]>>AlRing[3]>>AlRing[4];
76 break;
77 case 8:
78 istrstream(p)>>outerAl[0]>>outerAl[1]>>outerAl[2]>>outerAl[3]>>outerAl[4];
79 break;
80 case 9:
81 istrstream(p)>>AgLayer[0]>>AgLayer[1]>>AgLayer[2]>>AgLayer[3]>>AgLayer[4];
82 break;
83 case 10:
84 istrstream(p)>>CuLayer[0]>>CuLayer[1]>>CuLayer[2]>>CuLayer[3]>>CuLayer[4];
85 break;
86 case 11:
87 istrstream(p)>>AlCover[0]>>AlCover[1]>>AlCover[2]>>AlCover[3]>>AlCover[4];
88 }
89 }
90}