X-Git-Url: http://git.uio.no/git/?a=blobdiff_plain;f=MUON%2FAliMUONGeometryEnvelopeStore.cxx;h=d03e601a76379ed071d66c4a4e0a8d164aa532df;hb=3e5fa09cdc65f097da6eeff74c13de88247311ac;hp=1f7daac8d00449b87899f53cb8631c7000968459;hpb=e118b27eada9373935aaa96fdc51b0ac2bf6185f;p=u%2Fmrichter%2FAliRoot.git diff --git a/MUON/AliMUONGeometryEnvelopeStore.cxx b/MUON/AliMUONGeometryEnvelopeStore.cxx index 1f7daac8d00..d03e601a763 100644 --- a/MUON/AliMUONGeometryEnvelopeStore.cxx +++ b/MUON/AliMUONGeometryEnvelopeStore.cxx @@ -14,39 +14,44 @@ **************************************************************************/ // $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 + +/// \cond CLASSIMP ClassImp(AliMUONGeometryEnvelopeStore) +/// \endcond //______________________________________________________________________________ AliMUONGeometryEnvelopeStore::AliMUONGeometryEnvelopeStore( - AliMUONGeometryStore* detElements) + AliMpExMap* detElements) : TObject(), fEnvelopes(0), fDetElements(detElements), + fReferenceFrame(), fDebug(false), fAlign(false) { -// Standard constructor +/// Standard constructor fEnvelopes = new TObjArray(100); } @@ -57,24 +62,18 @@ AliMUONGeometryEnvelopeStore::AliMUONGeometryEnvelopeStore() : TObject(), fEnvelopes(0), fDetElements(0), + fReferenceFrame(), fDebug(false), fAlign(false) { -// Default constructor +/// Default constructor } -//______________________________________________________________________________ -AliMUONGeometryEnvelopeStore::AliMUONGeometryEnvelopeStore(const AliMUONGeometryEnvelopeStore& rhs) - : TObject(rhs) -{ - AliFatal("Copy constructor is not implemented."); -} - //______________________________________________________________________________ AliMUONGeometryEnvelopeStore::~AliMUONGeometryEnvelopeStore() { -// +/// Destructor // Add deleting rotation matrices @@ -84,28 +83,29 @@ AliMUONGeometryEnvelopeStore::~AliMUONGeometryEnvelopeStore() } } -//______________________________________________________________________________ -AliMUONGeometryEnvelopeStore& -AliMUONGeometryEnvelopeStore::operator = (const AliMUONGeometryEnvelopeStore& rhs) -{ - // 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 { -// Finds the envelope specified by name. -// --- +/// Find the envelope specified by name. for (Int_t i=0; iGetEntriesFast(); i++) { AliMUONGeometryEnvelope* envelope @@ -121,22 +121,26 @@ AliMUONGeometryEnvelopeStore::FindEnvelope(const TString& name) const Bool_t AliMUONGeometryEnvelopeStore::AlignEnvelope( AliMUONGeometryEnvelope* envelope) const { -// Find transformation by the detection element Id (if not 0) -// (= unique ID of enevelope) and set it to the envelope. -// Return true if transformation is applied, false otherwise. -// --- +/// Find transformation by the detection element Id (if not 0) +/// (= unique ID of enevelope) and set it to the envelope. +/// Return true if transformation is applied, false otherwise. Int_t detElemId = envelope->GetUniqueID(); 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; } @@ -150,9 +154,8 @@ void AliMUONGeometryEnvelopeStore::AddEnvelope(const TString& name, Bool_t isVirtual, const char* only) { -// Adds the volume with the specified name and transformation -// to the list of envelopes. -// --- +/// Add the volume with the specified name and transformation +/// to the list of envelopes. if (!isVirtual) AliDebug(1,Form("Adding non-virtual envelope %s id %d",name.Data(),id)); // else AliDebug(1,Form("Adding virtual envelope %s id %d",name.Data(),id)); @@ -172,9 +175,8 @@ void AliMUONGeometryEnvelopeStore::AddEnvelope(const TString& name, const TGeoTranslation& translation, const char* only) { -// Adds the volume with the specified name and transformation -// to the list of envelopes. -// --- +/// Add the volume with the specified name and transformation +/// to the list of envelopes. if (fDebug) { cout << "... Adding "; @@ -204,9 +206,8 @@ void AliMUONGeometryEnvelopeStore::AddEnvelope(const TString& name, const TGeoRotation& rotation, const char* only) { -// Adds the volume with the specified name and transformation -// to the list of envelopes. -// --- +/// Add the volume with the specified name and transformation +/// to the list of envelopes. if (fDebug) { cout << "... Adding "; @@ -251,9 +252,8 @@ void AliMUONGeometryEnvelopeStore::AddEnvelope(const TString& name, const TGeoCombiTrans& transform, const char* only) { -// Adds the volume with the specified name and transformation -// to the list of envelopes. -// --- +/// Add the volume with the specified name and transformation +/// to the list of envelopes. if (fDebug) { cout << "... Adding "; @@ -284,9 +284,8 @@ void AliMUONGeometryEnvelopeStore::AddEnvelope(const TString& name, Int_t copyNo, const char* only) { -// Adds the volume with the specified name and transformation -// to the list of envelopes. -// --- +/// Add the volume with the specified name and transformation +/// to the list of envelopes. if (fDebug) { cout << "... Adding " @@ -310,9 +309,8 @@ void AliMUONGeometryEnvelopeStore::AddEnvelope(const TString& name, const TGeoTranslation& translation, const char* only) { -// Adds the volume with the specified name and transformation -// to the list of envelopes. -// --- +/// Add the volume with the specified name and transformation +/// to the list of envelopes. if (fDebug) { cout << "... Adding " @@ -342,9 +340,8 @@ void AliMUONGeometryEnvelopeStore::AddEnvelope(const TString& name, const TGeoRotation& rotation, const char* only) { -// Adds the volume with the specified name and transformation -// to the list of envelopes. -// --- +/// Add the volume with the specified name and transformation +/// to the list of envelopes. if (fDebug) { cout << "... Adding " @@ -378,9 +375,8 @@ void AliMUONGeometryEnvelopeStore::AddEnvelope(const TString& name, const TGeoCombiTrans& transform, const char* only) { -// Adds the volume with the specified name and transformation -// to the list of envelopes. -// --- +/// Add the volume with the specified name and transformation +/// to the list of envelopes. if (fDebug) { cout << "... Adding " @@ -409,9 +405,8 @@ void AliMUONGeometryEnvelopeStore::AddEnvelope(const TString& name, void AliMUONGeometryEnvelopeStore::AddEnvelopeConstituent(const TString& name, const TString& envName, Int_t copyNo) { -// Adds the volume with the specified name and transformation -// to the list of envelopes. -// --- +/// Add the volume with the specified name and transformation +/// as a constituent of the envelope envName. if (fDebug) { cout << "... Adding constituent " << name @@ -434,9 +429,8 @@ void AliMUONGeometryEnvelopeStore::AddEnvelopeConstituent(const TString& name, const TString& envName, Int_t copyNo, const TGeoTranslation& translation) { -// Adds the volume with the specified name and transformation -// to the list of envelopes. -// --- +/// Add the volume with the specified name and transformation +/// as a constituent of the envelope envName. if (fDebug) { cout << "... Adding constituent " << name @@ -461,9 +455,8 @@ void AliMUONGeometryEnvelopeStore::AddEnvelopeConstituent(const TString& name, const TGeoTranslation& translation, const TGeoRotation& rotation) { -// Adds the volume with the specified name and transformation -// to the list of envelopes. -// --- +/// Add the volume with the specified name and transformation +/// as a constituent of the envelope envName. if (fDebug) { cout << "... Adding constituent " << name @@ -487,9 +480,8 @@ void AliMUONGeometryEnvelopeStore::AddEnvelopeConstituent(const TString& name, const TString& envName, Int_t copyNo, const TGeoCombiTrans& transform) { -// Adds the volume with the specified name and transformation -// to the list of envelopes. -// --- +/// Add the volume with the specified name and transformation +/// as a constituent of the envelope envName. if (fDebug) { cout << "... Adding constituent " << name @@ -513,9 +505,8 @@ void AliMUONGeometryEnvelopeStore::AddEnvelopeConstituentParam(const TString& n const TString& envName, Int_t copyNo, Int_t npar, Double_t* param) { -// Adds the volume with the specified name and transformation -// to the list of envelopes. -// --- +/// Add the volume with the specified name and transformation +/// as a constituent of the envelope envName. if (fDebug) { cout << "... Adding parameterised constituent " << name @@ -539,9 +530,8 @@ void AliMUONGeometryEnvelopeStore::AddEnvelopeConstituentParam(const TString& n const TGeoTranslation& translation, Int_t npar, Double_t* param) { -// Adds the volume with the specified name and transformation -// to the list of envelopes. -// --- +/// Add the volume with the specified name and transformation +/// as a constituent of the envelope envName. if (fDebug) { cout << "... Adding parameterised constituent " << name @@ -567,9 +557,8 @@ void AliMUONGeometryEnvelopeStore::AddEnvelopeConstituentParam(const TString& n const TGeoRotation& rotation, Int_t npar, Double_t* param) { -// Adds the volume with the specified name and transformation -// to the list of envelopes. -// --- +/// Add the volume with the specified name and transformation +/// as a constituent of the envelope envName. if (fDebug) { cout << "... Adding parameterised constituent " << name @@ -594,9 +583,8 @@ void AliMUONGeometryEnvelopeStore::AddEnvelopeConstituentParam(const TString& n const TGeoCombiTrans& transform, Int_t npar, Double_t* param) { -// Adds the volume with the specified name and transformation -// to the list of envelopes. -// --- +/// Add the volume with the specified name and transformation +/// as a constituent of the envelope envName. if (fDebug) { cout << "... Adding parameterised constituent " << name @@ -618,8 +606,7 @@ void AliMUONGeometryEnvelopeStore::AddEnvelopeConstituentParam(const TString& n //______________________________________________________________________________ Int_t AliMUONGeometryEnvelopeStore::GetNofDetElements() const { -// Returns the number od envelopes with detElemId>0. -// --- +/// Return the number od envelopes with detElemId>0. Int_t nofDetElems = 0;