BOSS 7.0.9
BESIII Offline Software System
Loading...
Searching...
No Matches
BesSCMParameter.cc
Go to the documentation of this file.
1//BOOST --- BESIII Object_Oriented Simulation Tool //
2//Description:
3//Author: Caogf
4//Created: June, 2007
5//Modified:
6//Comment:
7//---------------------------------------------------------------------//
8//$ID: BesSCMParameter.cc
9
10#include "BesSCMParameter.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/BesSCM.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)>>innerCryo[0]>>innerCryo[1]>>innerCryo[2];
58 break;
59 case 2:
60 istrstream(p)>>l1Adia[0]>>l1Adia[1]>>l1Adia[2];
61 break;
62 case 3:
63 istrstream(p)>>innerShield[0]>>innerShield[1]>>innerShield[2];
64 break;
65 case 4:
66 istrstream(p)>>l2Adia[0]>>l2Adia[1]>>l2Adia[2];
67 break;
68 case 5:
69 istrstream(p)>>outerShield[0]>>outerShield[1]>>outerShield[2];
70 break;
71 case 6:
72 istrstream(p)>>l3Adia[0]>>l3Adia[1]>>l3Adia[2];
73 break;
74 case 7:
75 istrstream(p)>>endShield[0]>>endShield[1]>>endShield[2]>>endShield[3]>>endShield[4];
76 break;
77 case 8:
78 istrstream(p)>>l1insu[0]>>l1insu[1]>>l1insu[2];
79 break;
80 case 9:
81 istrstream(p)>>coil[0]>>coil[1]>>coil[2];
82 break;
83 case 10:
84 istrstream(p)>>l2insu[0]>>l2insu[1]>>l2insu[2];
85 break;
86 case 11:
87 istrstream(p)>>supp[0]>>supp[1]>>supp[2];
88 break;
89 case 12:
90 istrstream(p)>>l4Adia[0]>>l4Adia[1]>>l4Adia[2];
91 break;
92 case 13:
93 istrstream(p)>>endCoil[0]>>endCoil[1]>>endCoil[2]>>endCoil[3]>>endCoil[4];
94 break;
95 case 14:
96 istrstream(p)>>outerCryo[0]>>outerCryo[1]>>outerCryo[2];
97 break;
98 case 15:
99 istrstream(p)>>endCryo[0]>>endCryo[1]>>endCryo[2]>>endCryo[3]>>endCryo[4];
100 break;
101 case 16:
102 istrstream(p)>>rein[0]>>rein[1]>>rein[2]>>rein[3]>>rein[4];
103 break;
104 case 17:
105 istrstream(p)>>pipe1[0]>>pipe1[1]>>pipe1[2]>>pipe1[3]>>pipe1[4]>>pipe1[5];
106 break;
107 case 18:
108 istrstream(p)>>pipe2[0]>>pipe2[1]>>pipe2[2]>>pipe2[3]>>pipe2[4]>>pipe2[5];
109 break;
110 case 19:
111 istrstream(p)>>pipe3[0]>>pipe3[1]>>pipe3[2]>>pipe3[3]>>pipe3[4]>>pipe3[5];
112 break;
113 case 20:
114 istrstream(p)>>hole[0]>>hole[1]>>hole[2]>>hole[3]>>hole[4]>>hole[5]>>hole[6]>>hole[7]>>hole[8]>>hole[9]>>hole[10]>>hole[11]>>hole[12];
115 }
116 }
117}
118