Index: trunk/examples/extended/exoticphysics/monopole/src/DetectorConstruction.cc
===================================================================
--- trunk/examples/extended/exoticphysics/monopole/src/DetectorConstruction.cc	(revision 812)
+++ trunk/examples/extended/exoticphysics/monopole/src/DetectorConstruction.cc	(revision 1230)
@@ -25,5 +25,5 @@
 //
 // $Id: DetectorConstruction.cc,v 1.1 2007/08/16 10:32:04 vnivanch Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/exoticphysics/monopole/src/DetectorMessenger.cc
===================================================================
--- trunk/examples/extended/exoticphysics/monopole/src/DetectorMessenger.cc	(revision 812)
+++ trunk/examples/extended/exoticphysics/monopole/src/DetectorMessenger.cc	(revision 1230)
@@ -25,5 +25,5 @@
 //
 // $Id: DetectorMessenger.cc,v 1.1 2007/08/16 10:32:04 vnivanch Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/exoticphysics/monopole/src/EventAction.cc
===================================================================
--- trunk/examples/extended/exoticphysics/monopole/src/EventAction.cc	(revision 812)
+++ trunk/examples/extended/exoticphysics/monopole/src/EventAction.cc	(revision 1230)
@@ -25,5 +25,5 @@
 //
 // $Id: EventAction.cc,v 1.1 2007/08/16 10:32:04 vnivanch Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/exoticphysics/monopole/src/EventActionMessenger.cc
===================================================================
--- trunk/examples/extended/exoticphysics/monopole/src/EventActionMessenger.cc	(revision 812)
+++ trunk/examples/extended/exoticphysics/monopole/src/EventActionMessenger.cc	(revision 1230)
@@ -25,5 +25,5 @@
 //
 // $Id: EventActionMessenger.cc,v 1.1 2007/08/16 10:32:04 vnivanch Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/exoticphysics/monopole/src/G4Monopole.cc
===================================================================
--- trunk/examples/extended/exoticphysics/monopole/src/G4Monopole.cc	(revision 812)
+++ trunk/examples/extended/exoticphysics/monopole/src/G4Monopole.cc	(revision 1230)
@@ -103,4 +103,5 @@
 
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
+
 G4Monopole* G4Monopole::Monopole()
 {    
Index: trunk/examples/extended/exoticphysics/monopole/src/G4MonopolePhysics.cc
===================================================================
--- trunk/examples/extended/exoticphysics/monopole/src/G4MonopolePhysics.cc	(revision 812)
+++ trunk/examples/extended/exoticphysics/monopole/src/G4MonopolePhysics.cc	(revision 1230)
@@ -25,6 +25,6 @@
 //
 //
-// $Id: G4MonopolePhysics.cc,v 1.1 2007/08/16 10:32:04 vnivanch Exp $
-// GEANT4 tag $Name:  $
+// $Id: G4MonopolePhysics.cc,v 1.2 2009/07/15 10:19:47 vnivanch Exp $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //---------------------------------------------------------------------------
@@ -42,6 +42,8 @@
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
 
+#include "G4MonopolePhysics.hh"
+#include "G4MonopolePhysicsMessenger.hh"
+
 #include "G4Monopole.hh"
-#include "G4MonopolePhysics.hh"
 #include "G4ParticleDefinition.hh"
 #include "G4ProcessManager.hh"
@@ -55,37 +57,83 @@
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
 
-G4MonopolePhysics::G4MonopolePhysics(const G4String& name):  G4VPhysicsConstructor(name)
-{}
+G4MonopolePhysics::G4MonopolePhysics(const G4String& nam)
+  : G4VPhysicsConstructor(nam)
+{
+  magCharge = 1;
+  elCharge  = 0;
+  monopoleMass = 100.*GeV;
+  theMessenger = new G4MonopolePhysicsMessenger(this);
+}
 
 G4MonopolePhysics::~G4MonopolePhysics()
-{}
+{
+  delete theMessenger;
+}
 
 void G4MonopolePhysics::ConstructParticle()
 {
-  G4Monopole::MonopoleDefinition(); 
+  G4Monopole::MonopoleDefinition(monopoleMass, magCharge, elCharge);
+}
+
+//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
+void G4MonopolePhysics::ConstructProcess()
+{
+  if(verboseLevel > 0) {
+    G4cout << "G4MonopolePhysics::ConstructProcess" << G4endl;
+  }
+  G4Monopole* mpl = G4Monopole::Monopole();
+  
+  G4ProcessManager* pmanager = new G4ProcessManager(mpl);
+  mpl->SetProcessManager(pmanager);
+  
+  // defined monopole parameters and binning
+
+  G4double emax = 10.*TeV;
+  G4double magn = mpl->MagneticCharge();
+  G4double emin = mpl->GetPDGMass()/20000.;
+  if(emin < keV) emin = keV;
+
+  G4int nbin = G4int(std::log10(emin/eV));
+  emin       = std::pow(10.,G4double(nbin))*eV;
+
+  nbin = G4int(std::log10(emax/emin));
+  if(nbin < 1) nbin = 1;
+  nbin *= 10;
+  
+  pmanager->AddProcess( new G4Transportation(), -1, 0, 0);
+  if(magn != 0.0) {
+    G4mplIonisation* mplioni = new G4mplIonisation(magn);
+    mplioni->SetDEDXBinning(nbin);
+    mplioni->SetMinKinEnergy(emin);
+    mplioni->SetMaxKinEnergy(emax);
+    pmanager->AddProcess(mplioni, -1, 1, 1);
+  }
+  if(mpl->GetPDGCharge() != 0.0) {
+    G4hhIonisation* hhioni = new G4hhIonisation();
+    hhioni->SetDEDXBinning(nbin);
+    hhioni->SetMinKinEnergy(emin);
+    hhioni->SetMaxKinEnergy(emax);
+    pmanager->AddProcess(hhioni,  -1, 2, 2);
+  }
+  pmanager->AddProcess( new G4StepLimiter(),  -1, -1, 3);
+
+}
+
+void G4MonopolePhysics::SetMagneticCharge(G4int val)
+{
+  magCharge = val;
+}
+
+void G4MonopolePhysics::SetElectricCharge(G4int val)
+{
+  elCharge = val;
+}
+
+void G4MonopolePhysics::SetMonopoleMass(G4double mass)
+{
+  monopoleMass = mass;
 }
 
 
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
-void G4MonopolePhysics::ConstructProcess()
-{
 
-  // Add standard EM Processes for gamma
-  G4cout << "G4MonopolePhysics::ConstructProcess" << G4endl;
-
-  G4Monopole* mpl = G4Monopole::MonopoleDefinition();
-  
-  G4ProcessManager* pmanager = new G4ProcessManager(mpl);
-  mpl->SetProcessManager(pmanager);
-  
-  pmanager->AddProcess( new G4Transportation(), -1, 0, 0);
-  pmanager->AddProcess( new G4mplIonisation(mpl->MagneticCharge()), -1, 1, 1);
-  pmanager->AddProcess( new G4StepLimiter(),  -1, -1, 3);
-  if(mpl->GetPDGCharge() != 0.0) {
-    pmanager->AddProcess(new G4hhIonisation(),  -1, 2, 2);
-  }
-
-}
-
-//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
-
Index: trunk/examples/extended/exoticphysics/monopole/src/PrimaryGeneratorAction.cc
===================================================================
--- trunk/examples/extended/exoticphysics/monopole/src/PrimaryGeneratorAction.cc	(revision 812)
+++ trunk/examples/extended/exoticphysics/monopole/src/PrimaryGeneratorAction.cc	(revision 1230)
@@ -24,6 +24,6 @@
 // ********************************************************************
 //
-// $Id: PrimaryGeneratorAction.cc,v 1.1 2007/08/16 10:32:04 vnivanch Exp $
-// GEANT4 tag $Name:  $
+// $Id: PrimaryGeneratorAction.cc,v 1.2 2009/07/15 10:19:47 vnivanch Exp $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -44,8 +44,9 @@
 
 PrimaryGeneratorAction::PrimaryGeneratorAction(DetectorConstruction* det)
-:detector(det)					       
+  :detector(det)
 {
   particleGun  = new G4ParticleGun(1);
-  G4ParticleDefinition* particle = G4ParticleTable::GetParticleTable()->FindParticle("monopole");
+  G4ParticleDefinition* particle = 
+    G4ParticleTable::GetParticleTable()->FindParticle("monopole");
   particleGun->SetParticleDefinition(particle);
   particleGun->SetParticleEnergy(100 * GeV);
@@ -59,5 +60,4 @@
 }
 
-
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
 PrimaryGeneratorAction::~PrimaryGeneratorAction()
@@ -67,6 +67,6 @@
 }
 
+//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
 
-//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
 void PrimaryGeneratorAction::GeneratePrimaries(G4Event* anEvent)
 {
Index: trunk/examples/extended/exoticphysics/monopole/src/PrimaryGeneratorMessenger.cc
===================================================================
--- trunk/examples/extended/exoticphysics/monopole/src/PrimaryGeneratorMessenger.cc	(revision 812)
+++ trunk/examples/extended/exoticphysics/monopole/src/PrimaryGeneratorMessenger.cc	(revision 1230)
@@ -25,5 +25,5 @@
 //
 // $Id: PrimaryGeneratorMessenger.cc,v 1.1 2007/08/16 10:32:04 vnivanch Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/exoticphysics/monopole/src/RunAction.cc
===================================================================
--- trunk/examples/extended/exoticphysics/monopole/src/RunAction.cc	(revision 812)
+++ trunk/examples/extended/exoticphysics/monopole/src/RunAction.cc	(revision 1230)
@@ -24,6 +24,6 @@
 // ********************************************************************
 //
-// $Id: RunAction.cc,v 1.1 2007/08/16 10:32:04 vnivanch Exp $
-// GEANT4 tag $Name:  $
+// $Id: RunAction.cc,v 1.2 2008/06/11 14:34:19 vnivanch Exp $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 // 
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -84,9 +84,10 @@
   if(!binLength) binLength = 5 * mm;
 	if(binLength > detector->GetMaxStepSize()) binLength = detector->GetMaxStepSize();
-  G4int nbBins = (int)(0.5 + length / binLength);
   offsetX   = 0.5 * length;
  
 #ifdef G4ANALYSIS_USE
   if(GetVerbose() > 0) G4cout << "\n----> Histogram Tree opened" << G4endl;
+
+  G4int nbBins = (int)(0.5 + length / binLength);
 
   // Create the tree factory
@@ -143,4 +144,8 @@
 void RunAction::FillHisto(G4int ih, G4double x, G4double weight)
 {
+  if(GetVerbose() > 1) {
+    G4cout << "FillHisto " << ih << "  x=" << x << " weight= " << weight 
+	   << G4endl;
+  }
 #ifdef G4ANALYSIS_USE
   if(histo[ih]) histo[ih]->fill(x, weight);
Index: trunk/examples/extended/exoticphysics/monopole/src/RunActionMessenger.cc
===================================================================
--- trunk/examples/extended/exoticphysics/monopole/src/RunActionMessenger.cc	(revision 812)
+++ trunk/examples/extended/exoticphysics/monopole/src/RunActionMessenger.cc	(revision 1230)
@@ -25,5 +25,5 @@
 //
 // $Id: RunActionMessenger.cc,v 1.1 2007/08/16 10:32:04 vnivanch Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/exoticphysics/monopole/src/SteppingAction.cc
===================================================================
--- trunk/examples/extended/exoticphysics/monopole/src/SteppingAction.cc	(revision 812)
+++ trunk/examples/extended/exoticphysics/monopole/src/SteppingAction.cc	(revision 1230)
@@ -25,5 +25,5 @@
 //
 // $Id: SteppingAction.cc,v 1.2 2007/12/10 16:28:17 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/exoticphysics/monopole/src/TrackingAction.cc
===================================================================
--- trunk/examples/extended/exoticphysics/monopole/src/TrackingAction.cc	(revision 812)
+++ trunk/examples/extended/exoticphysics/monopole/src/TrackingAction.cc	(revision 1230)
@@ -25,5 +25,5 @@
 //
 // $Id: TrackingAction.cc,v 1.1 2007/08/16 10:32:04 vnivanch Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
