Ignore:
Timestamp:
Nov 5, 2010, 4:08:39 PM (14 years ago)
Author:
garnier
Message:

update ti head

Location:
trunk/examples/extended/electromagnetic/TestEm8/src
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/examples/extended/electromagnetic/TestEm8/src/PhysicsList.cc

    r1337 r1342  
    2424// ********************************************************************
    2525//
    26 //
    27 // $Id: PhysicsList.cc,v 1.19 2010/06/04 17:08:15 vnivanch Exp $
    28 // GEANT4 tag $Name: geant4-09-04-beta-01 $
     26// $Id: PhysicsList.cc,v 1.21 2010/10/27 14:52:07 vnivanch Exp $
     27// GEANT4 tag $Name: examples-V09-03-09 $
     28//
     29//---------------------------------------------------------------------------
     30//
     31// ClassName:   PhysicsList
     32//
     33// Description: EM physics with a possibility to add PAI model
     34//
     35// Author:      V.Ivanchenko 01.09.2010
     36//
     37//----------------------------------------------------------------------------
    2938//
    3039
     
    3948#include "G4EmStandardPhysics_option2.hh"
    4049#include "G4EmStandardPhysics_option3.hh"
     50#include "G4EmLivermorePhysics.hh"
     51#include "G4EmPenelopePhysics.hh"
    4152#include "G4DecayPhysics.hh"
    4253
     
    4758#include "G4Electron.hh"
    4859#include "G4Positron.hh"
     60#include "G4Proton.hh"
    4961
    5062#include "G4UnitsTable.hh"
     
    6779  cutForElectron  = defaultCutValue;
    6880  cutForPositron  = defaultCutValue;
    69 
    70   stepMaxProcess  = 0;
     81  cutForProton    = defaultCutValue;
    7182
    7283  pMessenger = new PhysicsListMessenger(this);
     84
     85  stepMaxProcess = new StepMax();
    7386
    7487  // Decay Physics is always defined
     
    140153    emPhysicsList = new G4EmStandardPhysics_option3();
    141154
     155  } else if (name == "emlivermore") {
     156
     157    emName = name;
     158    delete emPhysicsList;
     159    emPhysicsList = new G4EmLivermorePhysics();
     160
     161  } else if (name == "empenelope") {
     162
     163    emName = name;
     164    delete emPhysicsList;
     165    emPhysicsList = new G4EmPenelopePhysics();
     166
    142167  } else if (name == "pai") {
    143168
     
    163188{
    164189  // Step limitation seen as a process
    165   stepMaxProcess = new StepMax();
    166190
    167191  theParticleIterator->reset();
     
    195219  SetCutValue(cutForElectron, "e-");
    196220  SetCutValue(cutForPositron, "e+");
     221  SetCutValue(cutForProton, "proton");
    197222
    198223  if ( verboseLevel > 0 ) { DumpCutValuesTable(); }
     
    221246  cutForPositron = cut;
    222247  SetParticleCuts(cutForPositron, G4Positron::Positron());
     248}
     249
     250//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
     251
     252void PhysicsList::SetCutForProton(G4double cut)
     253{
     254  cutForPositron = cut;
     255  SetParticleCuts(cutForProton, G4Proton::Proton());
    223256}
    224257
  • trunk/examples/extended/electromagnetic/TestEm8/src/PhysicsListMessenger.cc

    r1337 r1342  
    2424// ********************************************************************
    2525//
     26// $Id: PhysicsListMessenger.cc,v 1.3 2010/09/08 09:12:10 vnivanch Exp $
     27// GEANT4 tag $Name: examples-V09-03-09 $
    2628//
    27 // $Id: PhysicsListMessenger.cc,v 1.2 2006/06/29 17:00:47 gunter Exp $
    28 // GEANT4 tag $Name: geant4-09-04-beta-01 $
     29//---------------------------------------------------------------------------
    2930//
     31// ClassName:   PhysicsListMessenger
     32//
     33// Description: EM physics with a possibility to add PAI model
     34//
     35// Author:      V.Ivanchenko 01.09.2010
     36//
     37//----------------------------------------------------------------------------
    3038//
    3139
     
    3846#include "G4UIcmdWithADoubleAndUnit.hh"
    3947#include "G4UIcmdWithAString.hh"
     48#include "G4UIcmdWithAnInteger.hh"
     49#include "HistoManager.hh"
    4050
    4151//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
     
    4454:pPhysicsList(pPhys)
    4555{   
    46   gammaCutCmd = new G4UIcmdWithADoubleAndUnit("/testem/phys/setGCut",this); 
    47   gammaCutCmd->SetGuidance("Set gamma cut.");
    48   gammaCutCmd->SetParameterName("Gcut",false);
    49   gammaCutCmd->SetUnitCategory("Length");
    50   gammaCutCmd->SetRange("Gcut>0.0");
    51   gammaCutCmd->AvailableForStates(G4State_PreInit,G4State_Idle);
     56  eCmd = new G4UIcmdWithADoubleAndUnit("/testem/phys/setMaxE",this); 
     57  eCmd->SetGuidance("Set max energy deposit");
     58  eCmd->SetParameterName("Emax",false);
     59  eCmd->SetUnitCategory("Energy");
     60  eCmd->SetRange("Emax>0.0");
     61  eCmd->AvailableForStates(G4State_PreInit,G4State_Idle);
    5262
    53   electCutCmd = new G4UIcmdWithADoubleAndUnit("/testem/phys/setECut",this); 
    54   electCutCmd->SetGuidance("Set electron cut.");
    55   electCutCmd->SetParameterName("Ecut",false);
    56   electCutCmd->SetUnitCategory("Length");
    57   electCutCmd->SetRange("Ecut>0.0");
    58   electCutCmd->AvailableForStates(G4State_PreInit,G4State_Idle);
     63  ebCmd = new G4UIcmdWithAnInteger("/testem/phys/setNbinsE",this); 
     64  ebCmd->SetGuidance("Set number of bins in energy.");
     65  ebCmd->SetParameterName("Ebins",false);
     66  ebCmd->SetRange("Ebins>0");
     67  ebCmd->AvailableForStates(G4State_PreInit,G4State_Idle);
    5968 
    60   protoCutCmd = new G4UIcmdWithADoubleAndUnit("/testem/phys/setPCut",this); 
    61   protoCutCmd->SetGuidance("Set positron cut.");
    62   protoCutCmd->SetParameterName("Pcut",false);
    63   protoCutCmd->SetUnitCategory("Length");
    64   protoCutCmd->SetRange("Pcut>0.0");
    65   protoCutCmd->AvailableForStates(G4State_PreInit,G4State_Idle); 
    66 
    67   allCutCmd = new G4UIcmdWithADoubleAndUnit("/testem/phys/setCuts",this); 
    68   allCutCmd->SetGuidance("Set cut for all.");
    69   allCutCmd->SetParameterName("cut",false);
    70   allCutCmd->SetUnitCategory("Length");
    71   allCutCmd->SetRange("cut>0.0");
    72   allCutCmd->AvailableForStates(G4State_PreInit,G4State_Idle); 
     69  cbCmd = new G4UIcmdWithAnInteger("/testem/phys/setNbinsCl",this); 
     70  cbCmd->SetGuidance("Set max number of clusters.");
     71  cbCmd->SetParameterName("Cbins",false);
     72  cbCmd->SetRange("Cbins>0");
     73  cbCmd->AvailableForStates(G4State_PreInit,G4State_Idle); 
    7374
    7475  pListCmd = new G4UIcmdWithAString("/testem/phys/addPhysics",this); 
     
    8283PhysicsListMessenger::~PhysicsListMessenger()
    8384{
    84   delete gammaCutCmd;
    85   delete electCutCmd;
    86   delete protoCutCmd;
    87   delete allCutCmd;
     85  delete eCmd;
     86  delete ebCmd;
     87  delete cbCmd;
    8888  delete pListCmd;
    8989}
     
    9494                                          G4String newValue)
    9595{       
    96   if( command == gammaCutCmd )
    97    { pPhysicsList->SetCutForGamma(gammaCutCmd->GetNewDoubleValue(newValue));}
     96  HistoManager* man = HistoManager::GetPointer();
     97  if( command == eCmd )
     98   { man->SetMaxEnergy(eCmd->GetNewDoubleValue(newValue));}
    9899     
    99   if( command == electCutCmd )
    100    { pPhysicsList->SetCutForElectron(electCutCmd->GetNewDoubleValue(newValue));}
     100  if( command == ebCmd )
     101   { man->SetNumberBins(ebCmd->GetNewIntValue(newValue));}
    101102     
    102   if( command == protoCutCmd )
    103    { pPhysicsList->SetCutForPositron(protoCutCmd->GetNewDoubleValue(newValue));}
    104 
    105   if( command == allCutCmd )
    106     {
    107       G4double cut = allCutCmd->GetNewDoubleValue(newValue);
    108       pPhysicsList->SetCutForGamma(cut);
    109       pPhysicsList->SetCutForElectron(cut);
    110       pPhysicsList->SetCutForPositron(cut);
    111     }
     103  if( command == cbCmd )
     104   { man->SetNumberBinsCluster(cbCmd->GetNewIntValue(newValue));}
    112105
    113106  if( command == pListCmd )
Note: See TracChangeset for help on using the changeset viewer.