148 {
150 double length, phi, r, rotateCell,rotateAngle;
151 double innerR, outR, z;
152 string name, line;
153
155 if(!geoPath){
156 G4cout<<"BOOST environment not set!"<<G4endl; exit(-1);
157 }
158 geoPath += "/dat/Mdc.txt";
159
161 if(!inFile.good()){
162 cout<<"Error, mdc parameters file not exist"<<endl;
163 return;
164 }
165
166 getline(inFile, line);
167 inFile>>fLayerNo>>fWireNo>>fSignalLayerNo>>fSignalWireR>>fFieldWireR;
168
169 inFile.seekg(1,ios::cur);
170 getline(inFile, line);
171 int i,signalLayer;
172 for(i=0; i<fSignalLayerNo; i++){
173 inFile>>signalLayer;
174 fSignalLayer[i]=signalLayer-1;
175 }
176
177 inFile.seekg(1,ios::cur);
178 getline(inFile, line);
179 getline(inFile, line);
180 for( i=0; i<fLayerNo; i++){
181 inFile>>name>>
wireNo>>length>>r>>phi>>firstWire>>rotateCell;
182 getline(inFile, line);
183
185
186 fLayer[i].SetName(name);fLayer[i].SetRadius(r);
187 fLayer[i].SetLength(length); fLayer[i].SetRotateCell(rotateCell);
188 fLayer[i].SetRotateAngle(rotateAngle); fLayer[i].SetWireNo(
wireNo);
189 fLayer[i].SetShiftPhi(twopi/
wireNo); fLayer[i].SetFirstWire(firstWire);
190
192 if(phi<0)phi += fLayer[i].ShiftPhi();
193 fLayer[i].SetPhi(phi);
194
195 if(i==0){
196 fLayer[i].SetSumWireNo(
wireNo); fLayer[i].SetBeginWireNo(0);
197 }else{
198 fLayer[i].SetBeginWireNo(fLayer[i-1].SumWireNo());
199 fLayer[i].SetSumWireNo(fLayer[i-1].SumWireNo()+
wireNo);
200 }
201
202 for(
int j=0; j<
wireNo; j++){
203 fWirePhi[fLayer[i].BeginWireNo()+j]=j*fLayer[i].ShiftPhi()+phi;
204 }
205 }
206
207 if(fLayer[fLayerNo-1].SumWireNo()!= fWireNo){
208 cout<<"Total wire number is not consistant!"<<endl;
209 }
210
211 getline(inFile, line);
212 inFile>>fSegmentNo;
213 inFile.seekg(1,ios::cur);
214 getline(inFile, line);
215 getline(inFile, line);
216
217 for(i=0; i<fSegmentNo; i++){
218 inFile>>length>>innerR>>outR>>z>>name;
219 getline(inFile,line);
220
221 fMdcSegment[i].SetLength(length); fMdcSegment[i].SetInnerR(innerR);
222 fMdcSegment[i].SetOutR(outR); fMdcSegment[i].SetZ(z);
223 fMdcSegment[i].SetName(name);
224 }
225
226}
static G4String GetBoostRoot()