From 67d736ee0324e3845a461a103931c09a70553575 Mon Sep 17 00:00:00 2001 From: hristov Date: Wed, 19 May 2004 12:56:08 +0000 Subject: [PATCH] Modifications needed by Geant4 (I.Hrivnacova) --- STEER/AliRun.cxx | 8 ++++---- macros/g4ConfigCommon.C | 9 +++++---- macros/g4menu.C | 31 +++++++++++++++++++++++++++++++ 3 files changed, 40 insertions(+), 8 deletions(-) diff --git a/STEER/AliRun.cxx b/STEER/AliRun.cxx index c915d254f1e..d3eeaf5e748 100644 --- a/STEER/AliRun.cxx +++ b/STEER/AliRun.cxx @@ -541,7 +541,8 @@ void AliRun::InitMC(const char *setup) return; } - fMCApp=new AliMC(GetName(),GetTitle()); + if (!fMCApp) + fMCApp=new AliMC(GetName(),GetTitle()); gROOT->LoadMacro(setup); gInterpreter->ProcessLine(fConfigFunction.Data()); @@ -552,9 +553,6 @@ void AliRun::InitMC(const char *setup) fNdets = fModules->GetLast()+1; - // Added also after in case of interactive initialisation of modules - fNdets = fModules->GetLast()+1; - TIter next(fModules); for(Int_t i=0; iAdd(mod,fRunLoader->GetEventFolder()->GetName()); Modules()->Add(mod); + + fNdets++; } diff --git a/macros/g4ConfigCommon.C b/macros/g4ConfigCommon.C index b4c90308b0e..5c09b8995e3 100644 --- a/macros/g4ConfigCommon.C +++ b/macros/g4ConfigCommon.C @@ -149,7 +149,6 @@ void ConfigCommon(Bool_t interactiveSetup) // Exclude detectors with temporary problem iCRT = 0; iEMCAL = 0; - iFMD = 0; // END OF ONLY FOR GEANT4 @@ -204,7 +203,7 @@ void ConfigCommon(Bool_t interactiveSetup) { //=================== SHIL parameters ============================ - AliSHIL *SHIL = new AliSHILv2("SHIL", "Shielding"); + AliSHIL *SHIL = new AliSHILv2("SHIL", "Shielding Version 2"); } @@ -293,8 +292,8 @@ void ConfigCommon(Bool_t interactiveSetup) AliTPC *TPC = new AliTPCv2("TPC", "Default"); // All sectors included - TPC->SetSecAL(-1); TPC->SetSecAU(-1); + TPC->SetSecAL(-1); } @@ -307,7 +306,7 @@ void ConfigCommon(Bool_t interactiveSetup) if (iRICH) { //=================== RICH parameters =========================== - AliRICH *RICH = new AliRICHv3("RICH", "normal RICH"); + AliRICH *RICH = new AliRICHv1("RICH", "normal RICH"); } @@ -400,6 +399,8 @@ void ConfigCommon(Bool_t interactiveSetup) else AliRunConfiguration::SwitchHoles(kFALSE); } + + cout << "End of g4ConfigCommon.C" << endl; } Float_t EtaToTheta(Float_t arg){ diff --git a/macros/g4menu.C b/macros/g4menu.C index 0f8eb4f2a42..fe7f07a1b4d 100644 --- a/macros/g4menu.C +++ b/macros/g4menu.C @@ -31,6 +31,8 @@ void g4menu() menu->AddButton("Run", "gAlice->Run()", "Process Alice run"); menu->AddButton("Geant4", "CreateGeant4()", "Create Geant4 only (without initializing AliRun)"); menu->AddButton("Geant4UI", "StartGeant4UI()","Go to Geant4 Interactive session"); + menu->AddButton("XML", "GenerateXML()","Generate XML (AGDD) file with geometry description"); + menu->AddButton("Quit", "Quit()", "Quit aliroot"); gROOT->SaveContext(); menu->Show(); } @@ -73,4 +75,33 @@ void StartGeant4UI() else { cout << "Monte Carlo has not been yet created." << endl; } +} + +void GenerateXML() +{ + if (gMC) { + // release Root terminal control + + // go into non-raw term mode + //Getlinem(kCleanUp, 0); + + // add test if gMC is TGeant4 + TGeant4* g4 = (TGeant4*)gMC; + + g4->ProcessGeantCommand("/xml/generateAGDD"); + + // new Root prompt + //Getlinem(kInit, ((TRint*)gROOT->GetApplication())->GetPrompt()); + } + else { + cout << "Monte Carlo has not been yet created." << endl; + } +} + +void Quit() +{ + delete gAlice->GetRunLoader(); + delete gAlice; + + exit(0); } -- 2.31.1