source: trunk/examples/extended/exoticphysics/monopole/src/G4MonopolePhysics.cc

Last change on this file was 1337, checked in by garnier, 14 years ago

tag geant4.9.4 beta 1 + modifs locales

File size: 4.7 KB
Line 
1//
2// ********************************************************************
3// * License and Disclaimer                                           *
4// *                                                                  *
5// * The  Geant4 software  is  copyright of the Copyright Holders  of *
6// * the Geant4 Collaboration.  It is provided  under  the terms  and *
7// * conditions of the Geant4 Software License,  included in the file *
8// * LICENSE and available at  http://cern.ch/geant4/license .  These *
9// * include a list of copyright holders.                             *
10// *                                                                  *
11// * Neither the authors of this software system, nor their employing *
12// * institutes,nor the agencies providing financial support for this *
13// * work  make  any representation or  warranty, express or implied, *
14// * regarding  this  software system or assume any liability for its *
15// * use.  Please see the license in the file  LICENSE  and URL above *
16// * for the full disclaimer and the limitation of liability.         *
17// *                                                                  *
18// * This  code  implementation is the result of  the  scientific and *
19// * technical work of the GEANT4 collaboration.                      *
20// * By using,  copying,  modifying or  distributing the software (or *
21// * any work based  on the software)  you  agree  to acknowledge its *
22// * use  in  resulting  scientific  publications,  and indicate your *
23// * acceptance of all terms of the Geant4 Software license.          *
24// ********************************************************************
25//
26// $Id: G4MonopolePhysics.cc,v 1.5 2010/06/04 19:03:36 vnivanch Exp $
27// GEANT4 tag $Name: geant4-09-04-beta-01 $
28//
29//---------------------------------------------------------------------------
30//
31// ClassName:   G4MonopolePhysics
32//
33// Author:      V.Ivanchenko 13.03.2005
34//
35// Modified:
36//
37//----------------------------------------------------------------------------
38//
39//
40//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
41//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
42
43#include "G4MonopolePhysics.hh"
44#include "G4MonopolePhysicsMessenger.hh"
45
46#include "G4Monopole.hh"
47#include "G4ParticleDefinition.hh"
48#include "G4ProcessManager.hh"
49
50#include "G4StepLimiter.hh"
51#include "G4Transportation.hh"
52#include "G4MonopoleTransportation.hh"
53#include "G4hMultipleScattering.hh"
54#include "G4mplIonisation.hh"
55#include "G4hhIonisation.hh"
56
57//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
58
59G4MonopolePhysics::G4MonopolePhysics(const G4String& nam)
60  : G4VPhysicsConstructor(nam)
61{
62  magCharge = 1;
63  elCharge  = 0;
64  monopoleMass = 100.*GeV;
65  theMessenger = new G4MonopolePhysicsMessenger(this);
66}
67
68G4MonopolePhysics::~G4MonopolePhysics()
69{
70  delete theMessenger;
71}
72
73void G4MonopolePhysics::ConstructParticle()
74{
75  mpl = G4Monopole::MonopoleDefinition(monopoleMass, magCharge, elCharge);
76}
77
78void G4MonopolePhysics::ConstructProcess()
79{
80  if(verboseLevel > 0) {
81    G4cout << "G4MonopolePhysics::ConstructProcess" << G4endl;
82  }
83 
84  G4ProcessManager* pmanager = new G4ProcessManager(mpl);
85  mpl->SetProcessManager(pmanager);
86 
87  // defined monopole parameters and binning
88
89  G4double emax = 10.*TeV;
90  G4double magn = mpl->MagneticCharge();
91  G4double emin = mpl->GetPDGMass()/20000.;
92  if(emin < keV) emin = keV;
93
94  G4int nbin = G4int(std::log10(emin/eV));
95  emin       = std::pow(10.,G4double(nbin))*eV;
96
97  nbin = G4int(std::log10(emax/emin));
98  if(nbin < 1) nbin = 1;
99  nbin *= 10;
100 
101  if(magn == 0.0) {
102    pmanager->AddProcess( new G4Transportation(), -1, 0, 0);
103  } else {
104    pmanager->AddProcess( new G4MonopoleTransportation(mpl), -1, 0, 0);
105  }
106
107  G4int idx = 1;
108  if(mpl->GetPDGCharge() != 0.0) {
109    //G4hMultipleScattering* hmsc = new G4hMultipleScattering();
110    //pmanager->AddProcess(hmsc,  -1, idx, idx);
111    //++idx;
112    G4hhIonisation* hhioni = new G4hhIonisation();
113    hhioni->SetDEDXBinning(nbin);
114    hhioni->SetMinKinEnergy(emin);
115    hhioni->SetMaxKinEnergy(emax);
116    pmanager->AddProcess(hhioni,  -1, idx, idx);
117    ++idx;
118  }
119  if(magn != 0.0) {
120    G4mplIonisation* mplioni = new G4mplIonisation(magn);
121    mplioni->SetDEDXBinning(nbin);
122    mplioni->SetMinKinEnergy(emin);
123    mplioni->SetMaxKinEnergy(emax);
124    pmanager->AddProcess(mplioni, -1, idx, idx);
125    ++idx;
126  }
127  pmanager->AddProcess( new G4StepLimiter(),  -1, -1, idx);
128
129}
130
131void G4MonopolePhysics::SetMagneticCharge(G4int val)
132{
133  magCharge = val;
134}
135
136void G4MonopolePhysics::SetElectricCharge(G4int val)
137{
138  elCharge = val;
139}
140
141void G4MonopolePhysics::SetMonopoleMass(G4double mass)
142{
143  monopoleMass = mass;
144}
145
146
147//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
148
Note: See TracBrowser for help on using the repository browser.