1 /**************************************************************************
2 * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
3 * SigmaEffect_thetadegrees *
4 * Author: The ALICE Off-line Project. *
5 * Contributors are mentioned in the code where appropriate. *
7 * Permission to use, copy, modify and distribute this software and its *
8 * documentation strictly for non-commercial purposes is hereby granted *
9 * without fee, provided that the above copyright notice appears in all *
10 * copies and that both the copyright notice and this permission notice *
11 * appear in the supporting documentation. The authors make no claims *
12 * about the suitability of this software for any purpeateose. It is *
13 * provided "as is" without express or implied warranty. *
14 **************************************************************************/
18 // Class AliMUONGeometryTransformer
19 // ----------------------------
20 // Top container class for geometry transformations
22 // Author: Ivana Hrivnacova, IPN Orsay
24 #include "AliMUONGeometryTransformer.h"
25 #include "AliMUONGeometryModuleTransformer.h"
26 #include "AliMUONGeometryDetElement.h"
27 #include "AliMUONGeometryStore.h"
28 #include "AliMUONGeometryBuilder.h"
31 #include "AliAlignObjMatrix.h"
33 #include <Riostream.h>
35 #include <TClonesArray.h>
36 #include <TGeoManager.h>
37 #include <TGeoPhysicalNode.h>
42 ClassImp(AliMUONGeometryTransformer)
44 //______________________________________________________________________________
45 AliMUONGeometryTransformer::AliMUONGeometryTransformer(Bool_t isOwner)
47 fModuleTransformers(0),
50 /// Standard constructor
52 // Create array for geometry modules
53 fModuleTransformers = new TObjArray();
54 fModuleTransformers->SetOwner(isOwner);
57 //______________________________________________________________________________
58 AliMUONGeometryTransformer::AliMUONGeometryTransformer()
60 fModuleTransformers(0),
63 /// Default constructor
66 //______________________________________________________________________________
67 AliMUONGeometryTransformer::AliMUONGeometryTransformer(
68 const AliMUONGeometryTransformer& right)
71 /// Copy constructor (not implemented)
73 AliFatal("Copy constructor not provided.");
76 //______________________________________________________________________________
77 AliMUONGeometryTransformer::~AliMUONGeometryTransformer()
81 delete fModuleTransformers;
82 delete fMisAlignArray;
85 //______________________________________________________________________________
86 AliMUONGeometryTransformer&
87 AliMUONGeometryTransformer::operator=(const AliMUONGeometryTransformer& right)
89 /// Assignement operator (not implemented)
91 // check assignement to self
92 if (this == &right) return *this;
94 AliFatal("Assignement operator not provided.");
103 //_____________________________________________________________________________
104 AliMUONGeometryModuleTransformer*
105 AliMUONGeometryTransformer::GetModuleTransformerNonConst(
106 Int_t index, Bool_t warn) const
108 /// Return the geometry module specified by index
110 if (index < 0 || index >= fModuleTransformers->GetEntriesFast()) {
113 << "Index: " << index << " outside limits" << std::endl;
118 return (AliMUONGeometryModuleTransformer*) fModuleTransformers->At(index);
121 //______________________________________________________________________________
122 TGeoHMatrix AliMUONGeometryTransformer::GetTransform(
123 Double_t x, Double_t y, Double_t z,
124 Double_t a1, Double_t a2, Double_t a3,
125 Double_t a4, Double_t a5, Double_t a6) const
127 // Builds the transformation from the given parameters
131 return TGeoCombiTrans(TGeoTranslation(x, y, z),
132 TGeoRotation("rot", a1, a2, a3, a4, a5, a6));
136 //______________________________________________________________________________
137 void AliMUONGeometryTransformer::FillModuleVolPath(Int_t moduleId,
138 const TString& volPath)
140 // Create module with the given moduleId and volPath
143 // Get/Create geometry module transformer
144 AliMUONGeometryModuleTransformer* moduleTransformer
145 = GetModuleTransformerNonConst(moduleId, false);
147 if ( !moduleTransformer ) {
148 moduleTransformer = new AliMUONGeometryModuleTransformer(moduleId);
149 AddModuleTransformer(moduleTransformer);
151 moduleTransformer->SetVolumePath(volPath);
154 //______________________________________________________________________________
155 void AliMUONGeometryTransformer::FillDetElemVolPath(Int_t detElemId,
156 const TString& volPath)
158 // Create detection element with the given detElemId and volPath
161 Int_t moduleId = AliMUONGeometryStore::GetModuleId(detElemId);
163 // Get detection element store
164 AliMUONGeometryStore* detElements =
165 GetModuleTransformer(moduleId)->GetDetElementStore();
167 // Add detection element
168 AliMUONGeometryDetElement* detElement
169 = new AliMUONGeometryDetElement(detElemId, volPath);
170 detElements->Add(detElemId, detElement);
174 //______________________________________________________________________________
175 void AliMUONGeometryTransformer::FillModuleTransform(Int_t moduleId,
176 Double_t x, Double_t y, Double_t z,
177 Double_t a1, Double_t a2, Double_t a3,
178 Double_t a4, Double_t a5, Double_t a6)
180 // Fill the transformation of the module.
183 // Get/Create geometry module transformer
185 // Modules numbers in the file are starting from 1
187 AliMUONGeometryModuleTransformer* moduleTransformer
188 = GetModuleTransformerNonConst(moduleId, false);
190 if ( !moduleTransformer) {
192 << "Module " << moduleId << " has not volume path defined." << endl;
195 // Build the transformation from the parameters
196 TGeoHMatrix transform
197 = GetTransform(x, y, z, a1, a2, a3, a4, a5, a6);
199 moduleTransformer->SetTransformation(transform);
202 //______________________________________________________________________________
203 void AliMUONGeometryTransformer::FillDetElemTransform(
205 Double_t x, Double_t y, Double_t z,
206 Double_t a1, Double_t a2, Double_t a3,
207 Double_t a4, Double_t a5, Double_t a6)
209 // Fill the transformation of the detection element.
213 Int_t moduleId = AliMUONGeometryStore::GetModuleId(detElemId);
215 // Get module transformer
216 const AliMUONGeometryModuleTransformer* kModuleTransformer
217 = GetModuleTransformer(moduleId);
219 if ( ! kModuleTransformer ) {
220 AliFatal(Form("Module transformer not defined, detElemId: %d", detElemId));
224 // Get detection element
225 AliMUONGeometryDetElement* detElement
226 = kModuleTransformer->GetDetElement(detElemId);
228 if ( ! detElement ) {
229 AliFatal(Form("Det element %d has not volume path defined", detElemId));
233 // Build the transformation from the parameters
234 TGeoHMatrix localTransform
235 = GetTransform(x, y, z, a1, a2, a3, a4, a5, a6);
236 detElement->SetLocalTransformation(localTransform);
238 // Compute global transformation
239 TGeoHMatrix globalTransform
240 = AliMUONGeometryBuilder::Multiply(
241 *kModuleTransformer->GetTransformation(),
243 detElement->SetGlobalTransformation(globalTransform);
246 //______________________________________________________________________________
248 AliMUONGeometryTransformer::ReadVolPaths(ifstream& in)
250 // Reads modules and detection element volume paths from stream
254 TString key, volumePath;
257 while ( !in.eof() ) {
259 in >> id >> volumePath;
261 // cout << "id=" << id << " "
262 // << "volPath= " << volumePath
265 if ( key == TString("CH") )
266 FillModuleVolPath(id, volumePath);
268 else if ( key == TString("DE") )
269 FillDetElemVolPath(id, volumePath);
272 AliFatal(Form("%s key not recognized", key.Data()));
281 //______________________________________________________________________________
282 TString AliMUONGeometryTransformer::ReadModuleTransforms(ifstream& in)
284 // Reads and fills modules transformations from a file
285 // Returns true, if reading finished correctly.
289 while ( key == TString("CH") ) {
292 Double_t a1, a2, a3, a4, a5, a6;
308 //cout << "moduleId=" << id << " "
309 // << "position= " << x << ", " << y << ", " << z << " "
310 // << "rotation= " << a1 << ", " << a2 << ", " << a3 << ", "
311 // << a4 << ", " << a5 << ", " << a6
315 FillModuleTransform(id, x, y, z, a1, a2, a3, a4, a5, a6);
324 //______________________________________________________________________________
325 TString AliMUONGeometryTransformer::ReadDetElemTransforms(ifstream& in)
327 // Reads detection elements transformations from a file
328 // Returns true, if reading finished correctly.
332 while ( key == TString("DE") ) {
337 Double_t a1, a2, a3, a4, a5, a6;
353 //cout << "detElemId=" << detElemId << " "
354 // << "position= " << x << ", " << y << ", " << z << " "
355 // << "rotation= " << a1 << ", " << a2 << ", " << a3 << ", "
356 // << a4 << ", " << a5 << ", " << a6
360 FillDetElemTransform(detElemId, x, y, z, a1, a2, a3, a4, a5, a6);
369 //______________________________________________________________________________
371 AliMUONGeometryTransformer::LoadTransforms(TGeoManager* tgeoManager)
373 /// Loads transformations for defined modules and detection elements
374 /// from the root file
376 for (Int_t i=0; i<fModuleTransformers->GetEntriesFast(); i++) {
377 AliMUONGeometryModuleTransformer* moduleTransformer
378 = (AliMUONGeometryModuleTransformer*)fModuleTransformers->At(i);
381 TString path = moduleTransformer->GetVolumePath();
383 // Make physical node
384 TGeoPhysicalNode* moduleNode = tgeoManager->MakePhysicalNode(path);
385 if ( ! moduleNode ) {
387 << "Module id: " << moduleTransformer->GetModuleId()
388 << " volume path: " << path << " not found in geometry." << endl;
392 // Set matrix from physical node
393 TGeoHMatrix matrix = *moduleNode->GetMatrix();
394 moduleTransformer->SetTransformation(matrix);
396 // Loop over detection elements
397 AliMUONGeometryStore* detElements
398 = moduleTransformer->GetDetElementStore();
400 for (Int_t j=0; j<detElements->GetNofEntries(); j++) {
401 AliMUONGeometryDetElement* detElement
402 = (AliMUONGeometryDetElement*)detElements->GetEntry(j);
405 TString dePath = detElement->GetVolumePath();
407 // Make physical node
408 TGeoPhysicalNode* deNode = tgeoManager->MakePhysicalNode(dePath);
411 << "Det element id: " << detElement->GetId()
412 << " volume path: " << path << " not found in geometry." << endl;
416 // Set global matrix from physical node
417 TGeoHMatrix globalMatrix = *deNode->GetMatrix();
418 detElement->SetGlobalTransformation(globalMatrix);
421 TGeoHMatrix localMatrix =
422 AliMUONGeometryBuilder::Multiply(
423 matrix.Inverse(), globalMatrix );
424 detElement->SetLocalTransformation(localMatrix);
430 //______________________________________________________________________________
432 AliMUONGeometryTransformer::ReadVolPaths(const TString& fileName)
434 // Reads detection element volume paths from a file
435 // Returns true, if reading finished correctly.
439 TString filePath = gSystem->Getenv("ALICE_ROOT");
440 filePath += "/MUON/data/";
441 filePath += fileName;
444 ifstream in(filePath, ios::in);
446 cerr << filePath << endl;
447 AliFatal("File not found.");
455 //______________________________________________________________________________
457 AliMUONGeometryTransformer::ReadTransformations(const TString& fileName)
459 // Reads transformations from a file
460 // Returns true, if reading finished correctly.
464 TString filePath = gSystem->Getenv("ALICE_ROOT");
465 filePath += "/MUON/data/";
466 filePath += fileName;
469 ifstream in(filePath, ios::in);
471 cerr << filePath << endl;
472 AliFatal("File not found.");
478 while ( !in.eof() ) {
479 if (key == TString("CH"))
480 key = ReadModuleTransforms(in);
481 else if (key == TString("DE"))
482 key = ReadDetElemTransforms(in);
484 AliFatal(Form("%s key not recognized", key.Data()));
492 //______________________________________________________________________________
494 AliMUONGeometryTransformer::ReadTransformations2(const TString& fileName)
496 // Reads transformations from root geometry file
497 // Returns true, if reading finished correctly.
501 TString filePath = gSystem->Getenv("ALICE_ROOT");
502 filePath += "/MUON/data/";
503 filePath += fileName;
505 // Load root geometry
506 TGeoManager* tgeoManager = TGeoManager::Import(fileName);
509 LoadTransforms(tgeoManager);
514 //______________________________________________________________________________
515 void AliMUONGeometryTransformer::WriteTransform(ofstream& out,
516 const TGeoMatrix* transform) const
518 // Writes the transformations
522 const Double_t* xyz = transform->GetTranslation();
523 out << setw(10) << setprecision(4) << xyz[0] << " "
524 << setw(10) << setprecision(4) << xyz[1] << " "
525 << setw(10) << setprecision(4) << xyz[2];
528 const Double_t* rm = transform->GetRotationMatrix();
529 TGeoRotation rotation;
530 rotation.SetMatrix(const_cast<Double_t*>(rm));
531 Double_t a1, a2, a3, a4, a5, a6;
532 rotation.GetAngles(a1, a2, a3, a4, a5, a6);
534 out << setw(8) << setprecision(4) << a1 << " "
535 << setw(8) << setprecision(4) << a2 << " "
536 << setw(8) << setprecision(4) << a3 << " "
537 << setw(8) << setprecision(4) << a4 << " "
538 << setw(8) << setprecision(4) << a5 << " "
539 << setw(8) << setprecision(4) << a6 << " " << endl;
542 //______________________________________________________________________________
543 void AliMUONGeometryTransformer::WriteModuleVolPaths(ofstream& out) const
545 // Write modules volume paths
547 for (Int_t i=0; i<fModuleTransformers->GetEntriesFast(); i++) {
548 AliMUONGeometryModuleTransformer* moduleTransformer
549 = (AliMUONGeometryModuleTransformer*)fModuleTransformers->At(i);
553 << setw(4) << moduleTransformer->GetModuleId() << " "
554 << moduleTransformer->GetVolumePath() << endl;
559 //______________________________________________________________________________
560 void AliMUONGeometryTransformer::WriteDetElemVolPaths(ofstream& out) const
562 // Write detection elements volume paths
564 for (Int_t i=0; i<fModuleTransformers->GetEntriesFast(); i++) {
565 AliMUONGeometryModuleTransformer* moduleTransformer
566 = (AliMUONGeometryModuleTransformer*)fModuleTransformers->At(i);
567 AliMUONGeometryStore* detElements
568 = moduleTransformer->GetDetElementStore();
570 for (Int_t j=0; j<detElements->GetNofEntries(); j++) {
571 AliMUONGeometryDetElement* detElement
572 = (AliMUONGeometryDetElement*)detElements->GetEntry(j);
576 << setw(4) << detElement->GetId() << " "
577 << detElement->GetVolumePath() << endl;
583 //______________________________________________________________________________
584 void AliMUONGeometryTransformer::WriteModuleTransforms(ofstream& out) const
586 // Write modules transformations
588 for (Int_t i=0; i<fModuleTransformers->GetEntriesFast(); i++) {
589 AliMUONGeometryModuleTransformer* moduleTransformer
590 = (AliMUONGeometryModuleTransformer*)fModuleTransformers->At(i);
591 const TGeoMatrix* transform
592 = moduleTransformer->GetTransformation();
596 << setw(4) << moduleTransformer->GetModuleId() + 1;
598 WriteTransform(out, transform);
603 //______________________________________________________________________________
604 void AliMUONGeometryTransformer::WriteDetElemTransforms(ofstream& out) const
606 // Writes detection elements transformations
609 for (Int_t i=0; i<fModuleTransformers->GetEntriesFast(); i++) {
610 AliMUONGeometryModuleTransformer* moduleTransformer
611 = (AliMUONGeometryModuleTransformer*)fModuleTransformers->At(i);
612 AliMUONGeometryStore* detElements
613 = moduleTransformer->GetDetElementStore();
615 for (Int_t j=0; j<detElements->GetNofEntries(); j++) {
616 AliMUONGeometryDetElement* detElement
617 = (AliMUONGeometryDetElement*)detElements->GetEntry(j);
618 const TGeoMatrix* transform
619 = detElement->GetLocalTransformation();
622 out << "DE " << setw(4) << detElement->GetId();
624 WriteTransform(out, transform);
634 //______________________________________________________________________________
636 AliMUONGeometryTransformer::ReadGeometryData(
637 const TString& volPathFileName,
638 const TString& transformFileName)
640 /// Read geometry data from given files;
641 /// if transformFileName has ".root" extension, the transformations
642 /// are loaded from root geometry file, otherwise ASCII file
643 /// format is supposed
645 Bool_t result1 = ReadVolPaths(volPathFileName);
647 // Get file extension
648 std::string fileName = transformFileName.Data();
649 std::string rootExt = fileName.substr(fileName.size()-5, fileName.size());
651 if ( rootExt != ".root" )
652 result2 = ReadTransformations(transformFileName);
654 result2 = ReadTransformations2(transformFileName);
656 return result1 && result2;
659 //______________________________________________________________________________
661 AliMUONGeometryTransformer::ReadGeometryData(
662 const TString& volPathFileName,
663 TGeoManager* tgeoManager)
665 /// Load geometry data from root geometry using defined
666 /// voluem paths from file
668 Bool_t result1 = ReadVolPaths(volPathFileName);
670 Bool_t result2 = LoadTransforms(tgeoManager);
672 return result1 && result2;
675 //______________________________________________________________________________
677 AliMUONGeometryTransformer::WriteGeometryData(
678 const TString& volPathFileName,
679 const TString& transformFileName,
680 const TString& misalignFileName) const
682 /// Write geometry data into given files
684 Bool_t result1 = WriteVolumePaths(volPathFileName);
685 Bool_t result2 = WriteTransformations(transformFileName);
687 Bool_t result3 = true;
688 if ( misalignFileName != "" )
689 result3 = WriteMisAlignmentData(misalignFileName);
691 return result1 && result2 && result3;
694 //______________________________________________________________________________
696 AliMUONGeometryTransformer::WriteVolumePaths(const TString& fileName) const
698 // Writes volume paths for modules and detection element volumes into a file
699 // Returns true, if writing finished correctly.
703 // if builder is not associated with any geometry module
704 if (fModuleTransformers->GetEntriesFast() == 0) return false;
707 TString filePath = gSystem->Getenv("ALICE_ROOT");
708 filePath += "/MUON/data/";
709 filePath += fileName;
712 ofstream out(filePath, ios::out);
714 cerr << filePath << endl;
715 AliError("File not found.");
718 #if !defined (__DECCXX)
719 out.setf(std::ios::fixed);
721 WriteModuleVolPaths(out);
722 WriteDetElemVolPaths(out);
727 //______________________________________________________________________________
729 AliMUONGeometryTransformer::WriteTransformations(const TString& fileName) const
731 // Writes transformations into a file
732 // Returns true, if writing finished correctly.
736 // if builder is not associated with any geometry module
737 if (fModuleTransformers->GetEntriesFast() == 0) return false;
740 TString filePath = gSystem->Getenv("ALICE_ROOT");
741 filePath += "/MUON/data/";
742 filePath += fileName;
745 ofstream out(filePath, ios::out);
747 cerr << filePath << endl;
748 AliError("File not found.");
751 #if !defined (__DECCXX)
752 out.setf(std::ios::fixed);
754 WriteModuleTransforms(out);
755 WriteDetElemTransforms(out);
760 //______________________________________________________________________________
762 AliMUONGeometryTransformer::WriteMisAlignmentData(const TString& fileName) const
764 // Writes misalignment data into a file
765 // Returns true, if writing finished correctly.
769 // if builder is not associated with any geometry module
770 if ( fModuleTransformers->GetEntriesFast() == 0 ) {
771 AliWarningStream() << "No geometry modules defined." << endl;
776 // if builder has no mis-alignment data
777 if ( ! fMisAlignArray ) {
778 AliWarningStream() << "No mis-alignment data defined." << endl;
783 TString filePath = gSystem->Getenv("ALICE_ROOT");
784 filePath += "/MUON/data/";
785 filePath += fileName;
787 // Write mis-alignment data in the root file
788 TFile file(fileName.Data(), "RECREATE");
789 fMisAlignArray->Write();
795 //_____________________________________________________________________________
796 void AliMUONGeometryTransformer::AddModuleTransformer(
797 AliMUONGeometryModuleTransformer* moduleTransformer)
799 /// Add the geometrymodule to the array
801 fModuleTransformers->AddAt(moduleTransformer,
802 moduleTransformer->GetModuleId());
805 //_____________________________________________________________________________
806 void AliMUONGeometryTransformer::AddMisAlignModule(Int_t moduleId,
807 const TGeoHMatrix& matrix)
809 /// Build AliAlignObjMatrix with module ID, its volumePaths
810 /// and the given delta transformation matrix
812 if ( ! fMisAlignArray )
813 fMisAlignArray = new TClonesArray("AliAlignObjMatrix", 200);
815 const AliMUONGeometryModuleTransformer* kTransformer
816 = GetModuleTransformer(moduleId);
817 if ( ! kTransformer ) {
818 AliErrorStream() << "Module " << moduleId << " not found." << endl;
823 TString path = kTransformer->GetVolumePath();
825 // Create mis align matrix
826 TClonesArray& refArray =*fMisAlignArray;
827 Int_t pos = fMisAlignArray->GetEntriesFast();
828 new (refArray[pos]) AliAlignObjMatrix(path.Data(), moduleId,
829 const_cast<TGeoHMatrix&>(matrix));
832 //_____________________________________________________________________________
833 void AliMUONGeometryTransformer::AddMisAlignDetElement(Int_t detElemId,
834 const TGeoHMatrix& matrix)
836 /// Build AliAlignObjMatrix with detection element ID, its volumePaths
837 /// and the given delta transformation matrix
839 if ( ! fMisAlignArray )
840 fMisAlignArray = new TClonesArray("AliAlignObjMatrix", 200);
842 const AliMUONGeometryDetElement* kDetElement
843 = GetDetElement(detElemId);
845 if ( ! kDetElement ) {
846 AliErrorStream() << "Det element " << detElemId << " not found." << endl;
851 TString path = kDetElement->GetVolumePath();
853 // Create mis align matrix
854 TClonesArray& refArray =*fMisAlignArray;
855 Int_t pos = fMisAlignArray->GetEntriesFast();
856 new(refArray[pos]) AliAlignObjMatrix(path.Data(), detElemId,
857 const_cast<TGeoHMatrix&>(matrix));
860 //_____________________________________________________________________________
861 void AliMUONGeometryTransformer::Global2Local(Int_t detElemId,
862 Float_t xg, Float_t yg, Float_t zg,
863 Float_t& xl, Float_t& yl, Float_t& zl) const
865 /// Transform point from the global reference frame (ALIC)
866 /// to the local reference frame of the detection element specified
869 const AliMUONGeometryModuleTransformer* kTransformer
870 = GetModuleTransformerByDEId(detElemId);
873 kTransformer->Global2Local(detElemId, xg, yg, zg, xl, yl, zl);
876 //_____________________________________________________________________________
877 void AliMUONGeometryTransformer::Global2Local(Int_t detElemId,
878 Double_t xg, Double_t yg, Double_t zg,
879 Double_t& xl, Double_t& yl, Double_t& zl) const
881 /// Transform point from the global reference frame (ALIC)
882 /// to the local reference frame of the detection element specified
885 const AliMUONGeometryModuleTransformer* kTransformer
886 = GetModuleTransformerByDEId(detElemId);
889 kTransformer->Global2Local(detElemId, xg, yg, zg, xl, yl, zl);
892 //_____________________________________________________________________________
893 void AliMUONGeometryTransformer::Local2Global(Int_t detElemId,
894 Float_t xl, Float_t yl, Float_t zl,
895 Float_t& xg, Float_t& yg, Float_t& zg) const
897 /// Transform point from the local reference frame of the detection element
898 /// specified by detElemId to the global reference frame (ALIC).
900 const AliMUONGeometryModuleTransformer* kTransformer
901 = GetModuleTransformerByDEId(detElemId);
904 kTransformer->Local2Global(detElemId, xl, yl, zl, xg, yg, zg);
907 //_____________________________________________________________________________
908 void AliMUONGeometryTransformer::Local2Global(Int_t detElemId,
909 Double_t xl, Double_t yl, Double_t zl,
910 Double_t& xg, Double_t& yg, Double_t& zg) const
912 /// Transform point from the local reference frame of the detection element
913 /// specified by detElemId to the global reference frame (ALIC).
915 const AliMUONGeometryModuleTransformer* kTransformer
916 = GetModuleTransformerByDEId(detElemId);
919 kTransformer->Local2Global(detElemId, xl, yl, zl, xg, yg, zg);
922 //_____________________________________________________________________________
923 const AliMUONGeometryModuleTransformer*
924 AliMUONGeometryTransformer::GetModuleTransformer(Int_t index, Bool_t warn) const
926 /// Return the geometry module specified by index
928 return GetModuleTransformerNonConst(index, warn);
931 //_____________________________________________________________________________
932 const AliMUONGeometryModuleTransformer*
933 AliMUONGeometryTransformer::GetModuleTransformerByDEId(Int_t detElemId,
936 /// Return the geometry module specified by index
939 Int_t index = AliMUONGeometryStore::GetModuleId(detElemId);
941 return GetModuleTransformer(index, warn);
944 //_____________________________________________________________________________
945 const AliMUONGeometryDetElement*
946 AliMUONGeometryTransformer::GetDetElement(Int_t detElemId, Bool_t warn) const
948 /// Return detection ellemnt with given detElemId
950 const AliMUONGeometryModuleTransformer* kTransformer
951 = GetModuleTransformerByDEId(detElemId, warn);
953 if (!kTransformer) return 0;
955 return kTransformer->GetDetElement(detElemId, warn);
958 //_____________________________________________________________________________
959 Bool_t AliMUONGeometryTransformer::HasDE(Int_t detElemId) const
961 /// Return true if detection element with given detElemId is defined
963 const AliMUONGeometryModuleTransformer* kTransformer
964 = GetModuleTransformerByDEId(detElemId, false);
966 if (!kTransformer) return false;
968 return ( kTransformer->GetDetElement(detElemId, false) != 0 );