169 TVector3 wiredirection;
173 int num = NUMBER_STRAWS;
192 cout<<
"numero totale di tubi "<<num<<endl;
195 pSttTube = (
PndSttTube*) SttTubeArray->At(tubeID);
198 Rrr =
sqrt( center.X()*center.X()+center.Y()*center.Y());
199 cout<<
"\tFirst STT straw tubeID; n. "<<tubeID<<
", centro X "<< center.X()
200 <<
", centro Y "<< center.Y()<<
", centro Z "<< center.Z()<<
", fR = "<<Rrr<<endl;
204 pSttTube = (
PndSttTube*) SttTubeArray->At(tubeID);
207 Rrr =
sqrt( center.X()*center.X()+center.Y()*center.Y());
208 cout<<
"\tLast STT straw tubeID, n. "<<tubeID<<
", centro X "<< center.X()
209 <<
", centro Y "<< center.Y()<<
", centro Z "<< center.Z()<<
", fR = "<<Rrr<<endl<<endl;
225 cout<<
"\tBOUNDARY Straws : Central Vertical Boundary, axial STT straws Center positions :\n";
230 Rrr =
sqrt( center.X()*center.X()+center.Y()*center.Y());
232 if(!(
fabs( wiredirection.X() )< 0.00001 &&
fabs( wiredirection.Y() )< 0.00001))
continue;
233 if(
fabs(center.X())>3.)
continue;
235 cout<<
"\tSTT straw || tubeID n. "<<i<<
", centro X "<< center.X()
236 <<
", centro Y "<< center.Y()<<
", centro Z "<< center.Z()<<
", fR = "<<Rrr;
238 if( center.X() < 0. ) {
239 if(
fabs( center.Y() ) < 30. ) { code = 10;}
else {code = 12;};
241 if(
fabs( center.Y() ) < 30. ) { code = 20;}
else {code = 22;};
244 if(stampa) cout<<
", SttCode = "<<code<<endl;
246 if( StrawCode[i-1] > -1 && StrawCode[i-1] != code) {
248 StrawCode2[i-1] = code;
250 StrawCode[i-1] = code;
258 if(stampa)cout<<
"\n\tExternal Round Boundary || STT straws :\n";
264 if(!(
fabs( wiredirection.X() )< 0.00001 &&
fabs( wiredirection.Y() )< 0.00001))
continue;
271 if( dist_x < xcircle && dist_y < ycircle )
continue;
273 if( i == 3628 || i==3514||i==3513 || i==3399 || i==3631 || i==3738 || i==3743 ||
274 i==3850|| i== 3855 || i== 3949|| i==3954 || i==4048)
continue;
277 if( i == 3856 || i==3948||i==3955 || i==4047 || i==4045 || i==4137 || i==4144 ||
280 if( i == 4055 || i==4136||i==4145 || i==4226 )
continue;
281 if( i == 4235 || i==4301||i==4310 || i==4376 )
continue;
282 if( i == 4236 || i==4300||i==4311 || i==4375 )
continue;
283 if( 4386 <= i && i<=4393 )
continue;
284 if( 4422 <= i && i<=4429 )
continue;
285 if( 4440 <= i && i<=4447 )
continue;
286 if( 4476 <= i && i<=4483 )
continue;
287 if( i == 3883 || i==3921||i==3982 || i==4020 )
continue;
288 if( i == 3434 || i==3478 ||i==3549 || i== 3593 )
continue;
289 if( i == 3211 || i==3250||i==3323 || i==3362 )
continue;
290 if( i == 3438 || i==3474||i==3553 || i==3589 )
continue;
291 if( i == 3669 || i==3700||i==3781 || i== 3812 )
continue;
292 if( i == 3888 || i==3916||i==3987 || i==4015 )
continue;
293 if( 4084 <= i && i<=4085 )
continue;
294 if( 4106 <= i && i<=4107 )
continue;
295 if( 4174 <= i && i<=4175 )
continue;
296 if( 4196 <= i && i<=4197 )
continue;
298 if( 4260 <= i && i<=4261 )
continue;
299 if( 4275 <= i && i<=4276 )
continue;
300 if( 4335 <= i && i<=4336 )
continue;
301 if( 4350 <= i && i<=4351 )
continue;
303 if( 4404 <= i && i<=4407 )
continue;
304 if( 4408 <= i && i<=4411 )
continue;
305 if( 4458 <= i && i<=4461 )
continue;
306 if( 4462 <= i && i<=4465 )
continue;
309 if(stampa)cout<<
"\tSTT straw || tubeID n. "<<i<<
", centro X "<< center.X()
310 <<
", centro Y "<< center.Y()<<
", centro Z "<< center.Z()<<
", fR = "<<Rrr;
311 if( center.X() < 0. ) {
313 if(stampa)cout<<
", SttCode = 13\n";
316 if(stampa)cout<<
", SttCode = 23\n";
319 if( StrawCode[i-1] > -1 && StrawCode[i-1] != code) {
321 StrawCode2[i-1] = code;
323 StrawCode[i-1] = code;
336 if(stampa)cout<<
"\n\tInner Boundary (smaller) with code 10; 2nd quadrant || STT straws :\n";
343 if(center.X()>0.)
continue;
344 if(!(
fabs( wiredirection.X() )< 0.00001 &&
fabs( wiredirection.Y() )< 0.00001))
continue;
345 distanza =
fabs(
sqrt(3.)*center.Y()-center.X() -2*apotema)/2.;
347 Rrr =
sqrt( center.X()*center.X()+center.Y()*center.Y());
348 if(stampa)cout<<
"\tSTT straw || tubeID n. "<<i<<
", centro X "<< center.X()
349 <<
", centro Y "<< center.Y()<<
", centro Z "<< center.Z()<<
", fR = "<<Rrr
350 <<
", SttCode = 10\n";
352 if( StrawCode[i-1] > -1 && StrawCode[i-1] != code) {
354 StrawCode2[i-1] = code;
356 StrawCode[i-1] = code;
364 if(stampa)cout<<
"\n\tInner Vertical Boundary (smaller) with code 10; 2nd-3rd quadrant || STT straws :\n";
370 if(!(
fabs( wiredirection.X() )< 0.00001 &&
fabs( wiredirection.Y() )< 0.00001))
continue;
371 if(center.X()>0.)
continue;
372 if(center.X()< -apotema - 2.*
STRAWRADIUS)
continue;
373 if(
fabs(center.Y())> apotema/
sqrt(3.))
continue;
374 Rrr =
sqrt( center.X()*center.X()+center.Y()*center.Y());
375 if(stampa)cout<<
"\tSTT straw || tubeID n. "<<i<<
", centro X "<< center.X()
376 <<
", centro Y "<< center.Y()<<
", centro Z "<< center.Z()<<
", fR = "<<Rrr
377 <<
", SttCode = 10\n";
379 if( StrawCode[i-1] > -1 && StrawCode[i-1] != code) {
381 StrawCode2[i-1] = code;
383 StrawCode[i-1] = code;
392 if(stampa)cout<<
"\n\tInner Boundary (smaller) with code 10; 3nd quadrant || STT straws :\n";
398 if(center.X()>0.)
continue;
399 if(!(
fabs( wiredirection.X() )< 0.00001 &&
fabs( wiredirection.Y() )< 0.00001))
continue;
400 distanza =
fabs(-
sqrt(3.)*center.Y()-center.X() -2*apotema)/2.;
402 Rrr =
sqrt( center.X()*center.X()+center.Y()*center.Y());
403 if(stampa)cout<<
"\tSTT straw || tubeID n. "<<i<<
", centro X "<< center.X()
404 <<
", centro Y "<< center.Y()<<
", centro Z "<< center.Z()<<
", fR = "<<Rrr
405 <<
", SttCode = 10\n";
407 if( StrawCode[i-1] > -1 && StrawCode[i-1] != code) {
409 StrawCode2[i-1] = code;
411 StrawCode[i-1] = code;
420 if(stampa)cout<<
"\n\tInner Boundary (smaller) with code 20; 1nd quadrant || STT straws :\n";
426 if(center.X()<0.)
continue;
427 if(!(
fabs( wiredirection.X() )< 0.00001 &&
fabs( wiredirection.Y() )< 0.00001))
continue;
428 distanza =
fabs(
sqrt(3.)*center.Y()+center.X() -2*apotema)/2.;
430 Rrr =
sqrt( center.X()*center.X()+center.Y()*center.Y());
431 if(stampa)cout<<
"\tSTT straw || tubeID n. "<<i<<
", centro X "<< center.X()
432 <<
", centro Y "<< center.Y()<<
", centro Z "<< center.Z()<<
", fR = "<<Rrr
433 <<
", SttCode = 20\n";
435 if( StrawCode[i-1] > -1 && StrawCode[i-1] != code) {
437 StrawCode2[i-1] = code;
439 StrawCode[i-1] = code;
447 if(stampa)cout<<
"\n\tInner Vertical Boundary (smaller) with code 20; 1st-2nd quadrant || STT straws :\n";
453 if(!(
fabs( wiredirection.X() )< 0.00001 &&
fabs( wiredirection.Y() )< 0.00001))
continue;
454 if(center.X()<0.)
continue;
456 if(
fabs(center.Y())> apotema/
sqrt(3.))
continue;
457 Rrr =
sqrt( center.X()*center.X()+center.Y()*center.Y());
458 if(stampa)cout<<
"\tSTT straw || tubeID n. "<<i<<
", centro X "<< center.X()
459 <<
", centro Y "<< center.Y()<<
", centro Z "<< center.Z()<<
", fR = "<<Rrr
460 <<
", SttCode = 20\n";
462 if( StrawCode[i-1] > -1 && StrawCode[i-1] != code) {
464 StrawCode2[i-1] = code;
466 StrawCode[i-1] = code;
475 if(stampa)cout<<
"\n\tInner Boundary (smaller) with code 20; 4nd quadrant || STT straws :\n";
481 if(center.X()<0.)
continue;
482 if(!(
fabs( wiredirection.X() )< 0.00001 &&
fabs( wiredirection.Y() )< 0.00001))
continue;
483 distanza =
fabs(-
sqrt(3.)*center.Y()+center.X() -2*apotema)/2.;
485 Rrr =
sqrt( center.X()*center.X()+center.Y()*center.Y());
486 if(stampa)cout<<
"\tSTT straw || tubeID n. "<<i<<
", centro X "<< center.X()
487 <<
", centro Y "<< center.Y()<<
", centro Z "<< center.Z()<<
", fR = "<<Rrr
488 <<
", SttCode = 20\n";
490 if( StrawCode[i-1] > -1 && StrawCode[i-1] != code) {
492 StrawCode2[i-1] = code;
494 StrawCode[i-1] = code;
505 if(stampa)cout<<
"\n\tInner Boundary (the larger), the one with code 21; 1nd quadrant || STT straws :\n";
511 if(center.X()<0.)
continue;
512 if(!(
fabs( wiredirection.X() )< 0.00001 &&
fabs( wiredirection.Y() )< 0.00001))
continue;
513 distanza =
fabs(
sqrt(3.)*center.Y()+center.X() -2*apotema)/2.;
515 Rrr =
sqrt( center.X()*center.X()+center.Y()*center.Y());
516 if(stampa)cout<<
"\tSTT straw || tubeID n. "<<i<<
", centro X "<< center.X()
517 <<
", centro Y "<< center.Y()<<
", centro Z "<< center.Z()<<
", fR = "<<Rrr
518 <<
", SttCode = 21\n";
520 if( StrawCode[i-1] > -1 && StrawCode[i-1] != code) {
522 StrawCode2[i-1] = code;
524 StrawCode[i-1] = code;
533 if(stampa)cout<<
"\n\tInner Vertical Boundary (the larger) the one with code 21; 1st-4th quadrant || STT straws :\n";
539 if(!(
fabs( wiredirection.X() )< 0.00001 &&
fabs( wiredirection.Y() )< 0.00001))
continue;
540 if(center.X()<0.)
continue;
542 if(
fabs(center.Y())> apotema/
sqrt(3.))
continue;
543 Rrr =
sqrt( center.X()*center.X()+center.Y()*center.Y());
544 if(stampa)cout<<
"\tSTT straw || tubeID n. "<<i<<
", centro X "<< center.X()
545 <<
", centro Y "<< center.Y()<<
", centro Z "<< center.Z()<<
", fR = "<<Rrr
546 <<
", SttCode = 21\n";
548 if( StrawCode[i-1] > -1 && StrawCode[i-1] != code) {
550 StrawCode2[i-1] = code;
552 StrawCode[i-1] = code;
561 if(stampa)cout<<
"\n\tInner Boundary (the larger) the one with code 21; 4nd quadrant || STT straws :\n";
567 if(center.X()<0.)
continue;
568 if(!(
fabs( wiredirection.X() )< 0.00001 &&
fabs( wiredirection.Y() )< 0.00001))
continue;
569 distanza =
fabs(-
sqrt(3.)*center.Y()+center.X() -2*apotema)/2.;
571 Rrr =
sqrt( center.X()*center.X()+center.Y()*center.Y());
572 if(stampa)cout<<
"\tSTT straw || tubeID n. "<<i<<
", centro X "<< center.X()
573 <<
", centro Y "<< center.Y()<<
", centro Z "<< center.Z()<<
", fR = "<<Rrr
574 <<
", SttCode = 21\n";
576 if( StrawCode[i-1] > -1 && StrawCode[i-1] != code) {
578 StrawCode2[i-1] = code;
580 StrawCode[i-1] = code;
588 if(stampa)cout<<
"\n\tInner Boundary (the larger) the one with code 11, 2nd quadrant || STT straws :\n";
594 if(center.X()>0.)
continue;
595 if(!(
fabs( wiredirection.X() )< 0.00001 &&
fabs( wiredirection.Y() )< 0.00001))
continue;
596 distanza =
fabs(
sqrt(3.)*center.Y()-center.X() -2*apotema)/2.;
598 Rrr =
sqrt( center.X()*center.X()+center.Y()*center.Y());
599 if(stampa)cout<<
"\tSTT straw || tubeID n. "<<i<<
", centro X "<< center.X()
600 <<
", centro Y "<< center.Y()<<
", centro Z "<< center.Z()<<
", fR = "<<Rrr
601 <<
", SttCode = 11\n";
603 if( StrawCode[i-1] > -1 && StrawCode[i-1] != code) {
605 StrawCode2[i-1] = code;
607 StrawCode[i-1] = code;
616 if(stampa)cout<<
"\n\tInner Vertical Boundary (the larger) the one with code 11; 2nd-3rd quadrant || STT straws :\n";
622 if(!(
fabs( wiredirection.X() )< 0.00001 &&
fabs( wiredirection.Y() )< 0.00001))
continue;
623 if(center.X()>0.)
continue;
625 if(
fabs(center.Y())> apotema/
sqrt(3.))
continue;
626 Rrr =
sqrt( center.X()*center.X()+center.Y()*center.Y());
627 if(stampa)cout<<
"\tSTT straw || tubeID n. "<<i<<
", centro X "<< center.X()
628 <<
", centro Y "<< center.Y()<<
", centro Z "<< center.Z()<<
", fR = "<<Rrr
629 <<
", SttCode = 11\n";
631 if( StrawCode[i-1] > -1 && StrawCode[i-1] != code) {
633 StrawCode2[i-1] = code;
635 StrawCode[i-1] = code;
645 if(stampa)cout<<
"\n\tInner Boundary 3nd quadrant (the larger) the one with code 11; || STT straws :\n";
651 if(center.X()>0.)
continue;
652 if(!(
fabs( wiredirection.X() )< 0.00001 &&
fabs( wiredirection.Y() )< 0.00001))
continue;
653 distanza =
fabs(-
sqrt(3.)*center.Y()-center.X() -2*apotema)/2.;
655 Rrr =
sqrt( center.X()*center.X()+center.Y()*center.Y());
656 if(stampa)cout<<
"\tSTT straw || tubeID n. "<<i<<
", centro X "<< center.X()
657 <<
", centro Y "<< center.Y()<<
", centro Z "<< center.Z()<<
", fR = "<<Rrr
658 <<
", SttCode = 11\n";
660 if( StrawCode[i-1] > -1 && StrawCode[i-1] != code) {
662 StrawCode2[i-1] = code;
664 StrawCode[i-1] = code;
678 if(stampa)cout<<
"\n\tOuter Boundary (the larger), the one with code 24 or 25; 1nd quadrant || STT straws :\n";
684 if(center.X()<0.)
continue;
685 if(!(
fabs( wiredirection.X() )< 0.00001 &&
fabs( wiredirection.Y() )< 0.00001))
continue;
686 distanza =
fabs(
sqrt(3.)*center.Y()+center.X() -2*apotema)/2.;
690 if( center.X() -
STRAWRADIUS <
x ) { code = 25; }
else { code = 24; }
692 Rrr =
sqrt( center.X()*center.X()+center.Y()*center.Y());
693 if(stampa)cout<<
"\tSTT straw || tubeID n. "<<i<<
", centro X "<< center.X()
694 <<
", centro Y "<< center.Y()<<
", centro Z "<< center.Z()<<
", fR = "<<Rrr
695 <<
", SttCode = "<<code<<endl;
696 if( StrawCode[i-1] > -1 && StrawCode[i-1] != code) {
698 StrawCode2[i-1] = code;
700 StrawCode[i-1] = code;
709 if(stampa)cout<<
"\n\tOuter Vertical Boundary (the larger) the one with code 24; 1st-4th quadrant || STT straws :\n";
715 if(!(
fabs( wiredirection.X() )< 0.00001 &&
fabs( wiredirection.Y() )< 0.00001))
continue;
716 if(center.X()<0.)
continue;
718 if(
fabs(center.Y())> apotema/
sqrt(3.))
continue;
719 Rrr =
sqrt( center.X()*center.X()+center.Y()*center.Y());
720 if(stampa)cout<<
"\tSTT straw || tubeID n. "<<i<<
", centro X "<< center.X()
721 <<
", centro Y "<< center.Y()<<
", centro Z "<< center.Z()<<
", fR = "<<Rrr
722 <<
", SttCode = 24\n";
724 if( StrawCode[i-1] > -1 && StrawCode[i-1] != code) {
726 StrawCode2[i-1] = code;
728 StrawCode[i-1] = code;
737 if(stampa)cout<<
"\n\tOuter Boundary (the larger) the one with code 24 or 25; 4nd quadrant || STT straws :\n";
743 if(center.X()<0.)
continue;
744 if(!(
fabs( wiredirection.X() )< 0.00001 &&
fabs( wiredirection.Y() )< 0.00001))
continue;
745 distanza =
fabs(-
sqrt(3.)*center.Y()+center.X() -2*apotema)/2.;
749 if( center.X() -
STRAWRADIUS <
x ) { code = 25; }
else { code = 24; }
751 Rrr =
sqrt( center.X()*center.X()+center.Y()*center.Y());
752 if(stampa)cout<<
"\tSTT straw || tubeID n. "<<i<<
", centro X "<< center.X()
753 <<
", centro Y "<< center.Y()<<
", centro Z "<< center.Z()<<
", fR = "<<Rrr
754 <<
", SttCode = "<<code<<endl;
755 if( StrawCode[i-1] > -1 && StrawCode[i-1] != code) {
757 StrawCode2[i-1] = code;
759 StrawCode[i-1] = code;
767 if(stampa)cout<<
"\n\tOuter Boundary (the larger) the one with code 14 or 15, 2nd quadrant || STT straws :\n";
773 if(center.X()>0.)
continue;
774 if(!(
fabs( wiredirection.X() )< 0.00001 &&
fabs( wiredirection.Y() )< 0.00001))
continue;
775 distanza =
fabs(
sqrt(3.)*center.Y()-center.X() -2*apotema)/2.;
779 if( center.X() +
STRAWRADIUS > -
x ) { code = 15; }
else { code = 14; }
781 Rrr =
sqrt( center.X()*center.X()+center.Y()*center.Y());
782 if(stampa)cout<<
"\tSTT straw || tubeID n. "<<i<<
", centro X "<< center.X()
783 <<
", centro Y "<< center.Y()<<
", centro Z "<< center.Z()<<
", fR = "<<Rrr
784 <<
", SttCode = "<<code<<endl;
785 if( StrawCode[i-1] > -1 && StrawCode[i-1] != code) {
787 StrawCode2[i-1] = code;
789 StrawCode[i-1] = code;
798 if(stampa)cout<<
"\n\tOuter Vertical Boundary (the larger) the one with code 12; 2nd-3rd quadrant || STT straws :\n";
804 if(!(
fabs( wiredirection.X() )< 0.00001 &&
fabs( wiredirection.Y() )< 0.00001))
continue;
805 if(center.X()>0.)
continue;
807 if(
fabs(center.Y())> apotema/
sqrt(3.))
continue;
808 Rrr =
sqrt( center.X()*center.X()+center.Y()*center.Y());
809 if(stampa)cout<<
"\tSTT straw || tubeID n. "<<i<<
", centro X "<< center.X()
810 <<
", centro Y "<< center.Y()<<
", centro Z "<< center.Z()<<
", fR = "<<Rrr
811 <<
", SttCode = 14\n";
813 if( StrawCode[i-1] > -1 && StrawCode[i-1] != code) {
815 StrawCode2[i-1] = code;
817 StrawCode[i-1] = code;
827 if(stampa)cout<<
"\n\tOuter Boundary 3nd quadrant (the larger) the one with code 14 or 15; || STT straws :\n";
833 if(center.X()>0.)
continue;
834 if(!(
fabs( wiredirection.X() )< 0.00001 &&
fabs( wiredirection.Y() )< 0.00001))
continue;
835 distanza =
fabs(-
sqrt(3.)*center.Y()-center.X() -2*apotema)/2.;
839 if( center.X() +
STRAWRADIUS > -
x ) { code = 15; }
else { code = 14; }
841 Rrr =
sqrt( center.X()*center.X()+center.Y()*center.Y());
842 if(stampa)cout<<
"\tSTT straw || tubeID n. "<<i<<
", centro X "<< center.X()
843 <<
", centro Y "<< center.Y()<<
", centro Z "<< center.Z()<<
", fR = "<<Rrr
844 <<
", SttCode = "<<code<<endl;
845 if( StrawCode[i-1] > -1 && StrawCode[i-1] != code) {
847 StrawCode2[i-1] = code;
849 StrawCode[i-1] = code;
const Double_t RSTRAWDETECTORMAX
friend F32vec4 sqrt(const F32vec4 &a)
void CalculateSpecialRegion(Double_t RSTRAWDETECTORMIN, Double_t APOTEMAMAXINNERPARSTRAW, Double_t APOTEMAMINOUTERPARSTRAW, Double_t VERTICALGAP, Double_t &x, Double_t &y)
const Double_t STRAWRADIUS
const Double_t APOTEMAMINOUTERPARSTRAW
friend F32vec4 fabs(const F32vec4 &a)
const Double_t VERTICALGAP
const Double_t APOTEMAMAXINNERPARSTRAW
const Double_t APOTEMASTRAWDETECTORMIN
TVector3 GetWireDirection()