Elmination of overlaps detected with root v5-32 (Mario Sitta)
authormasera <masera@f7af4fe6-9843-0410-8265-dc069ae4e863>
Mon, 23 Jan 2012 21:08:44 +0000 (21:08 +0000)
committermasera <masera@f7af4fe6-9843-0410-8265-dc069ae4e863>
Mon, 23 Jan 2012 21:08:44 +0000 (21:08 +0000)
ITS/AliITSv11GeometrySDD.cxx
ITS/AliITSv11GeometrySPD.cxx
ITS/AliITSv11GeometrySSD.cxx
ITS/AliITSv11GeometrySupport.cxx

index 334a502..2f1ba72 100755 (executable)
@@ -2382,6 +2382,8 @@ TGeoVolume* AliITSv11GeometrySDD::CreateHybrid(Int_t iLRSide) {
     ccToSensPoliVol->SetLineColor(fColorPolyhamide);
 
     TGeoXtru* ccToSensAlSh = new TGeoXtru(2);
+    xcc[6] += 0.001;
+    ycc[7] -= 0.001;
     ccToSensAlSh->DefinePolygon(8, xcc, ycc);
     ccToSensAlSh->DefineSection(0, 0.);
     ccToSensAlSh->DefineSection(1, fgkHybAlCCThick);
index 87aa2fd..cfb2765 100644 (file)
@@ -2719,7 +2719,7 @@ TList* AliITSv11GeometrySPD::CreateConeModule(Bool_t sideC, const Double_t angro
     volCylGasFr->SetLineColor(kPurple);
 
     // The optical fibers bundle on the cone as a Tube
-    Double_t optLength = shCable->GetX(5) - shCable->GetX(0) + kYtoHalfStave;
+    Double_t optLength = shCable->GetX(5) - shCable->GetX(0) + kYtoHalfStave -0.85;
     TGeoTube *shOptFibs = new TGeoTube(0., 0.5*kOptFibDiamet, 0.5*optLength);
 
     TGeoVolume *volOptFibs = new TGeoVolume("ITSSPDOpticalFibersOnCone",
@@ -2814,7 +2814,7 @@ TList* AliITSv11GeometrySPD::CreateConeModule(Bool_t sideC, const Double_t angro
       container[0]->AddNode(volCollTube, 1, trCollTube);
     }
         
-    Double_t dxPatch = 2.9;
+    Double_t dxPatch = 2.75;
     Double_t dzPatch = 2.8;
     TGeoCombiTrans *tr2 = new TGeoCombiTrans(1.7*ext2Length - dxPatch, 0.0, dzPatch, rot2);
     container[3]->AddNode(volPatch, 0, tr2);
index 8b864b5..0b221e7 100644 (file)
@@ -494,7 +494,7 @@ const Double_t AliITSv11GeometrySSD::fgkEndCapSupportMiddleRadius[2] = {377.0*fg
 const Double_t AliITSv11GeometrySSD::fgkEndCapSupportLowRadius[2] = {375.0*fgkmm,435.0*fgkmm};
 const Double_t AliITSv11GeometrySSD::fgkEndCapSupportHighWidth = 20.0*fgkmm;
 const Double_t AliITSv11GeometrySSD::fgkEndCapSupportLowWidth[2] = {3.0*fgkmm,3.0*fgkmm};
-const Double_t AliITSv11GeometrySSD::fgkEndCapSupportCenterLay5ITSPosition = 625.0*fgkmm;
+const Double_t AliITSv11GeometrySSD::fgkEndCapSupportCenterLay5ITSPosition = 624.9*fgkmm;
 const Double_t AliITSv11GeometrySSD::fgkEndCapSupportCenterLay5Position = 2.5*fgkmm;
 const Double_t AliITSv11GeometrySSD::fgkEndCapSupportCenterLay6ITSPosition = 635.0*fgkmm;
 const Double_t AliITSv11GeometrySSD::fgkEndCapSupportCenterLay6Position = 2.5*fgkmm;
@@ -1253,6 +1253,7 @@ void AliITSv11GeometrySSD::CreateTransformationMatrices(){
             new TGeoTranslation(0.0,(1-i)*(fgkEndLadderMountingBlockPosition[i]
                         +  0.5*fgkSSDMountingBlockWidth),
                         -  0.5*fgkCarbonFiberLowerSupportHeight);
+  fendladderlowersupptrans[0]->SetDz(-0.5*fgkCarbonFiberLowerSupportHeight-fgkSSDTolerance);
   fendladderlowersupptrans[2] = new TGeoTranslation(0.0,
                                                                         fgkCarbonFiberLowerSupportVolumePosition[1]
                                                                +    fgkCarbonFiberLowerSupportVolumePosition[0],
@@ -1929,9 +1930,9 @@ TGeoVolume* AliITSv11GeometrySSD::GetCarbonFiberJunction(Double_t width){
                                                  fgkCarbonFiberJunctionEdge[0]
                        *                         TMath::Sin(fgkCarbonFiberJunctionAngle[0]
                        *                         TMath::DegToRad()));
-  vertex[4] = new TVector3(fgkCarbonFiberJunctionLength,
+  vertex[4] = new TVector3(fgkCarbonFiberJunctionLength-fgkSSDTolerance,
                                                   fgkCarbonFiberJunctionEdge[1]);
-  vertex[5] = new TVector3(fgkCarbonFiberJunctionLength); 
+  vertex[5] = new TVector3(fgkCarbonFiberJunctionLength-fgkSSDTolerance); 
   vertex[1] = GetReflection(vertex[5],reflectionparam);        
   vertex[2] = GetReflection(vertex[4],reflectionparam);        
   Double_t xvertexpoints[6], yvertexpoints[6];
@@ -2259,12 +2260,12 @@ TList* AliITSv11GeometrySSD::GetSSDHybridParts(){
     xmothervertex[i][2] = 0.5*(fgkSSDSensorLength-ssdstiffenerseparation); //0.5*fgkSSDStiffenerWidth;
     ymothervertex[i][2] = -0.5*fgkSSDStiffenerHeight-fgkSSDChipHeight -fgkSSDChipCablesHeight[i+2];
     xmothervertex[i][3] = xmothervertex[i][2];
-    ymothervertex[i][3] = ymothervertex[i][2]+fgkSSDChipCablesHeight[0]+fgkSSDChipCablesHeight[1];
+    ymothervertex[i][3] = ymothervertex[i][2]+fgkSSDChipCablesHeight[0]+fgkSSDChipCablesHeight[1]+fgkSSDTolerance;
 
     xmothervertex[i][4] = xmothervertex[i][2]-0.4;  
     ymothervertex[i][4] = ymothervertex[i][3];
     xmothervertex[i][5] = xmothervertex[i][4];
-    ymothervertex[i][5] = ymothervertex[i][4]+2*ssdchipcablesradius[i];
+    ymothervertex[i][5] = ymothervertex[i][4]+2*ssdchipcablesradius[i]-fgkSSDTolerance;
 
     xmothervertex[i][6] = 0.5*fgkSSDStiffenerWidth+ssdchipcablesradius[i]+0.3*fgkmm;
     ymothervertex[i][6] = ymothervertex[i][5];
@@ -3004,11 +3005,11 @@ TGeoVolume* AliITSv11GeometrySSD::GetSSDMountingBlock(){
   xmothervertex[6]  = xvertex[5]+fgkSSDMountingBlockLength[2];
   ymothervertex[6]  = ymothervertex[5];
   xmothervertex[7]  = xmothervertex[6];
-  ymothervertex[7]  = ymothervertex[4];
+  ymothervertex[7]  = ymothervertex[4] - fgkSSDTolerance;
   xmothervertex[8]  = xmothervertex[7]
                                        + 0.5*(fgkSSDMountingBlockLength[1]
                                        -          fgkSSDMountingBlockLength[2]);
-  ymothervertex[8]  = ymothervertex[4];
+  ymothervertex[8]  = ymothervertex[7];
   xmothervertex[9]  = xmothervertex[8];
   ymothervertex[9]  = ymothervertex[2];
   xmothervertex[10] = xvertex[0]+fgkSSDMountingBlockLength[0];
@@ -3445,9 +3446,9 @@ void AliITSv11GeometrySSD::GetSSDChipCables(TGeoVolume *&cableL, TGeoVolume *&ca
   xmothervertex[3] = xvertexpoints[0][3+nedges];
   ymothervertex[3] = yvertexpoints[0][3+nedges];
   xmothervertex[4] = xvertexpoints[0][3+2*nedges];
-  ymothervertex[4] = yvertexpoints[0][3+2*nedges];
+  ymothervertex[4] = yvertexpoints[0][3+2*nedges]+fgkSSDTolerance;
   xmothervertex[5] = xvertexpoints[0][4+2*nedges];
-  ymothervertex[5] = yvertexpoints[0][4+2*nedges];
+  ymothervertex[5] = yvertexpoints[0][4+2*nedges]+fgkSSDTolerance;
   xmothervertex[6] = xvertexpoints[1][5+2*nedges];
   ymothervertex[6] = yvertexpoints[1][5+2*nedges];
   xmothervertex[7] = xvertexpoints[0][1];
@@ -7720,7 +7721,7 @@ void AliITSv11GeometrySSD::SetLadderSupport(Int_t nedges){
   Double_t ssdcablepatchpanel3BB26radiusmin[2];
   Double_t ssdcablepatchpanel3BB26radiusmax[2];
   Double_t ssdcablepatchpanel3RB26zsection[2];
-  ssdcablepatchpanel3BB26radiusmin[0] = ssdcableslay5pconrmin[3]-0.5*fgkSSDPatchPanelHeight+2.8;
+  ssdcablepatchpanel3BB26radiusmin[0] = ssdcableslay5pconrmin[3]-0.5*fgkSSDPatchPanelHeight+2.8+0.003;//Avoid small overlap with SPDshieldring;
   ssdcablepatchpanel3BB26radiusmax[0] = ssdcablepatchpanel3BB26radiusmin[0]
                                                                          + fgkSSDCablesLay5RightSideHeight
                                                                          + fgkSSDCablesLay6RightSideHeight+0.5*fgkSSDPatchPanelHeight;
index 047fcb7..26c1ae5 100644 (file)
@@ -160,6 +160,15 @@ void AliITSv11GeometrySupport::SPDCone(TGeoVolume *moth,const TGeoManager *mgr)
   TGeoXtru *centralomegashape = new TGeoXtru(2);
 
   CreateSPDOmegaShape(xair,yair,kThicknessOmega,xomega,yomega);
+  // Temporary fix for awkward extrusions seen only with Root v5.32
+  yomega[ 1] += 0.0001;
+  yomega[ 2] += 0.0001;
+  yomega[ 5] += 0.0001;
+  yomega[ 6] += 0.0001;
+  xomega[15] -= 0.0001;
+  xomega[16] -= 0.0001;
+  yomega[28] -= 0.0001;
+  yomega[29] -= 0.0001;
 
   centralomegashape->DefinePolygon(48,xomega,yomega);
   centralomegashape->DefineSection(0,-kHalfLengthCentral);
@@ -207,6 +216,14 @@ void AliITSv11GeometrySupport::SPDCone(TGeoVolume *moth,const TGeoManager *mgr)
   TGeoXtru *endcapomegashape = new TGeoXtru(2);
 
   CreateSPDOmegaShape(xair,yair,kThicknessOmega,xomega,yomega);
+  // Temporary fix for awkward extrusions seen only with Root v5.32
+  yomega[19] -= 0.0001;
+  yomega[20] -= 0.0001;
+  yomega[31] -= 0.0001;
+  yomega[42] += 0.0001;
+  yomega[43] += 0.0001;
+  yomega[46] += 0.0001;
+  yomega[47] += 0.0001;
 
   endcapomegashape->DefinePolygon(48,xomega,yomega);
   endcapomegashape->DefineSection(0,-kHalfLengthEndCap);
@@ -4305,6 +4322,7 @@ void AliITSv11GeometrySupport::SPDCableTraysSideC(TGeoVolume *moth,
 // Updated:      10 Jun 2010  Mario Sitta  Freon inside cooling pipes
 // Updated:      08 Sep 2010  Mario Sitta
 // Updated:      14 Sep 2010  Mario Sitta  Cables prolonged till cone
+// Updated:      20 Dec 2011  Mario Sitta  Composite vol to avoid new overlap
 //
 // Technical data are taken from AutoCAD drawings and other (oral)
 // information given by D.Elia
@@ -4338,6 +4356,8 @@ void AliITSv11GeometrySupport::SPDCableTraysSideC(TGeoVolume *moth,
   const Double_t kCoaxCableSectCu     =    6.024 *fgkmm;// Computed
   const Double_t kCoaxCableHighMeg    =    5.695 *fgkmm;// Computed
 
+  const Double_t kCablesYtrans        =    2.500 *fgkmm;// Avoid ovlps
+
   // Overall position and rotation of the C-Side Cable Trays
   const Double_t kTraySideCRPos       =   45.300 *fgkcm;
   const Double_t kTraySideCZPos       = -102.400 *fgkcm;
@@ -4358,6 +4378,7 @@ void AliITSv11GeometrySupport::SPDCableTraysSideC(TGeoVolume *moth,
 
   // The Cable Tray lower face: a Xtru
   TGeoXtru *sideCHorFace = new TGeoXtru(2);
+  sideCHorFace->SetName("ITSsuppSPDTraySideCHor");
 
   xprof[0] = 0.;
   yprof[0] = 0.;
@@ -4454,6 +4475,7 @@ void AliITSv11GeometrySupport::SPDCableTraysSideC(TGeoVolume *moth,
 
   // The internal wall: a Xtru
   TGeoXtru *intWall = new TGeoXtru(2);
+  intWall->SetName("ITSsuppSPDTraySideCWall");
 
   xprof[0] = sideCHorFace->GetX(5);
   yprof[0] = sideCHorFace->GetY(5);
@@ -4519,11 +4541,11 @@ void AliITSv11GeometrySupport::SPDCableTraysSideC(TGeoVolume *moth,
   xprof[0] = -kTrayCCablesZLenOut;
   yprof[0] = xprof[0]/TanD(kTrayCCablesOutRot);
   xprof[1] = sideCMidFace->GetX(5);
-  yprof[1] = sideCMidFace->GetY(5);
+  yprof[1] = sideCMidFace->GetY(5) + kCablesYtrans;
   xprof[2] = sideCMidFace->GetX(4);
-  yprof[2] = sideCMidFace->GetY(4);
+  yprof[2] = sideCMidFace->GetY(4) + kCablesYtrans;
   xprof[3] = sideCMidFace->GetX(3);
-  yprof[3] = sideCMidFace->GetY(3);
+  yprof[3] = sideCMidFace->GetY(3) + kCablesYtrans;
   xprof[4] = xprof[3] - kOpticalFibersSect*SinD(kTrayCFoldAngle);
   yprof[4] = yprof[3] + kOpticalFibersSect*CosD(kTrayCFoldAngle);
   InsidePoint(xprof[1], yprof[1], xprof[2], yprof[2], xprof[3], yprof[3],
@@ -4543,11 +4565,11 @@ void AliITSv11GeometrySupport::SPDCableTraysSideC(TGeoVolume *moth,
   xprof[0] = -kTrayCCablesZLenOut;
   yprof[0] = xprof[0]/TanD(kTrayCCablesOutRot);
   xprof[1] = sideCMidFace->GetX(5);
-  yprof[1] = sideCMidFace->GetY(5);
+  yprof[1] = sideCMidFace->GetY(5) + kCablesYtrans;
   xprof[2] = sideCMidFace->GetX(4);
-  yprof[2] = sideCMidFace->GetY(4);
+  yprof[2] = sideCMidFace->GetY(4) + kCablesYtrans;
   xprof[3] = sideCMidFace->GetX(3);
-  yprof[3] = sideCMidFace->GetY(3);
+  yprof[3] = sideCMidFace->GetY(3) + kCablesYtrans;
   xprof[4] = xprof[3] - kLowVoltCableSectCu*SinD(kTrayCFoldAngle);
   yprof[4] = yprof[3] + kLowVoltCableSectCu*CosD(kTrayCFoldAngle);
   InsidePoint(xprof[1], yprof[1], xprof[2], yprof[2], xprof[3], yprof[3],
@@ -4590,11 +4612,11 @@ void AliITSv11GeometrySupport::SPDCableTraysSideC(TGeoVolume *moth,
   xprof[0] = -kTrayCCablesZLenOut;
   yprof[0] = xprof[0]/TanD(kTrayCCablesOutRot);
   xprof[1] = sideCMidFace->GetX(5);
-  yprof[1] = sideCMidFace->GetY(5);
+  yprof[1] = sideCMidFace->GetY(5) + kCablesYtrans;
   xprof[2] = sideCMidFace->GetX(4);
-  yprof[2] = sideCMidFace->GetY(4);
+  yprof[2] = sideCMidFace->GetY(4) + kCablesYtrans;
   xprof[3] = sideCMidFace->GetX(3);
-  yprof[3] = sideCMidFace->GetY(3);
+  yprof[3] = sideCMidFace->GetY(3) + kCablesYtrans;
   xprof[4] = xprof[3] - kHiVoltCableSectCu*SinD(kTrayCFoldAngle);
   yprof[4] = yprof[3] + kHiVoltCableSectCu*CosD(kTrayCFoldAngle);
   InsidePoint(xprof[1], yprof[1], xprof[2], yprof[2], xprof[3], yprof[3],
@@ -4637,11 +4659,11 @@ void AliITSv11GeometrySupport::SPDCableTraysSideC(TGeoVolume *moth,
   xprof[0] = -kTrayCCablesZLenOut;
   yprof[0] = xprof[0]/TanD(kTrayCCablesOutRot);
   xprof[1] = sideCMidFace->GetX(5);
-  yprof[1] = sideCMidFace->GetY(5);
+  yprof[1] = sideCMidFace->GetY(5) + kCablesYtrans;
   xprof[2] = sideCMidFace->GetX(4);
-  yprof[2] = sideCMidFace->GetY(4);
+  yprof[2] = sideCMidFace->GetY(4) + kCablesYtrans;
   xprof[3] = sideCMidFace->GetX(3);
-  yprof[3] = sideCMidFace->GetY(3);
+  yprof[3] = sideCMidFace->GetY(3) + kCablesYtrans;
   xprof[4] = xprof[3] - kCoaxCableSectCu*SinD(kTrayCFoldAngle);
   yprof[4] = yprof[3] + kCoaxCableSectCu*CosD(kTrayCFoldAngle);
   InsidePoint(xprof[1], yprof[1], xprof[2], yprof[2], xprof[3], yprof[3],
@@ -4678,6 +4700,11 @@ void AliITSv11GeometrySupport::SPDCableTraysSideC(TGeoVolume *moth,
   coaxCablesMeg->DefineSection(0, 0);
   coaxCablesMeg->DefineSection(1, kCoaxCableSectCu);
 
+  // To avoid a newly discovered overlap,
+  // transform the two overlapping volumes into a Composite Shape
+  TGeoCompositeShape *trayIntern =
+    new TGeoCompositeShape("ITSSPDInternalTrayC",
+                          "ITSsuppSPDTraySideCHor+ITSsuppSPDTraySideCWall");
 
   // We have all shapes: now create the real volumes
   TGeoMedium *medAl   = mgr->GetMedium("ITS_ALUMINUM$");
@@ -4688,14 +4715,14 @@ void AliITSv11GeometrySupport::SPDCableTraysSideC(TGeoVolume *moth,
   TGeoMedium *medPUR  = mgr->GetMedium("ITS_POLYURETHANE$");
   TGeoMedium *medMeg  = mgr->GetMedium("ITS_MEGOLON$");
 
-  TGeoVolume *traySideCHorFace  = new TGeoVolume("ITSsuppSPDTraySideCHor",
-                                                sideCHorFace, medAl);
+  TGeoVolume *traySideCIntern  = new TGeoVolume("ITSsuppSPDTraySideCInternal",
+                                               trayIntern, medAl);
 
-  traySideCHorFace->SetVisibility(kTRUE);
-  traySideCHorFace->SetLineColor(6); // Purple
-  traySideCHorFace->SetLineWidth(1);
-  traySideCHorFace->SetFillColor(traySideCHorFace->GetLineColor());
-  traySideCHorFace->SetFillStyle(4000); // 0% transparent
+  traySideCIntern->SetVisibility(kTRUE);
+  traySideCIntern->SetLineColor(6); // Purple
+  traySideCIntern->SetLineWidth(1);
+  traySideCIntern->SetFillColor(traySideCIntern->GetLineColor());
+  traySideCIntern->SetFillStyle(4000); // 0% transparent
 
   TGeoVolume *traySideCMidFace  = new TGeoVolume("ITSsuppSPDTraySideCMid",
                                                 sideCMidFace, medAl);
@@ -4733,15 +4760,6 @@ void AliITSv11GeometrySupport::SPDCableTraysSideC(TGeoVolume *moth,
   traySideCLongCover->SetFillColor(traySideCLongCover->GetLineColor());
   traySideCLongCover->SetFillStyle(4000); // 0% transparent
 
-  TGeoVolume *traySideCIntWall  = new TGeoVolume("ITSsuppSPDTraySideCWall",
-                                                intWall, medAl);
-
-  traySideCIntWall->SetVisibility(kTRUE);
-  traySideCIntWall->SetLineColor(6); // Purple
-  traySideCIntWall->SetLineWidth(1);
-  traySideCIntWall->SetFillColor(traySideCIntWall->GetLineColor());
-  traySideCIntWall->SetFillStyle(4000); // 0% transparent
-
   TGeoVolume *traySideCHorTube = new TGeoVolume("ITSsuppSPDTraySideCHorTube",
                                                horTube, medIn);
 
@@ -4861,7 +4879,7 @@ void AliITSv11GeometrySupport::SPDCableTraysSideC(TGeoVolume *moth,
 
 
   // Now build up the trays
-  cableTrayC->AddNode(traySideCHorFace,1,0);
+  cableTrayC->AddNode(traySideCIntern,1,0);
 
   cableTrayC->AddNode(traySideCMidFace,1,0);
 
@@ -4879,8 +4897,6 @@ void AliITSv11GeometrySupport::SPDCableTraysSideC(TGeoVolume *moth,
 
   cableTrayC->AddNode(traySideCLongCover,1,0);
 
-  cableTrayC->AddNode(traySideCIntWall,1,0);
-
   traySideCHorTube->AddNode(traySideCHorFreon, 1, 0);
   traySideCIncTube->AddNode(traySideCIncFreon, 1, 0);
   traySideCOutTube->AddNode(traySideCOutFreon, 1, 0);
@@ -5892,7 +5908,7 @@ void AliITSv11GeometrySupport::SDDCableTraysSideC(TGeoVolume *moth,
   const Double_t kSideCInputCablesPOLYAX =    0.1098;
 
   const Double_t kSideCOutputCablesX0    =   27.40    *fgkcm;
-  const Double_t kSideCOutputCablesWide  =    8.30    *fgkcm;
+  const Double_t kSideCOutputCablesWide  =    8.50    *fgkcm;
   const Double_t kSideCOutputCablesHigh  =    1.18    *fgkcm;
   const Double_t kSideCOutputCablesCu    =    0.6775;
   const Double_t kSideCOutputCablesPlast =    0.1613;
@@ -7129,6 +7145,7 @@ void AliITSv11GeometrySupport::SSDCableTraysSideC(TGeoVolume *moth,
   const Double_t kCablePlasticHeight     =   11.50 *fgkmm;// 1150 mm^2
   const Double_t kCoolingWaterHeight     =    2.65 *fgkmm;//  265 mm^2
   const Double_t kPoliUrethaneHeight     =    4.62 *fgkmm;//  462 mm^2
+  const Double_t kCablesYtrans           =    2.50 *fgkmm;// Avoid ovlps
 
   // Overall position and rotation of the C-Side Cable Trays
   const Double_t kTraySideCRPos          =   45.30    *fgkcm;
@@ -7153,11 +7170,11 @@ void AliITSv11GeometrySupport::SSDCableTraysSideC(TGeoVolume *moth,
   // Copper lies on the lower plate: get position of its points
   TGeoXtru *lowerplate = (TGeoXtru*)(mgr->GetVolume("ITSsuppTraySideCLower")->GetShape());
   xprof[0] = lowerplate->GetX(5);
-  yprof[0] = lowerplate->GetY(5);
+  yprof[0] = lowerplate->GetY(5) + kCablesYtrans;
   xprof[1] = lowerplate->GetX(4);
-  yprof[1] = lowerplate->GetY(4);
+  yprof[1] = lowerplate->GetY(4) + kCablesYtrans;
   xprof[2] = lowerplate->GetX(3);
-  yprof[2] = lowerplate->GetY(3);
+  yprof[2] = lowerplate->GetY(3) + kCablesYtrans;
   xprof[3] = xprof[2] - kCopperHeight*SinD(kSideCFoldAngle);
   yprof[3] = yprof[2] + kCopperHeight*CosD(kSideCFoldAngle);
   InsidePoint(xprof[0], yprof[0], xprof[1], yprof[1], xprof[2], yprof[2],