2 added + 5 modified, total 7 files
slic/include
diff -N LCOpticalPhysics.hh
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ LCOpticalPhysics.hh 3 Jul 2007 18:01:30 -0000 1.1
@@ -0,0 +1,58 @@
+//
+////////////////////////////////////////////////////////////////
+// //
+// Title: Optical physics for a Linear Collider Detector //
+// Date: //
+// Author: //
+// //
+////////////////////////////////////////////////////////////////
+//
+
+#ifndef LCOpticalPhysics_h
+#define LCOpticalPhysics_h 1
+
+#include "G4VPhysicsConstructor.hh"
+#include "G4Cerenkov.hh"
+#include "G4Scintillation.hh"
+#include "G4OpAbsorption.hh"
+#include "G4OpRayleigh.hh"
+#include "G4OpBoundaryProcess.hh"
+#include "G4ProcessManager.hh"
+
+class LCOpticalPhysics : public G4VPhysicsConstructor
+{
+ public:
+ LCOpticalPhysics(const G4String& name = "optical");
+ virtual ~LCOpticalPhysics();
+
+ // This method will be invoked in the Construct() method.
+ // each particle type will be instantiated
+ virtual void ConstructParticle();
+ // This method will be invoked in the Construct() method.
+ // each physics process will be instantiated and
+ // registered to the process manager of each particle type
+ virtual void ConstructProcess();
+ //these methods Construct physics processes and register them
+ void ConstructOp();
+ //for the Messenger (not using it in slic)
+ //void SetVerbose(G4int);
+ //void SetNbOfPhotonsCerenkov(G4int);
+
+ protected:
+ G4Cerenkov* theCerenkovProcess;
+ G4Scintillation* theScintillationProcess;
+ G4OpAbsorption* theAbsorptionProcess;
+ G4OpRayleigh* theRayleighScatteringProcess;
+ G4OpBoundaryProcess* theBoundaryProcess;
+};
+
+
+#endif
+
+
+
+
+
+
+
+
slic/include
diff -u -r1.16 -r1.17
--- PhysicsListManager.hh 27 Apr 2007 01:54:32 -0000 1.16
+++ PhysicsListManager.hh 3 Jul 2007 18:01:30 -0000 1.17
@@ -1,4 +1,4 @@
-// $Header: /cvs/lcd/slic/include/PhysicsListManager.hh,v 1.16 2007/04/27 01:54:32 jeremy Exp $
+// $Header: /cvs/lcd/slic/include/PhysicsListManager.hh,v 1.17 2007/07/03 18:01:30 jeremy Exp $
#ifndef SLIC_PHYSICSLISTMANAGER_HH
#define SLIC_PHYSICSLISTMANAGER_HH 1
@@ -63,8 +63,20 @@
return m_enableLimits;
}
+ inline bool enableOptical()
+ {
+ return m_enableOptical;
+ }
+
+ inline void enableOptical(bool b)
+ {
+ m_enableOptical = b;
+ }
+
void setupUserLimitsProcesses();
+ void setupOpticalProcesses();
+
private:
G4VUserPhysicsList* m_currentList;
@@ -72,6 +84,7 @@
bool m_isFromDefault;
bool m_enableLimits;
bool m_setupLimits;
+ bool m_enableOptical;
PhysicsMessenger* m_messenger;
slic/include
diff -u -r1.10 -r1.11
--- PhysicsMessenger.hh 5 Sep 2006 23:21:48 -0000 1.10
+++ PhysicsMessenger.hh 3 Jul 2007 18:01:30 -0000 1.11
@@ -1,4 +1,4 @@
-// $Header: /cvs/lcd/slic/include/PhysicsMessenger.hh,v 1.10 2006/09/05 23:21:48 jeremy Exp $
+// $Header: /cvs/lcd/slic/include/PhysicsMessenger.hh,v 1.11 2007/07/03 18:01:30 jeremy Exp $
#ifndef SLIC_PHYSICSMESSENGER_HH
#define SLIC_PHYSICSMESSENGER_HH 1
@@ -37,6 +37,7 @@
G4UIcommand* m_selectCmd;
G4UIcmdWithoutParameter* m_printListsCmd;
G4UIcmdWithoutParameter* m_printCurrentCmd;
+ G4UIcmdWithABool* m_enableOpticalCmd;
};
}
slic/src
diff -N LCOpticalPhysics.cc
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ LCOpticalPhysics.cc 3 Jul 2007 18:01:30 -0000 1.1
@@ -0,0 +1,102 @@
+//
+////////////////////////////////////////////////////////////////
+// //
+// Title: Optical physics for a Linear Collider Detector //
+// Date: //
+// Author: //
+// //
+////////////////////////////////////////////////////////////////
+//
+
+#include "LCOpticalPhysics.hh"
+
+// #include "globals.hh"
+// #include "G4ios.hh"
+// #include <iomanip>
+
+LCOpticalPhysics::LCOpticalPhysics(const G4String& name)
+ : G4VPhysicsConstructor(name)
+{
+}
+
+LCOpticalPhysics::~LCOpticalPhysics()
+{
+}
+
+
+
+void LCOpticalPhysics::ConstructParticle()
+{
+
+// G4cout << "Inside LCOpticalPhysics::ConstructParticle()" << G4endl;
+
+ // optical photon
+ G4OpticalPhoton::OpticalPhotonDefinition();
+}
+
+void LCOpticalPhysics::ConstructProcess()
+{
+ ConstructOp();
+
+}
+
+void LCOpticalPhysics::ConstructOp()
+{
+ theCerenkovProcess = new G4Cerenkov("Cerenkov");
+ theScintillationProcess = new G4Scintillation("Scintillation");
+ theAbsorptionProcess = new G4OpAbsorption();
+ theRayleighScatteringProcess = new G4OpRayleigh();
+ theBoundaryProcess = new G4OpBoundaryProcess();
+
+// theCerenkovProcess->DumpPhysicsTable();
+// theScintillationProcess->DumpPhysicsTable();
+// theAbsorptionProcess->DumpPhysicsTable();
+// theRayleighScatteringProcess->DumpPhysicsTable();
+
+
+
+//#ifdef debug
+// G4cout << "VERBOSE = " << theCerenkovProcess->GetVerboseLevel() << G4endl;
+// G4cout << "Inside LCOpticalPhysics::ConstructOp()" << G4endl;
+ //#endif
+
+
+ theCerenkovProcess->SetMaxNumPhotonsPerStep(300);
+ theCerenkovProcess->SetTrackSecondariesFirst(true);
+
+ theScintillationProcess->SetScintillationYieldFactor(1.);
+ theScintillationProcess->SetTrackSecondariesFirst(true);
+
+ G4OpticalSurfaceModel themodel = unified;
+ theBoundaryProcess->SetModel(themodel);
+
+ theParticleIterator->reset();
+ while( (*theParticleIterator)() ){
+
+ G4ParticleDefinition* particle = theParticleIterator->value();
+ G4ProcessManager* pmanager = particle->GetProcessManager();
+ G4String particleName = particle->GetParticleName();
+ if (theCerenkovProcess->IsApplicable(*particle)) {
+ //#ifdef debug
+ //G4cout << "applicable to Cerenkov" << G4endl;
+ //#endif
+ pmanager->AddContinuousProcess(theCerenkovProcess);
+ }
+ if (theScintillationProcess->IsApplicable(*particle)) {
+ //#ifdef debug
+ //G4cout << "applicable to Scintillator" << G4endl;
+ //#endif
+ pmanager->AddProcess(theScintillationProcess);
+ pmanager->SetProcessOrderingToLast(theScintillationProcess, idxAtRest);
+ pmanager->SetProcessOrderingToLast(theScintillationProcess, idxPostStep);
+ }
+ if (particleName == "opticalphoton") {
+ //#ifdef debug
+ //G4cout << " AddDiscreteProcess to OpticalPhoton " << G4endl;
+ //#endif
+ pmanager->AddDiscreteProcess(theAbsorptionProcess);
+ pmanager->AddDiscreteProcess(theRayleighScatteringProcess);
+ pmanager->AddDiscreteProcess(theBoundaryProcess);
+ }
+ }
+}
slic/src
diff -u -r1.8 -r1.9
--- CommandLineProcessor.cc 27 Apr 2007 01:54:34 -0000 1.8
+++ CommandLineProcessor.cc 3 Jul 2007 18:01:30 -0000 1.9
@@ -1,4 +1,4 @@
-// $Id: CommandLineProcessor.cc,v 1.8 2007/04/27 01:54:34 jeremy Exp $
+// $Id: CommandLineProcessor.cc,v 1.9 2007/07/03 18:01:30 jeremy Exp $
#include "CommandLineProcessor.hh"
@@ -51,7 +51,8 @@
{"physics-list", required_argument, 0, 'l'},
{"log-file", required_argument, 0, 'L'},
{"seed", required_argument, 0, 'd'},
- {"dump-gdml", required_argument, 0, 'G'},
+ {"dump-gdml", required_argument, 0, 'G'},
+ {"optical", no_argument, 0, 'c'},
{0, 0, 0, 0}
};
@@ -332,6 +333,14 @@
1,
1,
"/lcdd/dumpGDML"));
+
+ // Enable optical physics processes.
+ addOption(new CommandLineOption("c",
+ "optical",
+ "Enable optical physics processes.",
+ 0,
+ 0,
+ "/physics/enableOptical"));
}
void CommandLineProcessor::processOption(const string& opt)
@@ -378,6 +387,9 @@
// Geometry file.
processOption("g");
+ // Optical processes.
+ processOption("c");
+
// Physics list.
processOption("l");
slic/src
diff -u -r1.18 -r1.19
--- PhysicsListManager.cc 27 Apr 2007 01:54:35 -0000 1.18
+++ PhysicsListManager.cc 3 Jul 2007 18:01:30 -0000 1.19
@@ -1,4 +1,4 @@
-// $Header: /cvs/lcd/slic/src/PhysicsListManager.cc,v 1.18 2007/04/27 01:54:35 jeremy Exp $
+// $Header: /cvs/lcd/slic/src/PhysicsListManager.cc,v 1.19 2007/07/03 18:01:30 jeremy Exp $
#include "PhysicsListManager.hh"
// geant4
@@ -6,6 +6,10 @@
#include "G4UserSpecialCuts.hh"
#include "G4StepLimiter.hh"
#include "G4RunManager.hh"
+#include "G4VModularPhysicsList.hh"
+
+// slic
+#include "LCOpticalPhysics.hh"
namespace slic
{
@@ -24,8 +28,9 @@
m_currentList( 0 ),
m_isInitialized( false ),
m_isFromDefault( false ),
- m_enableLimits( false ),
- m_setupLimits( false )
+ m_enableLimits( false ),
+ m_setupLimits( false ),
+ m_enableOptical( false )
{
// set current to default
m_currentListName = m_defaultListName;
@@ -55,8 +60,14 @@
log() << LOG::okay << "Using default physics list <" << m_defaultListName << ">" << LOG::done;
}
- // create list
+ // Create the physics list from the name argument.
m_currentList = PhysicsListFactory::instance()->create( m_currentListName );
+
+ // Enable optical processes if selected.
+ if (enableOptical()) {
+ setupOpticalProcesses();
+ }
+
G4RunManager::GetRunManager()->SetUserInitialization( m_currentList );
log().okay("Registered physics list <" + m_currentListName + "> with G4RunManager");
@@ -111,4 +122,13 @@
log() << LOG::warning << "PhysicsListManager::setupUserLimitsProcesses() was already called!" << LOG::done;
}
}
+
+ void PhysicsListManager::setupOpticalProcesses()
+ {
+#ifdef SLIC_LOG
+ log() << LOG::okay << "Enabling optical physics processes for the current physics list." << LOG::done;
+#endif
+ G4VModularPhysicsList* l = dynamic_cast<G4VModularPhysicsList*> ( m_currentList );
+ l->RegisterPhysics( new LCOpticalPhysics("optical"));
+ }
}
slic/src
diff -u -r1.21 -r1.22
--- PhysicsMessenger.cc 27 Apr 2007 01:54:35 -0000 1.21
+++ PhysicsMessenger.cc 3 Jul 2007 18:01:30 -0000 1.22
@@ -1,4 +1,4 @@
-// $Header: /cvs/lcd/slic/src/PhysicsMessenger.cc,v 1.21 2007/04/27 01:54:35 jeremy Exp $
+// $Header: /cvs/lcd/slic/src/PhysicsMessenger.cc,v 1.22 2007/07/03 18:01:30 jeremy Exp $
#include "PhysicsMessenger.hh"
// slic
@@ -47,6 +47,13 @@
mgr->log() << LOG::okay << "Current physics list <" << mgr->getCurrentListName() << ">." << LOG::done;
mgr->log() << LOG::okay << "Physics has been initialized <" << mgr->isInitialized() << ">." << LOG::done;
}
+ // Enable optical physics processes.
+ else if ( cmd == m_enableOpticalCmd ) {
+ bool enableOptical=true;
+ if (newVals != G4String("") )
+ enableOptical = G4UIcmdWithABool::GetNewBoolValue(newVals);
+ PhysicsListManager::instance()->enableOptical(enableOptical);
+ }
else {
mgr->log() << LOG::error << "Unknown command for PhysicsMessenger." << LOG::done;
}
@@ -73,5 +80,11 @@
// print current list
m_printCurrentCmd = new G4UIcmdWithoutParameter( "/physics/printCurrent", this );
m_printCurrentCmd->SetGuidance( "Print name of currently selected physics list." );
+
+ // Enable optical physics processes for the current list when it is initialized.
+ m_enableOpticalCmd = new G4UIcmdWithABool("/physics/enableOptical", this);
+ m_enableOpticalCmd->SetGuidance("Enable optical physics processes.");
+ m_enableOpticalCmd->SetParameterName ("enable", 'b', true);
+ m_enableOpticalCmd->SetDefaultValue(true);
}
}
CVSspam 0.2.8