63 Double_t rotation, Double_t lx, Double_t ly,
64 Double_t
d, Double_t dx, Double_t dy, Double_t stereoF, Double_t stereoB)
66 TNamed(tempName.Data(),
""),
89 fFrontLorentzShift(0.132),
90 fBackLorentzShift(0.026),
95 fName = tempName.Data();
101 fRotation = rotation;
109 fBackStripShift = 0.;
110 fFrontStripShift = 0.;
111 Double_t dbNoX = fLx / fDx;
113 fTanF = TMath::Tan (fStereoF);
114 fTanB = TMath::Tan (fStereoB);
115 fSinRot = TMath::Sin(fRotation);
116 fCosRot = TMath::Cos(fRotation);
120 Double_t dbNoY = fLy / fDy;
121 fNChannelsFront = Int_t( TMath::Ceil ( dbNoX )
122 *TMath::Ceil ( dbNoY ));
125 else if ( fType == 2 ) {
126 fNChannelsFront = Int_t(TMath::Ceil ( dbNoX ));
127 Double_t aPlus = TMath::Abs( fLy * TMath::Tan(fStereoB) );
129 Double_t dbNoB = ( fLx + aPlus ) / fDy ;
130 fNChannelsBack = Int_t(TMath::Ceil ( dbNoB ));
132 else if ( fType == 3 ) {
133 fNChannelsFront = Int_t(TMath::Ceil ( dbNoX ));
134 if (fStereoB*180/TMath::Pi()>80) {
135 fNChannelsBack = Int_t(TMath::Ceil ( fLy / fDy ));
138 fNChannelsBack = fNChannelsFront;
142 cout <<
"-E- CbmStsSensor: Illegal sensor type " << fType << endl;
143 Fatal(
"",
"Illegal sensor type");
148 fSigmaX = fDx / TMath::Sqrt(12);
149 fSigmaY = fDy / TMath::Sqrt(12);
152 else if ( fType == 2 || fType == 3 ) {
154 if (fStereoF==0. && fStereoB*180/TMath::Pi()<80 ) {
155 fSigmaX = fDx / TMath::Sqrt(12);
156 fSigmaY = fDx / (TMath::Sqrt(6)*TMath::Tan(fStereoB));
157 fSigmaXY = (-1. * fDx * fDx)/(12.*TMath::Tan(fStereoB));
159 else if (fStereoF==0. && fStereoB*180/TMath::Pi()>80 ) {
160 fSigmaX = fDx / TMath::Sqrt(12);
161 fSigmaY = fDy / TMath::Sqrt(12);
165 fSigmaX = fDx / TMath::Sqrt(24);
166 fSigmaY = fDx / (TMath::Sqrt(24)*TMath::Tan(fStereoB));
170 Int_t sensorNumber = ( fDetectorId & (7<<1) ) >> 1;
172 if ( sensorNumber == 1 ) {
173 fBackStripShift = 0.;
174 fFrontStripShift = 0.;
175 if (fStereoB < 0) fBackStripShift = fLy * TMath::Tan(-fStereoB);
177 else if ( sensorNumber == 2 ) {
178 if (fStereoB*180/TMath::Pi()>80) {
179 fBackStripShift = 0.;
180 fFrontStripShift = 1. * fLy * TMath::Tan(fStereoF);
183 fBackStripShift = 1. * fLy * TMath::Tan(fStereoB);
184 fFrontStripShift = 1. * fLy * TMath::Tan(fStereoF);
187 else if ( sensorNumber == 3 ){
188 if (fStereoB*180/TMath::Pi()>80) {
189 fBackStripShift = 0.;
190 fFrontStripShift = 2. * fLy * TMath::Tan(fStereoF);
193 fBackStripShift = 2. * fLy * TMath::Tan(fStereoB);
194 fFrontStripShift = 2. * fLy * TMath::Tan(fStereoF);
200 cout <<
"-E- CbmStsSensor: Illegal sensor type " << fType << endl;
201 Fatal(
"",
"Illegal sensor type");
205 Double_t cosRot = TMath::Cos(fRotation);
206 Double_t sinRot = TMath::Sin(fRotation);
207 Double_t vX = cosRot * cosRot * fSigmaX * fSigmaX
208 - 2. * cosRot * sinRot * fSigmaXY
209 + sinRot * sinRot * fSigmaY * fSigmaY;
210 Double_t vY = sinRot * sinRot * fSigmaX * fSigmaX
211 + 2. * cosRot * sinRot * fSigmaXY
212 + cosRot * cosRot * fSigmaY * fSigmaY;
213 Double_t vXY = cosRot * sinRot * fSigmaX * fSigmaX
214 + ( cosRot*cosRot - sinRot*sinRot ) * fSigmaXY
215 - cosRot * sinRot * fSigmaY * fSigmaY;
216 fSigmaX = TMath::Sqrt(vX);
217 fSigmaY = TMath::Sqrt(vY);
220 fXSmearWidth = 0.0005;
223 fFrontLorentzShift = 0.132;
224 fBackLorentzShift = 0.026;
225 fFrontLorentzShift = fBackLorentzShift = 0.0;
231 Double_t y0, Double_t rotation, Double_t lx,
232 Double_t ly, Double_t dx, Double_t dy,
233 Double_t stereoF, Double_t stereoB)
251 fFrontStripShift(0.),
255 fXSmearWidth(0.0005),
257 fFrontLorentzShift(0.132),
258 fBackLorentzShift(0.026),
267 fRotation = rotation;
274 fBackStripShift = 0.;
275 fFrontStripShift = 0.;
276 Double_t dbNoX = fLx / fDx;
278 fTanF = TMath::Tan (fStereoF);
279 fTanB = TMath::Tan (fStereoB);
280 fSinRot = TMath::Sin(fRotation);
281 fCosRot = TMath::Cos(fRotation);
285 Double_t dbNoY = fLy / fDy;
286 fNChannelsFront = Int_t( TMath::Ceil ( dbNoX )
287 *TMath::Ceil ( dbNoY ));
290 else if ( fType == 2 ) {
291 fNChannelsFront = Int_t(TMath::Ceil ( dbNoX ));
292 Double_t aPlus = TMath::Abs( fLy * TMath::Tan(fStereoB) );
294 Double_t dbNoB = ( fLx + aPlus ) / fDy ;
295 fNChannelsBack = Int_t(TMath::Ceil ( dbNoB ));
297 else if ( fType == 3 ) {
298 fNChannelsFront = Int_t(TMath::Ceil ( dbNoX ));
299 fNChannelsBack = fNChannelsFront;
302 cout <<
"-E- CbmStsSensor: Illegal sensor type " << fType << endl;
303 Fatal(
"",
"Illegal sensor type");
308 fSigmaX = fDx / TMath::Sqrt(12);
309 fSigmaY = fDy / TMath::Sqrt(12);
312 else if ( fType == 2 || fType == 3 ) {
313 if (fStereoF==0. && fStereoB*180/TMath::Pi()<80 ) {
314 fSigmaX = fDx / TMath::Sqrt(12);
315 fSigmaY = fDx / (TMath::Sqrt(6)*TMath::Tan(fStereoB));
316 fSigmaXY = (-1. * fDx * fDx)/(12.*TMath::Tan(fStereoB));
318 else if (fStereoF==0. && fStereoB*180/TMath::Pi()>80 ) {
319 fSigmaX = fDx / TMath::Sqrt(12);
320 fSigmaY = fDy / TMath::Sqrt(12);
324 fSigmaX = fDx / TMath::Sqrt(24);
325 fSigmaY = fDx / (TMath::Sqrt(24)*TMath::Tan(fStereoB));
329 Int_t sensorNumber = ( fDetectorId & (7<<1) ) >> 1;
330 if ( sensorNumber == 1 ) {
331 fBackStripShift = 0.;
332 fFrontStripShift = 0.;
333 if (fStereoB < 0) fBackStripShift = fLy * TMath::Tan(-fStereoB);
335 else if ( sensorNumber == 2 ) {
336 if (fStereoB*180/TMath::Pi()>80) {
337 fBackStripShift = 0.;
338 fFrontStripShift = 1. * fLy * TMath::Tan(fStereoF);
341 fBackStripShift = 1. * fLy * TMath::Tan(fStereoB);
342 fFrontStripShift = 1. * fLy * TMath::Tan(fStereoF);
345 else if ( sensorNumber == 3 ){
346 if (fStereoB*180/TMath::Pi()>80) {
347 fBackStripShift = 0.;
348 fFrontStripShift = 2. * fLy * TMath::Tan(fStereoF);
351 fBackStripShift = 2. * fLy * TMath::Tan(fStereoB);
352 fFrontStripShift = 2. * fLy * TMath::Tan(fStereoF);
358 cout <<
"-E- CbmStsSensor: Illegal sensor type " << fType << endl;
359 Fatal(
"",
"Illegal sensor type");
363 Double_t cosRot = TMath::Cos(fRotation);
364 Double_t sinRot = TMath::Sin(fRotation);
365 Double_t vX = cosRot * cosRot * fSigmaX * fSigmaX
366 - 2. * cosRot * sinRot * fSigmaXY
367 + sinRot * sinRot * fSigmaY * fSigmaY;
368 Double_t vY = sinRot * sinRot * fSigmaX * fSigmaX
369 + 2. * cosRot * sinRot * fSigmaXY
370 + cosRot * cosRot * fSigmaY * fSigmaY;
371 Double_t vXY = cosRot * sinRot * fSigmaX * fSigmaX
372 + ( cosRot*cosRot - sinRot*sinRot ) * fSigmaXY
373 - cosRot * sinRot * fSigmaY * fSigmaY;
374 fSigmaX = TMath::Sqrt(vX);
375 fSigmaY = TMath::Sqrt(vY);
378 fXSmearWidth = 0.0005;
381 fFrontLorentzShift = 0.132;
382 fBackLorentzShift = 0.026;
398 if (iSide !=0 && iSide != 1) {
399 cout <<
"-W- CbmStsSensor::GetChannel: Illegal side number "
407 if ( ! IntCoord(x, y, xint, yint) )
return -1;
410 Double_t dbNoX = fLx / fDx;
413 Int_t nCol = Int_t(TMath::Ceil( dbNoX));
414 Int_t iCol = Int_t(xint / fDx);
415 Int_t iRow = Int_t(yint / fDy);
416 iChan = iRow * nCol + iCol;
417 if ( iChan < 0 || iChan > fNChannelsFront ) {
418 cout <<
"-E- CbmStsSensor::GetChannel: "
419 <<
"Channel number " << iChan <<
" exceeds limit "
420 << fNChannelsFront << endl;
422 cout << x <<
" " << y <<
" " << iSide << endl;
423 Fatal(
"GetChannel",
"illegal channel number");
428 else if ( fType == 2 ) {
431 iChan = Int_t ( xint / fDx );
432 if ( iChan < 0 || iChan > fNChannelsFront )
434 cout <<
"-E- CbmStsSensor::GetChannel: "
435 <<
"Front channel number " << iChan <<
" exceeds limit "
436 << fNChannelsFront << endl;
437 Fatal(
"GetChannel",
"illegal channel number");
442 Double_t xp = xint + yint * TMath::Tan(fStereoB);
444 iChan = Int_t ( xp / fDx );
445 if ( iChan < 0 || iChan > fNChannelsBack ) {
446 cout <<
"-E- CbmStsSensor::GetChannel: "
447 <<
"Back channel number " << iChan <<
" exceeds limit "
448 << fNChannelsBack << endl;
449 cout <<
" Sensor " <<
GetSensorNr() <<
" of station "
451 cout <<
" Point coordinates: (" << x <<
", " << y
453 Fatal(
"GetChannel",
"illegal channel number");
459 else if ( fType == 3 ) {
461 Double_t xf = xint + fFrontStripShift + yint * TMath::Tan(fStereoF);
462 xf = xf - TMath::Floor(xf/fLx) * fLx;
463 iChan = Int_t ( xf / fDx );
464 if ( iChan < 0 || iChan > fNChannelsFront ) {
465 cout <<
"-E- CbmStsSensor::GetChannel: "
466 <<
"Front channel number " << iChan <<
" exceeds limit "
467 << fNChannelsFront << endl;
468 Fatal(
"GetChannel",
"illegal channel number");
472 if (fStereoB*180/TMath::Pi()>80) {
474 xp = xp - TMath::Floor(xp/fLy) * fLy;
475 iChan = Int_t( xp / fDy );
479 Double_t xp = xint + fBackStripShift + yint * TMath::Tan(fStereoB);
481 xp = xp - TMath::Floor(xp/fLx) * fLx;
483 iChan = Int_t( xp / fDx );
486 if ( iChan < 0 || iChan > fNChannelsBack ) {
487 cout <<
"-E- CbmStsSensor::GetChannel: "
488 <<
"Back channel number " << iChan <<
" exceeds limit "
489 << fNChannelsBack << endl;
490 cout <<
" Sensor " <<
GetSensorNr() <<
" of station "
492 cout <<
" Point coordinates: (" << x <<
", " << y
494 Fatal(
"GetChannel",
"illegal channel number");
508 if (iSide !=0 && iSide != 1) {
509 cout <<
"-W- CbmStsSensor::GetChannel: Illegal side number "
517 if ( ! IntCoord(x, y, xint, yint) )
return -1;
520 Double_t dbNoX = fLx / fDx;
523 Int_t nCol = Int_t(TMath::Ceil( dbNoX));
524 Int_t iCol = Int_t(xint / fDx);
525 Int_t iRow = Int_t(yint / fDy);
526 iChan = iRow * nCol + iCol;
527 if ( iChan < 0 || iChan > fNChannelsFront ) {
528 cout <<
"-E- CbmStsSensor::GetChannel: "
529 <<
"Channel number " << iChan <<
" exceeds limit "
530 << fNChannelsFront << endl;
532 cout << x <<
" " << y <<
" " << iSide << endl;
533 Fatal(
"GetChannel",
"illegal channel number");
538 else if ( fType == 2 ) {
540 iChan = Int_t ( xint / fDx );
541 if ( iChan < 0 || iChan > fNChannelsFront ) {
542 cout <<
"-E- CbmStsSensor::GetChannel: "
543 <<
"Front channel number " << iChan <<
" exceeds limit "
544 << fNChannelsFront << endl;
545 Fatal(
"GetChannel",
"illegal channel number");
551 Double_t xp = xint + yint * TMath::Tan(fStereoB) + fBackStripShift;
553 iChan = Int_t ( xp / fDx );
554 if ( iChan < 0 || iChan > fNChannelsBack ) {
555 cout <<
"-E- CbmStsSensor::GetChannel: "
556 <<
"Back channel number " << iChan <<
" exceeds limit "
557 << fNChannelsBack << endl;
558 cout <<
" Sensor " <<
GetSensorNr() <<
" of station "
560 cout <<
" Point coordinates: (" << x <<
", " << y
562 Fatal(
"GetChannel",
"illegal channel number");
568 else if ( fType == 3 ) {
571 Double_t xf = xint + fFrontStripShift + yint * TMath::Tan(fStereoF);
572 xf = xf - TMath::Floor(xf/fLx) * fLx;
574 if ( iChan < 0 || iChan > fNChannelsFront ) {
575 cout <<
"-E- CbmStsSensor::GetChannel: "
576 <<
"Front channel number " << iChan <<
" exceeds limit "
577 << fNChannelsFront << endl;
578 Fatal(
"GetChannel",
"illegal channel number");
583 if (fStereoB*180/TMath::Pi()>80) {
585 xp = xp - TMath::Floor(xp/fLy) * fLy;
589 Double_t xp = xint + fBackStripShift + yint * TMath::Tan(fStereoB);
590 xp = xp - TMath::Floor(xp/fLx) * fLx;
594 if ( iChan < 0 || iChan > fNChannelsBack ) {
595 cout <<
"-E- CbmStsSensor::GetChannel: "
596 <<
"Back channel number " << iChan <<
" exceeds limit "
597 << fNChannelsBack << endl;
598 cout <<
" Sensor " <<
GetSensorNr() <<
" of station "
600 cout <<
" Point coordinates: (" << x <<
", " << y
602 Fatal(
"GetChannel",
"illegal channel number");
618 if ( z > fD )
return -1;
619 if ( z < 0. )
return -1;
623 x += fFrontLorentzShift*z;
628 if ( ! IntCoord(x, y, xint, yint) )
return -1;
634 Double_t xf = xint + fFrontStripShift + yint * TMath::Tan(fStereoF);
636 if (fType != 2) xf = xf - TMath::Floor(xf/fLx) * fLx;
639 iChan = TMath::Nint(xf/fDx);
641 if ( iChan < 0 || iChan > fNChannelsFront )
return -1;
642 dPitch = xf - iChan * fDx;
653 if ( z > fD )
return -1;
654 if ( z < 0. )
return -1;
658 x += fBackLorentzShift*z;
664 if ( ! IntCoord(x, y, xint, yint) )
return -1;
669 if (fStereoB*180/TMath::Pi()>80) {
671 xp = xp - TMath::Floor(xp/fLy) * fLy;
672 iChan = (Int_t)(xp/fDy);
675 xp = xint + fBackStripShift + yint * TMath::Tan(fStereoB);
677 if (fType != 2) xp = xp - TMath::Floor(xp/fLx) * fLx;
680 iChan = TMath::Nint(xp/fDy);
685 if ( iChan < 0 || iChan > fNChannelsBack )
return -1;
687 dPitch = xp - iChan * fDy;
731 vector<Double_t>& xCross,
732 vector<Double_t>& yCross) {
739 if ( iFStrip < 0 || iFStrip > fNChannelsFront) {
740 cout <<
"-W- CbmStsSensor::Intersect: "
741 <<
"Invalid front channel number ! "
742 << iFStrip <<
" " << fNChannelsFront << endl;
745 if ( iBStrip < 0 || iBStrip > fNChannelsBack) {
746 cout <<
"-W- CbmStsSensor::Intersect: "
747 <<
"Invalid back channel number ! "
748 << iBStrip <<
" " << fNChannelsBack << endl;
753 Double_t xF = Double_t( iFStrip + 0.5 ) * fDx;
756 Double_t xB = Double_t( iBStrip + 0.5 ) * fDx;
761 Int_t nSegB = Int_t ( fLy * TMath::Tan(fStereoB) / fLx ) + 2;
762 Int_t nSegF = Int_t ( fLy * TMath::Tan(fStereoF) / fLx ) + 2;
764 for (Int_t iSegB=0; iSegB<nSegB; iSegB++) {
766 for (Int_t iSegF=0; iSegF<nSegF; iSegF++) {
768 x = ((-1./TMath::Tan(fStereoB)) * (xB - Double_t(iSegB)*fLx) + ((1./TMath::Tan(fStereoF)) * (xF - Double_t(iSegF)*fLx)))/((1./TMath::Tan(fStereoF))-(1./TMath::Tan(fStereoB)));
769 y = (-1./TMath::Tan(fStereoB)) * x + (1./TMath::Tan(fStereoB)) * (xB - fBackStripShift + Double_t(iSegB)*fLx);
773 if ( y < 0. || y > fLy )
continue;
774 if ( x < 0. || x > fLx )
continue;
777 Double_t xHit = x * TMath::Cos(fRotation) - y * TMath::Sin(fRotation);
778 Double_t yHit = y * TMath::Cos(fRotation) + x * TMath::Sin(fRotation);
781 xCross.push_back(xHit);
782 yCross.push_back(yHit);
786 return xCross.size();
793 Double_t& xCross, Double_t& yCross, Double_t& zCross) {
796 if ( iFStrip < 0 || iFStrip > fNChannelsFront) {
797 cout <<
"-W- CbmStsSensor::Intersect: "
798 <<
"Invalid front channel number ! "
799 << iFStrip <<
" " << fNChannelsFront << endl;
802 if ( iBStrip < 0 || iBStrip > fNChannelsBack) {
803 cout <<
"-W- CbmStsSensor::Intersect: "
804 <<
"Invalid back channel number ! "
805 << iBStrip <<
" " << fNChannelsBack << endl;
808 Double_t xPoint = xCross, yPoint = yCross;
814 Double_t xint = ( Double_t(iFStrip) + 0.5 ) * fDx;
816 Double_t sinrot = TMath::Sin(fRotation);
817 Double_t cosrot = TMath::Cos(fRotation);
818 Double_t tanstrB = 0.0, sterB = fStereoB * TMath::RadToDeg();
819 if (!(TMath::Abs(sterB-90.) < 1 || TMath::Abs(sterB+90.) < 1)) tanstrB = TMath::Tan(fStereoB);
820 Double_t tanstrF = TMath::Tan(fStereoF);
821 Int_t nStripMaxB = ( fStereoB<0. ? 0 : Int_t(fLy*(tanstrB)/fLx)+1 );
822 Int_t nStripBegB = ( fStereoB>0. ? 0 : -Int_t(fLy*(tanstrB)/fLx)-1 );
827 Double_t x0 = ( Double_t(iBStrip) + 0.5 ) * fDx;
832 Double_t xtemp, ytemp;
835 if (tanstrF==0. && tanstrB == 0.0) {
836 yint = ( Double_t(iBStrip) + 0.5 ) * fDy;
839 xtemp = xint - fLx/2.;
840 ytemp = yint - fLy/2.;
843 xCross = xtemp * cosrot - ytemp * sinrot;
844 yCross = xtemp * sinrot + ytemp * cosrot;
847 xCross = xCross + fX0;
848 yCross = yCross + fY0;
851 }
else if (tanstrF==0.) {
853 for (Int_t iStrip=nStripBegB; iStrip<=nStripMaxB; iStrip++) {
855 yint = ( x0 - xint - fBackStripShift + Double_t(iStrip) * fLx ) / tanstrB;
857 if ( ! ( yint>0. && yint<fLy ) )
continue;
859 if ( zCross > 0.001 ) {
860 Fatal(
"Intersect",
"Intersection of two strips in two different points not valid");
865 xtemp = xint - fLx/2.;
866 ytemp = yint - fLy/2.;
869 xCross = xtemp * cosrot - ytemp * sinrot;
870 yCross = xtemp * sinrot + ytemp * cosrot;
873 xCross = xCross + fX0;
874 yCross = yCross + fY0;
880 for (Int_t iStripB=0; iStripB<=1; iStripB++) {
882 for (Int_t iStripF=-1; iStripF<=0; iStripF++) {
884 x = ((-1./tanstrB) * (x0 - fBackStripShift + Double_t(iStripB)*fLx) + (1./tanstrF) * (xint - fFrontStripShift + Double_t(iStripF)*fLx))/((1./tanstrF)-(1./tanstrB));
885 yint = (-1./tanstrB) * x + (1./tanstrB) * (x0 - fBackStripShift + Double_t(iStripB)*fLx);
887 if ( ! ( yint>0. && yint<fLy ) )
continue;
888 if ( ! ( x>0. && x<fLx ) )
continue;
890 if ( zCross > 0.001 ) {
893 Warning(
"Intersect",
"1 Intersection of two strips in two different points not valid");
898 ytemp = yint - fLy/2.;
903 Double_t xCross1 = xtemp * cosrot - ytemp * sinrot;
904 Double_t yCross1 = xtemp * sinrot + ytemp * cosrot;
914 if (TMath::Abs(TMath::Abs(fStereoF-fStereoB)*TMath::RadToDeg()-90) < 0.1) {
915 if (TMath::Abs(xCross1-xPoint) > 0.5 || TMath::Abs(yCross1-yPoint) > 0.5)
continue;
923 if ( zCross < 0.001 )
return -1;
931 Double_t& xCross, Double_t& yCross, Double_t& zCross) {
934 if ( fChan < 0 || fChan > fNChannelsFront) {
935 cout <<
"-W- CbmStsSensor::Intersect: "
936 <<
"Invalid front channel number ! "
937 << fChan <<
" " << fNChannelsFront << endl;
940 if ( bChan < 0 || bChan > fNChannelsBack) {
941 cout <<
"-W- CbmStsSensor::Intersect: "
942 <<
"Invalid back channel number ! "
943 << bChan <<
" " << fNChannelsBack << endl;
951 Double_t sinrot = TMath::Sin(fRotation);
952 Double_t cosrot = TMath::Cos(fRotation);
955 Double_t xint = ( fChan + 0.0 ) * fDx - cosrot*fFrontLorentzShift*fD/2.;
959 Double_t x0 = ( bChan + 0.0 ) * fDy - cosrot*fBackLorentzShift*fD/2. ;
964 Double_t xtemp, ytemp;
966 if (fStereoF==0.&&fStereoB*180/TMath::Pi()<80) {
968 Double_t tanstrB = TMath::Tan(fStereoB);
970 Int_t nStripMaxB = ( fStereoB<0. ? 0 : Int_t(fLy*tanstrB/fLx)+1 );
971 Int_t nStripBegB = ( fStereoB>0. ? 0 : -Int_t(fLy*tanstrB/fLx)-1 );
975 if (fType == 2) nStripBegB = nStripMaxB = 0;
977 for (Int_t iStrip=nStripBegB; iStrip<=nStripMaxB; iStrip++) {
979 yint = ( x0 - xint - fBackStripShift + Double_t(iStrip) * fLx ) / tanstrB;
981 if ( ! ( yint>0. && yint<fLy ) )
continue;
983 if ( zCross > 0.001 ) {
984 Fatal(
"Intersect",
"Intersection of two strips in two different points not valid");
989 xtemp = xint - fLx/2.;
990 ytemp = yint - fLy/2.;
993 xCross = xtemp * cosrot - ytemp * sinrot;
994 yCross = xtemp * sinrot + ytemp * cosrot;
997 xCross = xCross + fX0;
998 yCross = yCross + fY0;
1002 else if (fStereoB*180/TMath::Pi()>80) {
1003 yint = ( bChan + 0.5 ) * fDy;
1005 if ( zCross > 0.001 ) {
1006 Fatal(
"Intersect",
"Intersection of two strips in two different points not valid");
1011 xtemp = xint - fLx/2.;
1012 ytemp = yint - fLy/2.;
1015 xCross = xtemp * cosrot - ytemp * sinrot;
1016 yCross = xtemp * sinrot + ytemp * cosrot;
1019 xCross = xCross + fX0;
1020 yCross = yCross + fY0;
1024 Double_t tanstrB = TMath::Tan(fStereoB);
1025 Double_t tanstrF = TMath::Tan(fStereoF);
1026 Int_t nStripMaxB = ( fStereoB<0. ? 0 : Int_t(fLy*tanstrB/fLx)+1 );
1027 Int_t nStripBegB = ( fStereoB>0. ? 0 : -Int_t(fLy*tanstrB/fLx)-1 );
1029 Int_t nStripMaxF = ( fStereoF<=0. ? 0 : Int_t(fLy*tanstrF/fLx)+1 );
1030 Int_t nStripBegF = ( fStereoF>0. ? 0 : -Int_t(fLy*tanstrF/fLx)-1 );
1038 nStripBegB = nStripMaxB = 0;
1039 nStripBegF = nStripMaxF = 0;
1046 for (Int_t iStripB = nStripBegB; iStripB <= nStripMaxB; ++iStripB) {
1048 for (Int_t iStripF = nStripBegF; iStripF <= nStripMaxF; ++iStripF) {
1052 x = ((1./tanstrB) * (x0 - fBackStripShift + Double_t(iStripB)*fLx) + (1./tanstrF) * (xint - fFrontStripShift + Double_t(iStripF)*fLx))/((1./tanstrF)+(1./tanstrB));
1054 yint = (1./tanstrB) * x + (1./tanstrB) * (x0 - fBackStripShift + Double_t(iStripB)*fLx);
1056 if ( ! ( yint>0. && yint<fLy ) )
continue;
1057 if ( ! ( x>0. && x<fLx ) )
continue;
1059 if ( zCross > 0.001 ) {
1060 Fatal(
"Intersect",
"2 Intersection of two strips in two different points not valid");
1066 ytemp = yint - fLy/2.;
1069 xCross = xtemp * cosrot - ytemp * sinrot;
1070 yCross = xtemp * sinrot + ytemp * cosrot;
1073 xCross = xCross + fX0;
1074 yCross = yCross + fY0;
1081 if ( zCross < 0.001 )
return -1;
1089 Double_t safety = 0.3;
1090 Double_t
glob[3] = {xCross, yCross, zCross}, loc[3] = {0};
1091 gGeoManager->cd(fName);
1092 gGeoManager->MasterToLocal(
glob, loc);
1094 if (TMath::Abs(loc[0])-fLx/2 > safety || TMath::Abs(loc[1])-fLy/2 > safety)
return -1;
1096 if (fLx > 20.0 && abs(loc[0]) < fLx/2 && abs(loc[1]) < fLy/2) {
1098 TString where = gGeoManager->FindNode(xCross+TMath::Sign(safety,fX0), yCross+TMath::Sign(safety,fY0), zCross)->GetName();
1099 if (!where.Contains(
"sens",TString::kIgnoreCase))
return -1;
1100 if (!fName.Contains(where)) {
1101 if (fName.Contains(
"sens",TString::kIgnoreCase) && !fName.Contains(where))
return -1;
1106 if (fName.Contains(
"Sensor_hot")) {
1107 gGeoManager->cd(fName);
1108 gGeoManager->CdUp();
1109 TString where = gGeoManager->FindNode(xCross+TMath::Sign(safety,fX0), yCross+TMath::Sign(safety,fY0), zCross)->GetName();
1111 if (!where.Contains(
"hot"))
return -1;