projects/slic/trunk/src
--- projects/slic/trunk/src/LCExtendedParticles.cc 2014-02-27 01:10:09 UTC (rev 3030)
+++ projects/slic/trunk/src/LCExtendedParticles.cc 2014-02-27 01:11:21 UTC (rev 3031)
@@ -6,6 +6,7 @@
// geant4
#include "G4ProcessManager.hh"
#include "G4SystemOfUnits.hh"
+#include "G4ParticleTableIterator.hh"
namespace slic {
@@ -17,6 +18,9 @@
}
void LCExtendedParticles::ConstructParticle() {
+
+ //std::cout << "LCExtendedParticles::ConstructParticle" << std::endl;
+
// Get the particle data table to be imported.
HepPDT::ParticleDataTable* pdtbl = HepPDTManager::instance()->getParticleDataTable();
@@ -30,12 +34,18 @@
// Add particles that Geant4 does not already know about.
if (pdef == 0) {
- G4String name = "extended";
+
+ std::cout << "constructing new particle: " << pdata.PDTname() << std::endl;
+
+ G4String particleType = "extended";
if (id.isSUSY())
- name = "susy";
+ particleType = "susy";
+ std::cout << " type: " << particleType << std::endl;
+
// Create a G4ParticleDefinition for this SUSY particle.
- new G4ParticleDefinition(pdata.PDTname(), // name
+ new G4ParticleDefinition(
+ pdata.PDTname(), // name
pdata.mass().value() * GeV, // mass
pdata.totalWidth().value(), // width
pdata.charge(), // charge
@@ -45,7 +55,7 @@
0, // 2*isospin
0, // 2*isospin3
0, // G-parity
- "extended", // type
+ particleType, // type
0, // lepton number
0, // baryon number
pdata.pid(), // PDG encoding
@@ -59,12 +69,17 @@
}
void LCExtendedParticles::ConstructProcess() {
- theParticleIterator->reset();
- while ((*theParticleIterator)()) {
- G4ParticleDefinition* pdef = theParticleIterator->value();
+ G4ParticleTable::G4PTblDicIterator* particleIterator = G4ParticleTable::GetParticleTable()->GetIterator();
+ particleIterator->reset();
+
+ while ((*particleIterator)()) {
+ G4ParticleDefinition* pdef = particleIterator->value();
G4ProcessManager* pmgr = pdef->GetProcessManager();
if (pdef->GetParticleType() == "extended" || pdef->GetParticleType() == "susy") {
+
+ std::cout << "assigning processes to particle: " << pdef->GetParticleName() << std::endl;
+
if (pdef->GetPDGCharge() != 0) {
pmgr->AddProcess(&m_scatter, -1, 1, 1); // multiple scattering
pmgr->AddProcess(&m_ionise, -1, 2, 2); // ionisation
projects/slic/trunk/src
--- projects/slic/trunk/src/LCOpticalPhysics.cc 2014-02-27 01:10:09 UTC (rev 3030)
+++ projects/slic/trunk/src/LCOpticalPhysics.cc 2014-02-27 01:11:21 UTC (rev 3031)
@@ -55,11 +55,12 @@
//G4OpticalSurfaceModel themodel = unified;
//theBoundaryProcess->SetModel(themodel);
- theParticleIterator->reset();
+ G4ParticleTable::G4PTblDicIterator* particleIterator = G4ParticleTable::GetParticleTable()->GetIterator();
+ particleIterator->reset();
- while ((*theParticleIterator)()) {
+ while ((*particleIterator)()) {
- G4ParticleDefinition* particle = theParticleIterator->value();
+ G4ParticleDefinition* particle = particleIterator->value();
G4ProcessManager* pmanager = particle->GetProcessManager();
G4String particleName = particle->GetParticleName();