slic/src
diff -u -r1.14 -r1.15
--- PhysicsListFactory.cc 16 Dec 2006 00:06:20 -0000 1.14
+++ PhysicsListFactory.cc 18 Dec 2006 20:01:51 -0000 1.15
@@ -1,4 +1,4 @@
-// $Header: /cvs/lcd/slic/src/PhysicsListFactory.cc,v 1.14 2006/12/16 00:06:20 jeremy Exp $
+// $Header: /cvs/lcd/slic/src/PhysicsListFactory.cc,v 1.15 2006/12/18 20:01:51 jeremy Exp $
#include "PhysicsListFactory.hh"
// geant4 physics lists
@@ -28,16 +28,23 @@
#include "QGSP_EMX.hh"
#include "QGSP_HP.hh"
-#include "PhysicsListBuilder.hh"
-
-// Dennis Wright's LC Physics list
+// lcphys
#ifdef SLIC_USE_LCPHYS
#include "LCPhysicsList.hh"
#endif
+// slic
+#include "PhysicsListBuilder.hh"
+
using namespace std;
-// Define a physics list builder with class and string name.
+/**
+ * A macro to add a TPhysicsListBuilder for a single physics list.
+ *
+ * @param list The class name of the list.
+ * @param name The name of the list which will be used to instantiate it.
+ * @param description A short description of the list.
+ */
#define BUILDER(list,name,description) this->addBuilder( new TPhysicsListBuilder<list>( name, description ) );
namespace slic
@@ -58,13 +65,11 @@
m_builders.clear();
}
- /**
- * @param name The name of the physics list to instantiate.
- * @return G4VUserPhysicsList base object with concrete type such as LHEP.
- */
G4VUserPhysicsList* PhysicsListFactory::create( const std::string& name )
{
+#ifdef SLIC_VERBOSE
G4cout << "Creating physics list <" << name << ">." << G4endl;
+#endif
G4VUserPhysicsList* physicslist = 0;
@@ -74,7 +79,7 @@
physicslist = builder->create();
}
else {
- G4Exception("ERROR: No builder found for physics list <" + name + ">.");
+ G4Exception("ERROR: No builder found for physics list <" + name + "> .");
}
return physicslist;
@@ -85,7 +90,7 @@
os << std::endl;
os << "----GEANT4 PHYSICS LISTS----" << std::endl << std::endl;
os << "NAME DESCRIPTION" << std::endl;
- os << "------------------------------------------------------------------" << std::endl;
+ os << "----------------------------------------------------------------------" << std::endl;
for ( BuilderMap::const_iterator it = m_builders.begin();
it != m_builders.end();
it++ ) {
@@ -100,20 +105,19 @@
{
#ifdef SLIC_USE_LCPHYS
- std::cout << "LCPhys enabled!" << std::endl;
BUILDER(LCPhysicsList,"LCPhys","ILC Physics List by Dennis Wright.")
#endif
BUILDER(LHEP, "LHEP", "Low and High Energy Parameterised")
BUILDER(FTFC, "FTFC", "Fritiof with CHIPS")
BUILDER(FTFP, "FTFP", "Fritiof with precompound")
- BUILDER(LBE, "LBE", "")
+ BUILDER(LBE, "LBE", "low backgrounds experiment with low energy EM")
BUILDER(LHEP_BERT, "LHEP_BERT", "LHEP with Bertini Cascade")
- BUILDER(LHEP_BERT_HP, "LHEP_BERT_HP", "")
+ BUILDER(LHEP_BERT_HP, "LHEP_BERT_HP", "LHEP with Bertini Cascade and high precision neutrons")
BUILDER(LHEP_BIC, "LHEP_BIC", "LHEP with Binary Cascade")
- BUILDER(LHEP_BIC_HP, "LHEP_BIC_HP", "")
- BUILDER(LHEP_EMV, "LHEP_EMV", "")
- BUILDER(LHEP_HP, "LHEP_HP", "")
+ BUILDER(LHEP_BIC_HP, "LHEP_BIC_HP", "LHEP with Binary Cascade and high precision neutrons")
+ BUILDER(LHEP_EMV, "LHEP_EMV", "LHEP with v 7.1 EM processes")
+ BUILDER(LHEP_HP, "LHEP_HP", "LHEP with high precision neutrons")
BUILDER(LHEP_LEAD, "LHEP_LEAD", "LHEP with leading particle")
BUILDER(LHEP_LEAD_HP, "LHEP_LEAD_HP", "LHEP with leading particle and HP")
BUILDER(LHEP_PRECO, "LHEP_PRECO", "LHEP with precompound")
@@ -121,53 +125,24 @@
BUILDER(QGSC, "QGSC", "quark gluon-string with CHIPS")
BUILDER(QGSC_LEAD, "QGSC_LEAD", "QGSC with leading particle")
BUILDER(QGSC_LEAD_HP, "QGSC_LEAD_HP", "QGSC_LEAD with HP")
- BUILDER(QGSP, "QGSP", "quark-gluon-string with precompound")
+ BUILDER(QGSP, "QGSP", "quark gluon-string with precompound")
BUILDER(QGSP_BERT, "QGSP_BERT", "QGSP with Bertini Cascade")
- BUILDER(QGSP_BERT_HP, "QGSP_BERT_HP", "")
+ BUILDER(QGSP_BERT_HP, "QGSP_BERT_HP", "QGSP with Bertini Cascade and high precision neutrons")
BUILDER(QGSP_BIC, "QGSP_BIC", "QGSP with Binary Cascade")
- BUILDER(QGSP_EMV, "QGSP_EMV", "")
- BUILDER(QGSP_EMX, "QGSP_EMX", "")
- BUILDER(QGSP_HP, "QGSP_HP", "")
-
- // This one causes a compile error.
- // BUILDER(QBBC,"")
+ BUILDER(QGSP_EMV, "QGSP_EMV", "LHEP with v 7.1 EM processes")
+ BUILDER(QGSP_EMX, "QGSP_EMX", "QGSP with v 7.2 EM processes")
+ BUILDER(QGSP_HP, "QGSP_HP", "QGSP with high precision neutron")
}
void PhysicsListFactory::addBuilder( VPhysicsListBuilder* builder)
{
const G4String& name = builder->getName();
- m_builders[ name ] = builder;
+
+ if ( m_builders.find( name ) != m_builders.end() ) {
+ G4cerr << "WARNING: Ignoring duplicate physics list builder for <" << name << "> ." << G4endl;
+ }
+ else {
+ m_builders[ name ] = builder;
+ }
}
}
-
-/*
-
-complete list of physics_lists from source/physics_lists/include
-
-FTFC - Fritiof with CHIPS
-FTFP - Fritiof with precompound
-LBE
-LHEP - Low and High Energy Parameterised
-LHEP_BERT - LHEP with Bertini Cascade
-LHEP_BERT_HP
-LHEP_BIC - LHEP with Binary Cascade
-LHEP_BIC_HP
-LHEP_EMV
-LHEP_HP
-LHEP_LEAD - LHEP with leading particle
-LHEP_LEAD_HP
-LHEP_PRECO - LHEP with precompound
-LHEP_PRECO_HP
-QBBC
-QGSC - quark gluon-string with CHIPS
-QGSC_LEAD - QGSC with leading
-QGSC_LEAD_HP
-QGSP - quark-gluon-string with precompound
-QGSP_BERT - QGSP with bertini
-QGSP_BERT_HP
-QGSP_BIC - QGSP with binary cascade
-QGSP_EMV
-QGSP_EMX
-QGSP_HP
-
-*/
slic/include
diff -u -r1.11 -r1.12
--- PhysicsListFactory.hh 16 Dec 2006 00:06:20 -0000 1.11
+++ PhysicsListFactory.hh 18 Dec 2006 20:01:51 -0000 1.12
@@ -1,4 +1,4 @@
-// $Header: /cvs/lcd/slic/include/PhysicsListFactory.hh,v 1.11 2006/12/16 00:06:20 jeremy Exp $
+// $Header: /cvs/lcd/slic/include/PhysicsListFactory.hh,v 1.12 2006/12/18 20:01:51 jeremy Exp $
#ifndef SLIC_PHYSICSLISTFACTORY_HH
#define SLIC_PHYSICSLISTFACTORY_HH 1
@@ -19,9 +19,11 @@
/**
* @class PhysicsListFactory
- * @brief Instantiates a Geant4 physics list based on the name.
+ * Factory to instantiates a Geant4 physics list based on the name.
+ * Available physics lists are defined in the directory
+ * $G4INSTALL/source/physics_lists/lists/include
+ * in the v 8.2 Geant4 release.
*/
-
class PhysicsListFactory : public Singleton<PhysicsListFactory>
{
@@ -32,23 +34,35 @@
public:
- // Map of list names to their builders.
+ /**
+ * Map of list names to builders.
+ */
typedef std::map<G4String, VPhysicsListBuilder*> BuilderMap;
public:
- // Initialize the default set of physics list builders,
- // which is all the lists from $G4INSTALL/source/physics_lists/lists/include
- // in the Geant4 8.2 version.
- void initializeBuilders();
-
- // Add a builder that can instantiate a physics list.
+ /**
+ * Initialize a TPhysicsListBuilder for each supported physics list.
+ */
+ void initializeBuilders();
+
+ /**
+ * Add a builder that can instantiate a physics list.
+ * @param The VPhysicsListBuilder to add to the PhysicsListFactory .
+ */
void addBuilder( VPhysicsListBuilder* );
- // Return the physics list matching name.
+ /**
+ * @param name The name of the physics list to instantiate.
+ * @return A G4VUserPhysicsList with a concrete type of @param name, such as LHEP.
+ */
G4VUserPhysicsList* create( const std::string& name ) ;
- // Print the available lists with their descriptions.
+ /**
+ * Print the available lists with their descriptions.
+ * @param An ostream for print out.
+ * @return The same ostream after printing.
+ */
std::ostream& printAvailableLists(std::ostream &os) ;
private: