#include "TG4ModularPhysicsList.h"
#include "TG4ParticlesManager.h"
#include "TG4G3PhysicsManager.h"
+#include "TG4PhysicsConstructorGeneral.h"
#include "TG4PhysicsConstructorEM.h"
-#include "TG4PhysicsConstructorOptical.h"
+#include "TG4PhysicsConstructorMuon.h"
#include "TG4PhysicsConstructorHadron.h"
+#include "TG4PhysicsConstructorIon.h"
+#include "TG4PhysicsConstructorOptical.h"
#include "TG4PhysicsConstructorSpecialCuts.h"
#include "TG4PhysicsConstructorSpecialControls.h"
#include "TG4GeometryServices.h"
#include "AliDecayer.h"
#include <G4ParticleDefinition.hh>
+#include <G4OpBoundaryProcess.hh>
#include <G4VProcess.hh>
#include <G3MedTable.hh>
//_____________________________________________________________________________
TG4PhysicsManager::TG4PhysicsManager(TG4ModularPhysicsList* physicsList)
- : fPhysicsList(physicsList),
+ : TG4Verbose("physicsManager"),
+ fMessenger(this),
+ fPhysicsList(physicsList),
fDecayer(0),
fSetEMPhysics(true),
- fSetOpticalPhysics(false),
+ fSetMuonPhysics(true),
fSetHadronPhysics(false),
+ fSetOpticalPhysics(false),
fSetSpecialCutsPhysics(false),
fSetSpecialControlsPhysics(false)
}
//_____________________________________________________________________________
-TG4PhysicsManager::TG4PhysicsManager(){
+TG4PhysicsManager::TG4PhysicsManager()
+ : TG4Verbose("physicsManager"),
+ fMessenger(this) {
//
- delete fDecayer;
- delete fParticlesManager;
- delete fG3PhysicsManager;
}
//_____________________________________________________________________________
-TG4PhysicsManager::TG4PhysicsManager(const TG4PhysicsManager& right) {
+TG4PhysicsManager::TG4PhysicsManager(const TG4PhysicsManager& right)
+ : TG4Verbose("physicsManager"),
+ fMessenger(this) {
//
TG4Globals::Exception(
"Attempt to copy TG4PhysicsManager singleton.");
//_____________________________________________________________________________
TG4PhysicsManager::~TG4PhysicsManager() {
//
+ delete fDecayer;
+ delete fParticlesManager;
+ delete fG3PhysicsManager;
}
// operators
*fG3PhysicsManager->GetControlVector());
medium->SetLimits(limits);
- // add verbose
- G4cout << "TG4PhysicsManager::GstparCut: new TG4Limits() for medium "
- << itmed << " has been created." << G4endl;
+ if (VerboseLevel() > 1) {
+ G4cout << "TG4PhysicsManager::GstparCut: new TG4Limits() for medium "
+ << itmed << " has been created." << G4endl;
+ }
}
// add units
*fG3PhysicsManager->GetControlVector());
medium->SetLimits(limits);
- // add verbose
- G4cout << "TG4PhysicsManager::GstparControl: new TG4Limits() for medium"
- << itmed << " has been created." << G4endl;
+ if (VerboseLevel() > 1) {
+ G4cout << "TG4PhysicsManager::GstparControl: new TG4Limits() for medium"
+ << itmed << " has been created." << G4endl;
+ }
}
// set parameter
// and registeres them in the modular physics list.
// ---
+ // general physics
+ fPhysicsList->RegisterPhysics(
+ new TG4PhysicsConstructorGeneral(VerboseLevel()));
+
// electromagnetic physics
if (fSetEMPhysics)
- fPhysicsList->RegisterPhysics(new TG4PhysicsConstructorEM());
+ fPhysicsList->RegisterPhysics(
+ new TG4PhysicsConstructorEM(VerboseLevel()));
- // optical physics
- if (fSetOpticalPhysics)
- fPhysicsList->RegisterPhysics(new TG4PhysicsConstructorOptical());
+ // muon physics
+ if (fSetMuonPhysics && fSetEMPhysics)
+ fPhysicsList->RegisterPhysics(
+ new TG4PhysicsConstructorMuon(VerboseLevel()));
// hadron physics
- if (fSetHadronPhysics)
- fPhysicsList->RegisterPhysics(new TG4PhysicsConstructorHadron());
+ if (fSetEMPhysics || fSetHadronPhysics) {
+ fPhysicsList->RegisterPhysics(
+ new TG4PhysicsConstructorIon(
+ VerboseLevel(), fSetEMPhysics, fSetHadronPhysics));
+ fPhysicsList->RegisterPhysics(
+ new TG4PhysicsConstructorHadron(
+ VerboseLevel(), fSetEMPhysics, fSetHadronPhysics));
+ }
+
+ // optical physics
+ if (fSetOpticalPhysics)
+ fPhysicsList->RegisterPhysics(
+ new TG4PhysicsConstructorOptical(VerboseLevel()));
+ // special processes
if (fSetSpecialCutsPhysics)
- fPhysicsList->RegisterPhysics(new TG4PhysicsConstructorSpecialCuts());
+ fPhysicsList->RegisterPhysics(
+ new TG4PhysicsConstructorSpecialCuts(VerboseLevel()));
if (fSetSpecialControlsPhysics)
- fPhysicsList->RegisterPhysics(new TG4PhysicsConstructorSpecialControls());
+ fPhysicsList->RegisterPhysics(
+ new TG4PhysicsConstructorSpecialControls(VerboseLevel()));
+
+ // warn about not allowed combinations
+ if (fSetMuonPhysics && !fSetEMPhysics) {
+ G4String text = "TG4PhysicsManager::CreatePhysicsConstructors:\n";
+ text = text + " Muon physics cannot be constructed without EM physics.\n";
+ text = text + " SetMuon control was ignored.";
+ TG4Globals::Warning(text);
+ }
// all created physics constructors are deleted
// in the TG4ModularPhysicsList destructor
return fProcessMCMap.GetMCProcess(process);
}
+//_____________________________________________________________________________
+AliMCProcess TG4PhysicsManager::GetOpBoundaryStatus(const G4VProcess* process)
+{
+// Returns the AliMCProcess code according to the OpBoundary process
+// status.
+// ---
+
+ if (!process) return kPNoProcess;
+
+#ifdef TGEANT4_DEBUG
+ G4OpBoundaryProcess* opBoundary
+ = dynamic_cast<G4OpBoundaryProcess*>(process);
+
+ if (!opBoundary)
+ TG4Globals::Exception(
+ "TG4PhysicsManager::GetOpBoundaryStatus: Wrong process type.");
+ return kPNoProcess;
+ }
+
+ return opBoundary;
+#else
+ G4OpBoundaryProcess* opBoundary = (G4OpBoundaryProcess*)process;
+#endif
+
+ switch (opBoundary->GetStatus()) {
+ // reflection
+ case FresnelReflection:
+ case TotalInternalReflection:
+ case LambertianReflection:
+ case LobeReflection:
+ case SpikeReflection:
+ case BackScattering:
+ return kPLightReflection;
+ ;;
+
+ // refraction
+ case FresnelRefraction:
+ return kPLightRefraction;
+ ;;
+
+ // absorption
+ case Absorption:
+ case Detection:
+ return kPLightAbsorption;
+ ;;
+ }
+
+ // should not happen
+ return kPNoProcess;
+}
+