3 added + 6 modified, total 9 files
slic/include
diff -N LCExtendedDecay.hh
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ LCExtendedDecay.hh 4 Aug 2009 22:50:41 -0000 1.1
@@ -0,0 +1,22 @@
+#ifndef SLIC_LCEXTENDEDDECAY_HH
+#define SLIC_LCEXTENDEDDECAY_HH 1
+
+#include "G4UnknownDecay.hh"
+
+namespace slic
+{
+ class LCExtendedDecay : public G4UnknownDecay
+ {
+ public:
+ LCExtendedDecay()
+ : G4UnknownDecay( "LCExtendedDecay" )
+ {;}
+
+ G4bool IsApplicable( const G4ParticleDefinition &pdef )
+ {
+ return ( pdef.GetParticleType() == "extended" );
+ }
+ };
+}
+
+#endif
slic/include
diff -N LCExtendedParticles.hh
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ LCExtendedParticles.hh 4 Aug 2009 22:50:41 -0000 1.1
@@ -0,0 +1,31 @@
+#ifndef SLIC_LCEXTENDEDPARTICLES_HH
+#define SLIC_LCEXTENDEDPARTICLES_HH
+
+// slic
+#include "LCExtendedDecay.hh"
+
+// geant4
+#include "G4VPhysicsConstructor.hh"
+
+namespace slic
+{
+ class LCExtendedParticles : public G4VPhysicsConstructor
+ {
+ public:
+
+ LCExtendedParticles( const G4String& name = "LCExtendedParticles" );
+
+ virtual ~LCExtendedParticles();
+
+ void ConstructParticle();
+
+ void ConstructProcess();
+
+ private:
+
+ LCExtendedDecay m_decay;
+
+ };
+}
+
+#endif
slic/include
diff -u -r1.1 -r1.2
--- LCSUSYPhysics.hh 11 Apr 2008 03:20:19 -0000 1.1
+++ LCSUSYPhysics.hh 4 Aug 2009 22:50:41 -0000 1.2
@@ -11,7 +11,7 @@
namespace slic
{
- class LCSUSYPhysics : public G4VPhysicsConstructor, public Module
+ class LCSUSYPhysics : public G4VPhysicsConstructor
{
public:
@@ -24,7 +24,7 @@
void ConstructProcess();
private:
- std::vector<G4ParticleDefinition*> m_pdefs;
+
LCSUSYDecay m_decay;
};
}
slic/include
diff -u -r1.18 -r1.19
--- PhysicsListManager.hh 11 Apr 2008 03:20:19 -0000 1.18
+++ PhysicsListManager.hh 4 Aug 2009 22:50:41 -0000 1.19
@@ -1,4 +1,4 @@
-// $Header: /cvs/lcd/slic/include/PhysicsListManager.hh,v 1.18 2008/04/11 03:20:19 jeremy Exp $
+// $Header: /cvs/lcd/slic/include/PhysicsListManager.hh,v 1.19 2009/08/04 22:50:41 jeremy Exp $
#ifndef SLIC_PHYSICSLISTMANAGER_HH
#define SLIC_PHYSICSLISTMANAGER_HH 1
@@ -73,12 +73,17 @@
m_enableOptical = b;
}
+ // Needs to be public for the RunManager to call it.
void setupUserLimitsProcesses();
+ private:
+
void setupOpticalProcesses();
void setupSUSY();
+ void setupExtended();
+
private:
G4VUserPhysicsList* m_currentList;
slic/src
diff -N LCExtendedParticles.cc
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ LCExtendedParticles.cc 4 Aug 2009 22:50:42 -0000 1.1
@@ -0,0 +1,79 @@
+#include "LCExtendedParticles.hh"
+
+// slic
+#include "HepPDTManager.hh"
+
+// geant4
+#include "G4ProcessManager.hh"
+
+namespace slic
+{
+
+ LCExtendedParticles::LCExtendedParticles( const G4String& name )
+ : G4VPhysicsConstructor( name )
+ {}
+
+ LCExtendedParticles::~LCExtendedParticles()
+ {}
+
+ void LCExtendedParticles::ConstructParticle()
+ {
+ // Get the particle data table to be imported.
+ HepPDT::ParticleDataTable* pdtbl = HepPDTManager::instance()->getParticleDataTable();
+
+ // Loop over all particles.
+ for ( HepPDT::ParticleDataTable::const_iterator it = pdtbl->begin();
+ it != pdtbl->end();
+ it++ )
+ {
+ HepPDT::ParticleID id = it->first;
+ HepPDT::ParticleData pdata = it->second;
+
+ // Check for a built-in definition of this particle.
+ G4ParticleDefinition* pdef = G4ParticleTable::GetParticleTable()->FindParticle( pdata.pid() );
+
+ // Add non-SUSY particles that Geant4 does not already know about.
+ // SUSY particles are instead added by LCSUSYPhysics.
+ if ( !id.isSUSY() && pdef == 0)
+ {
+ // Create a G4ParticleDefinition for this SUSY particle.
+ G4ParticleDefinition *pdef =
+ new G4ParticleDefinition(
+ pdata.PDTname(), // name
+ pdata.mass().value() * GeV, // mass
+ pdata.totalWidth().value(), // width
+ pdata.charge(), // charge
+ 0, // 2*spin
+ 0, // parity
+ 0, // C-conjugation
+ 0, // 2*isospin
+ 0, // 2*isospin3
+ 0, // G-parity
+ "extended", // type
+ 0, // lepton number
+ 0, // baryon number
+ pdata.pid(), // PDG encoding
+ false, // stable
+ 1e30, // lifetime (DEBUG)
+ 0, // decay table
+ false // short lived
+ );
+ }
+ }
+
+ }
+
+ void LCExtendedParticles::ConstructProcess()
+ {
+ theParticleIterator->reset();
+ while( (*theParticleIterator)() )
+ {
+ G4ParticleDefinition* pdef = theParticleIterator->value();
+ G4ProcessManager* pmgr = pdef->GetProcessManager();
+ if ( m_decay.IsApplicable( *pdef ) )
+ {
+ pmgr->AddProcess( &m_decay, -1, -1, 1 );
+ }
+ }
+ }
+}
slic/src
diff -u -r1.3 -r1.4
--- LCSUSYPhysics.cc 26 Aug 2008 23:12:13 -0000 1.3
+++ LCSUSYPhysics.cc 4 Aug 2009 22:50:42 -0000 1.4
@@ -12,7 +12,7 @@
namespace slic
{
LCSUSYPhysics::LCSUSYPhysics( const G4String& name )
- : G4VPhysicsConstructor( name ), Module( name )
+ : G4VPhysicsConstructor( name )
{;}
LCSUSYPhysics::~LCSUSYPhysics()
@@ -34,15 +34,11 @@
// Only adding SUSY particles.
if ( id.isSUSY() )
{
-#ifdef SLIC_LOG
- log() << LOG::verbose << "found SUSY p " << id.PDTname() << " with pdgid " << id.pid() << LOG::done;
-#endif
-
// Create a G4ParticleDefinition for this SUSY particle.
G4ParticleDefinition *pdef =
new G4ParticleDefinition(
pdata.PDTname(), // name
- pdata.mass().value(), // mass
+ pdata.mass().value() * GeV, // mass
pdata.totalWidth().value(), // width
pdata.charge(), // charge
0, // 2*spin
@@ -59,10 +55,7 @@
1e30, // lifetime (DEBUG)
0, // decay table
false // short lived
- );
-
- // Save the particles for ConstructProcess().
- m_pdefs.push_back( pdef );
+ );
}
}
}
@@ -76,7 +69,6 @@
G4ProcessManager* pmgr = pdef->GetProcessManager();
if ( m_decay.IsApplicable( *pdef ) )
{
- log() << LOG::verbose << "adding LCSUSYDecay to " << pdef->GetParticleName() << LOG::done;
pmgr->AddProcess( &m_decay, -1, -1, 1 );
}
}
slic/src
diff -u -r1.11 -r1.12
--- LcioMcpFactory.cc 10 Sep 2008 00:04:58 -0000 1.11
+++ LcioMcpFactory.cc 4 Aug 2009 22:50:42 -0000 1.12
@@ -1,4 +1,4 @@
-// $Header: /cvs/lcd/slic/src/LcioMcpFactory.cc,v 1.11 2008/09/10 00:04:58 jeremy Exp $
+// $Header: /cvs/lcd/slic/src/LcioMcpFactory.cc,v 1.12 2009/08/04 22:50:42 jeremy Exp $
#include "LcioMcpFactory.hh"
// slic
@@ -107,7 +107,9 @@
IMPL::MCParticleImpl* LcioMcpFactory::createMcpFromInitialRecurse(EVENT::MCParticle* mcpInit)
{
+#ifdef SLIC_LOG
log() << LOG::debug << "createMcpFromInitialRecurse: " << m_manager->getMCParticleIndex(m_manager->getInitialMcpCollection(), mcpInit) << LOG::done;
+#endif
MCParticleImpl* mcp = 0;
@@ -117,7 +119,9 @@
// no associated primary with this initial mcp?
if( !g4primary ) {
+#ifdef SLIC_LOG
log() << LOG::debug << "initialOnly" << LOG::done;
+#endif
// create from initial Mcp only
mcp = createMcpFromInitialOnly( mcpInit );
@@ -125,7 +129,9 @@
// create from primary
else {
+#ifdef SLIC_LOG
log() << LOG::debug << "fromPrimary" << LOG::done;
+#endif
// create it from primary
mcp = createMcpFromPrimary( g4primary, mcpInit );
@@ -174,7 +180,9 @@
*/
if ( !trj ) {
+#ifdef SLIC_LOG
log() << LOG::debug << "initialAndPrimary" << LOG::done;
+#endif
/* Recursively create Mcps from primary and initial Mcp. */
mcp = createMcpFromInitialAndPrimary( primary, mcpInit );
@@ -183,7 +191,9 @@
/* Found a trajectory. */
else {
+#ifdef SLIC_LOG
log() << LOG::debug << "initialAndTrajectory" << LOG::done;
+#endif
/* Recursively create Mcps from trajectory and initial Mcp. */
mcp = createMcpFromInitialAndTrajectory( trj, mcpInit );
@@ -344,6 +354,9 @@
IMPL::MCParticleImpl* LcioMcpFactory::createMcpFromTrajectory( Trajectory* trj)
{
+ log() << LOG::debug << "createMcpFromTrajectory" << LOG::done;
+ log() << LOG::debug << "particle: " << trj->GetParticleDefinition()->GetParticleName() << LOG::done;
+
// new Mcp
MCParticleImpl* mcp = new MCParticleImpl();
@@ -365,17 +378,26 @@
G4int npts = trj->GetPointEntries();
// begin pnt
+
G4VTrajectoryPoint* beginTrjPnt = trj->GetPoint( 0 );
G4ThreeVector beginPos = beginTrjPnt->GetPosition() / mm;
double fBeginPos[3] = { beginPos.x(), beginPos.y(), beginPos.z() };
mcp->setVertex( fBeginPos );
+#ifdef SLIC_LOG
+ log() << LOG::debug << "begin pnt: " << beginPos.x() << " " << beginPos.y() << " " << beginPos.z() << LOG::done;
+#endif
+
// end pnt
G4VTrajectoryPoint* endTrjPnt = trj->GetPoint( npts - 1 );
G4ThreeVector endPos = endTrjPnt->GetPosition() / mm;
double fEndPos[3] = { endPos.x(), endPos.y(), endPos.z() };
mcp->setEndpoint( fEndPos );
+#ifdef SLIC_LOG
+ log() << LOG::debug << "end pnt: " << endPos.x() << " " << endPos.y() << " " << endPos.z() << LOG::done;
+#endif
+
// time
mcp->setTime( trj->GetGlobalTime() );
@@ -476,6 +498,9 @@
if ( dauMcp == 0 ) {
// create from trj if null
+#ifdef SLIC_LOG
+ log() << LOG::okay << "hello there pretty" << LOG::done;
+#endif
dauMcp = createMcpFromTrajectory( trj );
}
slic/src
diff -u -r1.34 -r1.35
--- LcioPrimaryGenerator.cc 26 Aug 2008 23:15:31 -0000 1.34
+++ LcioPrimaryGenerator.cc 4 Aug 2009 22:50:42 -0000 1.35
@@ -1,4 +1,4 @@
-// $Header: /cvs/lcd/slic/src/LcioPrimaryGenerator.cc,v 1.34 2008/08/26 23:15:31 jeremy Exp $
+// $Header: /cvs/lcd/slic/src/LcioPrimaryGenerator.cc,v 1.35 2009/08/04 22:50:42 jeremy Exp $
// slic
#include "LcioPrimaryGenerator.hh"
@@ -7,6 +7,9 @@
#include "LcioMcpUtil.hh"
#include "StringUtil.hh"
+// Geant4
+#include "G4ParticleTable.hh"
+
// std
#include <sstream>
@@ -44,29 +47,39 @@
return;
}
-#ifdef SLIC_LOG
- log() << LOG::debug << "nInitialMCParticles: " << nhep << LOG::done;
-#endif
+//#ifdef SLIC_LOG
+// log() << LOG::debug << "nInitialMCParticles: " << nhep << LOG::done;
+//#endif
for ( int i=0; i < nhep; i++ ) {
-#ifdef SLIC_LOG
- log() << LOG::debug << "particleIdx: " << i << LOG::done;
-#endif
-
MCParticleImpl* mcp = dynamic_cast<MCParticleImpl*>
(mcpVec->getElementAt( i ) );
- assert( mcp );
-
-#ifdef SLIC_LOG
- log() << LOG::debug << "pdg <" << mcp->getPDG() << ">" << LOG::done;
+ //assert( mcp );
+ if (mcp == 0)
+ G4Exception( "Fatal Error. Could not find MCParticle at indx." );
+
+ // debug info
+ G4ParticleTable* tbl = G4ParticleTable::GetParticleTable();
+ G4ParticleDefinition* pdef = tbl->FindParticle( mcp->getPDG() );
+
+ G4String pname = "unknown";
+ if (pdef != 0)
+ pname = pdef->GetParticleName();
+ // end debug info
+
+#ifdef SLIC_LOG
+ log() << LOG::debug << "generating particle #" << i << ", pdg: " << mcp->getPDG() << ", name: " << pname << LOG::done;
+ log() << LOG::debug << " vertex: ( " << mcp->getVertex()[0] << ", " << mcp->getVertex()[1] << ", " << mcp->getVertex()[2] << " )" << LOG::done;
+ if (mcp->getEndpoint() != 0)
+ log() << LOG::debug << " endp: ( " << mcp->getEndpoint()[0] << ", " << mcp->getEndpoint()[1] << ", " << mcp->getEndpoint()[2] << " )" << LOG::done;
+ log() << LOG::debug << " time: " << mcp->getTime() << LOG::done;
#endif
G4int numPar = mcp->getParents().size();
- log() << "nParents: " << numPar << LOG::done;
-
+ log() << " nparents: " << numPar << LOG::done;
/*
* Handle 4 cases, following Ron Cassell's LCSHEPEvtInterface from LCS package:
@@ -91,26 +104,19 @@
parMcp = dynamic_cast<MCParticleImpl*>(mcp->getParents()[0]);
g4parent = m_mcpManager->getMaps()->findPrimaryFromMcp( parMcp );
+ // Check if the particle has parents, in which case it needs a predecay.
if ( g4parent != 0 ) {
+ isPreDecay = true;
#ifdef SLIC_LOG
-// log() << LOG::debug << "primary is preDecay" << LOG::done;
-// std::istringstream ss;
-// log() << LOG::debug << "g4parent <" << g4parent << ">" << LOG::done;
- log() << LOG::debug << "parentMCParticleIdx: " << LcioMcpManager::instance()->getMCParticleIndex(mcpVec, parMcp) << LOG::done;
+ log() << " PREDECAY" << LOG::done;
+ log() << LOG::debug << " parIdx: " << LcioMcpManager::instance()->getMCParticleIndex(mcpVec, parMcp) << LOG::done;
#endif
-
- isPreDecay = true;
}
}
// case 1
if ( isPreDecay ) {
-
-#ifdef SLIC_LOG
- log() << LOG::debug << "PREDECAY" << LOG::done;
-#endif
-
createPrimary = true;
// no vertex
}
@@ -119,7 +125,7 @@
if ( mcp->getGeneratorStatus() == 1 ) {
#ifdef SLIC_LOG
- log() << LOG::debug << "FINAL STATE" << LOG::done;
+ log() << LOG::debug << " FINAL STATE" << LOG::done;
#endif
createPrimary = true;
@@ -145,7 +151,7 @@
if ( dist > m_mcpManager->getMinimumTrackingDistance() ) {
#ifdef SLIC_LOG
- log() << LOG::debug << "INTERMEDIATE OR DOC TO BE TRACKED" << LOG::done;
+ log() << LOG::debug << " INTERMEDIATE OR DOC TO BE TRACKED" << LOG::done;
#endif
createPrimary = true;
@@ -155,7 +161,7 @@
// *This particle will not be tracked.*
#ifdef SLIC_LOG
else {
- log() << LOG::debug << "INTERMEDIATE OR DOC THAT WILL NOT BE TRACKED" << LOG::done;
+ log() << LOG::debug << " INTERMEDIATE OR DOC THAT WILL NOT BE TRACKED" << LOG::done;
}
#endif
}
@@ -164,9 +170,9 @@
}
#ifdef SLIC_LOG
- log() << "isPreDecay: " << isPreDecay << LOG::done;
- log() << "createPrimary: " << createPrimary << LOG::done;
- log() << "createVertex: " << createVertex << LOG::done;
+ log() << " isPreDecay: " << isPreDecay << LOG::done;
+ log() << " createPrimary: " << createPrimary << LOG::done;
+ log() << " createVertex: " << createVertex << LOG::done;
#endif
// create a primary
@@ -179,33 +185,36 @@
assert( g4parent );
- // computation of proper_time from RC
+ //
+ // Computation of proper_time from RC
+ //
+
G4ThreeVector parMom = g4parent->GetMomentum();
#ifdef SLIC_LOG
- log() << "parentMomentum: " << parMom << LOG::done;
+ log() << " parentMomentum: " << parMom << LOG::done;
#endif
G4double E = sqrt(pow(g4parent->GetMass(), 2) + pow( parMom.x(), 2 ) + pow( parMom.y(), 2) + pow( parMom.z(), 2 ) );
#ifdef SLIC_LOG
- log() << "particleTime: " << mcp->getTime() << LOG::done;
- log() << "parentTime: " << parMcp->getTime() << LOG::done;
- log() << "parentMass: " << g4parent->GetMass() << LOG::done;
+ log() << " particleTime: " << mcp->getTime() << LOG::done;
+ log() << " parentTime: " << parMcp->getTime() << LOG::done;
+ log() << " parentMass: " << g4parent->GetMass() << LOG::done;
#endif
G4double proper_time = ( ( mcp->getTime() - parMcp->getTime() ) * g4parent->GetMass() ) / E;
#ifdef SLIC_LOG
- log() << LOG::debug << "parentE: " << E << LOG::done;
- log() << LOG::debug << "properTime: " << proper_time << LOG::done;
+ log() << LOG::debug << " parentE: " << E << LOG::done;
+ log() << LOG::debug << " properTime: " << proper_time << LOG::done;
#endif
g4parent->SetDaughter( thePrimary );
g4parent->SetProperTime( proper_time );
#ifdef SLIC_LOG
- log() << LOG::debug << "mcp decay time <" << mcp->getTime() - parMcp->getTime() << ">" << LOG::done;
+ log() << LOG::debug << " mcp decay time <" << mcp->getTime() - parMcp->getTime() << ">" << LOG::done;
#endif
}
}
@@ -219,10 +228,6 @@
// insert mcp, primary pair into LcioManager's map (could be null)
if ( thePrimary ) {
-
-#ifdef SLIC_LOG
- log() << LOG::debug << "adding mcp <" << mcp << "> to primary <" << thePrimary << "> link" << LOG::done;
-#endif
m_mcpManager->getMaps()->addMcpToPrimaryLink(mcp, thePrimary );
}
@@ -234,8 +239,6 @@
G4PrimaryParticle* LcioPrimaryGenerator::createPrimaryParticleFromMcp(IMPL::MCParticleImpl* mcp)
{
- assert( mcp );
-
G4PrimaryParticle* primary = new G4PrimaryParticle(mcp->getPDG(),
mcp->getMomentum()[0] * GeV,
mcp->getMomentum()[1] * GeV,
@@ -250,7 +253,6 @@
{
#ifdef SLIC_LOG
log() << "createPrimaryVertexFromMcp" << LOG::done;
- log() << "particleMomentum: " << mcp->getVertex() << LOG::done;
log() << "particleTime: " << mcp->getTime() << LOG::done;
#endif
slic/src
diff -u -r1.20 -r1.21
--- PhysicsListManager.cc 11 Apr 2008 03:20:19 -0000 1.20
+++ PhysicsListManager.cc 4 Aug 2009 22:50:42 -0000 1.21
@@ -1,4 +1,4 @@
-// $Header: /cvs/lcd/slic/src/PhysicsListManager.cc,v 1.20 2008/04/11 03:20:19 jeremy Exp $
+// $Header: /cvs/lcd/slic/src/PhysicsListManager.cc,v 1.21 2009/08/04 22:50:42 jeremy Exp $
#include "PhysicsListManager.hh"
// geant4
@@ -12,6 +12,7 @@
#include "LCOpticalPhysics.hh"
#include "HepPDTManager.hh"
#include "LCSUSYPhysics.hh"
+#include "LCExtendedParticles.hh"
namespace slic
{
@@ -58,75 +59,79 @@
{
if ( !m_isInitialized ) {
+#ifdef SLIC_LOG
if ( m_isFromDefault ) {
- log() << LOG::okay << "Using default physics list <" << m_defaultListName << ">" << LOG::done;
+ log() << LOG::okay << "Using default physics list <" << m_defaultListName << ">." << LOG::done;
}
+#endif
// Create the physics list from the name argument.
m_currentList = PhysicsListFactory::instance()->create( m_currentListName );
- // Support for SUSY (in progress).
+ // Support for SUSY particles from PDT table.
setupSUSY();
- // Enable optical processes if selected.
- if (enableOptical()) {
+ // Support for extended set of SM particles from PDT which Geant4 does not know about.
+ setupExtended();
+
+ // Enable optical processes.
+ if ( enableOptical() ) {
setupOpticalProcesses();
}
G4RunManager::GetRunManager()->SetUserInitialization( m_currentList );
- log().okay("Registered physics list <" + m_currentListName + "> with G4RunManager");
+#ifdef SLIC_LOG
+ log().okay( "Registered physics list <" + m_currentListName + "> with G4RunManager" );
+ log() << LOG::debug << "Dumping Geant4 particle table ..." << LOG::done;
+ G4ParticleTable::GetParticleTable()->DumpTable(); // FIXME: Goes to G4cout.
+#endif
m_isInitialized = true;
}
- // called twice
+#ifdef SLIC_LOG
+ // Don't allow this to be called twice.
else {
log().error("Ignoring additional call to PhysicsListManager::initializePhysics()");
}
+#endif
}
void PhysicsListManager::setupUserLimitsProcesses()
{
-
- if ( !m_setupLimits ) {
-
- log() << LOG::okay << "Enabling user physics limits" << LOG::done;
-
- G4ParticleTable* ptbl = G4ParticleTable::GetParticleTable();
-
- G4ParticleTable::G4PTblDicIterator* piter = ptbl->GetIterator();
-
- G4UserSpecialCuts* cuts = new G4UserSpecialCuts("UserSpecialCuts");
- G4StepLimiter* slim = new G4StepLimiter("StepLimiter");
-
- piter->reset();
- while ( (*piter)() )
- {
- G4ParticleDefinition* pdef = piter->value();
- G4ProcessManager* pmgr = pdef->GetProcessManager();
-
- // add user limit processes for steps and special cuts
- if ( pmgr ) {
- pmgr->AddProcess( slim,
- -1,
- -1,
- 3);
-
- pmgr->AddProcess( cuts,
- -1,
- -1,
- 4);
- }
- else {
- G4Exception( "ERROR: G4ProcessManager is null!" );
- }
+#ifdef SLIC_LOG
+ log() << LOG::okay << "Enabling user physics limits." << LOG::done;
+#endif
+
+ G4ParticleTable* ptbl = G4ParticleTable::GetParticleTable();
+
+ G4ParticleTable::G4PTblDicIterator* piter = ptbl->GetIterator();
+
+ G4UserSpecialCuts* cuts = new G4UserSpecialCuts("UserSpecialCuts");
+ G4StepLimiter* slim = new G4StepLimiter("StepLimiter");
+
+ piter->reset();
+ while ( (*piter)() )
+ {
+ G4ParticleDefinition* pdef = piter->value();
+ G4ProcessManager* pmgr = pdef->GetProcessManager();
+
+ // add user limit processes for steps and special cuts
+ if ( pmgr ) {
+ pmgr->AddProcess( slim,
+ -1,
+ -1,
+ 3);
+
+ pmgr->AddProcess( cuts,
+ -1,
+ -1,
+ 4);
}
-
- m_setupLimits = true;
- }
- else {
- log() << LOG::warning << "PhysicsListManager::setupUserLimitsProcesses() was already called!" << LOG::done;
- }
+ else {
+ G4Exception( "ERROR: G4ProcessManager is null!" );
+ }
+ }
}
void PhysicsListManager::setupOpticalProcesses()
@@ -137,7 +142,7 @@
G4VModularPhysicsList* l = dynamic_cast<G4VModularPhysicsList*> ( m_currentList );
l->RegisterPhysics( new LCOpticalPhysics("optical"));
}
-
+
void PhysicsListManager::setupSUSY()
{
#ifdef SLIC_LOG
@@ -148,9 +153,30 @@
{
l->RegisterPhysics( new LCSUSYPhysics() );
}
+#ifdef SLIC_LOG
else
{
- log() << LOG::error << "HepPDTManager could not load particle data, so SUSY will not be enabled." << LOG::done;
+ log() << LOG::error << "HepPDTManager could not load particle data, so SUSY will not be enabled!" << LOG::done;
}
+#endif
+ }
+
+ void PhysicsListManager::setupExtended()
+ {
+#ifdef SLIC_LOG
+ log() << LOG::always << "Enabling extended PDT particles for the current physics list." << LOG::done;
+#endif
+
+ G4VModularPhysicsList* l = dynamic_cast<G4VModularPhysicsList*> ( m_currentList );
+ if ( HepPDTManager::instance()->getParticleDataTable() )
+ {
+ l->RegisterPhysics( new LCExtendedParticles() );
+ }
+#ifdef SLIC_LOG
+ else
+ {
+ log() << LOG::error << "HepPDTManager could not load particle data, so extended particles will not be enabled!" << LOG::done;
+ }
+#endif
}
}
CVSspam 0.2.8