10#include "G4ThreeVector.hh"
38 BSCDz = emcPara.
GetBSCDz()-TaperRingThickness3;
44 BSCDz1 = emcPara.
GetBSCDz1()-TaperRingThickness3;
94 for(G4int i=0;i<BSCNbTheta*6;i++)
132 const G4double
delta=1.*mm;
133 TaperRingRmin1 = BSCRmax1-TaperRingThickness1;
134 TaperRingRmin2 = TaperRingRmin1+TaperRingDz*
tan(TaperRingTheta);
135 TaperRingDr = TaperRingThickness2/
cos(TaperRingTheta);
136 TaperRingOuterLength1 = TaperRingOuterLength+TaperRingThickness3*
tan(TaperRingTheta);
138 BSCRmax2 = TaperRingRmin2+TaperRingDr-TaperRingThickness3*
tan(TaperRingTheta);
139 BSCRmax = BSCRmin+33.8*cm;
140 BSCPhiDphi= 360.*deg/BSCNbPhi;
141 BSCPhiSphi= -BSCPhiDphi/2.;
143 BSCPhiRmax= BSCRmax-0.5*cm;
144 BSCPhiRmin= BSCRmin/
sin(90.*deg+BSCPhiDphi/2.)
145 *
sin(90.*deg+BSCPhiDphi/2.-BSCAngleRotat);
146 SPBarDphi=2*atan(SPBarwidth/(2*BSCRmax));
149 zHalfLength[0] = BSCCryLength/2.;
150 yHalfLength1[0]= BSCYFront0/2.;
151 xHalfLength1[0]= BSCPhiRmin*
tan(BSCPhiDphi)/2.;
152 xHalfLength2[0]= xHalfLength1[0];
155 G4double rminprojected=BSCRmin*
cos(BSCAngleRotat);
156 rminprojected=BSCRmin;
158 yHalfLength2[0]= yHalfLength1[0]
159 +(BSCYFront0-BSCPosition0)/rminprojected*BSCCryLength/2.;
160 xHalfLength3[0]= xHalfLength1[0]*(BSCPhiRmin+BSCCryLength)/BSCPhiRmin;
161 xHalfLength4[0]= xHalfLength2[0]*(BSCPhiRmin+BSCCryLength)/BSCPhiRmin;
163 thetaPosition[0]= 90.*deg;
164 xPosition[0] = BSCPhiRmin+BSCCryLength/2.;
166 -(xHalfLength1[0]+xHalfLength3[0]+xHalfLength2[0]+xHalfLength4[0])/4.;
167 zPosition[0] = (yHalfLength1[0]+yHalfLength2[0])/2.;
169 theta0= 90.*deg-atan((BSCYFront0-BSCPosition0)/rminprojected);
172 G4cout <<
"------------------------------------>1"<< G4endl
173 <<
"The direction of crystal is:"
174 << theta0/deg <<
"(deg)."<< G4endl;
177 rearBoxPosX[0] = xPosition[0]+BSCCryLength/2.+rearBoxDz/2.;
178 rearBoxPosY[0] = -(xHalfLength3[0]+xHalfLength4[0])/2.;
179 rearBoxPosZ[0] = yHalfLength2[0];
181 OCGirderRmin1[0] = rearBoxPosX[0]+rearBoxDz/2.+
delta;
182 OCGirderRmin2[0] = rearBoxPosX[0]+rearBoxDz/2.+
delta;
183 OCGirderDz[0] = rearBoxLength;
184 OCGirderPosZ[0] = rearBoxLength/2;
186 cableLength[0] = BSCDz-rearBoxPosZ[0];
187 cablePosX[0] = BSCPhiRmax-cableDr-2.*mm;
188 cablePosY[0] = rearBoxPosY[0]-3*cableDr;
189 cablePosZ[0] = BSCDz-cableLength[0]/2;
192 zHalfLength[1]= BSCCryLength/2.;
193 yHalfLength1[1]= BSCYFront0/2.;
194 G4double deltaR= BSCYFront0*
cos(theta0);
195 xHalfLength1[1]= xHalfLength1[0];
196 xHalfLength2[1]= xHalfLength1[1]*(BSCPhiRmin+deltaR)/BSCPhiRmin;
197 yHalfLength2[1]= yHalfLength1[1]
198 +
tan(theta0-atan(rminprojected/(BSCYFront0*(1.+1./
sin(theta0))-
199 BSCPosition1)))*BSCCryLength/2.;
200 deltaR=deltaR+BSCCryLength*
sin(theta0);
201 xHalfLength4[1]= xHalfLength1[1]*(BSCPhiRmin+deltaR)/BSCPhiRmin;
202 deltaR=deltaR-yHalfLength2[1]*2.*
cos(theta0);
203 xHalfLength3[1]= xHalfLength1[1]*(BSCPhiRmin+deltaR)/BSCPhiRmin;
205 thetaPosition[1]= theta0;
206 xPosition[1] = BSCPhiRmin+BSCCryLength/2.*
sin(theta0)
207 + (3.*yHalfLength1[1]-yHalfLength2[1])/2.*
cos(theta0);
209 -(xHalfLength1[1]+xHalfLength3[1]+xHalfLength2[1]+xHalfLength4[1])/4.;
210 zPosition[1] = yHalfLength1[0]*2.
211 + (yHalfLength1[1]*2./
tan(theta0)+BSCCryLength/2.)*
cos(theta0)
212 + (yHalfLength1[1]+yHalfLength2[1])/2.*
sin(theta0);
214 rearBoxPosX[1] = xPosition[1]+(BSCCryLength/2.+rearBoxDz/2.)*
sin(theta0);
215 rearBoxPosY[1] = -(xHalfLength3[1]+xHalfLength4[1])/2.;
216 rearBoxPosZ[1] = zPosition[1]+(BSCCryLength/2.+rearBoxDz/2.)*
cos(theta0);
218 OCGirderRmin1[1] = rearBoxPosX[1]+rearBoxDz*
sin(theta0)/2.+rearBoxLength*
cos(theta0)/2+
delta;
219 OCGirderRmin2[1] = rearBoxPosX[1]+rearBoxDz*
sin(theta0)/2.-rearBoxLength*
cos(theta0)/2+
delta;
220 OCGirderDz[1] = rearBoxLength*
sin(theta0);
221 OCGirderPosZ[1] = rearBoxPosZ[1]+rearBoxDz*
cos(theta0)/2.;
223 cableLength[1] = BSCDz-rearBoxPosZ[1];
224 cablePosX[1] = cablePosX[0];
225 cablePosY[1] = cablePosY[0]+2*cableDr;
226 cablePosZ[1] = BSCDz-cableLength[1]/2;
228 theta0= theta0-atan((yHalfLength2[1]-yHalfLength1[1])*2./BSCCryLength);
230 for(i=2;i<BSCNbTheta;i++)
234 G4cout <<
"------------------------------------>"<<i<< G4endl
235 <<
"The direction of crystal is:"
236 << theta0/deg <<
"(deg)." << G4endl;
241 CryLength=BSCCryLength1;
242 yHalfLength1[i]=BSCYFront1/2.;
245 CryLength=BSCCryLength;
246 yHalfLength1[i]=BSCYFront/2.;
248 zHalfLength[i]=CryLength/2;
250 deltaR=yHalfLength1[i]*2.*
cos(theta0);
251 xHalfLength1[i]=xHalfLength1[0];
252 xHalfLength2[i]=xHalfLength1[i]/BSCPhiRmin*(BSCPhiRmin+deltaR);
253 yHalfLength2[i]=yHalfLength1[i]
254 *(1.+CryLength/(rminprojected/
sin(theta0)
255 +yHalfLength1[i]*2./
tan(theta0)));
256 deltaR=deltaR+CryLength*
sin(theta0);
257 xHalfLength4[i]=xHalfLength1[i]/BSCPhiRmin*(BSCPhiRmin+deltaR);
258 deltaR=deltaR-yHalfLength2[i]*2.*
cos(theta0);
259 xHalfLength3[i]=xHalfLength1[i]/BSCPhiRmin*(BSCPhiRmin+deltaR);
261 thetaPosition[i]=theta0;
262 xPosition[i]=BSCPhiRmin+zHalfLength[i]*
sin(theta0)
263 + (3.*yHalfLength1[i]-yHalfLength2[i])/2.*
cos(theta0);
265 -(xHalfLength1[i]+xHalfLength3[i]+xHalfLength2[i]+xHalfLength4[i])/4.;
266 zPosition[i]=BSCPosition1+rminprojected/
tan(theta0)
267 +(2.*yHalfLength1[i]/
tan(theta0)+zHalfLength[i])*
cos(theta0)
268 +(yHalfLength1[i]+yHalfLength2[i])/2.*
sin(theta0);
270 rearBoxPosX[i] = xPosition[i]+(CryLength/2.+rearBoxDz/2.)*
sin(theta0);
271 rearBoxPosY[i] = -(xHalfLength3[i]+xHalfLength4[i])/2.;
272 rearBoxPosZ[i] = zPosition[i]+(CryLength/2.+rearBoxDz/2.)*
cos(theta0);
274 OCGirderRmin1[i] = rearBoxPosX[i]+rearBoxDz*
sin(theta0)/2.+rearBoxLength*
cos(theta0)/2+
delta;
275 OCGirderRmin2[i] = rearBoxPosX[i]+rearBoxDz*
sin(theta0)/2.-rearBoxLength*
cos(theta0)/2+
delta;
276 OCGirderDz[i] = rearBoxLength*
sin(theta0);
277 OCGirderPosZ[i] = rearBoxPosZ[i]+rearBoxDz*
cos(theta0)/2.;
281 yCable = i-4*(G4int)(i/4);
282 cableLength[i] = BSCDz-(rearBoxPosZ[i]+rearBoxDz/2.*
cos(theta0));
283 cablePosX[i] = cablePosX[0]-xCable*2*cableDr;
284 cablePosY[i] = cablePosY[0]+yCable*2*cableDr;
285 cablePosZ[i] = BSCDz-cableLength[i]/2;
287 theta0=theta0-atan(2.*yHalfLength1[i]/(rminprojected/
sin(theta0)
288 +2.*yHalfLength1[i]/
tan(theta0)));
291 thetaPosition[BSCNbTheta]=theta0;
294 G4cout <<
"------------------------------------>"<<i<< G4endl
295 <<
"The direction of crystal is:"
296 << theta0/deg <<
"(deg)." << G4endl;
300 G4double dx=0.001*mm;
301 for(i=0;i<BSCNbTheta;i++)
313 CryLength=BSCCryLength1;
315 CryLength=BSCCryLength;
317 oop=sqrt((yHalfLength2[i]-yHalfLength1[i])*(yHalfLength2[i]
319 +(xHalfLength3[i]+xHalfLength4[i]-xHalfLength1[i]
320 -xHalfLength2[i])*(xHalfLength3[i]+xHalfLength4[i]
321 -xHalfLength1[i]-xHalfLength2[i])/4);
322 thetaAxis[i]=atan(oop/CryLength);
323 phiAxis[i] =180.*deg+atan((yHalfLength2[i]-yHalfLength1[i])
324 /(xHalfLength3[i]+xHalfLength4[i]
325 -xHalfLength1[i]-xHalfLength2[i])*2.);
326 tanAlpha2[i]=-(xHalfLength4[i]-xHalfLength3[i])/yHalfLength2[i]/2.;
327 tanAlpha1[i]=-(xHalfLength2[i]-xHalfLength1[i])/yHalfLength1[i]/2.;
356 G4double totalThickness=fTyvekThickness+fAlThickness+fMylarThickness;
357 G4double
delta=0.,angle1=0.*deg,angle2=0.*deg;
360 G4double rminprojected=BSCRmin*
cos(BSCAngleRotat);
361 rminprojected=BSCRmin;
365 for(i=0;i<BSCNbTheta;i++)
370 CryLength=BSCCryLength1;
372 CryLength=BSCCryLength;
374 zHalfLength[BSCNbTheta+i]=totalThickness/2.;
375 yHalfLength1[BSCNbTheta+i]=yHalfLength1[i];
376 yHalfLength2[BSCNbTheta+i]=yHalfLength1[i]
377 +(yHalfLength2[i]-yHalfLength1[i])*totalThickness/CryLength;
378 xHalfLength1[BSCNbTheta+i]=xHalfLength1[i];
379 xHalfLength2[BSCNbTheta+i]=xHalfLength2[i];
380 xHalfLength1[BSCNbTheta*2+i]=xHalfLength3[BSCNbTheta+i]=
381 xHalfLength1[i]*(CryLength-totalThickness)/CryLength
382 +xHalfLength3[i]*totalThickness/CryLength;
383 xHalfLength2[BSCNbTheta*4+i]=xHalfLength4[BSCNbTheta+i]=
384 xHalfLength2[i]*(CryLength-totalThickness)/CryLength
385 +xHalfLength4[i]*totalThickness/CryLength;
387 zHalfLength[BSCNbTheta*5+i]=zHalfLength[BSCNbTheta*4+i]=
388 zHalfLength[BSCNbTheta*3+i]=zHalfLength[BSCNbTheta*2+i]=
389 zHalfLength[i]-totalThickness/2.;
391 yHalfLength2[BSCNbTheta*2+i]=yHalfLength1[BSCNbTheta*2+i]=
392 totalThickness/
cos(thetaPosition[i+1]-thetaPosition[i])/2.;
393 xHalfLength3[BSCNbTheta*2+i]=xHalfLength3[i];
394 xHalfLength4[BSCNbTheta*2+i]=xHalfLength3[i]
395 +(xHalfLength4[i]-xHalfLength3[i])*yHalfLength2[BSCNbTheta*2+i]
397 xHalfLength2[BSCNbTheta*2+i]=xHalfLength3[BSCNbTheta+i]
398 +(xHalfLength4[BSCNbTheta+i]-xHalfLength3[BSCNbTheta+i])
399 *yHalfLength1[BSCNbTheta*2+i]/yHalfLength2[BSCNbTheta*1+i];
401 yHalfLength2[BSCNbTheta*4+i]=yHalfLength1[BSCNbTheta*4+i]=
403 xHalfLength4[BSCNbTheta*4+i]=xHalfLength4[i];
404 xHalfLength3[BSCNbTheta*4+i]=xHalfLength4[i]
405 -(xHalfLength4[i]-xHalfLength3[i])*yHalfLength2[BSCNbTheta*4+i]
407 xHalfLength1[BSCNbTheta*4+i]=xHalfLength4[BSCNbTheta+i]
408 -(xHalfLength4[BSCNbTheta+i]-xHalfLength3[BSCNbTheta+i])
409 *yHalfLength1[BSCNbTheta*4+i]/yHalfLength2[BSCNbTheta*1+i];
411 delta=totalThickness/2.+yHalfLength1[BSCNbTheta*2+i];
412 angle1=atan(yHalfLength2[i]/(xHalfLength4[i]-xHalfLength3[i]));
413 angle2=atan(2.*(xHalfLength4[i]-xHalfLength2[i])*
sin(angle1)
416 yHalfLength1[BSCNbTheta*5+i]=yHalfLength1[BSCNbTheta*3+i]=
417 yHalfLength1[i]-
delta;
418 yHalfLength2[BSCNbTheta*5+i]=yHalfLength2[BSCNbTheta*3+i]=
419 yHalfLength2[i]-
delta;
420 xHalfLength4[BSCNbTheta*3+i]=xHalfLength3[BSCNbTheta*3+i]=
421 xHalfLength2[BSCNbTheta*3+i]=xHalfLength1[BSCNbTheta*3+i]=
422 totalThickness/
cos(angle2)/
sin(angle1)/2.;
423 xHalfLength4[BSCNbTheta*5+i]=xHalfLength3[BSCNbTheta*5+i]=
424 xHalfLength2[BSCNbTheta*5+i]=xHalfLength1[BSCNbTheta*5+i]=
427 zHalfLength[i]=zHalfLength[i]-totalThickness/2.;
428 yHalfLength1[i]=yHalfLength1[i]-
delta;
429 yHalfLength2[i]=yHalfLength2[i]-
delta;
430 delta=totalThickness*(1.+1./
cos(angle2)/
sin(angle1))/2.;
431 xHalfLength1[i]=xHalfLength1[i]-
delta;
432 xHalfLength2[i]=xHalfLength2[i]-
delta;
433 xHalfLength3[i]=xHalfLength3[i]-
delta;
434 xHalfLength4[i]=xHalfLength4[i]-
delta;
436 oop=sqrt((yHalfLength2[i]-yHalfLength1[i])*(yHalfLength2[i]
438 +(xHalfLength3[i]+xHalfLength4[i]-xHalfLength1[i]
439 -xHalfLength2[i])*(xHalfLength3[i]+xHalfLength4[i]
440 -xHalfLength1[i]-xHalfLength2[i])/4);
441 thetaAxis[i]=atan(oop/CryLength);
443 phiAxis[i] =180.*deg+atan((yHalfLength2[i]-yHalfLength1[i])
444 /(xHalfLength3[i]+xHalfLength4[i]
445 -xHalfLength1[i]-xHalfLength2[i])*2.);
447 oop=sqrt((yHalfLength2[BSCNbTheta+i]-yHalfLength1[BSCNbTheta+i])
448 *(yHalfLength2[BSCNbTheta+i]-yHalfLength1[BSCNbTheta+i])
449 +(xHalfLength3[BSCNbTheta+i]+xHalfLength4[BSCNbTheta+i]
450 -xHalfLength1[BSCNbTheta+i]-xHalfLength2[BSCNbTheta+i])
451 *(xHalfLength3[BSCNbTheta+i]+xHalfLength4[BSCNbTheta+i]
452 -xHalfLength1[BSCNbTheta+i]-xHalfLength2[BSCNbTheta+i])/4);
453 thetaAxis[BSCNbTheta+i]=atan(oop/totalThickness);
454 phiAxis [BSCNbTheta+i]=
455 -atan((yHalfLength2[BSCNbTheta+i]-yHalfLength1[BSCNbTheta+i])
456 /(xHalfLength3[BSCNbTheta+i]+xHalfLength4[BSCNbTheta+i]
457 -xHalfLength1[BSCNbTheta+i]-xHalfLength2[BSCNbTheta+i])*2.);
459 oop=sqrt((yHalfLength2[i]-yHalfLength1[i])*(yHalfLength2[i]
461 +(xHalfLength3[BSCNbTheta*2+i]+xHalfLength4[BSCNbTheta*2+i]
462 -xHalfLength1[BSCNbTheta*2+i]-xHalfLength2[BSCNbTheta*2+i])
463 *(xHalfLength3[BSCNbTheta*2+i]+xHalfLength4[BSCNbTheta*2+i]
464 -xHalfLength1[BSCNbTheta*2+i]-xHalfLength2[BSCNbTheta*2+i])
466 thetaAxis[BSCNbTheta*2+i]=atan(oop/(zHalfLength[BSCNbTheta*2+i]*2));
467 phiAxis [BSCNbTheta*2+i]=
468 -atan((yHalfLength2[i]-yHalfLength1[i])
469 /(xHalfLength3[BSCNbTheta*2+i]+xHalfLength4[BSCNbTheta*2+i]
470 -xHalfLength1[BSCNbTheta*2+i]-xHalfLength2[BSCNbTheta*2+i])*4);
472 oop=sqrt((yHalfLength2[i]-yHalfLength1[i])*(yHalfLength2[i]
474 +(xHalfLength4[i]-xHalfLength2[i])
475 *(xHalfLength4[i]-xHalfLength2[i])*4);
476 thetaAxis[BSCNbTheta*3+i]=atan(oop/(zHalfLength[BSCNbTheta*3+i]*2));
477 phiAxis [BSCNbTheta*3+i]=-atan((yHalfLength2[i]-yHalfLength1[i])
478 /(xHalfLength4[i]-xHalfLength2[i]));
480 thetaAxis[BSCNbTheta*4+i]=
481 atan((xHalfLength4[BSCNbTheta*4+i]+xHalfLength3[BSCNbTheta*4+i]
482 -xHalfLength2[BSCNbTheta*4+i]-xHalfLength1[BSCNbTheta*4+i])/2.
483 /(zHalfLength[BSCNbTheta*4+i]*2));
484 phiAxis [BSCNbTheta*4+i]=0;
486 thetaAxis[BSCNbTheta*5+i]=atan((xHalfLength3[BSCNbTheta*5+i]
487 -xHalfLength1[BSCNbTheta*5+i])
488 /(zHalfLength[BSCNbTheta*5+i]*2));
489 phiAxis [BSCNbTheta*5+i]=-90.*deg;
491 tanAlpha2[BSCNbTheta+i]=tanAlpha1[BSCNbTheta+i]=tanAlpha1[i]=
492 -(xHalfLength2[i]-xHalfLength1[i])/yHalfLength1[i]/2.;
493 tanAlpha1[BSCNbTheta*2+i]=(xHalfLength2[BSCNbTheta*2+i]
494 -xHalfLength1[BSCNbTheta*2+i])
495 /yHalfLength1[BSCNbTheta*2+i]/2.;
496 tanAlpha1[BSCNbTheta*3+i]=tanAlpha1[i]*2.;
497 tanAlpha1[BSCNbTheta*4+i]=(xHalfLength2[BSCNbTheta*4+i]
498 -xHalfLength1[BSCNbTheta*4+i])
499 /yHalfLength1[BSCNbTheta*4+i]/2.;
500 tanAlpha1[BSCNbTheta*5+i]=(xHalfLength2[BSCNbTheta*5+i]
501 -xHalfLength1[BSCNbTheta*5+i])
502 /yHalfLength1[BSCNbTheta*5+i]/2.;
504 tanAlpha2[i]=-(xHalfLength4[i]-xHalfLength3[i])/yHalfLength2[i]/2.;
506 tanAlpha2[BSCNbTheta*2+i]=(xHalfLength4[BSCNbTheta*2+i]
507 -xHalfLength3[BSCNbTheta*2+i])
508 /yHalfLength2[BSCNbTheta*2+i]/2.;
509 tanAlpha2[BSCNbTheta*3+i]=tanAlpha2[i]*2.;
510 tanAlpha2[BSCNbTheta*4+i]=(xHalfLength4[BSCNbTheta*4+i]
511 -xHalfLength3[BSCNbTheta*4+i])
512 /yHalfLength2[BSCNbTheta*4+i]/2.;
513 tanAlpha2[BSCNbTheta*5+i]=(xHalfLength4[BSCNbTheta*5+i]
514 -xHalfLength3[BSCNbTheta*5+i])
515 /yHalfLength2[BSCNbTheta*5+i]/2.;
517 zPosition[BSCNbTheta*5+i]=zPosition[BSCNbTheta*3+i]=zPosition[i]=
518 zPosition[i]+totalThickness/2.*
cos(thetaPosition[i])
519 -yHalfLength1[BSCNbTheta*2+i]*
sin(thetaPosition[i]);
520 zPosition[i]=totalThickness/2.;
521 xPosition[BSCNbTheta*5+i]=xPosition[BSCNbTheta*3+i]=xPosition[i]=
522 xPosition[i]+totalThickness/2.*
sin(thetaPosition[i])
523 +totalThickness*(1./
cos(thetaPosition[i+1]-thetaPosition[i])-1)/2.
524 *
cos(thetaPosition[i]);
525 xPosition[i]=totalThickness*(1.-1./
cos(angle2)/
sin(angle1))/2.;
527 yPosition[i]=yPosition[i]
528 +totalThickness*(1.-1./
cos(angle2)/
sin(angle1))/2.;
529 yPosition[i]=yHalfLength1[BSCNbTheta*2+i]-totalThickness/2.;
530 yPosition[BSCNbTheta*3+i]=yPosition[i]*2.+xHalfLength1[BSCNbTheta*3+i];
531 yPosition[BSCNbTheta*5+i]=xHalfLength1[BSCNbTheta*5+i];
533 xPosition[BSCNbTheta+i]=BSCPhiRmin
534 +zHalfLength[BSCNbTheta+i]*
sin(thetaPosition[i])
535 +(3.*yHalfLength1[BSCNbTheta+i]-yHalfLength2[BSCNbTheta+i])/2.
536 *
cos(thetaPosition[i]);
537 yPosition[BSCNbTheta+i]=(xHalfLength1[BSCNbTheta+i]
538 +xHalfLength3[BSCNbTheta+i]
539 +xHalfLength2[BSCNbTheta+i]
540 +xHalfLength4[BSCNbTheta+i])/4.;
541 zPosition[BSCNbTheta+i]=BSCPosition1+rminprojected/
tan(thetaPosition[i])
542 +(2.*yHalfLength1[BSCNbTheta+i]/
tan(thetaPosition[i])
543 +zHalfLength[BSCNbTheta+i])*
cos(thetaPosition[i])
544 +(yHalfLength1[BSCNbTheta+i]+yHalfLength2[BSCNbTheta+i])/2.
545 *
sin(thetaPosition[i]);
547 xPosition[BSCNbTheta*2+i]=xPosition[i]
548 +((yHalfLength1[i]+yHalfLength2[i])/2.+yHalfLength1[BSCNbTheta*2+i])
549 *
cos(thetaPosition[i]);
550 zPosition[BSCNbTheta*2+i]=zPosition[i]
551 -((yHalfLength1[i]+yHalfLength2[i])/2.+yHalfLength1[BSCNbTheta*2+i])
552 *
sin(thetaPosition[i]);
553 yPosition[BSCNbTheta*2+i]=(xHalfLength1[BSCNbTheta*2+i]
554 +xHalfLength3[BSCNbTheta*2+i]
555 +xHalfLength2[BSCNbTheta*2+i]
556 +xHalfLength4[BSCNbTheta*2+i])/4.;
558 xPosition[BSCNbTheta*4+i]=xPosition[i]
559 -((yHalfLength1[i]+yHalfLength2[i])/2.+yHalfLength1[BSCNbTheta*4+i])
560 *
cos(thetaPosition[i]);
561 zPosition[BSCNbTheta*4+i]=zPosition[i]
562 -((yHalfLength1[i]+yHalfLength2[i])/2.+yHalfLength1[BSCNbTheta*4+i])
563 *
sin(thetaPosition[i]);
564 yPosition[BSCNbTheta*4+i]=(xHalfLength1[BSCNbTheta*4+i]
565 +xHalfLength3[BSCNbTheta*4+i]
566 +xHalfLength2[BSCNbTheta*4+i]
567 +xHalfLength4[BSCNbTheta*4+i])/4.;
572 for(i=0;i<BSCNbTheta*6;i++)
574 G4cout <<
"The sizes of the " << i+1 <<
" crystal are:" << G4endl
575 <<
"zHalfLength =" << zHalfLength[i]/cm <<
"(cm)," << G4endl
576 <<
"thetaAxis =" << thetaAxis[i]/deg <<
"(deg),"<< G4endl
577 <<
"phiAxis =" << phiAxis[i]/deg <<
"(deg),"<< G4endl
578 <<
"yHalfLength1=" << yHalfLength1[i]/cm <<
"(cm)," << G4endl
579 <<
"xHalfLength1=" << xHalfLength1[i]/cm <<
"(cm)," << G4endl
580 <<
"xHalfLength2=" << xHalfLength2[i]/cm <<
"(cm)," << G4endl
581 <<
"tanAlpha1 =" << tanAlpha1[i] << G4endl
582 <<
"yHalfLength2=" << yHalfLength2[i]/cm <<
"(cm)," << G4endl
583 <<
"xHalfLength3=" << xHalfLength3[i]/cm <<
"(cm)," << G4endl
584 <<
"xHalfLength4=" << xHalfLength4[i]/cm <<
"(cm)," << G4endl
585 <<
"tanAlpha2 =" << tanAlpha2[i] <<
"." << G4endl
586 <<
"The position of the " << i+1 <<
" crystal is:" << G4endl
587 <<
"(" << xPosition[i]/cm <<
","
588 << yPosition[i]/cm <<
","
589 << zPosition[i]/cm <<
")cm" << G4endl;
597 fTyvekThickness = val(
'X');
598 fAlThickness = val(
'Y');
599 fMylarThickness = val(
'Z');
604 if(NbCrystal>=0&&NbCrystal<BSCNbTheta*6)
606 return xPosition[NbCrystal];
616 if(NbCrystal>=0&&NbCrystal<BSCNbTheta*6)
618 return yPosition[NbCrystal];
628 if(NbCrystal>=0&&NbCrystal<BSCNbTheta*6)
630 return zPosition[NbCrystal];
640 if(NbCrystal>=0&&NbCrystal<BSCNbTheta*6)
642 return thetaPosition[NbCrystal];
652 if(NbCrystal>=0&&NbCrystal<BSCNbTheta*6)
654 return zHalfLength[NbCrystal];
664 if(NbCrystal>=0&&NbCrystal<BSCNbTheta*6)
666 return thetaAxis[NbCrystal];
676 if(NbCrystal>=0&&NbCrystal<BSCNbTheta*6)
678 return phiAxis[NbCrystal];
688 if(NbCrystal>=0&&NbCrystal<BSCNbTheta*6)
690 return yHalfLength1[NbCrystal];
700 if(NbCrystal>=0&&NbCrystal<BSCNbTheta*6)
702 return xHalfLength1[NbCrystal];
712 if(NbCrystal>=0&&NbCrystal<BSCNbTheta*6)
714 return xHalfLength2[NbCrystal];
724 if(NbCrystal>=0&&NbCrystal<BSCNbTheta*6)
726 return tanAlpha1[NbCrystal];
736 if(NbCrystal>=0&&NbCrystal<BSCNbTheta*6)
738 return yHalfLength2[NbCrystal];
748 if(NbCrystal>=0&&NbCrystal<BSCNbTheta*6)
750 return xHalfLength3[NbCrystal];
760 if(NbCrystal>=0&&NbCrystal<BSCNbTheta*6)
762 return xHalfLength4[NbCrystal];
772 if(NbCrystal>=0&&NbCrystal<BSCNbTheta*6)
774 return tanAlpha2[NbCrystal];
784 if(NbCrystal>=0&&NbCrystal<BSCNbTheta*6)
786 return physiBSCCrystal[NbCrystal];
double tan(const BesAngle a)
double sin(const BesAngle a)
double cos(const BesAngle a)
void ComputeEMCParameters()
G4double GetThetaPosition(G4int NbCrystal)
G4double GetYPosition(G4int NbCrystal)
G4double GetZHalfLength(G4int NbCrystal)
G4double GetXHalfLength2(G4int NbCrystal)
G4double GetTanAlpha2(G4int NbCrystal)
G4double GetTanAlpha1(G4int NbCrystal)
G4double GetYHalfLength1(G4int NbCrystal)
G4double GetThetaAxis(G4int NbCrystal)
G4double GetXHalfLength4(G4int NbCrystal)
G4double GetYHalfLength2(G4int NbCrystal)
G4VPhysicalVolume * GetPhysiBSCCrystal(G4int NbCrystal)
G4double GetXPosition(G4int NbCrystal)
G4double GetZPosition(G4int NbCrystal)
void SetCasingThickness(G4ThreeVector)
G4double GetXHalfLength1(G4int NbCrystal)
G4double GetPhiAxis(G4int NbCrystal)
void PrintEMCParameters()
G4double GetXHalfLength3(G4int NbCrystal)
G4double GetOrgGlassLengthY()
G4double GetBSCPosition1()
G4double GetCrystalLength()
G4double GetRearCasingThickness()
G4double GetOrgGlassLengthZ()
G4double GetOCGirderAngle()
G4double GetSPBarThickness()
G4double GetBSCPosition0()
G4double GetTaperRingInnerLength()
G4double GetTaperRingThickness1()
static BesEmcParameter & GetInstance()
G4double GetTyvekThickness()
G4double GetOrgGlassLengthX()
G4double GetTaperRingDz()
G4double GetTaperRingThickness3()
G4double GetMylarThickness()
G4double GetWaterPipeThickness()
G4double GetWaterPipeDr()
G4double GetTaperRingTheta()
G4double GetHangingPlateDz()
G4double GetRearBoxLength()
G4double GetEndRingRmin()
G4double GetCrystalLength1()
G4double GetSPBarThickness1()
G4double GetTaperRingThickness2()
G4double GetTaperRingOuterLength()
G4double GetAlThickness()
G4double GetPABoxThickness()
G4double GetBSCAngleRotat()