//
// 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);
AliMUONGeometryModuleTransformer::AliMUONGeometryModuleTransformer()
: TObject(),
fModuleId(0),
+ fVolumePath(),
fTransformation(0),
fDetElements(0)
{
//______________________________________________________________________________
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
#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:
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(
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