]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - ITS/AliITSv11GeomCable.cxx
Fixing the wrapper volumes
[u/mrichter/AliRoot.git] / ITS / AliITSv11GeomCable.cxx
index 9c5726c2fc6005c4e5eaf2059988dc93158c7e23..4a780558a6350da49fb32e6f052e04aa28b3f4bd 100644 (file)
@@ -22,6 +22,7 @@
 
 // Root Geometry includes
 #include <TGeoManager.h>
+#include <TGeoMatrix.h>
 #include <TGeoVolume.h>
 #include <TGeoNode.h>
 
 
 ClassImp(AliITSv11GeomCable)
 
-//________________________________________________________________________
-AliITSv11GeomCable::AliITSv11GeomCable(const char* name) { 
-  // constructor
-  fDebug = 0;
-  fInitialNode = 0;
-  fPointArray.SetOwner(); 
-  SetName(name);
-};
-
 
 //________________________________________________________________________
-AliITSv11GeomCable::AliITSv11GeomCable(const AliITSv11GeomCable &s) :
-  TNamed(s.GetName(),s.GetTitle()),fDebug(s.fDebug),fPointArray(s.fPointArray),
-  fVolumeArray(s.fVolumeArray),fInitialNode(s.fInitialNode)
-{
-  //     Copy Constructor 
-  printf("Copy Constructor of AliITSv11GeomCable ???\n");  
+AliITSv11GeomCable::AliITSv11GeomCable(): TNamed(),
+  fDebug(0),
+  fPointArray(),
+  fVolumeArray(),
+  fCurrentVol(0),
+  fInitialNode(0)
+{ 
+  // constructor
+  fPointArray.SetOwner();
+  for(Int_t i=0;i<fgkCableMaxNodeLevel;i++)fNodeInd[i]=0;
 }
 
 //________________________________________________________________________
-AliITSv11GeomCable& AliITSv11GeomCable::operator=(const AliITSv11GeomCable &s) {
-  //     Assignment operator
-  // Not fully inplemented yet !!!
-  printf("Assignment operator of AliITSv11GeomCable not fully inplemented yet !!!\n");  
-
-  if(&s == this) return *this;
-  SetName(s.GetName());
-  SetTitle(s.GetTitle());
-  fDebug = s.fDebug;
-//   fPointArray = s.fPointArray;
-//   fVolumeArray = s.fVolumeArray;
-  fInitialNode = s.fInitialNode;
-  return *this;
+AliITSv11GeomCable::AliITSv11GeomCable(const char* name): TNamed(name,""),
+  fDebug(0),
+  fPointArray(),
+  fVolumeArray(),
+  fCurrentVol(0),
+  fInitialNode(0) { 
+  // constructor
+  fPointArray.SetOwner(); 
+  for(Int_t i=0;i<fgkCableMaxNodeLevel;i++)fNodeInd[i]=0;
 }
 
+
 //________________________________________________________________________
 AliITSv11GeomCable::~AliITSv11GeomCable() {
   fPointArray.Clear();
   fVolumeArray.Clear();
-};
+}
 
 //________________________________________________________________________
 void AliITSv11GeomCable::AddCheckPoint( TGeoVolume *vol, Int_t iCheckPt,
@@ -97,7 +90,7 @@ void AliITSv11GeomCable::AddCheckPoint( TGeoVolume *vol, Int_t iCheckPt,
     TVectorD *point = new TVectorD(3,coord);
     fPointArray.AddAt(point, iCheckPt);
   };
-};
+}
 
 //________________________________________________________________________
 void AliITSv11GeomCable::ResetPoints() {
@@ -106,7 +99,7 @@ void AliITSv11GeomCable::ResetPoints() {
   //
   fPointArray.Delete();
   fVolumeArray.Clear();
-};
+}
 
 
 //________________________________________________________________________
@@ -116,9 +109,13 @@ const {
   // Get the check point #iCheckPt
   //
   TVectorD *coordVector =(TVectorD *)fPointArray.UncheckedAt(iCheckPt);
+#if ROOT_VERSION_CODE < ROOT_VERSION(4,0,0)
+  CopyFrom(coord, coordVector->GetElements());
+#else
   CopyFrom(coord, coordVector->GetMatrixArray());
+#endif
   return kTRUE;
-};
+}
 
 //________________________________________________________________________
 Int_t AliITSv11GeomCable::GetVect( Int_t iCheckPt,  Double_t *coord)
@@ -128,9 +125,13 @@ const {
   //
 
   TVectorD *coordVector =(TVectorD *)fPointArray.UncheckedAt(iCheckPt);
+#if ROOT_VERSION_CODE < ROOT_VERSION(4,0,0)
+  CopyFrom(coord, coordVector->GetElements());
+#else
   CopyFrom(coord, coordVector->GetMatrixArray());
+#endif
   return kTRUE;
-};
+}
 
 //________________________________________________________________________
 TGeoVolume *AliITSv11GeomCable::GetVolume( Int_t iCheckPt ) const {
@@ -142,7 +143,7 @@ TGeoVolume *AliITSv11GeomCable::GetVolume( Int_t iCheckPt ) const {
     return 0;
   else
     return (TGeoVolume *) fVolumeArray.UncheckedAt(iCheckPt);
-};
+}
 
 //________________________________________________________________________
 void AliITSv11GeomCable::SetInitialNode(TGeoVolume *vol) {
@@ -153,17 +154,17 @@ void AliITSv11GeomCable::SetInitialNode(TGeoVolume *vol) {
   if (fInitialNode) delete fInitialNode;
   fInitialNode = new TGeoNodeMatrix(vol,0);
   fInitialNode->SetName("nodeInConstruction");
-};
+}
 
 //________________________________________________________________________
 void AliITSv11GeomCable::ResetInitialNode() {
   // Reset the initial node if it is set.
   if (fInitialNode) delete fInitialNode;
   fInitialNode = 0;
-};
+}
 
 //________________________________________________________________________
-bool AliITSv11GeomCable::CheckDaughter(TGeoNode* node, Int_t i)
+bool AliITSv11GeomCable::CheckDaughter(const TGeoNode* node, Int_t i)
 {
 // Search where is the current volume in the tree of nodes
 // stop each time it find the pointer of the current volume
@@ -186,7 +187,7 @@ bool AliITSv11GeomCable::CheckDaughter(TGeoNode* node, Int_t i)
     fNodeInd[i] = -1;
   };
   return kFALSE;
-};
+}
 
 //________________________________________________________________________
 Int_t AliITSv11GeomCable::
@@ -242,7 +243,7 @@ GetCheckPoint( Int_t iCheckPt, Int_t iOccur, Int_t motherLevel,
     CopyFrom(localCoord, coord);
   };
   return kTRUE;
-};
+}
 
 //________________________________________________________________________
 Int_t AliITSv11GeomCable::GetCheckVect( Int_t iCheckPt, Int_t iOccur,
@@ -295,7 +296,7 @@ Int_t AliITSv11GeomCable::GetCheckVect( Int_t iCheckPt, Int_t iOccur,
     CopyFrom(localCoord, coord);
   };
   return kTRUE;
-};
+}
 
 
 //________________________________________________________________________
@@ -348,5 +349,5 @@ Int_t AliITSv11GeomCable::GetCheckVect( const Double_t *localCoord,
     CopyFrom(tempCoord, coord);
   };
   return kTRUE;
-};
+}