]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - MUON/AliMUONGeometryDetElement.cxx
In alignment code:
[u/mrichter/AliRoot.git] / MUON / AliMUONGeometryDetElement.cxx
index 46f87dacb684851cad7e68a800faf7b260f45793..be6b5b09c524747498e747d086a273bdeeeabb54 100644 (file)
  **************************************************************************/
 
 // $Id$
-//
-// --------------------------------------
+
+//-----------------------------------------------------------------------------
 // Class AliMUONGeometryDetElement
 // --------------------------------------
 // The class defines the detection element.
 // Author: Ivana Hrivnacova, IPN Orsay
+//-----------------------------------------------------------------------------
 
 #include "AliMUONGeometryDetElement.h"
 
 
 #include <sstream>
 
+/// \cond CLASSIMP
 ClassImp(AliMUONGeometryDetElement)
+/// \endcond
+
+const TString AliMUONGeometryDetElement::fgkDENamePrefix = "DE";
+
+//______________________________________________________________________________
+TString AliMUONGeometryDetElement::GetDEName(Int_t detElemId)
+{
+/// Return the module name for given moduleId
+
+  TString deName(fgkDENamePrefix);
+  deName += detElemId;
+  return deName;
+}   
+
+//______________________________________________________________________________
+AliMUONGeometryDetElement::AliMUONGeometryDetElement(Int_t detElemId)
+ : TObject(),
+   fDEName(GetDEName(detElemId)),
+   fVolumePath(),
+   fLocalTransformation(0),
+   fGlobalTransformation(0)
+{ 
+/// Standard constructor
+
+  SetUniqueID(detElemId);
+}
 
 //______________________________________________________________________________
 AliMUONGeometryDetElement::AliMUONGeometryDetElement(
                                         Int_t detElemId,
                                         const TString& volumePath)
  : TObject(),
+   fDEName(GetDEName(detElemId)),
    fVolumePath(volumePath),
    fLocalTransformation(0),
    fGlobalTransformation(0)
@@ -47,23 +76,14 @@ AliMUONGeometryDetElement::AliMUONGeometryDetElement(
 }
 
 //______________________________________________________________________________
-AliMUONGeometryDetElement::AliMUONGeometryDetElement()
+AliMUONGeometryDetElement::AliMUONGeometryDetElement(TRootIOCtor* /*ioCtor*/)
  : TObject(),
+   fDEName(),
    fVolumePath(),
    fLocalTransformation(0),
    fGlobalTransformation(0)
 {
-/// Default constructor
-}
-
-//______________________________________________________________________________
-AliMUONGeometryDetElement::AliMUONGeometryDetElement(
-                                   const AliMUONGeometryDetElement& rhs)
-  : TObject(rhs)
-{
-/// Protected copy constructor
-
-  AliFatal("Copy constructor is not implemented.");
+/// Root IO constructor
 }
 
 //______________________________________________________________________________
@@ -75,20 +95,6 @@ AliMUONGeometryDetElement::~AliMUONGeometryDetElement()
   delete fGlobalTransformation;
 }
 
-//______________________________________________________________________________
-AliMUONGeometryDetElement& 
-AliMUONGeometryDetElement::operator = (const AliMUONGeometryDetElement& rhs) 
-{
-/// Protected assignement operator
-
-  // check assignement to self
-  if (this == &rhs) return *this;
-
-  AliFatal("Assignment operator is not implemented.");
-    
-  return *this;  
-}
-
 //
 // private methods
 //
@@ -97,7 +103,7 @@ AliMUONGeometryDetElement::operator = (const AliMUONGeometryDetElement& rhs)
 void  AliMUONGeometryDetElement::PrintTransform(
                                             const TGeoHMatrix* transform) const
 {
-/// Prints the detection element transformation
+/// Print the detection element transformation
 
   cout << "DetElemId: " << GetUniqueID();
   cout << "  name: " << fVolumePath << endl;
@@ -148,9 +154,8 @@ void  AliMUONGeometryDetElement::Global2Local(
                                   Float_t xg, Float_t yg, Float_t zg, 
                                   Float_t& xl, Float_t& yl, Float_t& zl) const
 {
-/// Transforms point from the global reference frame (ALIC)
-/// to the local reference frame of the detection element specified
-/// by detElemId.
+/// Transform point from the global reference frame (ALIC)
+/// to the local reference frame of this detection element.
 
   Double_t dxg = xg;
   Double_t dyg = yg;
@@ -169,9 +174,8 @@ void  AliMUONGeometryDetElement::Global2Local(
                                   Double_t xg, Double_t yg, Double_t zg, 
                                   Double_t& xl, Double_t& yl, Double_t& zl) const
 {
-/// Transforms point from the global reference frame (ALIC)
-/// to the local reference frame of the detection element specified
-/// by detElemId.
+/// Transform point from the global reference frame (ALIC)
+/// to the local reference frame of this detection element
 
    // Check transformation
    if (!fGlobalTransformation) {
@@ -196,8 +200,8 @@ void  AliMUONGeometryDetElement::Local2Global(
                  Float_t xl, Float_t yl, Float_t zl, 
                  Float_t& xg, Float_t& yg, Float_t& zg) const
 {
-/// Transforms point from the local reference frame of the detection element 
-/// specified by detElemId to the global reference frame (ALIC).
+/// Transform point from the local reference frame of this detection element 
+/// to the global reference frame (ALIC).
 
   Double_t dxl = xl;
   Double_t dyl = yl;
@@ -216,8 +220,8 @@ void  AliMUONGeometryDetElement::Local2Global(
                  Double_t xl, Double_t yl, Double_t zl, 
                  Double_t& xg, Double_t& yg, Double_t& zg) const
 {
-/// Transforms point from the local reference frame of the detection element 
-/// specified by detElemId to the global reference frame (ALIC).
+/// Transform point from the local reference frame of this detection element 
+/// to the global reference frame (ALIC).
 
    // Check transformation
    if (!fGlobalTransformation) {
@@ -239,14 +243,17 @@ void  AliMUONGeometryDetElement::Local2Global(
 
 //______________________________________________________________________________
 void AliMUONGeometryDetElement::SetLocalTransformation(
-                                                const TGeoHMatrix& transform)
+                                                const TGeoHMatrix& transform, 
+                                                Bool_t warn)
 { 
-/// Sets global transformation;
-/// gives warning if the global transformation is already defined.
+/// Set local transformation;
+/// give warning if the global transformation is already defined.
  
-  if (fLocalTransformation) {
+  if ( fLocalTransformation ) {
     delete fLocalTransformation;
-    AliWarning("Local transformation already defined was deleted.");
+    if ( warn ) {
+      AliWarning("Local transformation already defined was deleted.");
+    }  
   }  
 
   fLocalTransformation = new TGeoHMatrix(transform);
@@ -254,14 +261,17 @@ void AliMUONGeometryDetElement::SetLocalTransformation(
                                              
 //______________________________________________________________________________
 void AliMUONGeometryDetElement::SetGlobalTransformation(
-                                                const TGeoHMatrix& transform)
+                                                const TGeoHMatrix& transform,
+                                                Bool_t warn)
 { 
-/// Sets global transformation;
-/// gives warning if the global transformation is already defined.
+/// Set global transformation;
+/// give warning if the global transformation is already defined.
  
   if (fGlobalTransformation) {
     delete fGlobalTransformation;
-    AliWarning("Global transformation already defined was deleted.");
+    if ( warn ) {
+      AliWarning("Global transformation already defined was deleted.");
+    }  
   }  
 
   fGlobalTransformation = new TGeoHMatrix(transform);
@@ -270,7 +280,7 @@ void AliMUONGeometryDetElement::SetGlobalTransformation(
 //______________________________________________________________________________
 void AliMUONGeometryDetElement::PrintLocalTransform() const
 {
-/// Prints detection element relative transformation
+/// Print detection element relative transformation
 /// (the transformation wrt module frame)
 
   PrintTransform(fLocalTransformation);
@@ -279,7 +289,7 @@ void AliMUONGeometryDetElement::PrintLocalTransform() const
 //______________________________________________________________________________
 void AliMUONGeometryDetElement::PrintGlobalTransform() const
 {
-/// Prints detection element global transformation
+/// Print detection element global transformation
 /// (the transformation wrt global frame)
 
   PrintTransform(fGlobalTransformation);