From 6d72374bf5e4bc4ed2a94ff17a689ac55182e0b6 Mon Sep 17 00:00:00 2001 From: ivana Date: Thu, 29 Nov 2001 16:25:34 +0000 Subject: [PATCH] added inheritance from TG4VPhysicsConstructor; all G4cout calls controlled by verbose level (defined in TG4Verbose) --- TGeant4/TG4PhysicsConstructorEM.cxx | 14 ++++++++++---- TGeant4/TG4PhysicsConstructorEM.h | 9 ++++++--- TGeant4/TG4PhysicsConstructorGeneral.cxx | 21 +++++++++++++++------ TGeant4/TG4PhysicsConstructorGeneral.h | 7 +++++-- TGeant4/TG4PhysicsConstructorMuon.cxx | 14 ++++++++++---- TGeant4/TG4PhysicsConstructorMuon.h | 9 ++++++--- TGeant4/TG4PhysicsConstructorOptical.cxx | 14 ++++++++++---- TGeant4/TG4PhysicsConstructorOptical.h | 7 +++++-- 8 files changed, 67 insertions(+), 28 deletions(-) diff --git a/TGeant4/TG4PhysicsConstructorEM.cxx b/TGeant4/TG4PhysicsConstructorEM.cxx index c15049f8dd4..1b2ec38ce54 100644 --- a/TGeant4/TG4PhysicsConstructorEM.cxx +++ b/TGeant4/TG4PhysicsConstructorEM.cxx @@ -23,10 +23,15 @@ //_____________________________________________________________________________ TG4PhysicsConstructorEM::TG4PhysicsConstructorEM(const G4String& name) - : G4VPhysicsConstructor(name) -{ + : TG4VPhysicsConstructor(name) { +// +} + +//_____________________________________________________________________________ +TG4PhysicsConstructorEM::TG4PhysicsConstructorEM(G4int verboseLevel, + const G4String& name) + : TG4VPhysicsConstructor(name, verboseLevel) { // - SetVerboseLevel(1); } //_____________________________________________________________________________ @@ -152,6 +157,7 @@ void TG4PhysicsConstructorEM::ConstructProcess() ConstructProcessForElectron(); ConstructProcessForPositron(); - if (verboseLevel>0) + if (VerboseLevel() > 0) { G4cout << "### Electromagnetic physics constructed." << G4endl; + } } diff --git a/TGeant4/TG4PhysicsConstructorEM.h b/TGeant4/TG4PhysicsConstructorEM.h index 6b7204cff6e..1193632c697 100644 --- a/TGeant4/TG4PhysicsConstructorEM.h +++ b/TGeant4/TG4PhysicsConstructorEM.h @@ -12,7 +12,8 @@ #ifndef TG4_PHYSICS_CONSTRUCTOR_EM_H #define TG4_PHYSICS_CONSTRUCTOR_EM_H -#include +#include "TG4VPhysicsConstructor.h" + #include #include #include @@ -22,10 +23,12 @@ #include #include -class TG4PhysicsConstructorEM: public G4VPhysicsConstructor +class TG4PhysicsConstructorEM: public TG4VPhysicsConstructor { public: - TG4PhysicsConstructorEM(const G4String& name = "EM"); + TG4PhysicsConstructorEM(const G4String& name = "EM"); + TG4PhysicsConstructorEM(G4int verboseLevel, + const G4String& name = "EM"); virtual ~TG4PhysicsConstructorEM(); protected: diff --git a/TGeant4/TG4PhysicsConstructorGeneral.cxx b/TGeant4/TG4PhysicsConstructorGeneral.cxx index 8031ada91be..f2e9626e4a0 100644 --- a/TGeant4/TG4PhysicsConstructorGeneral.cxx +++ b/TGeant4/TG4PhysicsConstructorGeneral.cxx @@ -24,10 +24,16 @@ //_____________________________________________________________________________ TG4PhysicsConstructorGeneral::TG4PhysicsConstructorGeneral(const G4String& name) - : G4VPhysicsConstructor(name) -{ + : TG4VPhysicsConstructor(name) { +// +} + +//_____________________________________________________________________________ +TG4PhysicsConstructorGeneral::TG4PhysicsConstructorGeneral( + G4int verboseLevel, + const G4String& name) + : TG4VPhysicsConstructor(name, verboseLevel) { // - SetVerboseLevel(1); } //_____________________________________________________________________________ @@ -59,10 +65,12 @@ void TG4PhysicsConstructorGeneral::ConstructProcess() if (aliDecayer) { TG4ExtDecayer* tg4Decayer = new TG4ExtDecayer(aliDecayer); // the tg4Decayer is deleted in G4Decay destructor - tg4Decayer->SetVerboseLevel(1); + tg4Decayer->VerboseLevel(VerboseLevel()); fDecayProcess.SetExtDecayer(tg4Decayer); - if (verboseLevel>0) G4cout << "### External decayer is set" << G4endl; + if (VerboseLevel() > 0) { + G4cout << "### External decayer is set" << G4endl; + } } theParticleIterator->reset(); @@ -81,6 +89,7 @@ void TG4PhysicsConstructorGeneral::ConstructProcess() TG4ProcessControlMap* processMap = TG4ProcessControlMap::Instance(); processMap->Add(&fDecayProcess, kDCAY); - if (verboseLevel>0) + if (VerboseLevel() > 0) { G4cout << "### General physics constructed." << G4endl; + } } diff --git a/TGeant4/TG4PhysicsConstructorGeneral.h b/TGeant4/TG4PhysicsConstructorGeneral.h index 424ee353106..c6f767fcc81 100644 --- a/TGeant4/TG4PhysicsConstructorGeneral.h +++ b/TGeant4/TG4PhysicsConstructorGeneral.h @@ -11,14 +11,17 @@ #ifndef TG4_PHYSICS_CONSTRUCTOR_GENERAL_H #define TG4_PHYSICS_CONSTRUCTOR_GENERAL_H -#include +#include "TG4VPhysicsConstructor.h" + #include #include -class TG4PhysicsConstructorGeneral: public G4VPhysicsConstructor +class TG4PhysicsConstructorGeneral: public TG4VPhysicsConstructor { public: TG4PhysicsConstructorGeneral(const G4String& name = "General"); + TG4PhysicsConstructorGeneral(G4int verboseLevel, + const G4String& name = "General"); virtual ~TG4PhysicsConstructorGeneral(); protected: diff --git a/TGeant4/TG4PhysicsConstructorMuon.cxx b/TGeant4/TG4PhysicsConstructorMuon.cxx index 14236808a19..d7a784262b8 100644 --- a/TGeant4/TG4PhysicsConstructorMuon.cxx +++ b/TGeant4/TG4PhysicsConstructorMuon.cxx @@ -33,10 +33,15 @@ //_____________________________________________________________________________ TG4PhysicsConstructorMuon::TG4PhysicsConstructorMuon(const G4String& name) - : G4VPhysicsConstructor(name) -{ + : TG4VPhysicsConstructor(name) { +// +} + +//_____________________________________________________________________________ +TG4PhysicsConstructorMuon::TG4PhysicsConstructorMuon(G4int verboseLevel, + const G4String& name) + : TG4VPhysicsConstructor(name, verboseLevel) { // - SetVerboseLevel(1); } //_____________________________________________________________________________ @@ -201,6 +206,7 @@ void TG4PhysicsConstructorMuon::ConstructProcess() ConstructProcessForTauPlus(); ConstructProcessForTauMinus(); - if (verboseLevel>0) + if (VerboseLevel() >0 ) { G4cout << "### Muon physics constructed." << G4endl; + } } diff --git a/TGeant4/TG4PhysicsConstructorMuon.h b/TGeant4/TG4PhysicsConstructorMuon.h index 79a327789a7..88fc8f4e974 100644 --- a/TGeant4/TG4PhysicsConstructorMuon.h +++ b/TGeant4/TG4PhysicsConstructorMuon.h @@ -11,7 +11,8 @@ #ifndef TG4_PHYSICS_CONSTRUCTOR_MUON_H #define TG4_PHYSICS_CONSTRUCTOR_MUON_H -#include +#include "TG4VPhysicsConstructor.h" + #include "G4MultipleScattering.hh" #include "G4MuBremsstrahlung.hh" #include "G4MuPairProduction.hh" @@ -20,10 +21,12 @@ #include "G4hIonisation.hh" #include -class TG4PhysicsConstructorMuon: public G4VPhysicsConstructor +class TG4PhysicsConstructorMuon: public TG4VPhysicsConstructor { public: - TG4PhysicsConstructorMuon(const G4String& name = "EM"); + TG4PhysicsConstructorMuon(const G4String& name = "Muon"); + TG4PhysicsConstructorMuon(G4int verboseLevel, + const G4String& name = "Muon"); virtual ~TG4PhysicsConstructorMuon(); protected: diff --git a/TGeant4/TG4PhysicsConstructorOptical.cxx b/TGeant4/TG4PhysicsConstructorOptical.cxx index 1c4481defd8..9ab25653ce4 100644 --- a/TGeant4/TG4PhysicsConstructorOptical.cxx +++ b/TGeant4/TG4PhysicsConstructorOptical.cxx @@ -21,10 +21,15 @@ //_____________________________________________________________________________ TG4PhysicsConstructorOptical::TG4PhysicsConstructorOptical(const G4String& name) - : G4VPhysicsConstructor(name) -{ + : TG4VPhysicsConstructor(name) { +// +} + +//_____________________________________________________________________________ +TG4PhysicsConstructorOptical::TG4PhysicsConstructorOptical(G4int verboseLevel, + const G4String& name) + : TG4VPhysicsConstructor(name, verboseLevel) { // - SetVerboseLevel(1); } //_____________________________________________________________________________ @@ -107,7 +112,8 @@ void TG4PhysicsConstructorOptical::ConstructProcess() mcMap->Add(theRayleighScatteringProcess, kPRayleigh); mcMap->Add(theBoundaryProcess, kPLightScattering); - if (verboseLevel>0) + if (VerboseLevel() > 0) { G4cout << "### " << namePhysics << " physics constructed." << G4endl; + } } diff --git a/TGeant4/TG4PhysicsConstructorOptical.h b/TGeant4/TG4PhysicsConstructorOptical.h index a12b2208f81..ac4d536100b 100644 --- a/TGeant4/TG4PhysicsConstructorOptical.h +++ b/TGeant4/TG4PhysicsConstructorOptical.h @@ -11,13 +11,16 @@ #ifndef TG4_PHYSICS_CONSTRUCTOR_OPTICAL_H #define TG4_PHYSICS_CONSTRUCTOR_OPTICAL_H -#include +#include "TG4VPhysicsConstructor.h" + #include -class TG4PhysicsConstructorOptical: public G4VPhysicsConstructor +class TG4PhysicsConstructorOptical: public TG4VPhysicsConstructor { public: TG4PhysicsConstructorOptical(const G4String& name = "Optical"); + TG4PhysicsConstructorOptical(G4int verboseLevel, + const G4String& name = "Optical"); virtual ~TG4PhysicsConstructorOptical(); protected: -- 2.43.0