00001 #include "DsPhysConsGeneral.h"
00002
00003 #include "GaudiKernel/DeclareFactoryEntries.h"
00004
00005 DECLARE_TOOL_FACTORY(DsPhysConsGeneral);
00006
00007 DsPhysConsGeneral::DsPhysConsGeneral(const std::string& type,
00008 const std::string& name,
00009 const IInterface* parent)
00010 : GiGaPhysConstructorBase(type,name,parent)
00011 {
00012 declareProperty("LowProdCut", m_lowProdCut=250*eV,
00013 "Lower bound on production energy");
00014 declareProperty("HighProdCut", m_highProdCut=100*GeV,
00015 "Upper bound on production energy");
00016
00017 declareProperty("GammaCut",m_gammaCut=1.0*mm,
00018 "Cut for gammas");
00019 declareProperty("ElectronCut",m_electronCut=100.0*micrometer,
00020 "Cut for electrons");
00021 declareProperty("PositronCut", m_positronCut=100.0*micrometer,
00022 "Cut for positrons");
00023 }
00024
00025 DsPhysConsGeneral::~DsPhysConsGeneral()
00026 {
00027 }
00028
00029 #include "G4ParticleTypes.hh"
00030 #include "G4BosonConstructor.hh"
00031 #include "G4LeptonConstructor.hh"
00032 #include "G4MesonConstructor.hh"
00033 #include "G4BaryonConstructor.hh"
00034 #include "G4IonConstructor.hh"
00035 #include "G4ShortLivedConstructor.hh"
00036 #include "G4Decay.hh"
00037 #include "G4RadioactiveDecay.hh"
00038 #include "DsG4RadioactiveDecay.hh"
00039 #include "G4ProcessManager.hh"
00040 #include "G4ProductionCutsTable.hh"
00041 #include "G4ParticlePropertyTable.hh"
00042
00043 void DsPhysConsGeneral::ConstructParticle()
00044 {
00045 {
00046 G4BosonConstructor con;
00047 con.ConstructParticle();
00048 }
00049 {
00050 G4LeptonConstructor con;
00051 con.ConstructParticle();
00052 }
00053 {
00054
00055
00056
00057
00058 G4PionPlus::PionPlusDefinition();
00059 G4PionMinus::PionMinusDefinition();
00060 G4PionZero::PionZeroDefinition();
00061 G4KaonPlus::KaonPlusDefinition();
00062 G4KaonMinus::KaonMinusDefinition();
00063 G4Eta::EtaDefinition();
00064 G4EtaPrime::EtaPrimeDefinition();
00065 G4KaonZero::KaonZeroDefinition();
00066 G4AntiKaonZero::AntiKaonZeroDefinition();
00067 G4KaonZeroLong::KaonZeroLongDefinition();
00068 G4KaonZeroShort::KaonZeroShortDefinition();
00069 }
00070 {
00071 G4BaryonConstructor con;
00072 con.ConstructParticle();
00073 }
00074 {
00075 G4IonConstructor con;
00076 con.ConstructParticle();
00077 }
00078
00079 {
00080 G4ShortLivedConstructor con;
00081 con.ConstructParticle();
00082 }
00083
00085 G4ParticlePropertyTable* propTable = G4ParticlePropertyTable::GetParticlePropertyTable();
00086 assert(propTable);
00087 G4ParticlePropertyData* photonData = propTable->GetParticleProperty(G4OpticalPhoton::Definition());
00088 assert(photonData);
00089 photonData->SetPDGEncoding(20022);
00090 photonData->SetAntiPDGEncoding(20022);
00091 if(propTable->SetParticleProperty(*photonData))
00092 info() << "Set PDG code for opticalphoton to " << G4OpticalPhoton::Definition()->GetPDGEncoding() << endreq;
00093 else
00094 warning() << "Failed to reset PDG code on opticalphoton.. it's still set to "
00095 << G4OpticalPhoton::Definition()->GetPDGEncoding() << endreq;
00096 }
00097
00098 void DsPhysConsGeneral::ConstructProcess()
00099 {
00100
00101
00102
00103
00104 G4Decay* theDecayProcess = new G4Decay();
00105 theParticleIterator->reset();
00106 while( (*theParticleIterator)() ) {
00107 G4ParticleDefinition* particle = theParticleIterator->value();
00108 G4ProcessManager* pmanager = particle->GetProcessManager();
00109 if (theDecayProcess->IsApplicable(*particle)) {
00110 pmanager->AddDiscreteProcess(theDecayProcess);
00111 pmanager ->SetProcessOrdering(theDecayProcess, idxPostStep);
00112 pmanager ->SetProcessOrdering(theDecayProcess, idxAtRest);
00113 }
00114 }
00115
00116 const G4IonTable* theIonTable
00117 = G4ParticleTable::GetParticleTable()->GetIonTable();
00118
00119 DsG4RadioactiveDecay* theRadioactiveDecay = new DsG4RadioactiveDecay();
00120 for (G4int i=0; i<theIonTable->Entries(); i++) {
00121 G4String particleName = theIonTable->GetParticle(i)->GetParticleName();
00122 if (particleName == "GenericIon") {
00123 G4ProcessManager* pmanager
00124 = theIonTable->GetParticle(i)->GetProcessManager();
00125 pmanager ->AddProcess(theRadioactiveDecay);
00126 pmanager ->SetProcessOrdering(theRadioactiveDecay, idxPostStep);
00127 pmanager ->SetProcessOrdering(theRadioactiveDecay, idxAtRest);
00128 }
00129 }
00130
00131 }
00132
00133 #if 0
00134 void DsPhysConsGeneral::SetCuts()
00135 {
00136
00137 G4ProductionCutsTable::GetProductionCutsTable()->
00138 SetEnergyRange(m_lowProdCut,m_highProdCut);
00139
00140
00141
00142 SetCutValue(m_gammaCut, "gamma");
00143 SetCutValue(m_electronCut, "e-");
00144 SetCutValue(m_positronCut, "e+");
00145 }
00146 #endif