Ignore:
Timestamp:
Sep 30, 2010, 2:47:17 PM (14 years ago)
Author:
garnier
Message:

tag geant4.9.4 beta 1 + modifs locales

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/examples/extended/electromagnetic/TestEm14/src/RunAction.cc

    r1230 r1337  
    2424// ********************************************************************
    2525//
    26 // $Id: RunAction.cc,v 1.4 2006/09/06 09:56:06 maire Exp $
    27 // GEANT4 tag $Name: geant4-09-03-cand-01 $
     26// $Id: RunAction.cc,v 1.5 2010/04/05 18:02:39 maire Exp $
     27// GEANT4 tag $Name: geant4-09-04-beta-01 $
    2828//
    2929//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
     
    4949RunAction::RunAction(DetectorConstruction* det, PrimaryGeneratorAction* prim,
    5050                     HistoManager* histo)
    51   : detector(det), primary(prim), ProcCounter(0), histoManager(histo)
     51  : detector(det), primary(prim), histoManager(histo)
    5252{ }
    5353
     
    6767  CLHEP::HepRandom::showEngineStatus();
    6868
    69   ProcCounter = new ProcessesCount;
    7069  totalCount = 0;
    7170  sumTrack = sumTrack2 = 0.;
     
    7372 
    7473  histoManager->book();
    75 }
    76 
    77 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
    78 
    79 void RunAction::CountProcesses(G4String procName)
    80 {
    81    //does the process  already encounted ?
    82    size_t nbProc = ProcCounter->size();
    83    size_t i = 0;
    84    while ((i<nbProc)&&((*ProcCounter)[i]->GetName()!=procName)) i++;
    85    if (i == nbProc) ProcCounter->push_back( new OneProcessCount(procName));
    86 
    87    (*ProcCounter)[i]->Count();
    8874}
    8975
     
    11399  //frequency of processes
    114100  G4cout << "\n Process calls frequency --->";
    115   for (size_t i=0; i< ProcCounter->size();i++) {
    116      G4String procName = (*ProcCounter)[i]->GetName();
    117      G4int    count    = (*ProcCounter)[i]->GetCounter();
     101  std::map<G4String,G4int>::iterator it; 
     102  for (it = procCounter.begin(); it != procCounter.end(); it++) {
     103     G4String procName = it->first;
     104     G4int    count    = it->second;
    118105     G4cout << "\t" << procName << " = " << count;
    119106     if (procName == "Transportation") survive = count;
    120107  }
    121  
     108     
    122109  if (survive > 0) {
    123110    G4cout << "\n\n Nb of incident particles surviving after "
     
    160147  G4EmCalculator emCalculator;
    161148  G4double sumc = 0.0; 
    162   for (size_t i=0; i< ProcCounter->size();i++) {
    163     G4String procName = (*ProcCounter)[i]->GetName();
     149  for (it = procCounter.begin(); it != procCounter.end(); it++) {
     150    G4String procName = it->first;     
    164151    G4double massSigma =
    165152    emCalculator.GetCrossSectionPerVolume(energy,particle,
     
    177164                 
    178165  //restore default format       
    179   G4cout.precision(prec);         
    180 
    181   // delete and remove all contents in ProcCounter
    182   while (ProcCounter->size()>0){
    183     OneProcessCount* aProcCount=ProcCounter->back();
    184     ProcCounter->pop_back();
    185     delete aProcCount;
    186   }
    187   delete ProcCounter;
     166  G4cout.precision(prec);
     167           
     168  // remove all contents in procCounter
     169  procCounter.clear();
    188170 
    189171  histoManager->save();
Note: See TracChangeset for help on using the changeset viewer.