]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - ITS/AliITSv11GeomCableFlat.cxx
Fix Coverity
[u/mrichter/AliRoot.git] / ITS / AliITSv11GeomCableFlat.cxx
index d25eff7676388ac632f5579ecadc26d514a0679f..8053822372d570d0b4cde22bb41753f391ccec47 100644 (file)
@@ -55,6 +55,7 @@ AliITSv11GeomCableFlat::AliITSv11GeomCableFlat():
     fLayColor[i]     = 0;
     fLayMedia[i]     = 0;  
  };
+  for(Int_t i=0;i<3;i++)fPreviousX[i]=0.;
 }
 
 //________________________________________________________________________
@@ -72,8 +73,9 @@ AliITSv11GeomCableFlat(const char* name, Double_t width, Double_t thick) :
     fLayColor[i]     = 0;
     fLayMedia[i]     = 0;  
   }; 
+  for(Int_t i=0;i<3;i++)fPreviousX[i]=0.;
 }
-
+/*
 //________________________________________________________________________
 AliITSv11GeomCableFlat::AliITSv11GeomCableFlat(const AliITSv11GeomCableFlat &s) :
   AliITSv11GeomCable(s),fWidth(s.fWidth),fThick(s.fThick),fNlayer(s.fNlayer)
@@ -85,6 +87,8 @@ AliITSv11GeomCableFlat::AliITSv11GeomCableFlat(const AliITSv11GeomCableFlat &s)
     fLayMedia[i] = s.fLayMedia[i];
     fLayColor[i] = s.fLayColor[i];
   }
+  for(Int_t i=0;i<3;i++)fPreviousX[i]=s.fPreviousX[i];
+
 }
 
 //________________________________________________________________________
@@ -106,7 +110,7 @@ operator=(const AliITSv11GeomCableFlat &s) {
   };
   return *this;
 }
-
+*/
 //________________________________________________________________________
 Int_t AliITSv11GeomCableFlat::GetPoint( Int_t iCheckPt, Double_t *coord)
   const {
@@ -712,7 +716,7 @@ TGeoVolume* AliITSv11GeomCableFlat::CreateAndInsertCableCylSegment(Int_t p2,
   Double_t torusPhi1 = TMath::ACos(cosPhi);
   Double_t torusR = (length/2)/TMath::Sin(torusPhi1);
   torusPhi1 = torusPhi1*TMath::RadToDeg();
-  Double_t perpLength = TMath::Sqrt(torusR*torusR-length*length/4);
+  Double_t perpLength = TMath::Sqrt((torusR-0.5*length)*(torusR+0.5*length));
   Double_t localTransT[3] = {-perpLength,0,0};
   Double_t globalTransT[3];
   rotTorus.LocalToMasterVect(localTransT, globalTransT);
@@ -737,10 +741,10 @@ TGeoVolume* AliITSv11GeomCableFlat::CreateAndInsertCableCylSegment(Int_t p2,
 }
 
 //________________________________________________________________________
-TGeoVolume *AliITSv11GeomCableFlat::CreateSegment( Double_t *coord1,
-                                                  Double_t *coord2,
-                                                  Double_t *localVect1,
-                                                  Double_t *localVect2 )
+TGeoVolume *AliITSv11GeomCableFlat::CreateSegment( const Double_t *coord1,
+                                                  const Double_t *coord2,
+                                                  const Double_t *localVect1,
+                                                  const Double_t *localVect2 )
 {
   // Create a segment with arbitrary vertices (general case)
   //=================================================
@@ -827,8 +831,8 @@ TGeoVolume *AliITSv11GeomCableFlat::CreateSegment( Double_t *coord1,
 }
 
 //________________________________________________________________________
-TGeoVolume *AliITSv11GeomCableFlat::CreateCylSegment(Double_t &phi,
-                                                    Double_t &r)
+TGeoVolume *AliITSv11GeomCableFlat::CreateCylSegment(const Double_t &phi,
+                                                    const Double_t &r)
 {
   // Create a segment in shape of a cylinder, allows to represent
   // a folded flat cable
@@ -868,8 +872,8 @@ TGeoVolume *AliITSv11GeomCableFlat::CreateCylSegment(Double_t &phi,
 }
 
 //________________________________________________________________________
-TGeoVolume *AliITSv11GeomCableFlat::CreateBoxSegment( Double_t *coord1,
-                                                     Double_t *coord2)
+TGeoVolume *AliITSv11GeomCableFlat::CreateBoxSegment( const Double_t *coord1,
+                                                     const Double_t *coord2)
 {
   // Create a segment for the case it is a simple box
   //=================================================