#include "AliMUONGeometryConstituent.h"
#include "AliModule.h"
#include "AliLog.h"
+#include "AliRun.h"
+
ClassImp(AliMUONGeometryBuilder)
// ---
// Do not apply global transformation
- // if mother volume != ALIC
+ // if mother volume was already placed in
+ // the new system of coordinates (that is MUON in negative Z)
// (as it is applied on the mother volume)
TGeoHMatrix transform(matrix);
- if (mName != TString("ALIC"))
+ if (mName == TString("DDIP"))
transform = fGlobalTransformation.Inverse() * transform;
// Decompose transformation
TGeoHMatrix total
= fGlobalTransformation *
(*geometry->GetTransformation()) *
- fGlobalTransformation.Inverse() *
(*localTransform);
- // !! The local detection element frame is
- // defined wrt the new ALICE coordinate system:
- // TGL = Tglobal * Tchamber * Tde
- // = Tglobal * Tchamber * Tglobal.inv * Tglobal * Tde
- // = (Tglobal * Tchamber * Tglobal.inv) * (Tglobal * Tde)
- // = Ttotal * Tde'
// Convert TGeoHMatrix to TGeoCombiTrans
TGeoCombiTrans globalTransform(localTransform->GetName());
builder->SetTransformations();
}
- // Place envelopes
+ // Place module volumes and envelopes
//
for (Int_t j=0; j<builder->NofGeometries(); j++) {
AliMUONGeometryModule* geometry = builder->Geometry(j);
+
+ // Place the module volume
+ if ( !geometry->IsVirtual() ) {
+ TGeoHMatrix total
+ = fGlobalTransformation *
+ (*geometry->GetTransformation());
+
+ PlaceVolume(geometry->GetVolume(), geometry->GetMotherVolume(),
+ 1, total, 0, 0, "ONLY");
+ }
// Loop over envelopes
const TObjArray* kEnvelopes = geometry->GetEnvelopeStore()->GetEnvelopes();
// Tglobal * Tch * Tenv
// Compound chamber transformation with the envelope one
- TGeoHMatrix total
- = fGlobalTransformation *
- (*geometry->GetTransformation()) *
- (*kEnvTrans);
- PlaceVolume(env->GetName(), geometry->GetMotherVolume(),
- env->GetCopyNo(), total, 0, 0, only);
+ if (geometry->IsVirtual()) {
+ TGeoHMatrix total
+ = fGlobalTransformation *
+ (*geometry->GetTransformation()) *
+ (*kEnvTrans);
+ PlaceVolume(env->GetName(), geometry->GetMotherVolume(),
+ env->GetCopyNo(), total, 0, 0, only);
+ }
+ else {
+ TGeoHMatrix total
+ = (*kEnvTrans);
+ PlaceVolume(env->GetName(), geometry->GetVolume(),
+ env->GetCopyNo(), total, 0, 0, only);
+ }
}
if (env->IsVirtual() && env->GetConstituents()->GetEntriesFast() > 0 ) {
= (AliMUONGeometryConstituent*)env->GetConstituents()->At(l);
// Compound chamber transformation with the envelope one + the constituent one
- TGeoHMatrix total
- = fGlobalTransformation *
- (*geometry->GetTransformation()) *
- (*kEnvTrans) *
- (*constituent->GetTransformation());
-
- PlaceVolume(constituent->GetName(), geometry->GetMotherVolume(),
- constituent->GetCopyNo(), total,
- constituent->GetNpar(), constituent->GetParam(), only);
+ if (geometry->IsVirtual()) {
+ TGeoHMatrix total
+ = fGlobalTransformation *
+ (*geometry->GetTransformation()) *
+ (*kEnvTrans) *
+ (*constituent->GetTransformation());
+
+ PlaceVolume(constituent->GetName(), geometry->GetMotherVolume(),
+ constituent->GetCopyNo(), total,
+ constituent->GetNpar(), constituent->GetParam(), only);
+ }
+ else {
+ TGeoHMatrix total
+ = (*kEnvTrans) *
+ (*constituent->GetTransformation());
+
+ PlaceVolume(constituent->GetName(), geometry->GetVolume(),
+ constituent->GetCopyNo(), total,
+ constituent->GetNpar(), constituent->GetParam(), only);
+ }
}
}
} // end of loop over envelopes
AliMUONVGeometryBuilder* builder
= (AliMUONVGeometryBuilder*)fGeometryBuilders->At(i);
+ // Read alignement data if geometry is read from Root file
+ if (gAlice->IsRootGeometry()) {
+ fAlign = true;
+ builder->ReadTransformations();
+ }
+
// Set sesitive volumes with each builder
builder->SetSensitiveVolumes();
+
// Read sensitive volume map from a file
builder->ReadSVMap();
if (!fAlign) builder->FillTransformations();