]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
- Adding volume path attribute (moved from AliMUONGeometryModule)
authorivana <ivana@f7af4fe6-9843-0410-8265-dc069ae4e863>
Wed, 8 Feb 2006 15:08:55 +0000 (15:08 +0000)
committerivana <ivana@f7af4fe6-9843-0410-8265-dc069ae4e863>
Wed, 8 Feb 2006 15:08:55 +0000 (15:08 +0000)
- fTransformation  type changed to TGeoHMatrix
- Adapted getters/setters accordingly
- Reordered includes, forward declarations

MUON/AliMUONGeometryModuleTransformer.cxx
MUON/AliMUONGeometryModuleTransformer.h

index 8a0c6ddc7fa615c6056dfa0cb963483dc5899ee5..ee9a94592c56395b1b6410cb628d8e471e286086 100644 (file)
 //
 // Author: Ivana Hrivnacova, IPN Orsay
 
+#include "AliMUONGeometryModuleTransformer.h"
+#include "AliMUONGeometryDetElement.h" 
+#include "AliMUONGeometryStore.h"      
+
+#include "AliLog.h"    
+
 #include <TVirtualMC.h>
 #include <TGeoMatrix.h>
 #include <TObjArray.h>
 #include <TArrayI.h>
 #include <Riostream.h>
 
-#include "AliLog.h"    
-
-#include "AliMUONGeometryModuleTransformer.h"
-#include "AliMUONGeometryDetElement.h" 
-#include "AliMUONGeometryStore.h"      
-
 ClassImp(AliMUONGeometryModuleTransformer)
 
 //______________________________________________________________________________
 AliMUONGeometryModuleTransformer::AliMUONGeometryModuleTransformer(Int_t moduleId)
  : TObject(),
    fModuleId(moduleId),
+   fVolumePath(),
    fTransformation(0),
    fDetElements(0)
 {
 /// Standard constructor
 
   // Chamber transformation
-  fTransformation = new TGeoCombiTrans("");
+  fTransformation = new TGeoHMatrix("");
 
   // Det elements transformation stores
   fDetElements = new AliMUONGeometryStore(true);
@@ -56,6 +57,7 @@ AliMUONGeometryModuleTransformer::AliMUONGeometryModuleTransformer(Int_t moduleI
 AliMUONGeometryModuleTransformer::AliMUONGeometryModuleTransformer()
  : TObject(),
    fModuleId(0),
+   fVolumePath(),
    fTransformation(0),
    fDetElements(0)
 {
@@ -169,13 +171,40 @@ void  AliMUONGeometryModuleTransformer::Local2Global(Int_t detElemId,
 
 //______________________________________________________________________________
 void  AliMUONGeometryModuleTransformer::SetTransformation(
-                                           const TGeoCombiTrans& transform)
+                                           const TGeoHMatrix& transform)
 {
 /// Set the module position wrt world.
 
   *fTransformation = transform;
 }  
 
+//______________________________________________________________________________
+TString AliMUONGeometryModuleTransformer::GetVolumeName() const
+{ 
+/// Extract volume name from the path
+  
+  std::string volPath = fVolumePath.Data();
+  std::string::size_type first = volPath.rfind('/')+1;
+  std::string::size_type last = volPath.rfind('_');
+  
+  return volPath.substr(first, last-first );
+}
+
+//______________________________________________________________________________
+TString AliMUONGeometryModuleTransformer::GetMotherVolumeName() const
+{ 
+/// Extract volume name from the path
+  
+  std::string volPath = fVolumePath.Data();
+  std::string::size_type first = volPath.rfind('/');
+  volPath = volPath.substr(0, first);
+
+  std::string::size_type next = volPath.rfind('/')+1;
+  std::string::size_type last = volPath.rfind('_');
+  
+  return volPath.substr(next, last-next );
+}
+
 //______________________________________________________________________________
 AliMUONGeometryDetElement*
 AliMUONGeometryModuleTransformer::GetDetElement(Int_t detElemId, Bool_t warn) const
index f4544a15c2400a35abb72caf874c99ba4e476f15..06482d7cf46e11e1d78dda8db0c933e018df6920 100644 (file)
 #include <TObject.h>
 #include <TString.h>
 
+class AliMUONGeometryDetElement;
+class AliMUONGeometryStore;
+
 class TGeoTranslation;
 class TGeoRotation;
-class TGeoCombiTrans;
+class TGeoHMatrix;
 class TObjArray;
 class TArrayI;
 
-class AliMUONGeometryDetElement;
-class AliMUONGeometryStore;
-
 class AliMUONGeometryModuleTransformer : public TObject
 {
   public:
@@ -52,11 +52,16 @@ class AliMUONGeometryModuleTransformer : public TObject
                  Double_t& xg, Double_t& yg, Double_t& zg) const;
 
     // set methods
-    void  SetTransformation(const TGeoCombiTrans& transform);
+    void  SetTransformation(const TGeoHMatrix& transform);
+    void  SetVolumePath(const TString& volumePath);
  
     // get methods
-    Int_t                  GetModuleId() const;
-    const TGeoCombiTrans*  GetTransformation() const;    
+    Int_t    GetModuleId() const;
+    TString  GetVolumePath() const;
+    TString  GetVolumeName() const;
+    TString  GetMotherVolumeName() const;
+
+    const TGeoHMatrix*  GetTransformation() const;    
 
     AliMUONGeometryStore*       GetDetElementStore() const;
     AliMUONGeometryDetElement*  GetDetElement(
@@ -65,27 +70,41 @@ class AliMUONGeometryModuleTransformer : public TObject
   protected:
     AliMUONGeometryModuleTransformer(const AliMUONGeometryModuleTransformer& rhs);
     // operators  
-    AliMUONGeometryModuleTransformer& operator = (const AliMUONGeometryModuleTransformer& rhs);
+    AliMUONGeometryModuleTransformer& 
+      operator = (const AliMUONGeometryModuleTransformer& rhs);
 
   private:
     // data members
-    Int_t                 fModuleId;      // the module Id
-    TGeoCombiTrans*       fTransformation;// the module transformation wrt to top
+    Int_t                 fModuleId;   // the module Id
+    TString               fVolumePath; // the full path of aligned module volume
+                                       // or envelope in geometry
+    TGeoHMatrix*          fTransformation;// the module transformation wrt to top
                                           // volume
     AliMUONGeometryStore* fDetElements;   // detection elements
  
-  ClassDef(AliMUONGeometryModuleTransformer,2) // MUON geometry module class
+  ClassDef(AliMUONGeometryModuleTransformer,3) // MUON geometry module class
 };
 
 // inline functions
 
-inline Int_t  AliMUONGeometryModuleTransformer::GetModuleId() const
+inline void 
+AliMUONGeometryModuleTransformer::SetVolumePath(const TString& volumePath)
+{ fVolumePath = volumePath; }
+
+inline Int_t  
+AliMUONGeometryModuleTransformer::GetModuleId() const
 { return fModuleId; }
 
-inline const TGeoCombiTrans* AliMUONGeometryModuleTransformer::GetTransformation() const 
+inline TString 
+AliMUONGeometryModuleTransformer::GetVolumePath() const
+{ return fVolumePath; }
+
+inline const TGeoHMatrix* 
+AliMUONGeometryModuleTransformer::GetTransformation() const 
 { return fTransformation; }
 
-inline  AliMUONGeometryStore* AliMUONGeometryModuleTransformer::GetDetElementStore() const
+inline  AliMUONGeometryStore* 
+AliMUONGeometryModuleTransformer::GetDetElementStore() const
 { return fDetElements; }
 
 #endif //ALI_MUON_GEOMETRY_MODULE_PARAM_H