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

update to geant4.9.3

Location:
trunk/examples/extended/radioactivedecay/exrdm/src
Files:
10 edited

Legend:

Unmodified
Added
Removed
  • trunk/examples/extended/radioactivedecay/exrdm/src/exrdmAnalysisManager.cc

    r807 r1230  
    4646  return fManager;
    4747}
     48void exrdmAnalysisManager::dispose()
     49{
     50  delete fManager;
     51  fManager = 0;
     52}
    4853
    4954//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
     
    5863  pulseWidth = 1.*microsecond;
    5964  histo   = new exrdmHisto();
    60 #if defined G4ANALYSIS_USE_AIDA || defined G4ANALYSIS_USE_ROOT
    61    bookHisto();
     65  bookHisto();
     66}
     67
     68//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
     69
     70exrdmAnalysisManager::~exrdmAnalysisManager()
     71{
     72#ifdef G4ANALYSIS_USE
     73#define HISTDELETE
    6274#endif
    63 }
    64 
    65 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
    66 
    67 exrdmAnalysisManager::~exrdmAnalysisManager()
    68 {
    69 //  delete histo;
     75#ifdef G4ANALYSIS_USE_ROOT
     76#define HISTDELETE
     77#endif
     78#ifdef HISTDELETE
     79  delete histo;
     80#endif
    7081}
    7182
     
    94105  // in aida these histos are indiced from 0-6
    95106  //
    96   histo->addTuple( "100", "Emitted Particles","float PID, Energy, Time, Weight" );
    97   histo->addTuple( "200", "RadioIsotopes","float PID, Time, Weight" );
    98   histo->addTuple( "300", "Energy Depositions","float Energy, Time, Weight" );
     107  histo->addTuple( "1", "Emitted Particles","double PID, Energy, Time, Weight" );
     108  histo->addTuple( "2", "RadioIsotopes","double PID, Time, Weight" );
     109  histo->addTuple( "3", "Energy Depositions","double Energy, Time, Weight" );
    99110
    100111}
     
    104115void exrdmAnalysisManager::BeginOfRun()
    105116{
    106 #if defined G4ANALYSIS_USE_AIDA || G4ANALYSIS_USE_ROOT
    107117  histo->book();
    108 #endif
    109   if(verbose > 0) {
    110     G4cout << "exrdmAnalysisManager: Histograms are booked and the run has been started"
    111            << G4endl;
    112   }
     118  G4cout << "exrdmAnalysisManager: Histograms are booked and the run has been started" << G4endl;
    113119}
    114120
     
    117123void exrdmAnalysisManager::EndOfRun()
    118124{
    119 #if defined G4ANALYSIS_USE_AIDA || G4ANALYSIS_USE_ROOT
    120125  histo->save(); 
    121 #endif
    122126}
    123127
  • trunk/examples/extended/radioactivedecay/exrdm/src/exrdmEventAction.cc

    r807 r1230  
    6767void exrdmEventAction::EndOfEventAction(const G4Event* evt)
    6868{
    69   G4int event_id       = evt->GetEventID();
    7069  //analysis
    7170  exrdmAnalysisManager::getInstance()->EndOfEvent();
    7271  // visualisation
     72#ifdef G4VIS_USE
     73  G4int event_id       = evt->GetEventID();
    7374  if (event_id < 100 && G4VVisManager::GetConcreteInstance()) {
    7475    G4TrajectoryContainer * trajectoryContainer = evt->GetTrajectoryContainer();
     
    8586    }
    8687  }
     88#endif
    8789}
    8890
  • trunk/examples/extended/radioactivedecay/exrdm/src/exrdmHisto.cc

    r807 r1230  
    2424// ********************************************************************
    2525//
    26 
    27 #include "exrdmHisto.hh"
    28 #include "exrdmHistoMessenger.hh"
    29 #include "G4ParticleTable.hh"
    30 
    31 #include "G4Tokenizer.hh"
    32 
    33 #ifdef G4ANALYSIS_USE_AIDA
     26#ifdef G4ANALYSIS_USE
    3427#include <AIDA/AIDA.h>
    3528#endif
     
    4740#include "TNtuple.h"
    4841#endif
     42
     43#include "exrdmHisto.hh"
     44#include "exrdmHistoMessenger.hh"
     45#include "G4ParticleTable.hh"
     46
     47#include "G4Tokenizer.hh"
     48
    4949//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
    5050exrdmHisto::exrdmHisto()
    5151{
    52   verbose    = 0;
     52  verbose    = 1;
    5353  histName   = "exrdm";
    54   histType   = "root";
     54  histType   = "aida";
     55  //histType   = "root";
    5556  nHisto     = 0;
    5657  nTuple     = 0;
    5758  defaultAct = 1;
    5859  //
    59 #ifdef G4ANALYSIS_USE_AIDA
    60   histo.clear();
    61   ntup.clear();
    62 #endif
     60#ifdef G4ANALYSIS_USE
     61  aida = 0;
     62  tree = 0;
     63#endif
     64
    6365#ifdef G4ANALYSIS_USE_ROOT
    6466  ROOThisto.clear();
     
    6769  Rcol.clear();
    6870#endif
     71
    6972  active.clear();
    7073  bins.clear();
     
    7881  tupleList.clear();
    7982  tupleListROOT.clear();
    80   messenger  = 0;
    8183
    8284  messenger = new exrdmHistoMessenger(this);
     
    8789exrdmHisto::~exrdmHisto()
    8890{
    89 #ifdef G4ANALYSIS_USE_AIDA
    90   for(G4int i=0; i<nHisto; i++) {
    91     if(histo[i]) delete histo[i];
    92   }
    93 #endif
    94 #ifdef G4ANALYSIS_USE_ROOT
    95   for(G4int i=0; i<nHisto; i++) {
    96     if(ROOThisto[i]) delete ROOThisto[i];
    97   }
     91#ifdef G4ANALYSIS_USE
     92  histo.clear();
     93  ntup.clear();
     94#endif
     95#ifdef G4ANALYSIS_USE_ROOT
     96  //FIXME : G.Barrand : the below is crashy.
     97  //        In principle the TH are deleted
     98  //        when doing the TFile::Close !
     99  //         In fact the hfileROOT should
     100  //        be deleted in save(). And I am pretty
     101  //        sure that the TApplication is not needed.
     102  //
     103  // removed by F.Lei
     104  //  for(G4int i=0; i<nHisto; i++) {
     105  //   if(ROOThisto[i]) delete ROOThisto[i];
     106  // }
    98107#endif
    99108  delete messenger;
     
    104113void exrdmHisto::book()
    105114{
     115#ifdef G4ANALYSIS_USE
    106116  G4cout << "### exrdmHisto books " << nHisto << " histograms " << G4endl;
    107 #ifdef G4ANALYSIS_USE_AIDA
    108117  // Creating the analysis factory
    109   AIDA::IAnalysisFactory* af = AIDA_createAnalysisFactory();
     118  aida = AIDA_createAnalysisFactory();
     119  if(!aida) {
     120    G4cout << "ERROR: can't get AIDA." << G4endl;
     121    return;
     122  }
    110123  // Creating the tree factory
    111   AIDA::ITreeFactory* tf = af->createTreeFactory();
     124 {AIDA::ITreeFactory* tf = aida->createTreeFactory();
    112125  // Creating a tree mapped to a new aida file.
    113   G4String aidaFileName;
    114   if (fileType == "hbook")
    115     aidaFileName = histName +G4String(".hbook");
    116   else
    117     aidaFileName = histName +G4String(".aida");
    118   tree = tf->create(aidaFileName,histType,false,true,"uncompress");
    119   if(tree)
    120     G4cout << "Tree store  : " << tree->storeName() << G4endl;
    121   else
    122     G4cout << "ERROR: Tree store " << histName  << " is not created!" << G4endl;
    123 
     126  G4String fileName = histName + "." + histType;
     127  if (histType == "root") fileName = histName + "_aida." + histType;
     128  tree = tf->create(fileName,histType,false,true,"compress=yes");
     129  delete tf;
     130  if(!tree) {
     131    G4cout << "ERROR: Tree store " << histName  << " is not created!" << G4endl;
     132    return;
     133  }
     134  G4cout << "Tree store  : " << tree->storeName() << G4endl;}
    124135  // Creating a histogram factory, whose histograms will be handled by the tree
    125   AIDA::IHistogramFactory* hf = af->createHistogramFactory(*tree);
     136 {AIDA::IHistogramFactory* hf = aida->createHistogramFactory(*tree);
    126137  // Creating an 1-dimensional histograms in the root directory of the tree
    127138  for(G4int i=0; i<nHisto; i++) {
    128139    if(active[i]) {
    129       histo[i] = hf->createHistogram1D(ids[i], titles[i], bins[i], xmin[i], xmax[i]);
     140      if(verbose>1)
     141        G4cout<<"book: histogram "<< i << " id= " << ids[i] <<G4endl;
     142      G4String tit = ids[i];
     143      if(histType == "root") tit = "h" + ids[i];
     144      histo[i] = hf->createHistogram1D(tit, titles[i], bins[i], xmin[i], xmax[i]);
    130145    }
    131146  }
     147  delete hf;
     148  G4cout << "AIDA histograms are booked" << G4endl;}
     149
    132150  // Creating a tuple factory, whose tuples will be handled by the tree 
    133   AIDA::ITupleFactory* tpf =  af->createTupleFactory( *tree );
     151 {AIDA::ITupleFactory* tpf =  aida->createTupleFactory( *tree );
     152  G4cout << "AIDA will book " << nTuple << " ntuples" << G4endl;
    134153  for(G4int i=0; i<nTuple; i++) {
    135154    if(tupleList[i] != "") {
    136       G4cout << "Creating Ntuple: " << tupleName[i] << G4endl;
    137       ntup[i] = tpf->create(tupleId[i], tupleName[i], tupleList[i]);
     155      G4cout << "Creating Ntuple: " << tupleName[i] <<":" <<tupleList[i] <<G4endl;
     156      ntup[i] = tpf->create(tupleId[i], tupleName[i], tupleList[i],"");
    138157    }
    139158  }
    140 #endif
    141 
    142 #ifdef G4ANALYSIS_USE_ROOT
    143   new TApplication("App", ((int *)0), ((char **)0));
     159  delete tpf;
     160  G4cout << "AIDA ntuples are booked" << G4endl;}
     161#endif
     162
     163#ifdef G4ANALYSIS_USE_ROOT
     164//  new TApplication("App", ((int *)0), ((char **)0));
    144165  G4String fileNameROOT = histName + G4String(".root");
    145166  hfileROOT = new TFile(fileNameROOT.c_str() ,"RECREATE","ROOT file for exRDM");
    146  
     167  G4cout << "Root file: " << fileNameROOT << G4endl;
    147168  // Creating an 1-dimensional histograms in the root directory of the tree
    148169  for(G4int i=0; i<nHisto; i++) {
     
    157178    if(tupleListROOT[i] != "") {
    158179      G4String id = G4String("t")+tupleId[i];
    159       G4cout << "Creating Ntuple "<<tupleId[i] << " in ROOT file: " << tupleName[i] << G4endl;
     180      G4cout << "Creating Ntuple "<<tupleId[i] << " in ROOT file: "
     181             << tupleName[i] << G4endl;
    160182      ROOTntup[i] = new TNtuple(id, tupleName[i], tupleListROOT[i]);
     183      G4cout << "ROOT Ntuple " << id << " " << tupleName[i] <<" "<< tupleListROOT[i]<< " booked " << G4endl;
    161184    }
    162185  }
     
    169192void exrdmHisto::save()
    170193{
    171 #ifdef G4ANALYSIS_USE_AIDA
     194#ifdef G4ANALYSIS_USE
    172195  // Write histogram file
    173196  tree->commit();
     
    175198  tree->close();
    176199  G4cout << "Histograms and Ntuples are saved" << G4endl;
     200  delete tree;
     201  tree = 0;
     202  delete aida;
     203  aida = 0;
     204  {for(G4int i=0; i<nHisto; i++) histo[i] = 0;}
     205  {for(G4int i=0; i<nTuple; i++) ntup[i] = 0;}
    177206#endif
    178207#ifdef G4ANALYSIS_USE_ROOT
     
    181210  G4cout << "ROOT: files closing..." << G4endl;
    182211  hfileROOT->Close();
     212  //
     213  // F.Lei added following Guy's suggestion!
     214  delete hfileROOT;
     215
    183216#endif
    184217}
     
    205238  ids.push_back(id);
    206239  titles.push_back(name);
    207 #ifdef G4ANALYSIS_USE_AIDA
     240#ifdef G4ANALYSIS_USE
    208241  histo.push_back(0);
    209242#endif
     
    241274           << G4endl;   
    242275  }
    243 #ifdef G4ANALYSIS_USE_AIDA 
     276#ifdef G4ANALYSIS_USE
    244277  if(i>=0 && i<nHisto) {
    245     histo[i]->fill((float)(x/unit[i]), (float)w);
     278    histo[i]->fill(x/unit[i], w);
    246279  } else {
    247280    G4cout << "exrdmHisto::fill: WARNING! wrong AIDA histogram index " << i << G4endl;
     
    264297    G4cout << "Scale histogram: #" << i << " by factor " << x << G4endl;   
    265298  }
    266 #ifdef G4ANALYSIS_USE_AIDA 
     299#ifdef G4ANALYSIS_USE
    267300  if(i>=0 && i<nHisto) {
    268301    histo[i]->scale(x);
     
    281314//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
    282315
    283 void exrdmHisto::addTuple(const G4String& w1, const G4String& w2, const G4String& w3)
    284 {
    285 //  G4cout << w1 << " " << w2 << " " << w3 << G4endl;
     316#ifdef G4ANALYSIS_USE
     317void exrdmHisto::addTuple(const G4String& w1, const G4String& w2, const G4String& w3 )
     318#else
     319void exrdmHisto::addTuple(const G4String& w1, const G4String& w2, const G4String& )
     320#endif
     321
     322{
     323  //G4cout << w1 << " " << w2 << " " << w3 << G4endl;
     324  nTuple++;
     325  tupleId.push_back(w1);
     326  tupleName.push_back(w2) ;
     327#ifdef G4ANALYSIS_USE
     328  tupleList.push_back(w3);
     329  ntup.push_back(0);
     330#endif
     331
     332#ifdef G4ANALYSIS_USE_ROOT
    286333  std::vector<float> ar;
    287334  ar.clear();
    288335  for (size_t i = 0; i < 20; i++) ar.push_back(0.);
    289   nTuple++;
    290 #ifdef G4ANALYSIS_USE_ROOT
    291336  Rarray.push_back(ar);
    292 #endif
    293   tupleId.push_back(w1);
    294   tupleName.push_back(w2) ;
    295337  // convert AIDA header to ROOT header for ntuple
    296338  G4Tokenizer next(w3);
     
    300342  while ( token != "") {
    301343   token = next();
    302    ROOTList1 = ROOTList1 + token +G4String(":");
     344   if (token == ",") token = next();
     345   if (token.contains(",")) token.remove(token.size()-1);
     346   ROOTList1 = ROOTList1 + token + G4String(":");
    303347   col++;
    304348  }
     
    306350//  G4cout << ROOTList << G4endl;
    307351  tupleListROOT.push_back(ROOTList);
    308   //
    309 #ifdef G4ANALYSIS_USE_AIDA 
    310   ntup.push_back(0);
    311 #endif
    312 #ifdef G4ANALYSIS_USE_ROOT
    313352  ROOTntup.push_back(0);
    314353  Rcol.push_back(col-1);
     
    323362    G4cout << "fill tuple # " << i
    324363           <<" with  parameter <" << parname << "> = " << x << G4endl;
    325 #ifdef G4ANALYSIS_USE_AIDA 
    326   if(ntup[i]) ntup[i]->fill(ntup[i]->findColumn(parname), (float)x);
     364#ifdef G4ANALYSIS_USE
     365  if(ntup[i]) ntup[i]->fill(ntup[i]->findColumn(parname), x);
    327366#endif
    328367}
     
    336375           <<" in column < " << col << "> = " << x << G4endl;
    337376  }
    338 #ifdef G4ANALYSIS_USE_AIDA 
    339   if(ntup[i]) ntup[i]->fill(col, (float)x);
     377#ifdef G4ANALYSIS_USE
     378  if(ntup[i]) ntup[i]->fill(col,double(x));
    340379#endif
    341380
     
    348387//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
    349388
    350 void exrdmHisto::fillTuple(G4int i, const G4String& parname, G4String x)
     389void exrdmHisto::fillTuple(G4int i, const G4String& parname, G4String& x)
    351390{
    352391  if(verbose > 1) {
     
    354393           <<" with  parameter <" << parname << "> = " << x << G4endl;
    355394  }
    356 #ifdef G4ANALYSIS_USE_AIDA 
     395#ifdef G4ANALYSIS_USE
    357396  if(ntup[i]) ntup[i]->fill(ntup[i]->findColumn(parname), x);
    358397#endif
     398
    359399}
    360400
     
    363403void exrdmHisto::addRow(G4int i)
    364404{
    365 #ifdef G4ANALYSIS_USE_AIDA
     405  if(verbose > 1) G4cout << "Added a raw #" << i << " to tuple" << G4endl;
     406#ifdef G4ANALYSIS_USE
    366407  if(ntup[i]) ntup[i]->addRow();
    367408#endif
  • trunk/examples/extended/radioactivedecay/exrdm/src/exrdmHistoMessenger.cc

    r807 r1230  
    4949
    5050  fileCmd = new G4UIcmdWithAString("/histo/fileType",this);
    51   fileCmd->SetGuidance("set type (hbook, XML) for the histograms file");
     51  fileCmd->SetGuidance("set type (aida, hbook or root) for the histograms file");
    5252  fileCmd->AvailableForStates(G4State_PreInit,G4State_Idle);
    5353
  • trunk/examples/extended/radioactivedecay/exrdm/src/exrdmMaterial.cc

    r807 r1230  
    115115
    116116  G4Material* aMaterial = 0;
    117   //  G4cout << name <<" "<< formula << " " << density/(g/cm3) << " " << tem <<" " <<pres << G4endl;
     117  G4cout << name <<" "<< formula << " " << density/(g/cm3) << " " << tem <<" " <<pres << G4endl;
    118118 
    119119  if (state == "") {
     
    237237      } else {
    238238        if (natoms>0) {
    239           aMaterial->AddElement( G4Element::GetElement(isotopename) , natoms);
     239          aMaterial->AddElement( G4Element::GetElement(isotopename,false) , natoms);
    240240        } else {
    241           aMaterial->AddElement( G4Element::GetElement(isotopename) , fatoms);
     241          aMaterial->AddElement( G4Element::GetElement(isotopename,false) , fatoms);
    242242        }
    243243      }     
    244244    } else {
    245       if ( G4Element::GetElement(element) == NULL) {
     245      if ( G4Element::GetElement(element,false) == NULL) {
    246246        G4Element* aElement = new G4Element(element, element, Z, A[Z-1]*g/mole);
    247247        if (natoms>0) {
     
    253253      } else {
    254254        if (natoms>0) {
    255           aMaterial->AddElement( G4Element::GetElement(element) , natoms);
     255          aMaterial->AddElement( G4Element::GetElement(element,false) , natoms);
    256256        } else {
    257           aMaterial->AddElement( G4Element::GetElement(element) , fatoms);
     257          aMaterial->AddElement( G4Element::GetElement(element,false) , fatoms);
    258258        }
    259259      }
  • trunk/examples/extended/radioactivedecay/exrdm/src/exrdmMaterialMessenger.cc

    r807 r1230  
    130130    //    G4cout<< "stat = " <<state<< "tem = " << tem<< " pre = " << pres << G4endl;
    131131    //     tick *= G4UIcommand::ValueOf(unt);
    132     materialsManager->AddMaterial(material,formula,den,state,tem,pres);
     132    materialsManager->AddMaterial(material,formula,den*g/cm3,state,tem,pres);
    133133  }
    134134}
  • trunk/examples/extended/radioactivedecay/exrdm/src/exrdmPhysListHadron.cc

    r807 r1230  
    253253  theAlphaInelasticProcess->RegisterMe(theTheoModel);
    254254  pManager->AddDiscreteProcess(theAlphaInelasticProcess);
     255
    255256  // GenericIon
    256257  pManager = G4GenericIon::GenericIon()->GetProcessManager();
     
    266267  theIonInelasticProcess->RegisterMe(theIonBC);
    267268  theIonInelasticProcess->RegisterMe(theTheoModel);
    268   pManager->AddDiscreteProcess(theIonInelasticProcess);
    269 
    270   // Add RadioactiveDecay Process
    271 
    272   G4RadioactiveDecay*  theRadioactiveDecay = new G4RadioactiveDecay();
    273   G4GenericIon* ion = G4GenericIon::GenericIon();
    274   pManager->AddProcess(theRadioactiveDecay, 0, -1, 3);
    275  
     269  pManager->AddDiscreteProcess(theIonInelasticProcess);
    276270}
  • trunk/examples/extended/radioactivedecay/exrdm/src/exrdmPhysicsList.cc

    r807 r1230  
    7575  pMessenger = new exrdmPhysicsListMessenger(this);
    7676
    77   SetVerboseLevel(2);
     77  SetVerboseLevel(1);
    7878
    7979  //default physics
     
    8787 
    8888  // Had physics
    89   hadPhysicsList = new exrdmPhysListHadron("hadron");
     89  hadPhysicsList = 0;
    9090  nhadcomp = 0;
    9191
     
    131131  }
    132132  if (hadPhysicsList) hadPhysicsList->ConstructProcess();
     133  G4cout << "### exrdmPhysicsList::ConstructProcess is done" << G4endl;
     134
    133135}
    134136
     
    141143  }
    142144  // default  Had physics
    143   if (name == "Hadron" && nhadcomp == 0) {
    144     if (hadPhysicsList) delete hadPhysicsList;
     145  if (name == "Hadron" && !hadPhysicsList) {
    145146    hadPhysicsList = new exrdmPhysListHadron("hadron");
    146147  } else if (name == "QGSP_BERT") {
    147148    AddExtraBuilders(false);
    148149    hadPhysicsList = new HadronPhysicsQGSP_BERT("std-hadron");
    149   } else if (name == "QGSP_BIC" && nhadcomp == 0) {
     150  } else if (name == "QGSP_BIC" && !hadPhysicsList) {
    150151    AddExtraBuilders(false);
    151152    hadPhysicsList = new HadronPhysicsQGSP_BIC("std-hadron");
    152   } else if (name == "QGSP_BERT_HP"  && nhadcomp == 0) {
     153  } else if (name == "QGSP_BERT_HP"  && !hadPhysicsList) {
    153154    AddExtraBuilders(true);
    154155    hadPhysicsList = new HadronPhysicsQGSP_BERT_HP("std-hadron");
    155   } else if (name == "QGSP_BIC_HP"  && nhadcomp == 0) {
     156  } else if (name == "QGSP_BIC_HP"  && !hadPhysicsList) {
    156157    AddExtraBuilders(true);
    157158    hadPhysicsList = new HadronPhysicsQGSP_BIC_HP("std-hadron");
    158159  } else if (name == "LowEnergy_EM") {
    159     if (!hadPhysicsList ||(hadPhysicsList->GetPhysicsName()=="hadron") ) {
    160       if (emPhysicsList) delete emPhysicsList;
     160      delete emPhysicsList;
    161161      emPhysicsList = new exrdmPhysListEmLowEnergy("lowe-em");
    162     } else {
    163       G4cout << "exrdmPhysicsList: using EM comes with Std-hadron" <<G4endl;
    164     }     
    165162  } else if (name == "Standard_EM") {
    166     if (!hadPhysicsList ||(hadPhysicsList->GetPhysicsName()=="hadron") ) {
    167       if (emPhysicsList) delete emPhysicsList;
     163      delete emPhysicsList;
    168164      emPhysicsList = new G4EmStandardPhysics();
    169     } else {
    170       G4cout << "exrdmPhysicsList: using EM comes with Std-hadron" <<G4endl;
    171     }
    172165  } else {
    173166      G4cout << "exrdmPhysicsList WARNING wrong or unkonwn <"
     
    180173void exrdmPhysicsList::AddExtraBuilders(G4bool flagHP)
    181174{
    182   if (emPhysicsList) delete emPhysicsList;
    183   emPhysicsList = new G4EmStandardPhysics();
    184 
    185   if (hadPhysicsList) {
    186     delete hadPhysicsList;
    187     hadPhysicsList = 0;
    188   }
    189   nhadcomp = 6;
    190 
     175  nhadcomp = 5;
    191176  hadronPhys.push_back( new G4EmExtraPhysics("extra EM"));
    192177  hadronPhys.push_back( new G4HadronElasticPhysics("elastic",verboseLevel,
     
    194179  hadronPhys.push_back( new G4QStoppingPhysics("stopping",verboseLevel));
    195180  hadronPhys.push_back( new G4IonBinaryCascadePhysics("ionBIC"));
    196   hadronPhys.push_back( new G4RadioactiveDecayPhysics("radioactiveDecay"));
    197181  hadronPhys.push_back( new G4NeutronTrackingCut("Neutron tracking cut"));
    198182}
     
    202186void exrdmPhysicsList::SetCuts()
    203187{
    204 
    205188  SetCutValue(cutForGamma, "gamma");
    206189  SetCutValue(cutForElectron, "e-");
     
    226209{
    227210  cutForGamma = cut;
     211  SetParticleCuts(cutForGamma, G4Gamma::Gamma());
    228212}
    229213
     
    233217{
    234218  cutForElectron = cut;
     219  SetParticleCuts(cutForElectron, G4Electron::Electron());
    235220}
    236221
     
    240225{
    241226  cutForPositron = cut;
     227  SetParticleCuts(cutForPositron, G4Positron::Positron());
    242228}
    243229
  • trunk/examples/extended/radioactivedecay/exrdm/src/exrdmRunAction.cc

    r807 r1230  
    5858    G4cout << "### Run : " << RunN << G4endl;
    5959
     60#ifdef G4VIS_USE
    6061  if (G4VVisManager::GetConcreteInstance())
    6162    {
     
    6465      UI->ApplyCommand("/vis/draw/current");
    6566    }
     67#endif
    6668}
    6769
     
    7476  analysis->EndOfRun();
    7577 
     78#ifdef G4VIS_USE
    7679  if (G4VVisManager::GetConcreteInstance())
    7780    G4UImanager::GetUIpointer()->ApplyCommand("/vis/show/view");
     81#endif
    7882}
    7983
  • trunk/examples/extended/radioactivedecay/exrdm/src/exrdmSteppingAction.cc

    r807 r1230  
    4646void exrdmSteppingAction::UserSteppingAction(const G4Step* fStep)
    4747{
    48 #ifdef G4ANALYSIS_USE
    4948  G4Track* fTrack = fStep->GetTrack();
    5049  G4int StepNo = fTrack->GetCurrentStepNumber();
    5150  if(StepNo >= 10000) fTrack->SetTrackStatus(fStopAndKill);
     51
     52#ifdef G4ANALYSIS_USE
     53#define COLLECT
     54#endif
     55#ifdef G4ANALYSIS_USE_ROOT
     56#ifndef COLLECT
     57#define COLLECT
     58#endif
     59#endif
     60
     61#ifdef COLLECT
    5262  if (StepNo == 1) {
    5363    if ( (fTrack->GetDefinition()->GetParticleType() == "nucleus") &&
     
    8090    }
    8191  }
    82   // energy deposition: collect energy deposited by decay products only
     92  // energy deposition
    8393  if (fTrack->GetTrackID() != 1 ) {
    84     if (fTrack->GetCreatorProcess()->GetProcessName() == "RadioactiveDecay") { 
     94    //    if (fTrack->GetCreatorProcess()->GetProcessName() == "RadioactiveDecay") {   
    8595      if (fStep->GetTotalEnergyDeposit() ) {
    8696        G4double time = fStep->GetPreStepPoint()->GetGlobalTime() ;
     
    92102        exrdmAnalysisManager::getInstance()->AddEnergy(edep,weight,time);
    93103      }
    94     }
     104      //    }
    95105  }
    96 #endif  
     106#endif
    97107}
    98108//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
Note: See TracChangeset for help on using the changeset viewer.