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