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 ] [ 10.5 ] [ 10.5.p1 ] [ 10.6 ] [ 10.6.p1 ] [ 10.6.p2 ] [ 10.6.p3 ] [ 10.7 ] [ 10.7.p1 ] [ 10.7.p2 ] [ 10.7.p3 ] [ 10.7.p4 ] [ 11.0 ] [ 11.0.p1 ] [ 11.0.p2 ] [ 11.0.p3, ] [ 11.0.p4 ] [ 11.1 ] [ 11.1.1 ] [ 11.1.2 ] [ 11.1.3 ] [ 11.2 ] [ 11.2.1 ] [ 11.2.2 ] [ 11.3.0 ]

Diff markup

Differences between /examples/extended/exoticphysics/monopole/src/G4MonopolePhysics.cc (Version 11.3.0) and /examples/extended/exoticphysics/monopole/src/G4MonopolePhysics.cc (Version 9.5.p2)


  1 //                                                  1 //
  2 // *******************************************      2 // ********************************************************************
  3 // * License and Disclaimer                         3 // * License and Disclaimer                                           *
  4 // *                                                4 // *                                                                  *
  5 // * The  Geant4 software  is  copyright of th      5 // * The  Geant4 software  is  copyright of the Copyright Holders  of *
  6 // * the Geant4 Collaboration.  It is provided      6 // * the Geant4 Collaboration.  It is provided  under  the terms  and *
  7 // * conditions of the Geant4 Software License      7 // * conditions of the Geant4 Software License,  included in the file *
  8 // * LICENSE and available at  http://cern.ch/      8 // * LICENSE and available at  http://cern.ch/geant4/license .  These *
  9 // * include a list of copyright holders.           9 // * include a list of copyright holders.                             *
 10 // *                                               10 // *                                                                  *
 11 // * Neither the authors of this software syst     11 // * Neither the authors of this software system, nor their employing *
 12 // * institutes,nor the agencies providing fin     12 // * institutes,nor the agencies providing financial support for this *
 13 // * work  make  any representation or  warran     13 // * work  make  any representation or  warranty, express or implied, *
 14 // * regarding  this  software system or assum     14 // * regarding  this  software system or assume any liability for its *
 15 // * use.  Please see the license in the file      15 // * use.  Please see the license in the file  LICENSE  and URL above *
 16 // * for the full disclaimer and the limitatio     16 // * for the full disclaimer and the limitation of liability.         *
 17 // *                                               17 // *                                                                  *
 18 // * This  code  implementation is the result      18 // * This  code  implementation is the result of  the  scientific and *
 19 // * technical work of the GEANT4 collaboratio     19 // * technical work of the GEANT4 collaboration.                      *
 20 // * By using,  copying,  modifying or  distri     20 // * By using,  copying,  modifying or  distributing the software (or *
 21 // * any work based  on the software)  you  ag     21 // * any work based  on the software)  you  agree  to acknowledge its *
 22 // * use  in  resulting  scientific  publicati     22 // * use  in  resulting  scientific  publications,  and indicate your *
 23 // * acceptance of all terms of the Geant4 Sof     23 // * acceptance of all terms of the Geant4 Software license.          *
 24 // *******************************************     24 // ********************************************************************
 25 //                                                 25 //
 26 /// \file exoticphysics/monopole/src/G4Monopol <<  26 // $Id: G4MonopolePhysics.cc,v 1.6 2010-11-29 15:14:17 vnivanch Exp $
 27 /// \brief Implementation of the G4MonopolePhy <<  27 // GEANT4 tag $Name: not supported by cvs2svn $
 28 //                                             << 
 29 //                                                 28 //
 30 //--------------------------------------------     29 //---------------------------------------------------------------------------
 31 //                                                 30 //
 32 // ClassName:   G4MonopolePhysics                  31 // ClassName:   G4MonopolePhysics
 33 //                                                 32 //
 34 // Author:      V.Ivanchenko 13.03.2005            33 // Author:      V.Ivanchenko 13.03.2005
 35 //                                                 34 //
 36 // Modified:                                       35 // Modified:
 37 //                                                 36 //
 38 //  12.07.10  S.Burdin (changed the magnetic a <<  37 //  12.07.10  S.Burdin (changed the magnetic and electric charge variables from integer to double)
 39 //            from integer to double)          << 
 40 //--------------------------------------------     38 //----------------------------------------------------------------------------
 41 //                                                 39 //
 42 //                                                 40 //
 43 //....oooOO0OOooo........oooOO0OOooo........oo     41 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
 44 //....oooOO0OOooo........oooOO0OOooo........oo     42 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
 45                                                    43 
 46 #include "G4MonopolePhysics.hh"                    44 #include "G4MonopolePhysics.hh"
                                                   >>  45 #include "G4MonopolePhysicsMessenger.hh"
 47                                                    46 
 48 #include "G4BuilderType.hh"                    << 
 49 #include "G4Monopole.hh"                           47 #include "G4Monopole.hh"
 50 #include "G4MonopolePhysicsMessenger.hh"       << 
 51 #include "G4MonopoleTransportation.hh"         << 
 52 #include "G4ParticleDefinition.hh"                 48 #include "G4ParticleDefinition.hh"
 53 #include "G4PhysicsListHelper.hh"              << 
 54 #include "G4ProcessManager.hh"                     49 #include "G4ProcessManager.hh"
 55 #include "G4ProcessVector.hh"                  <<  50 
 56 #include "G4StepLimiter.hh"                        51 #include "G4StepLimiter.hh"
 57 #include "G4SystemOfUnits.hh"                  << 
 58 #include "G4Transportation.hh"                     52 #include "G4Transportation.hh"
 59 #include "G4hIonisation.hh"                    <<  53 #include "G4MonopoleTransportation.hh"
 60 #include "G4hMultipleScattering.hh"                54 #include "G4hMultipleScattering.hh"
 61 #include "G4hhIonisation.hh"                   << 
 62 #include "G4mplIonisation.hh"                      55 #include "G4mplIonisation.hh"
 63 #include "G4mplIonisationWithDeltaModel.hh"        56 #include "G4mplIonisationWithDeltaModel.hh"
                                                   >>  57 #include "G4hhIonisation.hh"
                                                   >>  58 #include "G4hIonisation.hh"
 64                                                    59 
 65 //....oooOO0OOooo........oooOO0OOooo........oo     60 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
 66                                                    61 
 67 G4MonopolePhysics::G4MonopolePhysics(const G4S     62 G4MonopolePhysics::G4MonopolePhysics(const G4String& nam)
 68   : G4VPhysicsConstructor(nam), fMpl(nullptr)  <<  63   : G4VPhysicsConstructor(nam)
 69 {                                                  64 {
 70   fMagCharge = 1.0;                            <<  65   magCharge = 1.0;
 71   //  fMagCharge = -1.0;                       <<  66   //  magCharge = -1.0;
 72   //  fElCharge  = -50.0;                      <<  67   //  elCharge  = -50.0;
 73   fElCharge = 0.0;                             <<  68   elCharge  = 0.0;
 74   fMonopoleMass = 100. * GeV;                  <<  69   monopoleMass = 100.*GeV;
 75   SetPhysicsType(bUnknown);                    <<  70   theMessenger = new G4MonopolePhysicsMessenger(this);
 76   fMessenger = new G4MonopolePhysicsMessenger( << 
 77 }                                                  71 }
 78                                                    72 
 79 //....oooOO0OOooo........oooOO0OOooo........oo << 
 80                                                << 
 81 G4MonopolePhysics::~G4MonopolePhysics()            73 G4MonopolePhysics::~G4MonopolePhysics()
 82 {                                                  74 {
 83   delete fMessenger;                           <<  75   delete theMessenger;
 84 }                                                  76 }
 85                                                    77 
 86 //....oooOO0OOooo........oooOO0OOooo........oo << 
 87                                                << 
 88 void G4MonopolePhysics::ConstructParticle()        78 void G4MonopolePhysics::ConstructParticle()
 89 {                                                  79 {
 90   if (!fMpl) {                                 <<  80   mpl = G4Monopole::MonopoleDefinition(monopoleMass, magCharge, elCharge);
 91     fMpl = G4Monopole::MonopoleDefinition(fMon << 
 92   }                                            << 
 93   else {                                       << 
 94     G4Monopole::Monopole();                    << 
 95   }                                            << 
 96 }                                                  81 }
 97                                                    82 
 98 //....oooOO0OOooo........oooOO0OOooo........oo << 
 99                                                << 
100 void G4MonopolePhysics::ConstructProcess()         83 void G4MonopolePhysics::ConstructProcess()
101 {                                                  84 {
102   if (verboseLevel > 0) {                      <<  85   if(verboseLevel > 0) {
103     G4cout << "G4MonopolePhysics::ConstructPro     86     G4cout << "G4MonopolePhysics::ConstructProcess" << G4endl;
104   }                                                87   }
105                                                <<  88   
106   G4PhysicsListHelper* ph = G4PhysicsListHelpe <<  89   G4ProcessManager* pmanager = new G4ProcessManager(mpl);
107   G4ProcessManager* pmanager = fMpl->GetProces <<  90   mpl->SetProcessManager(pmanager);
108                                                <<  91   
109   // defined monopole parameters and binning       92   // defined monopole parameters and binning
110   G4double magn = fMpl->MagneticCharge();      << 
111   G4double emin = std::min(fMonopoleMass / 200 << 
112   G4double emax = std::max(10. * TeV, fMonopol << 
113   G4int nbin = G4lrint(10 * std::log10(emax /  << 
114                                                << 
115   // dedicated trasporation                    << 
116   if (magn != 0.0) {                           << 
117     G4int idxt(0);                             << 
118     pmanager->RemoveProcess(idxt);             << 
119     pmanager->AddProcess(new G4MonopoleTranspo << 
120   }                                            << 
121                                                    93 
122   if (fMpl->GetPDGCharge() != 0.0) {           <<  94   G4double emax = 10.*TeV;
                                                   >>  95   G4double magn = mpl->MagneticCharge();
                                                   >>  96   G4double emin = mpl->GetPDGMass()/20000.;
                                                   >>  97   if(emin < keV) emin = keV;
                                                   >>  98 
                                                   >>  99   G4int nbin = G4int(std::log10(emin/eV));
                                                   >> 100   emin       = std::pow(10.,G4double(nbin))*eV;
                                                   >> 101 
                                                   >> 102   nbin = G4int(std::log10(emax/emin));
                                                   >> 103   if(nbin < 1) nbin = 1;
                                                   >> 104   nbin *= 10;
                                                   >> 105   
                                                   >> 106   if(magn == 0.0) {
                                                   >> 107     pmanager->AddProcess( new G4Transportation(), -1, 0, 0);
                                                   >> 108   } else {
                                                   >> 109     pmanager->AddProcess( new G4MonopoleTransportation(mpl), -1, 0, 0);
                                                   >> 110   }
                                                   >> 111 
                                                   >> 112   G4int idx = 1;
                                                   >> 113   if(mpl->GetPDGCharge() != 0.0) {
                                                   >> 114     //G4hMultipleScattering* hmsc = new G4hMultipleScattering();
                                                   >> 115     //pmanager->AddProcess(hmsc,  -1, idx, idx);
                                                   >> 116     //++idx;
123     G4hIonisation* hhioni = new G4hIonisation(    117     G4hIonisation* hhioni = new G4hIonisation();
124     hhioni->SetDEDXBinning(nbin);                 118     hhioni->SetDEDXBinning(nbin);
125     hhioni->SetMinKinEnergy(emin);                119     hhioni->SetMinKinEnergy(emin);
126     hhioni->SetMaxKinEnergy(emax);                120     hhioni->SetMaxKinEnergy(emax);
127     ph->RegisterProcess(hhioni, fMpl);         << 121     pmanager->AddProcess(hhioni,  -1, idx, idx);
                                                   >> 122     ++idx;
128   }                                               123   }
129   if (magn != 0.0) {                           << 124   if(magn != 0.0) {
130     G4mplIonisation* mplioni = new G4mplIonisa    125     G4mplIonisation* mplioni = new G4mplIonisation(magn);
131     mplioni->SetDEDXBinning(nbin);                126     mplioni->SetDEDXBinning(nbin);
132     mplioni->SetMinKinEnergy(emin);               127     mplioni->SetMinKinEnergy(emin);
133     mplioni->SetMaxKinEnergy(emax);               128     mplioni->SetMaxKinEnergy(emax);
134     ph->RegisterProcess(mplioni, fMpl);        << 129     G4mplIonisationWithDeltaModel* mod = 
                                                   >> 130       new G4mplIonisationWithDeltaModel(magn,"PAI");
                                                   >> 131     mplioni->AddEmModel(0,mod,mod);
                                                   >> 132     pmanager->AddProcess(mplioni, -1, idx, idx);
                                                   >> 133     ++idx;
135   }                                               134   }
136   ph->RegisterProcess(new G4StepLimiter(), fMp << 135   pmanager->AddProcess( new G4StepLimiter(),  -1, -1, idx);
137 }                                              << 
138                                                   136 
139 //....oooOO0OOooo........oooOO0OOooo........oo << 137 }
140                                                   138 
141 void G4MonopolePhysics::SetMagneticCharge(G4do    139 void G4MonopolePhysics::SetMagneticCharge(G4double val)
142 {                                                 140 {
143   if (fMpl) {                                  << 141   magCharge = val;
144     G4Exception("G4MonopolePhysics", "01", Jus << 
145                 "Cannot set value when monopol << 
146   }                                            << 
147   else {                                       << 
148     fMagCharge = val;                          << 
149   }                                            << 
150 }                                                 142 }
151                                                   143 
152 //....oooOO0OOooo........oooOO0OOooo........oo << 
153                                                << 
154 void G4MonopolePhysics::SetElectricCharge(G4do    144 void G4MonopolePhysics::SetElectricCharge(G4double val)
155 {                                                 145 {
156   if (fMpl) {                                  << 146   elCharge = val;
157     G4Exception("G4MonopolePhysics", "01", Jus << 
158                 "Cannot set value when monopol << 
159   }                                            << 
160   else {                                       << 
161     fElCharge = val;                           << 
162   }                                            << 
163 }                                                 147 }
164                                                   148 
165 //....oooOO0OOooo........oooOO0OOooo........oo << 
166                                                << 
167 void G4MonopolePhysics::SetMonopoleMass(G4doub    149 void G4MonopolePhysics::SetMonopoleMass(G4double mass)
168 {                                                 150 {
169   if (fMpl) {                                  << 151   monopoleMass = mass;
170     G4Exception("G4MonopolePhysics", "01", Jus << 
171                 "Cannot set value when monopol << 
172   }                                            << 
173   else {                                       << 
174     fMonopoleMass = mass;                      << 
175   }                                            << 
176 }                                                 152 }
177                                                   153 
                                                   >> 154 
178 //....oooOO0OOooo........oooOO0OOooo........oo    155 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
                                                   >> 156 
179                                                   157