Ignore:
Timestamp:
Jan 8, 2010, 3:02:48 PM (14 years ago)
Author:
garnier
Message:

update to geant4.9.3

Location:
trunk/examples/extended/electromagnetic/TestEm3/src
Files:
19 edited

Legend:

Unmodified
Added
Removed
  • trunk/examples/extended/electromagnetic/TestEm3/src/DetectorConstruction.cc

    r807 r1230  
    2424// ********************************************************************
    2525//
    26 // $Id: DetectorConstruction.cc,v 1.20 2007/03/19 20:10:38 vnivanch Exp $
    27 // GEANT4 tag $Name: geant4-09-01-patch-02 $
     26// $Id: DetectorConstruction.cc,v 1.23 2009/03/04 18:49:17 maire Exp $
     27// GEANT4 tag $Name: geant4-09-03-cand-01 $
    2828//
    2929//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
     
    105105  G4Element* H  = manager->FindOrBuildElement(1);
    106106  G4Element* C  = manager->FindOrBuildElement(6);
     107  G4Element* N  = manager->FindOrBuildElement(7);
    107108  G4Element* O  = manager->FindOrBuildElement(8);
    108109  G4Element* Si = manager->FindOrBuildElement(14);
     
    164165  Sci->AddElement(C, natoms=9);
    165166  Sci->AddElement(H, natoms=10);
     167 
     168  Sci->GetIonisation()->SetBirksConstant(0.126*mm/MeV);
    166169
    167170  G4Material* Lct =
     
    199202  BGO->AddElement(Bi, natoms= 4);
    200203
     204  //SiNx
     205  density= 3.1 *g/cm3;
     206  G4Material* SiNx= new G4Material("SiNx", density, ncomponents=3);
     207  SiNx-> AddElement(Si, 300);
     208  SiNx-> AddElement(N, 310);
     209  SiNx-> AddElement(H, 6);
     210
    201211  //
    202212  // define gaseous materials using G4 NIST database
     
    205215 
    206216  G4Material* Air = manager->FindOrBuildMaterial("G4_AIR");
    207   manager->ConstructNewGasMaterial("Air20","G4_AIR",293.*kelvin, 1.*atmosphere);
     217  manager->ConstructNewGasMaterial("Air20","G4_AIR",293.*kelvin,1.*atmosphere);
    208218
    209219  G4Material* lAr = manager->FindOrBuildMaterial("G4_lAr");
     
    242252                  kStateGas, temperature= 273*kelvin, pressure= 1*atmosphere);
    243253  steam->AddMaterial(H2O, fractionmass=1.);
    244 
     254 
     255  new G4Material("ArgonGas", z=18, a=39.948*g/mole, density= 1.782*mg/cm3,
     256                 kStateGas, 273.15*kelvin, 1*atmosphere);
    245257  //
    246258  // examples of vacuum
  • trunk/examples/extended/electromagnetic/TestEm3/src/DetectorMessenger.cc

    r807 r1230  
    2525//
    2626// $Id: DetectorMessenger.cc,v 1.11 2006/06/29 16:52:26 gunter Exp $
    27 // GEANT4 tag $Name: $
     27// GEANT4 tag $Name: geant4-09-03-cand-01 $
    2828//
    2929//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
  • trunk/examples/extended/electromagnetic/TestEm3/src/EmAcceptance.cc

    r807 r1230  
    2525//
    2626// $Id: EmAcceptance.cc,v 1.6 2006/06/29 16:52:28 gunter Exp $
    27 // GEANT4 tag $Name: $
     27// GEANT4 tag $Name: geant4-09-03-cand-01 $
    2828//
    2929//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
  • trunk/examples/extended/electromagnetic/TestEm3/src/EventAction.cc

    r807 r1230  
    2424// ********************************************************************
    2525//
    26 // $Id: EventAction.cc,v 1.15 2007/04/22 16:25:21 vnivanch Exp $
    27 // GEANT4 tag $Name: $
     26// $Id: EventAction.cc,v 1.16 2008/05/29 16:59:27 vnivanch Exp $
     27// GEANT4 tag $Name: geant4-09-03-cand-01 $
    2828//
    2929//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
     
    7171  //initialize EnergyDeposit per event
    7272  //
    73   for (G4int k=0; k<MaxAbsor; k++)
     73  for (G4int k=0; k<MaxAbsor; k++) {
    7474    energyDeposit[k] = trackLengthCh[k] = 0.0;   
     75  }
    7576}
    7677
  • trunk/examples/extended/electromagnetic/TestEm3/src/EventActionMessenger.cc

    r807 r1230  
    2525//
    2626// $Id: EventActionMessenger.cc,v 1.4 2006/06/29 16:52:38 gunter Exp $
    27 // GEANT4 tag $Name: $
     27// GEANT4 tag $Name: geant4-09-03-cand-01 $
    2828//
    2929//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
  • trunk/examples/extended/electromagnetic/TestEm3/src/HistoManager.cc

    r807 r1230  
    2424// ********************************************************************
    2525//
    26 // $Id: HistoManager.cc,v 1.14 2007/11/12 17:04:55 maire Exp $
    27 // GEANT4 tag $Name: $
     26// $Id: HistoManager.cc,v 1.17 2009/03/04 18:49:17 maire Exp $
     27// GEANT4 tag $Name: geant4-09-03-cand-01 $
    2828//
    2929//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
     
    5454 
    5555  fileName[0] = "testem3";
    56   fileType    = "hbook"; 
    57   fileOption  = "--noErrors uncompress"; 
     56  fileType    = "root"; 
     57  fileOption  = "--noErrors export=root uncompress"; 
    5858  // histograms
    5959  for (G4int k=0; k<MaxHisto; k++) {
     
    241241void HistoManager::PrintHisto(G4int ih)
    242242{
    243  if (ih < MaxHisto) ascii[ih] = true;
     243 if (ih < MaxHisto) { ascii[ih] = true; ascii[0] = true; }
    244244 else
    245245    G4cout << "---> warning from HistoManager::PrintHisto() : histo " << ih
     
    254254{
    255255#ifdef G4ANALYSIS_USE
    256  
     256
     257 if (!ascii[0]) return;
     258 
    257259 G4String name = fileName[0] + ".ascii";
    258260 std::ofstream File(name, std::ios::out);
     
    267269      for (G4int iBin=0; iBin<Nbins[ih]; iBin++) {
    268270         File << "  " << iBin << "\t"
    269               << histo[ih]->binMean(iBin) << "\t"
     271              << 0.5*(histo[ih]->axis().binLowerEdge(iBin) +
     272                      histo[ih]->axis().binUpperEdge(iBin)) << "\t"
    270273              << histo[ih]->binHeight(iBin)
    271274              << G4endl;
  • trunk/examples/extended/electromagnetic/TestEm3/src/HistoMessenger.cc

    r807 r1230  
    2525//
    2626// $Id: HistoMessenger.cc,v 1.9 2007/11/12 17:04:55 maire Exp $
    27 // GEANT4 tag $Name: $
     27// GEANT4 tag $Name: geant4-09-03-cand-01 $
    2828//
    2929//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
  • trunk/examples/extended/electromagnetic/TestEm3/src/PhysListEmStandard.cc

    r807 r1230  
    2424// ********************************************************************
    2525//
    26 // $Id: PhysListEmStandard.cc,v 1.14 2007/06/22 09:22:05 maire Exp $
    27 // GEANT4 tag $Name: $
     26// $Id: PhysListEmStandard.cc,v 1.23 2009/11/13 17:01:44 maire Exp $
     27// GEANT4 tag $Name: geant4-09-03-cand-01 $
    2828//
    2929//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
     
    3838#include "G4PhotoElectricEffect.hh"
    3939
    40 #include "G4MultipleScattering.hh"
    41 
     40#include "G4eMultipleScattering.hh"
     41#include "G4UrbanMscModel93.hh"
    4242#include "G4eIonisation.hh"
    4343#include "G4eBremsstrahlung.hh"
    4444#include "G4eplusAnnihilation.hh"
    4545
     46#include "G4MuMultipleScattering.hh"
    4647#include "G4MuIonisation.hh"
    4748#include "G4MuBremsstrahlung.hh"
    4849#include "G4MuPairProduction.hh"
    4950
     51#include "G4hMultipleScattering.hh"
    5052#include "G4hIonisation.hh"
     53#include "G4hBremsstrahlung.hh"
     54#include "G4hPairProduction.hh"
     55
    5156#include "G4ionIonisation.hh"
    5257
     
    8590    } else if (particleName == "e-") {
    8691      //electron
    87       pmanager->AddProcess(new G4MultipleScattering, -1, 1, 1);
    88       pmanager->AddProcess(new G4eIonisation,        -1, 2, 2);
    89       pmanager->AddProcess(new G4eBremsstrahlung(),  -1, 3, 3);
     92      G4eMultipleScattering* msc = new G4eMultipleScattering();
     93      msc->AddEmModel(0, new G4UrbanMscModel93());
     94      pmanager->AddProcess(msc,                       -1, 1, 1);     
     95      pmanager->AddProcess(new G4eIonisation,         -1, 2, 2);
     96      pmanager->AddProcess(new G4eBremsstrahlung(),   -1, 3, 3);
    9097     
    9198    } else if (particleName == "e+") {
    9299      //positron
    93       pmanager->AddProcess(new G4MultipleScattering, -1, 1, 1);
    94       pmanager->AddProcess(new G4eIonisation,        -1, 2, 2);
    95       pmanager->AddProcess(new G4eBremsstrahlung(),  -1, 3, 3);
    96       pmanager->AddProcess(new G4eplusAnnihilation,   0,-1, 4);
     100      G4eMultipleScattering* msc = new G4eMultipleScattering();
     101      msc->AddEmModel(0, new G4UrbanMscModel93());
     102      pmanager->AddProcess(msc,                       -1, 1, 1);     
     103      pmanager->AddProcess(new G4eIonisation,         -1, 2, 2);
     104      pmanager->AddProcess(new G4eBremsstrahlung(),   -1, 3, 3);
     105      pmanager->AddProcess(new G4eplusAnnihilation,    0,-1, 4);
    97106     
    98     } else if( particleName == "mu+" ||
    99                particleName == "mu-"    ) {
     107    } else if( particleName == "mu-" ||
     108               particleName == "mu+"    ) {
    100109      //muon 
    101       pmanager->AddProcess(new G4MultipleScattering, -1, 1, 1);
    102       pmanager->AddProcess(new G4MuIonisation,       -1, 2, 2);
    103       pmanager->AddProcess(new G4MuBremsstrahlung,   -1, 3, 3);
    104       pmanager->AddProcess(new G4MuPairProduction,   -1, 4, 4);       
     110      pmanager->AddProcess(new G4MuMultipleScattering, -1, 1, 1);
     111      pmanager->AddProcess(new G4MuIonisation,         -1, 2, 2);
     112      pmanager->AddProcess(new G4MuBremsstrahlung,     -1, 3, 3);
     113      pmanager->AddProcess(new G4MuPairProduction,     -1, 4, 4);
     114             
     115    } else if( particleName == "proton" ||
     116               particleName == "pi-" ||
     117               particleName == "pi+"    ) {
     118      //proton 
     119      pmanager->AddProcess(new G4hMultipleScattering, -1, 1, 1);
     120      pmanager->AddProcess(new G4hIonisation,         -1, 2, 2);
     121      pmanager->AddProcess(new G4hBremsstrahlung,     -1, 3, 3);
     122      pmanager->AddProcess(new G4hPairProduction,     -1, 4, 4);       
    105123     
    106124    } else if( particleName == "alpha" ||
    107125               particleName == "He3" ||
    108                particleName == "GenericIon" ) {
    109       pmanager->AddProcess(new G4MultipleScattering, -1, 1, 1);
    110       pmanager->AddProcess(new G4ionIonisation,      -1, 2, 2);
     126               particleName == "GenericIon" ) {
     127      //Ions
     128      pmanager->AddProcess(new G4hMultipleScattering, -1, 1, 1);
     129      pmanager->AddProcess(new G4ionIonisation,       -1, 2, 2);
    111130
    112131    } else if ((!particle->IsShortLived()) &&
     
    114133               (particle->GetParticleName() != "chargedgeantino")) {
    115134      //all others charged particles except geantino
    116       pmanager->AddProcess(new G4MultipleScattering, -1, 1, 1);
    117       pmanager->AddProcess(new G4hIonisation,        -1, 2, 2);
     135      pmanager->AddProcess(new G4hMultipleScattering, -1, 1, 1);
     136      pmanager->AddProcess(new G4hIonisation,         -1, 2, 2);
    118137    }
    119138  }
     
    121140  // Em options
    122141  //
     142  // Main options and setting parameters are shown here.
     143  // Several of them have default values.
     144  //
    123145  G4EmProcessOptions emOptions;
    124    
    125   //coulomb scattering
     146 
     147  //physics tables
    126148  //
    127   emOptions.SetMscStepLimitation(fUseDistanceToBoundary);   
    128   emOptions.SetSkin(2.);
    129  
     149  emOptions.SetMinEnergy(100*eV);       //default   
     150  emOptions.SetMaxEnergy(100*TeV);      //default 
     151  emOptions.SetDEDXBinning(12*20);      //default=12*7 
     152  emOptions.SetLambdaBinning(12*20);    //default=12*7
     153  emOptions.SetSplineFlag(true);        //default
     154     
     155  //multiple coulomb scattering
     156  //
     157  emOptions.SetMscStepLimitation(fUseDistanceToBoundary);  //default=fUseSafety
     158  emOptions.SetMscRangeFactor(0.04);    //default
     159  emOptions.SetMscGeomFactor (2.5);     //default       
     160  emOptions.SetSkin(3.);                //default
     161     
    130162  //energy loss
    131163  //
    132   emOptions.SetLinearLossLimit(1.e-6);
    133   emOptions.SetStepFunction(0.2, 100*um);
     164  emOptions.SetStepFunction(0.2, 100*um);       //default=(0.2, 1*mm)     
     165  emOptions.SetLinearLossLimit(1.e-2);          //default
    134166   
    135167  //ionization
    136168  //
    137   emOptions.SetSubCutoff(true);
     169  emOptions.SetSubCutoff(false);                //default=false
    138170}
    139171
  • trunk/examples/extended/electromagnetic/TestEm3/src/PhysicsList.cc

    r807 r1230  
    2424// ********************************************************************
    2525//
    26 // $Id: PhysicsList.cc,v 1.20 2007/11/13 14:37:05 vnivanch Exp $
    27 // GEANT4 tag $Name: $
     26// $Id: PhysicsList.cc,v 1.30 2009/11/13 17:01:44 maire Exp $
     27// GEANT4 tag $Name: geant4-09-03-cand-01 $
    2828//
    2929//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
     
    3434
    3535#include "PhysListEmStandard.hh"
    36 #include "PhysListEmStandardIG.hh"
    37 #include "PhysListEmLivermore.hh"
    38 #include "PhysListEmPenelope.hh"
    3936
    4037#include "G4EmStandardPhysics.hh"
    4138#include "G4EmStandardPhysics_option1.hh"
    4239#include "G4EmStandardPhysics_option2.hh"
    43 
    44 #include "G4LossTableManager.hh"
     40#include "G4EmStandardPhysics_option3.hh"
     41#include "G4EmLivermorePhysics.hh"
     42#include "G4EmPenelopePhysics.hh"
     43
    4544#include "G4UnitsTable.hh"
     45#include "G4UrbanMscModel.hh"
    4646
    4747//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
     
    4949PhysicsList::PhysicsList() : G4VModularPhysicsList()
    5050{
    51   G4LossTableManager::Instance();
    5251  currentDefaultCut   = 1.0*mm;
    5352  cutForGamma         = currentDefaultCut;
     
    6059
    6160  // EM physics
    62   emName = G4String("standard");
     61  emName = G4String("local");
    6362  emPhysicsList = new PhysListEmStandard(emName);
    6463
     
    214213  if (name == emName) return;
    215214
    216   if (name == "standard") {
     215  if (name == "local") {
    217216
    218217    emName = name;
     
    220219    emPhysicsList = new PhysListEmStandard(name);
    221220
    222   } else if (name == "emstandard") {
     221  } else if (name == "emstandard_opt0") {
    223222
    224223    emName = name;
     
    237236    delete emPhysicsList;
    238237    emPhysicsList = new G4EmStandardPhysics_option2();
    239 
    240   } else if (name == "standardIG") {
    241 
    242     emName = name;
    243     delete emPhysicsList;
    244     emPhysicsList = new PhysListEmStandardIG(name);
    245 
    246   } else if (name == "livermore") {
    247 
    248     emName = name;
    249     delete emPhysicsList;
    250     emPhysicsList = new PhysListEmLivermore(name);
    251 
    252   } else if (name == "penelope") {
    253 
    254     emName = name;
    255     delete emPhysicsList;
    256     emPhysicsList = new PhysListEmPenelope(name);
     238   
     239  } else if (name == "emstandard_opt3") {
     240
     241    emName = name;
     242    delete emPhysicsList;
     243    emPhysicsList = new G4EmStandardPhysics_option3();
     244   
     245  } else if (name == "emlivermore") {
     246
     247    emName = name;
     248    delete emPhysicsList;
     249    emPhysicsList = new G4EmLivermorePhysics();
     250
     251  } else if (name == "empenelope") {
     252
     253    emName = name;
     254    delete emPhysicsList;
     255    emPhysicsList = new G4EmPenelopePhysics();
    257256
    258257  } else {
     
    288287
    289288void PhysicsList::SetCuts()
    290 {
    291      
     289{     
    292290  if (verboseLevel >0){
    293291    G4cout << "PhysicsList::SetCuts:";
     
    306304//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
    307305
    308 #include "G4Gamma.hh"
    309 #include "G4Electron.hh"
    310 #include "G4Positron.hh"
    311 
    312306void PhysicsList::SetCutForGamma(G4double cut)
    313307{
  • trunk/examples/extended/electromagnetic/TestEm3/src/PhysicsListMessenger.cc

    r807 r1230  
    2525//
    2626// $Id: PhysicsListMessenger.cc,v 1.3 2006/06/29 16:52:57 gunter Exp $
    27 // GEANT4 tag $Name: $
     27// GEANT4 tag $Name: geant4-09-03-cand-01 $
    2828//
    2929//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
  • trunk/examples/extended/electromagnetic/TestEm3/src/PrimaryGeneratorAction.cc

    r807 r1230  
    2525//
    2626// $Id: PrimaryGeneratorAction.cc,v 1.7 2006/06/29 16:53:00 gunter Exp $
    27 // GEANT4 tag $Name: $
     27// GEANT4 tag $Name: geant4-09-03-cand-01 $
    2828//
    2929//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
  • trunk/examples/extended/electromagnetic/TestEm3/src/PrimaryGeneratorMessenger.cc

    r807 r1230  
    2525//
    2626// $Id: PrimaryGeneratorMessenger.cc,v 1.3 2006/06/29 16:53:02 gunter Exp $
    27 // GEANT4 tag $Name: $
     27// GEANT4 tag $Name: geant4-09-03-cand-01 $
    2828//
    2929//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
  • trunk/examples/extended/electromagnetic/TestEm3/src/RunAction.cc

    r807 r1230  
    2424// ********************************************************************
    2525//
    26 // $Id: RunAction.cc,v 1.34 2007/04/24 13:05:14 vnivanch Exp $
    27 // GEANT4 tag $Name: geant4-09-01-patch-02 $
     26// $Id: RunAction.cc,v 1.37 2008/05/29 16:59:27 vnivanch Exp $
     27// GEANT4 tag $Name: geant4-09-03-cand-01 $
    2828//
    2929//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
     
    131131  G4cout << "\n------------------------------------------------------------\n";
    132132  G4cout << std::setw(14) << "material"
    133          << std::setw(17) << "Total Edep"
     133         << std::setw(17) << "Edep       RMS"
    134134         << std::setw(33) << "sqrt(E0(GeV))*rmsE/Emean"
    135135         << std::setw(23) << "total tracklen \n \n";
     
    139139      MeanEAbs  = sumEAbs[k]*norm;
    140140      MeanEAbs2 = sum2EAbs[k]*norm;
    141       rmsEAbs  = std::sqrt(std::fabs(MeanEAbs2 - MeanEAbs*MeanEAbs));
    142 
     141      rmsEAbs  = std::sqrt(std::abs(MeanEAbs2 - MeanEAbs*MeanEAbs));
     142      //G4cout << "k= " << k << "  RMS= " <<  rmsEAbs
     143      //     << "  applyLimit: " << applyLimit << G4endl;
    143144      if(applyLimit) {
    144145        G4int    nn    = 0;
     
    159160        MeanEAbs  = sume*norm1;
    160161        MeanEAbs2 = sume2*norm1;
    161         rmsEAbs  = std::sqrt(std::fabs(MeanEAbs2 - MeanEAbs*MeanEAbs));
     162        rmsEAbs  = std::sqrt(std::abs(MeanEAbs2 - MeanEAbs*MeanEAbs));
    162163      }
    163164
     
    171172      MeanLAbs  = sumLAbs[k]*norm;
    172173      MeanLAbs2 = sum2LAbs[k]*norm;
    173       rmsLAbs  = std::sqrt(std::fabs(MeanLAbs2 - MeanLAbs*MeanLAbs));
     174      rmsLAbs  = std::sqrt(std::abs(MeanLAbs2 - MeanLAbs*MeanLAbs));
    174175
    175176      //print
     
    178179       << std::setw(14) << Detector->GetAbsorMaterial(k)->GetName() << ": "
    179180       << std::setprecision(5)
    180        << std::setw(6) << G4BestUnit(MeanEAbs,"Energy") << " +- "
     181       << std::setw(6) << G4BestUnit(MeanEAbs,"Energy") << " : "
    181182       << std::setprecision(4)
    182183       << std::setw(5) << G4BestUnit( rmsEAbs,"Energy") 
     
    189190    }
    190191  G4cout << "\n------------------------------------------------------------\n";
     192
     193  G4cout << " Beam particle "
     194         << Primary->GetParticleGun()->
     195    GetParticleDefinition()->GetParticleName()
     196         << "  E = " << G4BestUnit(beamEnergy,"Energy") << G4endl;
    191197 
    192198  //Energy flow
  • trunk/examples/extended/electromagnetic/TestEm3/src/RunActionMessenger.cc

    r807 r1230  
    2525//
    2626// $Id: RunActionMessenger.cc,v 1.13 2007/04/25 10:07:27 vnivanch Exp $
    27 // GEANT4 tag $Name: $
     27// GEANT4 tag $Name: geant4-09-03-cand-01 $
    2828//
    2929//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
  • trunk/examples/extended/electromagnetic/TestEm3/src/StepMax.cc

    r807 r1230  
    2525//
    2626// $Id: StepMax.cc,v 1.4 2006/06/29 16:53:19 gunter Exp $
    27 // GEANT4 tag $Name: $
     27// GEANT4 tag $Name: geant4-09-03-cand-01 $
    2828//
    2929//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
  • trunk/examples/extended/electromagnetic/TestEm3/src/StepMaxMessenger.cc

    r807 r1230  
    2525//
    2626// $Id: StepMaxMessenger.cc,v 1.3 2006/06/29 16:53:21 gunter Exp $
    27 // GEANT4 tag $Name: $
     27// GEANT4 tag $Name: geant4-09-03-cand-01 $
    2828//
    2929//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
  • trunk/examples/extended/electromagnetic/TestEm3/src/SteppingAction.cc

    r807 r1230  
    2424// ********************************************************************
    2525//
    26 // $Id: SteppingAction.cc,v 1.25 2006/06/29 16:53:23 gunter Exp $
    27 // GEANT4 tag $Name: geant4-09-01-patch-02 $
     26// $Id: SteppingAction.cc,v 1.28 2008/05/29 16:59:27 vnivanch Exp $
     27// GEANT4 tag $Name: geant4-09-03-cand-01 $
    2828//
    2929//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
     
    4747:G4UserSteppingAction(),detector(det),runAct(run),eventAct(evt),
    4848 histoManager(hist)
    49 {}
     49{ }
    5050
    5151//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
     
    8181  G4double stepl = 0.;
    8282  if (particle->GetPDGCharge() != 0.) stepl = aStep->GetStepLength();
    83    
     83 
     84  //  G4cout << "Nabs= " << absorNum << "   edep(keV)= " << edep << G4endl;
     85 
    8486  // sum up per event
    8587  eventAct->SumEnergy(absorNum,edep,stepl);
    8688 
    8789  //longitudinal profile of edep per absorber
    88   if (edep>0.) histoManager->FillHisto(MaxAbsor+absorNum, layerNum+1., edep);
     90  if (edep>0.) histoManager->FillHisto(MaxAbsor+absorNum,
     91                                       G4double(layerNum+1), edep);
    8992 
    9093  //energy flow
     
    108111
    109112////  example of Birk attenuation
    110 ///G4double destep   = aStep->GetTotalEnergyDeposit();
    111 ////  G4double response = BirkAttenuation(aStep);
    112 ///G4cout << " Destep: " << destep/keV << " keV"
    113 ////         << " response after Birk: " << response/keV << " keV" << G4endl;
     113///G4double destep   = aStep->GetTotalEnergyDeposit();
     114///G4double response = BirksAttenuation(aStep);
     115///G4cout << " Destep: " << destep/keV << " keV"
     116///       << " response after Birks: " << response/keV << " keV" << G4endl;
    114117}
    115118
    116119//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
    117120
    118 G4double SteppingAction::BirkAttenuation(const G4Step* aStep)
     121G4double SteppingAction::BirksAttenuation(const G4Step* aStep)
    119122{
    120123 //Example of Birk attenuation law in organic scintillators.
    121124 //adapted from Geant3 PHYS337. See MIN 80 (1970) 239-244
    122125 //
    123  const G4String myMaterial = "Scintillator";
    124  const G4double birk1 = 0.013*g/(MeV*cm2);
    125  //
     126 G4Material* material = aStep->GetTrack()->GetMaterial();
     127 G4double birk1       = material->GetIonisation()->GetBirksConstant();
    126128 G4double destep      = aStep->GetTotalEnergyDeposit();
    127  G4Material* material = aStep->GetTrack()->GetMaterial();
     129 G4double stepl       = aStep->GetStepLength(); 
    128130 G4double charge      = aStep->GetTrack()->GetDefinition()->GetPDGCharge();
    129131 //
    130132 G4double response = destep;
    131  if ((material->GetName()==myMaterial)&&(charge!=0.))
     133 if (birk1*destep*stepl*charge != 0.)
    132134   {
    133      G4double correction =
    134      birk1*destep/((material->GetDensity())*(aStep->GetStepLength()));
    135      response = destep/(1. + correction);
     135     response = destep/(1. + birk1*destep/stepl);
    136136   }
    137137 return response;
  • trunk/examples/extended/electromagnetic/TestEm3/src/SteppingVerbose.cc

    r807 r1230  
    2525//
    2626// $Id: SteppingVerbose.cc,v 1.4 2006/06/29 16:53:25 gunter Exp $
    27 // GEANT4 tag $Name: $
     27// GEANT4 tag $Name: geant4-09-03-cand-01 $
    2828//
    2929//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
  • trunk/examples/extended/electromagnetic/TestEm3/src/TrackingAction.cc

    r807 r1230  
    2626//
    2727// $Id: TrackingAction.cc,v 1.2 2006/06/29 16:53:27 gunter Exp $
    28 // GEANT4 tag $Name: $
     28// GEANT4 tag $Name: geant4-09-03-cand-01 $
    2929//
    3030//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Note: See TracChangeset for help on using the changeset viewer.