virtual void CreateMaterials();
virtual void CreateGeometry() {} ///< No geometry is created
virtual void SetSensitiveVolumes() {} ///< No sensitive volumes are set
+ virtual void SetVolumes() {} ///< No volumes are set
virtual void SetTransformations() {} ///< No transformations are set
protected:
// Create geometry + envelopes
//
builder->CreateGeometry();
+ builder->SetVolumes();
if (!fAlign) builder->SetTransformations();
// Place module volumes and envelopes
// Get the builder
AliMUONVGeometryBuilder* builder
= (AliMUONVGeometryBuilder*)fGeometryBuilders->At(i);
-
- // Create detection elements from built geometry
- builder->CreateDetElements();
- }
+
+ // Update detection elements from built geometry
+ Bool_t create = ! fAlign;
+ builder->UpdateDetElements(create);
+ }
}
//_____________________________________________________________________________
// Load mapping as its info is used to define modules & DEs
LoadMapping();
- // Loop over geometry module
- for (Int_t moduleId = 0; moduleId < AliMpConstants::NofGeomModules(); ++moduleId ) {
+ if ( fModuleTransformers->GetEntriesFast() == 0 ) {
+ // Create modules only if they do not yet exist
+
+ // Loop over geometry module
+ for (Int_t moduleId = 0; moduleId < AliMpConstants::NofGeomModules(); ++moduleId ) {
- // Create geometry module transformer
- AliMUONGeometryModuleTransformer* moduleTransformer
- = new AliMUONGeometryModuleTransformer(moduleId);
- AddModuleTransformer(moduleTransformer);
- }
+ // Create geometry module transformer
+ AliMUONGeometryModuleTransformer* moduleTransformer
+ = new AliMUONGeometryModuleTransformer(moduleId);
+ AddModuleTransformer(moduleTransformer);
+ }
+ }
// Loop over detection elements
AliMpDEIterator it;
module->GetVolumePath());
if ( ! pnEntry ) {
AliErrorStream()
- << "Volume path for geometry module "
- << module->GetModuleId()
+ << "Volume path " << module->GetVolumePath().Data()
+ << " for geometry module " << module->GetModuleId() << " " << module
<< " not found in geometry." << endl;
}
else {
detElement->GetVolumePath());
if ( ! pnEntryDE ) {
AliErrorStream()
- << "Volume path for detection element "
- << detElement->GetId()
+ << "Volume path "
+ << detElement->GetVolumePath().Data()
+ << " for detection element " << detElement->GetId()
<< " not found in geometry." << endl;
}
else {
}
-
//______________________________________________________________________________
-void AliMUONSlatGeometryBuilder::SetTransformations()
+void AliMUONSlatGeometryBuilder::SetVolumes()
{
-/// Defines the transformations for the station345 chambers.
+/// Defines the volumes for the station345 chambers.
if (gAlice->GetModule("DIPO")) {
// if DIPO is preset, the whole station will be placed in DDIP volume
SetVolume(13, "SC09O", true);
SetVolume(14, "SC10I", true);
SetVolume(15, "SC10O", true);
+}
+
+
+//______________________________________________________________________________
+void AliMUONSlatGeometryBuilder::SetTransformations()
+{
+/// Defines the transformations for the station345 chambers.
// Stations 345 are not perpendicular to the beam axis
// See AliMUONConstants class
// methods
virtual void CreateGeometry();
+ virtual void SetVolumes();
virtual void SetTransformations();
virtual void SetSensitiveVolumes();
// }
}
+//______________________________________________________________________________
+void AliMUONSt1GeometryBuilder::SetVolumes()
+{
+/// Define the volumes for the station2 chambers.
+}
+
//______________________________________________________________________________
void AliMUONSt1GeometryBuilder::SetTransformations()
{
// methods
virtual void CreateGeometry();
+ virtual void SetVolumes();
virtual void SetTransformations();
virtual void SetSensitiveVolumes();
}
//______________________________________________________________________________
-void AliMUONSt1GeometryBuilderV2::SetTransformations()
+void AliMUONSt1GeometryBuilderV2::SetVolumes()
{
-/// Define the transformations for the station2 chambers.
+/// Define the volumes for the station2 chambers.
if (gAlice->GetModule("SHIL")) {
SetMotherVolume(0, "YOUT1");
SetVolume(0, "SC01", true);
SetVolume(1, "SC02", true);
+}
+
+//______________________________________________________________________________
+void AliMUONSt1GeometryBuilderV2::SetTransformations()
+{
+/// Define the transformations for the station2 chambers.
Double_t zpos1 = - AliMUONConstants::DefaultChamberZ(0);
SetTranslation(0, TGeoTranslation(0., 0., zpos1));
virtual void CreateMaterials();
virtual void CreateGeometry();
+ virtual void SetVolumes();
virtual void SetTransformations();
virtual void SetSensitiveVolumes();
}
//______________________________________________________________________________
-void AliMUONSt2GeometryBuilder::SetTransformations()
+void AliMUONSt2GeometryBuilder::SetVolumes()
{
-/// Defines the transformations for the station2 chambers.
+/// Defines the volumes for the station2 chambers.
// Define chamber volumes as virtual
SetVolume(2, "SC03", true);
SetVolume(3, "SC04", true);
+}
+
+//______________________________________________________________________________
+void AliMUONSt2GeometryBuilder::SetTransformations()
+{
+/// Defines the transformations for the station2 chambers.
Double_t zpos1 = - AliMUONConstants::DefaultChamberZ(2);
SetTranslation(2, TGeoTranslation(0., 0., zpos1));
// methods
virtual void CreateGeometry();
+ virtual void SetVolumes();
virtual void SetTransformations();
virtual void SetSensitiveVolumes();
}
//______________________________________________________________________________
-void AliMUONSt2GeometryBuilderV2::SetTransformations()
+void AliMUONSt2GeometryBuilderV2::SetVolumes()
{
-/// Defines the transformations for the station2 chambers.
+/// Defines the volumes for the station2 chambers.
if (gAlice->GetModule("SHIL")) {
SetMotherVolume(2, "YOUT1");
// Define chamber volumes as virtual
SetVolume(2, "SC03", true);
SetVolume(3, "SC04", true);
+}
+
+//______________________________________________________________________________
+void AliMUONSt2GeometryBuilderV2::SetTransformations()
+{
+/// Defines the transformations for the station2 chambers.
Double_t zpos1 = - AliMUONConstants::DefaultChamberZ(2);
SetTranslation(2, TGeoTranslation(0., 0., zpos1));
// methods
virtual void CreateGeometry();
+ virtual void SetVolumes();
virtual void SetTransformations();
virtual void SetSensitiveVolumes();
}
//______________________________________________________________________________
-void AliMUONTriggerGeometryBuilder::SetTransformations()
+void AliMUONTriggerGeometryBuilder::SetVolumes()
{
-/// Defines the transformations for the trigger chambers.
+/// Defines the volumes for the trigger chambers.
if (gAlice->GetModule("SHIL")) {
SetMotherVolume(16, "YOUT2");
SetVolume(17, "SC12");
SetVolume(18, "SC13");
SetVolume(19, "SC14");
+}
+
+//______________________________________________________________________________
+void AliMUONTriggerGeometryBuilder::SetTransformations()
+{
+/// Defines the transformations for the trigger chambers.
Double_t zpos1= AliMUONConstants::DefaultChamberZ(10);
SetTranslation(16, TGeoTranslation(0., 0., zpos1));
// methods
virtual void CreateGeometry();
+ virtual void SetVolumes();
virtual void SetTransformations();
virtual void SetSensitiveVolumes();
}
}
-
//______________________________________________________________________________
-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; i<fGeometryModules->GetEntriesFast(); i++) {
AliMUONGeometryModule* geometry
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
{
// methods
void SetReferenceFrame(const TGeoCombiTrans& referenceFrame);
void RebuildSVMaps(Bool_t withEnvelopes = true) const;
- void CreateDetElements() const;
+ void UpdateDetElements(Bool_t create) const;
/// Function to be overriden in a concrete chamber/station
/// geometry builder class.
/// usind the provided transformation.
virtual void CreateGeometry() = 0;
+ /// Function to be overriden in a concrete chamber/station
+ /// geometry class. \n
+ /// The volume name for each geometry module, its virtuality
+ /// and eventually the mother volume name should be defined
+ virtual void SetVolumes() = 0;
+
/// Function to be overriden in a concrete chamber/station
/// geometry class. \n
/// The transformation of each chamber(s) wrt ALICE