X-Git-Url: http://git.uio.no/git/?a=blobdiff_plain;f=MUON%2FAliMUONGeometryEnvelopeStore.cxx;h=c9047286b6eb296d6f6992d2d4e7728bcbea292a;hb=257f0eee1768a2fce3261c00d1abba5bec687da0;hp=63664707e2ee279c86a4cc300b4f8f6aeb2eaa4a;hpb=692de412b81f16738d28897496efdbb2e9e1ba0a;p=u%2Fmrichter%2FAliRoot.git diff --git a/MUON/AliMUONGeometryEnvelopeStore.cxx b/MUON/AliMUONGeometryEnvelopeStore.cxx index 63664707e2e..c9047286b6e 100644 --- a/MUON/AliMUONGeometryEnvelopeStore.cxx +++ b/MUON/AliMUONGeometryEnvelopeStore.cxx @@ -14,35 +14,42 @@ **************************************************************************/ // $Id$ -// + +//----------------------------------------------------------------------------- // Class AliMUONGeometryEnvelopeStore // ---------------------------------- // Class for definititon of the temporary volume envelopes // used in geometry construction -// // Author: Ivana Hrivnacova, IPN Orsay - -#include -#include -#include -#include -#include +//----------------------------------------------------------------------------- #include "AliMUONGeometryEnvelopeStore.h" #include "AliMUONGeometryEnvelope.h" #include "AliMUONGeometryDetElement.h" -#include "AliMUONGeometryStore.h" -#include "AliMUONConstants.h" +#include "AliMUONGeometryBuilder.h" + +#include "AliMpExMap.h" + #include "AliLog.h" +#include +#include +#include +#include + +using std::cout; +using std::endl; +/// \cond CLASSIMP ClassImp(AliMUONGeometryEnvelopeStore) +/// \endcond //______________________________________________________________________________ AliMUONGeometryEnvelopeStore::AliMUONGeometryEnvelopeStore( - AliMUONGeometryStore* detElements) + AliMpExMap* detElements) : TObject(), fEnvelopes(0), fDetElements(detElements), + fReferenceFrame(), fDebug(false), fAlign(false) { @@ -57,6 +64,7 @@ AliMUONGeometryEnvelopeStore::AliMUONGeometryEnvelopeStore() : TObject(), fEnvelopes(0), fDetElements(0), + fReferenceFrame(), fDebug(false), fAlign(false) { @@ -64,13 +72,6 @@ AliMUONGeometryEnvelopeStore::AliMUONGeometryEnvelopeStore() } -//______________________________________________________________________________ -AliMUONGeometryEnvelopeStore::AliMUONGeometryEnvelopeStore(const AliMUONGeometryEnvelopeStore& rhs) - : TObject(rhs) -{ - AliFatal("Copy constructor is not implemented."); -} - //______________________________________________________________________________ AliMUONGeometryEnvelopeStore::~AliMUONGeometryEnvelopeStore() { @@ -84,24 +85,24 @@ AliMUONGeometryEnvelopeStore::~AliMUONGeometryEnvelopeStore() } } -//______________________________________________________________________________ -AliMUONGeometryEnvelopeStore& -AliMUONGeometryEnvelopeStore::operator = (const AliMUONGeometryEnvelopeStore& rhs) -{ -/// Protected assignement operator - - // check assignement to self - if (this == &rhs) return *this; - - AliFatal("Assignment operator is not implemented."); - - return *this; -} - // // private methods // +//______________________________________________________________________________ +TGeoHMatrix +AliMUONGeometryEnvelopeStore::ConvertDETransform(const TGeoHMatrix& transform) const +{ +/// Convert transformation into the reference frame + + if ( fReferenceFrame.IsIdentity() ) + return transform; + else { + return AliMUONGeometryBuilder::Multiply( fReferenceFrame.Inverse(), + transform ); + } +} + //______________________________________________________________________________ AliMUONGeometryEnvelope* AliMUONGeometryEnvelopeStore::FindEnvelope(const TString& name) const @@ -130,13 +131,18 @@ Bool_t AliMUONGeometryEnvelopeStore::AlignEnvelope( if (detElemId == 0) return false; AliMUONGeometryDetElement* detElement - = (AliMUONGeometryDetElement*) fDetElements->Get(detElemId); + = (AliMUONGeometryDetElement*) fDetElements->GetValue(detElemId); if (!detElement) { AliWarning("Transformation not found."); return false; }; - envelope->SetTransform(*(detElement->GetLocalTransformation())); + // Apply frame transform + TGeoHMatrix newTransform + = ConvertDETransform(*(detElement->GetLocalTransformation())); + + envelope->SetTransform(newTransform); + return true; } @@ -402,7 +408,7 @@ void AliMUONGeometryEnvelopeStore::AddEnvelopeConstituent(const TString& name, const TString& envName, Int_t copyNo) { /// Add the volume with the specified name and transformation -/// to the list of envelopes. +/// as a constituent of the envelope envName. if (fDebug) { cout << "... Adding constituent " << name @@ -426,7 +432,7 @@ void AliMUONGeometryEnvelopeStore::AddEnvelopeConstituent(const TString& name, const TGeoTranslation& translation) { /// Add the volume with the specified name and transformation -/// to the list of envelopes. +/// as a constituent of the envelope envName. if (fDebug) { cout << "... Adding constituent " << name @@ -452,7 +458,7 @@ void AliMUONGeometryEnvelopeStore::AddEnvelopeConstituent(const TString& name, const TGeoRotation& rotation) { /// Add the volume with the specified name and transformation -/// to the list of envelopes. +/// as a constituent of the envelope envName. if (fDebug) { cout << "... Adding constituent " << name @@ -477,7 +483,7 @@ void AliMUONGeometryEnvelopeStore::AddEnvelopeConstituent(const TString& name, const TGeoCombiTrans& transform) { /// Add the volume with the specified name and transformation -/// to the list of envelopes. +/// as a constituent of the envelope envName. if (fDebug) { cout << "... Adding constituent " << name @@ -502,7 +508,7 @@ void AliMUONGeometryEnvelopeStore::AddEnvelopeConstituentParam(const TString& n Int_t npar, Double_t* param) { /// Add the volume with the specified name and transformation -/// to the list of envelopes. +/// as a constituent of the envelope envName. if (fDebug) { cout << "... Adding parameterised constituent " << name @@ -527,7 +533,7 @@ void AliMUONGeometryEnvelopeStore::AddEnvelopeConstituentParam(const TString& n Int_t npar, Double_t* param) { /// Add the volume with the specified name and transformation -/// to the list of envelopes. +/// as a constituent of the envelope envName. if (fDebug) { cout << "... Adding parameterised constituent " << name @@ -554,7 +560,7 @@ void AliMUONGeometryEnvelopeStore::AddEnvelopeConstituentParam(const TString& n Int_t npar, Double_t* param) { /// Add the volume with the specified name and transformation -/// to the list of envelopes. +/// as a constituent of the envelope envName. if (fDebug) { cout << "... Adding parameterised constituent " << name @@ -580,7 +586,7 @@ void AliMUONGeometryEnvelopeStore::AddEnvelopeConstituentParam(const TString& n Int_t npar, Double_t* param) { /// Add the volume with the specified name and transformation -/// to the list of envelopes. +/// as a constituent of the envelope envName. if (fDebug) { cout << "... Adding parameterised constituent " << name