314{
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333 G4double totalThickness=fTyvekThickness+fAlThickness+fMylarThickness;
334 G4double
delta=0.,angle1=0.*deg,angle2=0.*deg;
335 G4double oop;
336
337 G4double rminprojected=BSCRmin*
cos(BSCAngleRotat);
338 rminprojected=BSCRmin;
339
340 G4int i;
341 for(i=0;i<BSCNbTheta;i++)
342 {
343 zHalfLength[BSCNbTheta+i]=totalThickness/2.;
344 yHalfLength1[BSCNbTheta+i]=yHalfLength1[i];
345 yHalfLength2[BSCNbTheta+i]=yHalfLength1[i]
346 +(yHalfLength2[i]-yHalfLength1[i])*totalThickness/BSCCryLength;
347 xHalfLength1[BSCNbTheta+i]=xHalfLength1[i];
348 xHalfLength2[BSCNbTheta+i]=xHalfLength2[i];
349 xHalfLength1[BSCNbTheta*2+i]=xHalfLength3[BSCNbTheta+i]=
350 xHalfLength1[i]*(BSCCryLength-totalThickness)/BSCCryLength
351 +xHalfLength3[i]*totalThickness/BSCCryLength;
352 xHalfLength2[BSCNbTheta*4+i]=xHalfLength4[BSCNbTheta+i]=
353 xHalfLength2[i]*(BSCCryLength-totalThickness)/BSCCryLength
354 +xHalfLength4[i]*totalThickness/BSCCryLength;
355
356 zHalfLength[BSCNbTheta*5+i]=zHalfLength[BSCNbTheta*4+i]=
357 zHalfLength[BSCNbTheta*3+i]=zHalfLength[BSCNbTheta*2+i]=
358 zHalfLength[i]-totalThickness/2.;
359
360 yHalfLength2[BSCNbTheta*2+i]=yHalfLength1[BSCNbTheta*2+i]=
361 totalThickness/
cos(thetaPosition[i+1]-thetaPosition[i])/2.;
362 xHalfLength3[BSCNbTheta*2+i]=xHalfLength3[i];
363 xHalfLength4[BSCNbTheta*2+i]=xHalfLength3[i]
364 +(xHalfLength4[i]-xHalfLength3[i])*yHalfLength2[BSCNbTheta*2+i]
365 /yHalfLength2[i];
366 xHalfLength2[BSCNbTheta*2+i]=xHalfLength3[BSCNbTheta+i]
367 +(xHalfLength4[BSCNbTheta+i]-xHalfLength3[BSCNbTheta+i])
368 *yHalfLength1[BSCNbTheta*2+i]/yHalfLength2[BSCNbTheta*1+i];
369
370 yHalfLength2[BSCNbTheta*4+i]=yHalfLength1[BSCNbTheta*4+i]=
371 totalThickness/2.;
372 xHalfLength4[BSCNbTheta*4+i]=xHalfLength4[i];
373 xHalfLength3[BSCNbTheta*4+i]=xHalfLength4[i]
374 -(xHalfLength4[i]-xHalfLength3[i])*yHalfLength2[BSCNbTheta*4+i]
375 /yHalfLength2[i];
376 xHalfLength1[BSCNbTheta*4+i]=xHalfLength4[BSCNbTheta+i]
377 -(xHalfLength4[BSCNbTheta+i]-xHalfLength3[BSCNbTheta+i])
378 *yHalfLength1[BSCNbTheta*4+i]/yHalfLength2[BSCNbTheta*1+i];
379
380 delta=totalThickness/2.+yHalfLength1[BSCNbTheta*2+i];
381 angle1=atan(yHalfLength2[i]/(xHalfLength4[i]-xHalfLength3[i]));
382 angle2=atan(2.*(xHalfLength4[i]-xHalfLength2[i])*
sin(angle1)
383 /BSCCryLength);
384
385 yHalfLength1[BSCNbTheta*5+i]=yHalfLength1[BSCNbTheta*3+i]=
386 yHalfLength1[i]-
delta;
387 yHalfLength2[BSCNbTheta*5+i]=yHalfLength2[BSCNbTheta*3+i]=
388 yHalfLength2[i]-
delta;
389 xHalfLength4[BSCNbTheta*3+i]=xHalfLength3[BSCNbTheta*3+i]=
390 xHalfLength2[BSCNbTheta*3+i]=xHalfLength1[BSCNbTheta*3+i]=
391 totalThickness/
cos(angle2)/
sin(angle1)/2.;
392 xHalfLength4[BSCNbTheta*5+i]=xHalfLength3[BSCNbTheta*5+i]=
393 xHalfLength2[BSCNbTheta*5+i]=xHalfLength1[BSCNbTheta*5+i]=
394 totalThickness/2.;
395
396 zHalfLength[i]=zHalfLength[i]-totalThickness/2.;
397 yHalfLength1[i]=yHalfLength1[i]-
delta;
398 yHalfLength2[i]=yHalfLength2[i]-
delta;
399 delta=totalThickness*(1.+1./
cos(angle2)/
sin(angle1))/2.;
400 xHalfLength1[i]=xHalfLength1[i]-
delta;
401 xHalfLength2[i]=xHalfLength2[i]-
delta;
402 xHalfLength3[i]=xHalfLength3[i]-
delta;
403 xHalfLength4[i]=xHalfLength4[i]-
delta;
404
405 oop=sqrt((yHalfLength2[i]-yHalfLength1[i])*(yHalfLength2[i]
406 -yHalfLength1[i])
407 +(xHalfLength3[i]+xHalfLength4[i]-xHalfLength1[i]
408 -xHalfLength2[i])*(xHalfLength3[i]+xHalfLength4[i]
409 -xHalfLength1[i]-xHalfLength2[i])/4);
410 thetaAxis[i]=atan(oop/BSCCryLength);
411
412 phiAxis[i] =180.*deg+atan((yHalfLength2[i]-yHalfLength1[i])
413 /(xHalfLength3[i]+xHalfLength4[i]
414 -xHalfLength1[i]-xHalfLength2[i])*2.);
415
416 oop=sqrt((yHalfLength2[BSCNbTheta+i]-yHalfLength1[BSCNbTheta+i])
417 *(yHalfLength2[BSCNbTheta+i]-yHalfLength1[BSCNbTheta+i])
418 +(xHalfLength3[BSCNbTheta+i]+xHalfLength4[BSCNbTheta+i]
419 -xHalfLength1[BSCNbTheta+i]-xHalfLength2[BSCNbTheta+i])
420 *(xHalfLength3[BSCNbTheta+i]+xHalfLength4[BSCNbTheta+i]
421 -xHalfLength1[BSCNbTheta+i]-xHalfLength2[BSCNbTheta+i])/4);
422 thetaAxis[BSCNbTheta+i]=atan(oop/totalThickness);
423 phiAxis [BSCNbTheta+i]=
424 -atan((yHalfLength2[BSCNbTheta+i]-yHalfLength1[BSCNbTheta+i])
425 /(xHalfLength3[BSCNbTheta+i]+xHalfLength4[BSCNbTheta+i]
426 -xHalfLength1[BSCNbTheta+i]-xHalfLength2[BSCNbTheta+i])*2.);
427
428 oop=sqrt((yHalfLength2[i]-yHalfLength1[i])*(yHalfLength2[i]
429 -yHalfLength1[i])*4
430 +(xHalfLength3[BSCNbTheta*2+i]+xHalfLength4[BSCNbTheta*2+i]
431 -xHalfLength1[BSCNbTheta*2+i]-xHalfLength2[BSCNbTheta*2+i])
432 *(xHalfLength3[BSCNbTheta*2+i]+xHalfLength4[BSCNbTheta*2+i]
433 -xHalfLength1[BSCNbTheta*2+i]-xHalfLength2[BSCNbTheta*2+i])
434 /4);
435 thetaAxis[BSCNbTheta*2+i]=atan(oop/(zHalfLength[BSCNbTheta*2+i]*2));
436 phiAxis [BSCNbTheta*2+i]=
437 -atan((yHalfLength2[i]-yHalfLength1[i])
438 /(xHalfLength3[BSCNbTheta*2+i]+xHalfLength4[BSCNbTheta*2+i]
439 -xHalfLength1[BSCNbTheta*2+i]-xHalfLength2[BSCNbTheta*2+i])*4);
440
441 oop=sqrt((yHalfLength2[i]-yHalfLength1[i])*(yHalfLength2[i]
442 -yHalfLength1[i])*4
443 +(xHalfLength4[i]-xHalfLength2[i])
444 *(xHalfLength4[i]-xHalfLength2[i])*4);
445 thetaAxis[BSCNbTheta*3+i]=atan(oop/(zHalfLength[BSCNbTheta*3+i]*2));
446 phiAxis [BSCNbTheta*3+i]=-atan((yHalfLength2[i]-yHalfLength1[i])
447 /(xHalfLength4[i]-xHalfLength2[i]));
448
449 thetaAxis[BSCNbTheta*4+i]=
450 atan((xHalfLength4[BSCNbTheta*4+i]+xHalfLength3[BSCNbTheta*4+i]
451 -xHalfLength2[BSCNbTheta*4+i]-xHalfLength1[BSCNbTheta*4+i])/2.
452 /(zHalfLength[BSCNbTheta*4+i]*2));
453 phiAxis [BSCNbTheta*4+i]=0;
454
455 thetaAxis[BSCNbTheta*5+i]=atan((xHalfLength3[BSCNbTheta*5+i]
456 -xHalfLength1[BSCNbTheta*5+i])
457 /(zHalfLength[BSCNbTheta*5+i]*2));
458 phiAxis [BSCNbTheta*5+i]=-90.*deg;
459
460 tanAlpha2[BSCNbTheta+i]=tanAlpha1[BSCNbTheta+i]=tanAlpha1[i]=
461 -(xHalfLength2[i]-xHalfLength1[i])/yHalfLength1[i]/2.;
462 tanAlpha1[BSCNbTheta*2+i]=(xHalfLength2[BSCNbTheta*2+i]
463 -xHalfLength1[BSCNbTheta*2+i])
464 /yHalfLength1[BSCNbTheta*2+i]/2.;
465 tanAlpha1[BSCNbTheta*3+i]=tanAlpha1[i]*2.;
466 tanAlpha1[BSCNbTheta*4+i]=(xHalfLength2[BSCNbTheta*4+i]
467 -xHalfLength1[BSCNbTheta*4+i])
468 /yHalfLength1[BSCNbTheta*4+i]/2.;
469 tanAlpha1[BSCNbTheta*5+i]=(xHalfLength2[BSCNbTheta*5+i]
470 -xHalfLength1[BSCNbTheta*5+i])
471 /yHalfLength1[BSCNbTheta*5+i]/2.;
472
473 tanAlpha2[i]=-(xHalfLength4[i]-xHalfLength3[i])/yHalfLength2[i]/2.;
474
475 tanAlpha2[BSCNbTheta*2+i]=(xHalfLength4[BSCNbTheta*2+i]
476 -xHalfLength3[BSCNbTheta*2+i])
477 /yHalfLength2[BSCNbTheta*2+i]/2.;
478 tanAlpha2[BSCNbTheta*3+i]=tanAlpha2[i]*2.;
479 tanAlpha2[BSCNbTheta*4+i]=(xHalfLength4[BSCNbTheta*4+i]
480 -xHalfLength3[BSCNbTheta*4+i])
481 /yHalfLength2[BSCNbTheta*4+i]/2.;
482 tanAlpha2[BSCNbTheta*5+i]=(xHalfLength4[BSCNbTheta*5+i]
483 -xHalfLength3[BSCNbTheta*5+i])
484 /yHalfLength2[BSCNbTheta*5+i]/2.;
485
486 zPosition[BSCNbTheta*5+i]=zPosition[BSCNbTheta*3+i]=zPosition[i]=
487 zPosition[i]+totalThickness/2.*
cos(thetaPosition[i])
488 -yHalfLength1[BSCNbTheta*2+i]*
sin(thetaPosition[i]);
489 zPosition[i]=totalThickness/2.;
490 xPosition[BSCNbTheta*5+i]=xPosition[BSCNbTheta*3+i]=xPosition[i]=
491 xPosition[i]+totalThickness/2.*
sin(thetaPosition[i])
492 +totalThickness*(1./
cos(thetaPosition[i+1]-thetaPosition[i])-1)/2.
493 *
cos(thetaPosition[i]);
494 xPosition[i]=totalThickness*(1.-1./
cos(angle2)/
sin(angle1))/2.;
495
496 yPosition[i]=yPosition[i]
497 +totalThickness*(1.-1./
cos(angle2)/
sin(angle1))/2.;
498 yPosition[i]=yHalfLength1[BSCNbTheta*2+i]-totalThickness/2.;
499 yPosition[BSCNbTheta*3+i]=yPosition[i]*2.+xHalfLength1[BSCNbTheta*3+i];
500 yPosition[BSCNbTheta*5+i]=xHalfLength1[BSCNbTheta*5+i];
501
502 xPosition[BSCNbTheta+i]=BSCPhiRmin
503 +zHalfLength[BSCNbTheta+i]*
sin(thetaPosition[i])
504 +(3.*yHalfLength1[BSCNbTheta+i]-yHalfLength2[BSCNbTheta+i])/2.
505 *
cos(thetaPosition[i]);
506 yPosition[BSCNbTheta+i]=(xHalfLength1[BSCNbTheta+i]
507 +xHalfLength3[BSCNbTheta+i]
508 +xHalfLength2[BSCNbTheta+i]
509 +xHalfLength4[BSCNbTheta+i])/4.;
510 zPosition[BSCNbTheta+i]=BSCPosition1+rminprojected/
tan(thetaPosition[i])
511 +(2.*yHalfLength1[BSCNbTheta+i]/
tan(thetaPosition[i])
512 +zHalfLength[BSCNbTheta+i])*
cos(thetaPosition[i])
513 +(yHalfLength1[BSCNbTheta+i]+yHalfLength2[BSCNbTheta+i])/2.
514 *
sin(thetaPosition[i]);
515
516 xPosition[BSCNbTheta*2+i]=xPosition[i]
517 +((yHalfLength1[i]+yHalfLength2[i])/2.+yHalfLength1[BSCNbTheta*2+i])
518 *
cos(thetaPosition[i]);
519 zPosition[BSCNbTheta*2+i]=zPosition[i]
520 -((yHalfLength1[i]+yHalfLength2[i])/2.+yHalfLength1[BSCNbTheta*2+i])
521 *
sin(thetaPosition[i]);
522 yPosition[BSCNbTheta*2+i]=(xHalfLength1[BSCNbTheta*2+i]
523 +xHalfLength3[BSCNbTheta*2+i]
524 +xHalfLength2[BSCNbTheta*2+i]
525 +xHalfLength4[BSCNbTheta*2+i])/4.;
526
527 xPosition[BSCNbTheta*4+i]=xPosition[i]
528 -((yHalfLength1[i]+yHalfLength2[i])/2.+yHalfLength1[BSCNbTheta*4+i])
529 *
cos(thetaPosition[i]);
530 zPosition[BSCNbTheta*4+i]=zPosition[i]
531 -((yHalfLength1[i]+yHalfLength2[i])/2.+yHalfLength1[BSCNbTheta*4+i])
532 *
sin(thetaPosition[i]);
533 yPosition[BSCNbTheta*4+i]=(xHalfLength1[BSCNbTheta*4+i]
534 +xHalfLength3[BSCNbTheta*4+i]
535 +xHalfLength2[BSCNbTheta*4+i]
536 +xHalfLength4[BSCNbTheta*4+i])/4.;
537
538 }
539
540 if(verboseLevel>1)
541 for(i=0;i<BSCNbTheta*6;i++)
542 {
543 G4cout << "The sizes of the " << i+1 << " crystal are:" << G4endl
544 << "zHalfLength =" << zHalfLength[i]/cm << "(cm)," << G4endl
545 << "thetaAxis =" << thetaAxis[i]/deg << "(deg),"<< G4endl
546 << "phiAxis =" << phiAxis[i]/deg << "(deg),"<< G4endl
547 << "yHalfLength1=" << yHalfLength1[i]/cm << "(cm)," << G4endl
548 << "xHalfLength1=" << xHalfLength1[i]/cm << "(cm)," << G4endl
549 << "xHalfLength2=" << xHalfLength2[i]/cm << "(cm)," << G4endl
550 << "tanAlpha1 =" << tanAlpha1[i] << G4endl
551 << "yHalfLength2=" << yHalfLength2[i]/cm << "(cm)," << G4endl
552 << "xHalfLength3=" << xHalfLength3[i]/cm << "(cm)," << G4endl
553 << "xHalfLength4=" << xHalfLength4[i]/cm << "(cm)," << G4endl
554 << "tanAlpha2 =" << tanAlpha2[i] << "." << G4endl
555 << "The position of the " << i+1 << " crystal is:" << G4endl
556 << "(" << xPosition[i]/cm << ","
557 << yPosition[i]/cm << ","
558 << zPosition[i]/cm << ")cm" << G4endl;
559 }
560
561}