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

Last change on this file since 1288 was 1230, checked in by garnier, 14 years ago

update to geant4.9.3

File size: 4.5 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//
27// $Id: G4MonopolePhysics.cc,v 1.2 2009/07/15 10:19:47 vnivanch Exp $
28// GEANT4 tag $Name: geant4-09-03-cand-01 $
29//
30//---------------------------------------------------------------------------
31//
32// ClassName:   G4MonopolePhysics
33//
34// Author:      V.Ivanchenko 13.03.2005
35//
36// Modified:
37//
38//----------------------------------------------------------------------------
39//
40//
41//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
42//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
43
44#include "G4MonopolePhysics.hh"
45#include "G4MonopolePhysicsMessenger.hh"
46
47#include "G4Monopole.hh"
48#include "G4ParticleDefinition.hh"
49#include "G4ProcessManager.hh"
50
51#include "G4StepLimiter.hh"
52#include "G4Transportation.hh"
53#include "G4MultipleScattering.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  G4Monopole::MonopoleDefinition(monopoleMass, magCharge, elCharge);
76}
77
78//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
79void G4MonopolePhysics::ConstructProcess()
80{
81  if(verboseLevel > 0) {
82    G4cout << "G4MonopolePhysics::ConstructProcess" << G4endl;
83  }
84  G4Monopole* mpl = G4Monopole::Monopole();
85 
86  G4ProcessManager* pmanager = new G4ProcessManager(mpl);
87  mpl->SetProcessManager(pmanager);
88 
89  // defined monopole parameters and binning
90
91  G4double emax = 10.*TeV;
92  G4double magn = mpl->MagneticCharge();
93  G4double emin = mpl->GetPDGMass()/20000.;
94  if(emin < keV) emin = keV;
95
96  G4int nbin = G4int(std::log10(emin/eV));
97  emin       = std::pow(10.,G4double(nbin))*eV;
98
99  nbin = G4int(std::log10(emax/emin));
100  if(nbin < 1) nbin = 1;
101  nbin *= 10;
102 
103  pmanager->AddProcess( new G4Transportation(), -1, 0, 0);
104  if(magn != 0.0) {
105    G4mplIonisation* mplioni = new G4mplIonisation(magn);
106    mplioni->SetDEDXBinning(nbin);
107    mplioni->SetMinKinEnergy(emin);
108    mplioni->SetMaxKinEnergy(emax);
109    pmanager->AddProcess(mplioni, -1, 1, 1);
110  }
111  if(mpl->GetPDGCharge() != 0.0) {
112    G4hhIonisation* hhioni = new G4hhIonisation();
113    hhioni->SetDEDXBinning(nbin);
114    hhioni->SetMinKinEnergy(emin);
115    hhioni->SetMaxKinEnergy(emax);
116    pmanager->AddProcess(hhioni,  -1, 2, 2);
117  }
118  pmanager->AddProcess( new G4StepLimiter(),  -1, -1, 3);
119
120}
121
122void G4MonopolePhysics::SetMagneticCharge(G4int val)
123{
124  magCharge = val;
125}
126
127void G4MonopolePhysics::SetElectricCharge(G4int val)
128{
129  elCharge = val;
130}
131
132void G4MonopolePhysics::SetMonopoleMass(G4double mass)
133{
134  monopoleMass = mass;
135}
136
137
138//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
139
Note: See TracBrowser for help on using the repository browser.