From 55ebdd9f44f659a08f16cc1388cca72a77e05b90 Mon Sep 17 00:00:00 2001 From: ivana Date: Tue, 23 Jan 2001 15:46:14 +0000 Subject: [PATCH] updated for AliFiles changes; new method SwitchDetOnPPR() added --- AliGeant4/AliModulesComposition.cxx | 48 ++++++++++++++++++++--------- 1 file changed, 33 insertions(+), 15 deletions(-) diff --git a/AliGeant4/AliModulesComposition.cxx b/AliGeant4/AliModulesComposition.cxx index 81b3e1f7008..f140a0855a4 100644 --- a/AliGeant4/AliModulesComposition.cxx +++ b/AliGeant4/AliModulesComposition.cxx @@ -10,6 +10,7 @@ #include "AliDetSwitch.h" #include "AliMagneticField.h" #include "AliGlobals.h" +#include "AliFiles.h" #include "TG4GeometryManager.h" #include "TG4XMLGeometryGenerator.h" @@ -108,7 +109,7 @@ void AliModulesComposition::ConstructModules() // one module constructions G4int nofDets = fModuleConstructionVector.entries(); for (G4int i=0; iConfigure(); + fModuleConstructionVector[i]->Configure(*AliFiles::Instance()); } if (fForceAllLVSensitive) SetAllLVSensitiveToModules(fForceAllLVSensitive); @@ -124,7 +125,7 @@ void AliModulesComposition::ConstructModules() // more modules construction G4int nofModules = fMoreModulesConstruction->GetNofModules(); if (nofModules>0) { - fMoreModulesConstruction->Configure(); + fMoreModulesConstruction->Configure(*AliFiles::Instance()); if (fForceAllLVSensitive) SetAllLVSensitiveToModules(fForceAllLVSensitive); // override the setAllLVSensitive by Config.in macro @@ -229,10 +230,11 @@ void AliModulesComposition::SwitchDetOn(G4String moduleNameVer) G4int nofDets = fDetSwitchVector.entries(); if (moduleNameVer == "ALL") { - for (G4int id=0; idGetDefaultVersion(); - fDetSwitchVector[id]->SwitchOn(defaultVersion); - } + for (G4int id=0; idSwitchOnDefault(); + } + else if (moduleNameVer == "PPR") { + for (G4int id=0; idSwitchOnPPR(); + AliFiles::Instance()->SetMacroName("ConfigPPR"); } else if (moduleNameVer == "NONE") { for (G4int id=0; idGetDetName(); + if (iDetName == moduleName) { + fDetSwitchVector[id]->SwitchOnPPR(); + return; + } + } + AliGlobals::Exception( + "AliModulesComposition: Wrong detector name for " + moduleName + "."); +} + void AliModulesComposition::SwitchDetOff(G4String moduleName) { // Switchs off module specified by name. @@ -354,20 +373,19 @@ void AliModulesComposition::GenerateXMLGeometry() const G4VPhysicalVolume* world = AliSingleModuleConstruction::GetWorld(); - // set filename + // XML filename + // according to last switched detector G4String detName; - G4String version = "v"; - G4String filePath= getenv("AG4_INSTALL"); - filePath = filePath + "/xml/"; + G4int version; for (G4int i=fDetSwitchVector.entries()-1; i>=0; i--) { - G4int versionNumber = fDetSwitchVector[i]->GetSwitchedVersion(); - if (versionNumber > -1) { + version = fDetSwitchVector[i]->GetSwitchedVersion(); + if (version > -1) { detName = fDetSwitchVector[i]->GetDetName(); - AliGlobals::AppendNumberToString(version, versionNumber); - filePath = filePath + detName + version + ".xml"; break; } } + G4String filePath + = AliFiles::Instance()->GetXMLFilePath(detName, version); // set top volume name G4String topName = world->GetName() + "_comp"; @@ -388,7 +406,7 @@ void AliModulesComposition::GenerateXMLGeometry() const xml.CloseFile(); // set verbose - G4cout << "File " << detName << version << ".xml has been generated." + G4cout << "File " << detName << "v" << version << ".xml has been generated." << G4endl; } -- 2.43.0