| Classes | Job Modules | Data Objects | Services | Algorithms | Tools | Packages | Directories | Tracs |

In This Package:

DsPhysConsGeneral.cc

Go to the documentation of this file.
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     {   // All bosons
00046         G4BosonConstructor con;
00047         con.ConstructParticle();
00048     }
00049     {   // All leptons
00050         G4LeptonConstructor con;
00051         con.ConstructParticle();
00052     }
00053     { /* Adopted a subset of mesons to avoid segv at the very end of
00054        * the run (seems to be related with B mesons and hLowEIoni???).
00055        * Carbon-copied the meson list from the example in
00056        * advanced/underground/physics. Jianglai 05/08/2006
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     {   // All baryons
00071         G4BaryonConstructor con;
00072         con.ConstructParticle();
00073     }
00074     {   // All ions
00075         G4IonConstructor con;
00076         con.ConstructParticle();  
00077     }
00078 
00079     {   // all short lived (resonaces and quarks)
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     // can't call this from a GiGaPhysConstructorBase, but
00101     // G4VModularPhysicsList will do it for us.
00102     // AddTransportation();
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     //G4RadioactiveDecay* theRadioactiveDecay = new G4RadioactiveDecay();
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     // special for low energy physics
00137     G4ProductionCutsTable::GetProductionCutsTable()->
00138         SetEnergyRange(m_lowProdCut,m_highProdCut);
00139 
00140     // set cut values for gamma at first and for e- second and next for e+,
00141     // because some processes for e+/e- need cut values for gamma 
00142     SetCutValue(m_gammaCut, "gamma");
00143     SetCutValue(m_electronCut, "e-");
00144     SetCutValue(m_positronCut, "e+");
00145 }
00146 #endif
| Classes | Job Modules | Data Objects | Services | Algorithms | Tools | Packages | Directories | Tracs |

Generated on Mon Apr 11 20:53:24 2011 for DetSim by doxygen 1.4.7