**************************************************************************/
// $Id$
-//
-// --------------------------------------
+
+//-----------------------------------------------------------------------------
// Class AliMUONGeometryDetElement
// --------------------------------------
// The class defines the detection element.
// Author: Ivana Hrivnacova, IPN Orsay
+//-----------------------------------------------------------------------------
#include "AliMUONGeometryDetElement.h"
#include <sstream>
+using std::cout;
+using std::endl;
+using std::string;
/// \cond CLASSIMP
ClassImp(AliMUONGeometryDetElement)
/// \endcond
-const TString AliMUONGeometryDetElement::fgkDENamePrefix = "DE";
+//
+// static methods
+//
+
+//______________________________________________________________________________
+const TString& AliMUONGeometryDetElement::GetDENamePrefix()
+{
+ ///< Geometry DE name prefix
+ static const TString kDENamePrefix = "DE";
+ return kDENamePrefix;
+}
+
+//______________________________________________________________________________
+TString AliMUONGeometryDetElement::GetDEName(Int_t detElemId)
+{
+/// Return the module name for given moduleId
+
+ TString deName(GetDENamePrefix());
+ 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(),
+ fDEName(GetDEName(detElemId)),
fVolumePath(volumePath),
fLocalTransformation(0),
fGlobalTransformation(0)
/// Standard constructor
SetUniqueID(detElemId);
-
- fDEName = fgkDENamePrefix;
- fDEName += detElemId;
}
//______________________________________________________________________________
-AliMUONGeometryDetElement::AliMUONGeometryDetElement()
+AliMUONGeometryDetElement::AliMUONGeometryDetElement(TRootIOCtor* /*ioCtor*/)
: TObject(),
+ fDEName(),
fVolumePath(),
fLocalTransformation(0),
fGlobalTransformation(0)
{
-/// Default constructor
+/// Root IO constructor
}
//______________________________________________________________________________
//______________________________________________________________________________
void AliMUONGeometryDetElement::SetLocalTransformation(
- const TGeoHMatrix& transform)
+ const TGeoHMatrix& transform,
+ Bool_t warn)
{
/// 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);
//______________________________________________________________________________
void AliMUONGeometryDetElement::SetGlobalTransformation(
- const TGeoHMatrix& transform)
+ const TGeoHMatrix& transform,
+ Bool_t warn)
{
/// 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);