40 #include <Riostream.h>
41 #include <TObjArray.h>
43 #include <TGeoMatrix.h>
44 #include <TVirtualMC.h>
62 fGeometryModules->SetOwner(kFALSE);
64 for (Int_t i=0; i<nofModules; i++ )
137 const TString& volName, Int_t detElemId)
const
146 Int_t nofDaughters = TVirtualMC::GetMC()->NofVolDaughters(volName);
147 if (nofDaughters == 0) {
150 Ssiz_t npos1 = path0.Last(
'/')+1;
151 Ssiz_t npos2 = path0.Last(
'_');
152 TString volName0(path0(npos1, npos2-npos1));
157 ! svMap->
Get(path0) ) {
162 svMap->
Add(path0, detElemId);
167 for (Int_t i=0; i<nofDaughters; i++) {
168 Int_t copyNo = TVirtualMC::GetMC()->VolDaughterCopyNo(volName, i);
169 TString newName = TVirtualMC::GetMC()->VolDaughterName(volName, i);
171 TString path = path0;
174 MapSV(path, newName, detElemId);
193 if ( geometry->
GetModuleId() == moduleId)
return geometry;
208 AliFatal(Form(
"Module geometry %d is not defined", moduleId));
224 AliFatal(Form(
"Geometry %d is not defined", moduleId));
252 const TGeoTranslation& translation)
260 AliFatal(Form(
"Geometry %d is not defined", moduleId));
274 const TGeoTranslation& translation,
275 const TGeoRotation& rotation)
283 AliFatal(Form(
"Geometry %d is not defined", moduleId));
287 TGeoCombiTrans transformation
288 = TGeoCombiTrans(translation, rotation);
299 const TString& volumeName,
307 if ( path ==
"" ) path =
"/ALIC_1";
317 const TString& volumeName)
321 TString motherVolumeName =
ComposePath(volumeName, 1);
324 if ( path ==
"" ) path =
"/ALIC_1";
325 path.Insert(7, motherVolumeName);
336 const TGeoCombiTrans& referenceFrame)
372 for (Int_t j=0; j<envelopes->GetEntriesFast(); j++) {
377 if ( envelope->GetUniqueID() == 0)
continue;
380 Int_t detElemId = envelope->GetUniqueID();
390 detElements->
Add(detElemId, detElement);
399 TGeoHMatrix globalTransform
435 for (Int_t j=0; j<envelopes->GetEntriesFast(); j++) {
440 if ( envelope->GetUniqueID() == 0 )
continue;
447 if ( ! withEnvelopes && geometry->
IsVirtual() ) {
450 std::string::size_type vPathPos = path0.find(vPath);
451 if ( vPathPos != std::string::npos )
452 path0.erase(vPathPos, vPath.size());
455 if ( ! withEnvelopes && envelope->
IsVirtual()) {
456 std::string eName = envelope->GetName();
458 std::string::size_type ePathPos = path0.find(ePath);
459 if ( ePathPos != std::string::npos )
460 path0.erase(ePathPos, ePath.size());
464 MapSV(path0, envelope->GetName(), envelope->GetUniqueID());
466 for (Int_t k=0; k<envelope->
GetConstituents()->GetEntriesFast(); k++) {
469 TString path = path0;
471 MapSV(path, constituent->GetName(), envelope->GetUniqueID());
void SetIsVirtual(Bool_t isVirtual)
Set virtuality (true if module is not represented by a real volume)
const TObjArray * GetConstituents() const
Abstract base class for geometry construction per module(s)
AliMUONStringIntMap * GetSVMap() const
Return sensitive volume map.
Int_t GetModuleId() const
Return module ID.
TGeoHMatrix ConvertTransform(const TGeoHMatrix &transform) const
AliMUONGeometryEnvelopeStore * GetEnvelopeStore() const
Return envelopes associated with this module.
void SetMotherVolume(Int_t moduleId, const TString &volumeName)
Int_t GetCopyNo() const
Return copy number.
void UpdateDetElements(Bool_t create) const
Int_t GetModuleId(const TString &envName) const
virtual ~AliMUONVGeometryBuilder()
void SetTransformation(Int_t moduleId, const TGeoTranslation &translation, const TGeoRotation &rotation)
static Int_t GetGeomModuleId(Int_t detElemId, Bool_t warn=true)
void SetVolumePath(const TString &volumePath)
AliMUONStringIntMap * GetSVMap(Int_t moduleId) const
TGeoCombiTrans fReferenceFrame
the transformation from the builder reference frame to that of the transform
void SetReferenceFrame(const TGeoCombiTrans &referenceFrame)
TString GetVolumePath() const
Return the full path of the aligned volume or envelope in geometry.
AliMUONVGeometryBuilder()
void SetVolumePath(const TString &volumePath)
Set the full path of the aligned volume or envelope in geometry.
AliMUONGeometryModuleTransformer * GetTransformer() const
Return transformer.
void SetTransformation(const TGeoCombiTrans &transform)
Substitutes map <string, int> which ALICE does not allow to use.
void SetGlobalTransformation(const TGeoHMatrix &transform, Bool_t warn=true)
void SetTranslation(Int_t moduleId, const TGeoTranslation &translation)
TString ComposePath(const TString &volName, Int_t copyNo) const
AliMUONGeometryModule * GetGeometry(Int_t moduleId) const
TString GetVolumePath() const
Return the full path of aligned module volume or envelope in geometry.
AliMUONGeometryEnvelope * FindEnvelope(const TString &name) const
Int_t Get(const TString &first) const
const TGeoCombiTrans * GetTransformation() const
Store for temporary volumes envelopes.
Int_t GetCopyNo() const
Return copy number.
Geometry envelope helper class.
static TGeoHMatrix Multiply(const TGeoMatrix &m1, const TGeoMatrix &m2)
TObject * GetValue(Int_t keyFirst, Int_t keySecond) const
TGeoHMatrix ConvertDETransform(const TGeoHMatrix &transform) const
void Add(Int_t keyFirst, Int_t keySecond, TObject *object)
void MapSV(const TString &path0, const TString &volName, Int_t detElemId) const
virtual void Clear(Option_t *="")
AliMUONGeometryEnvelopeStore * GetEnvelopes(Int_t moduleId) const
Helper class for definititon of an assembly of volumes.
TObjArray * fGeometryModules
the modules geometries that will be built by this builder
Bool_t IsVirtual() const
Return true if module is not represented by a real volume.
void SetReferenceFrame(const TGeoCombiTrans &referenceFrame)
void SetVolume(Int_t moduleId, const TString &volumeName, Bool_t isVirtual=false)
void SetLocalTransformation(const TGeoHMatrix &transform, Bool_t warn=true)
Bool_t Add(const TString &first, Int_t second)
Geometry parameters for detector module.
Bool_t IsVirtual() const
Return true if envelope is virtual.
void RebuildSVMaps(Bool_t withEnvelopes=true) const
Class for storing detection element transformations.
Bool_t IsSensitiveVolume(Int_t volId) const
const TObjArray * GetEnvelopes() const
Helper class making Root persistent TExMap.