X-Git-Url: http://git.uio.no/git/?a=blobdiff_plain;f=MUON%2FAliMUONVGeometryBuilder.cxx;h=9a4d3ddd37c439c441bcd690cb94cc91bd296785;hb=e07ebd8f53f80b18f8ceb43233b0f7373573451c;hp=2417b124e993e0716a91dcb9ceb4af6fead653ab;hpb=31607b6fe1a7235219906510fcd6cb05dcda69dd;p=u%2Fmrichter%2FAliRoot.git diff --git a/MUON/AliMUONVGeometryBuilder.cxx b/MUON/AliMUONVGeometryBuilder.cxx index 2417b124e99..9a4d3ddd37c 100644 --- a/MUON/AliMUONVGeometryBuilder.cxx +++ b/MUON/AliMUONVGeometryBuilder.cxx @@ -14,12 +14,14 @@ **************************************************************************/ // $Id$ -// + +//----------------------------------------------------------------------------- // Class AliMUONVGeometryBuilder // ----------------------------- // Abstract base class for geometry construction per geometry module(s). // Author: Ivana Hrivnacova, IPN Orsay // 23/01/2004 +//----------------------------------------------------------------------------- #include "AliMUONVGeometryBuilder.h" #include "AliMUONGeometryModule.h" @@ -57,7 +59,8 @@ AliMUONVGeometryBuilder::AliMUONVGeometryBuilder( // Create the module geometries array fGeometryModules = new TObjArray(); - + fGeometryModules->SetOwner(kFALSE); + for (Int_t i=0; iAdd(new AliMUONGeometryModule(firstModuleId++)); } @@ -146,12 +149,11 @@ void AliMUONVGeometryBuilder::MapSV(const TString& path0, // Get the name of the last volume in the path Ssiz_t npos1 = path0.Last('/')+1; Ssiz_t npos2 = path0.Last('_'); - TString volName(path0(npos1, npos2-npos1)); + TString volName0(path0(npos1, npos2-npos1)); // Check if it is sensitive volume - Int_t moduleId = AliMpDEManager::GetGeomModuleId(detElemId); AliMUONGeometryModule* geometry = GetGeometry(moduleId); - if ( geometry->IsSensitiveVolume(volName) && + if ( geometry->IsSensitiveVolume(volName0) && ! svMap->Get(path0) ) { //cout << ".. adding to the map " // << path0 << " " << detElemId << endl; @@ -348,12 +350,14 @@ void AliMUONVGeometryBuilder::SetReferenceFrame( } } - //______________________________________________________________________________ -void AliMUONVGeometryBuilder::CreateDetElements() const +void AliMUONVGeometryBuilder::UpdateDetElements(Bool_t create) const { -/// Create detection elements and fill their global and -/// local transformations from geometry. +/// Create or update detection elements: +/// - if parameter create is true: detection elements are +/// created and their global and local transformations are filled from geometry. +/// - otherwise: only the volume path is passed from geometry +/// to detection elements for (Int_t i=0; iGetEntriesFast(); i++) { AliMUONGeometryModule* geometry @@ -379,29 +383,39 @@ void AliMUONVGeometryBuilder::CreateDetElements() const TString volPath = geometry->GetVolumePath(); volPath += ComposePath(envelope->GetName(), envelope->GetCopyNo()); - // Create detection element - AliMUONGeometryDetElement* detElement - = new AliMUONGeometryDetElement(detElemId, volPath); - detElements->Add(detElemId, detElement); + if ( create ) { + // Create detection element + AliMUONGeometryDetElement* detElement + = new AliMUONGeometryDetElement(detElemId, volPath); + detElements->Add(detElemId, detElement); - // Compose local transformation - const TGeoCombiTrans* transform = envelope->GetTransformation(); - // Apply frame transform - TGeoHMatrix localTransform = ConvertDETransform(*transform); - detElement->SetLocalTransformation(localTransform); - - // Compose global transformation - TGeoHMatrix globalTransform - = AliMUONGeometryBuilder::Multiply( + // Compose local transformation + const TGeoCombiTrans* transform = envelope->GetTransformation(); + // Apply frame transform + TGeoHMatrix localTransform = ConvertDETransform(*transform); + detElement->SetLocalTransformation(localTransform); + + // Compose global transformation + TGeoHMatrix globalTransform + = AliMUONGeometryBuilder::Multiply( (*geometry->GetTransformer()->GetTransformation()), localTransform ); ; - // Set the global transformation to detection element - detElement->SetGlobalTransformation(globalTransform); - - } + // Set the global transformation to detection element + detElement->SetGlobalTransformation(globalTransform); + } + else { + // Get existing det elements + AliMUONGeometryDetElement* detElement + = (AliMUONGeometryDetElement*)detElements->GetValue(detElemId); + + // Set volume path + detElement->SetVolumePath(volPath); + } + } } } + //_____ _________________________________________________________________________ void AliMUONVGeometryBuilder::RebuildSVMaps(Bool_t withEnvelopes) const {