337{
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356 G4double totalThickness=fTyvekThickness+fAlThickness+fMylarThickness;
357 G4double
delta=0.,angle1=0.*deg,angle2=0.*deg;
358 G4double oop;
359
360 G4double rminprojected=BSCRmin*
cos(BSCAngleRotat);
361 rminprojected=BSCRmin;
362
363
364 G4int i;
365 for(i=0;i<BSCNbTheta;i++)
366 {
367 G4double CryLength;
368 if(i==BSCNbTheta-1)
369 {
370 CryLength=BSCCryLength1;
371 } else {
372 CryLength=BSCCryLength;
373 }
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;
386
387 zHalfLength[BSCNbTheta*5+i]=zHalfLength[BSCNbTheta*4+i]=
388 zHalfLength[BSCNbTheta*3+i]=zHalfLength[BSCNbTheta*2+i]=
389 zHalfLength[i]-totalThickness/2.;
390
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]
396 /yHalfLength2[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];
400
401 yHalfLength2[BSCNbTheta*4+i]=yHalfLength1[BSCNbTheta*4+i]=
402 totalThickness/2.;
403 xHalfLength4[BSCNbTheta*4+i]=xHalfLength4[i];
404 xHalfLength3[BSCNbTheta*4+i]=xHalfLength4[i]
405 -(xHalfLength4[i]-xHalfLength3[i])*yHalfLength2[BSCNbTheta*4+i]
406 /yHalfLength2[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];
410
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)
414 /CryLength);
415
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]=
425 totalThickness/2.;
426
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;
435
436 oop=sqrt((yHalfLength2[i]-yHalfLength1[i])*(yHalfLength2[i]
437 -yHalfLength1[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);
442
443 phiAxis[i] =180.*deg+atan((yHalfLength2[i]-yHalfLength1[i])
444 /(xHalfLength3[i]+xHalfLength4[i]
445 -xHalfLength1[i]-xHalfLength2[i])*2.);
446
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.);
458
459 oop=sqrt((yHalfLength2[i]-yHalfLength1[i])*(yHalfLength2[i]
460 -yHalfLength1[i])*4
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])
465 /4);
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);
471
472 oop=sqrt((yHalfLength2[i]-yHalfLength1[i])*(yHalfLength2[i]
473 -yHalfLength1[i])*4
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]));
479
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;
485
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;
490
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.;
503
504 tanAlpha2[i]=-(xHalfLength4[i]-xHalfLength3[i])/yHalfLength2[i]/2.;
505
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.;
516
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.;
526
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];
532
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]);
546
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.;
557
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.;
568
569 }
570
571 if(verboseLevel>1)
572 for(i=0;i<BSCNbTheta*6;i++)
573 {
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;
590 }
591
592}