Changeset 1230 for trunk/examples/extended/radioactivedecay/exrdm/src
- Timestamp:
- Jan 8, 2010, 3:02:48 PM (14 years ago)
- Location:
- trunk/examples/extended/radioactivedecay/exrdm/src
- Files:
-
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/examples/extended/radioactivedecay/exrdm/src/exrdmAnalysisManager.cc
r807 r1230 46 46 return fManager; 47 47 } 48 void exrdmAnalysisManager::dispose() 49 { 50 delete fManager; 51 fManager = 0; 52 } 48 53 49 54 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... … … 58 63 pulseWidth = 1.*microsecond; 59 64 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 70 exrdmAnalysisManager::~exrdmAnalysisManager() 71 { 72 #ifdef G4ANALYSIS_USE 73 #define HISTDELETE 62 74 #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 70 81 } 71 82 … … 94 105 // in aida these histos are indiced from 0-6 95 106 // 96 histo->addTuple( "1 00", "Emitted Particles","floatPID, Energy, Time, Weight" );97 histo->addTuple( "2 00", "RadioIsotopes","floatPID, Time, Weight" );98 histo->addTuple( "3 00", "Energy Depositions","floatEnergy, 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" ); 99 110 100 111 } … … 104 115 void exrdmAnalysisManager::BeginOfRun() 105 116 { 106 #if defined G4ANALYSIS_USE_AIDA || G4ANALYSIS_USE_ROOT107 117 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; 113 119 } 114 120 … … 117 123 void exrdmAnalysisManager::EndOfRun() 118 124 { 119 #if defined G4ANALYSIS_USE_AIDA || G4ANALYSIS_USE_ROOT120 125 histo->save(); 121 #endif122 126 } 123 127 -
trunk/examples/extended/radioactivedecay/exrdm/src/exrdmEventAction.cc
r807 r1230 67 67 void exrdmEventAction::EndOfEventAction(const G4Event* evt) 68 68 { 69 G4int event_id = evt->GetEventID();70 69 //analysis 71 70 exrdmAnalysisManager::getInstance()->EndOfEvent(); 72 71 // visualisation 72 #ifdef G4VIS_USE 73 G4int event_id = evt->GetEventID(); 73 74 if (event_id < 100 && G4VVisManager::GetConcreteInstance()) { 74 75 G4TrajectoryContainer * trajectoryContainer = evt->GetTrajectoryContainer(); … … 85 86 } 86 87 } 88 #endif 87 89 } 88 90 -
trunk/examples/extended/radioactivedecay/exrdm/src/exrdmHisto.cc
r807 r1230 24 24 // ******************************************************************** 25 25 // 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 34 27 #include <AIDA/AIDA.h> 35 28 #endif … … 47 40 #include "TNtuple.h" 48 41 #endif 42 43 #include "exrdmHisto.hh" 44 #include "exrdmHistoMessenger.hh" 45 #include "G4ParticleTable.hh" 46 47 #include "G4Tokenizer.hh" 48 49 49 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 50 50 exrdmHisto::exrdmHisto() 51 51 { 52 verbose = 0;52 verbose = 1; 53 53 histName = "exrdm"; 54 histType = "root"; 54 histType = "aida"; 55 //histType = "root"; 55 56 nHisto = 0; 56 57 nTuple = 0; 57 58 defaultAct = 1; 58 59 // 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 63 65 #ifdef G4ANALYSIS_USE_ROOT 64 66 ROOThisto.clear(); … … 67 69 Rcol.clear(); 68 70 #endif 71 69 72 active.clear(); 70 73 bins.clear(); … … 78 81 tupleList.clear(); 79 82 tupleListROOT.clear(); 80 messenger = 0;81 83 82 84 messenger = new exrdmHistoMessenger(this); … … 87 89 exrdmHisto::~exrdmHisto() 88 90 { 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 // } 98 107 #endif 99 108 delete messenger; … … 104 113 void exrdmHisto::book() 105 114 { 115 #ifdef G4ANALYSIS_USE 106 116 G4cout << "### exrdmHisto books " << nHisto << " histograms " << G4endl; 107 #ifdef G4ANALYSIS_USE_AIDA108 117 // 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 } 110 123 // Creating the tree factory 111 AIDA::ITreeFactory* tf = af->createTreeFactory();124 {AIDA::ITreeFactory* tf = aida->createTreeFactory(); 112 125 // 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;} 124 135 // 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); 126 137 // Creating an 1-dimensional histograms in the root directory of the tree 127 138 for(G4int i=0; i<nHisto; i++) { 128 139 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]); 130 145 } 131 146 } 147 delete hf; 148 G4cout << "AIDA histograms are booked" << G4endl;} 149 132 150 // 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; 134 153 for(G4int i=0; i<nTuple; i++) { 135 154 if(tupleList[i] != "") { 136 G4cout << "Creating Ntuple: " << tupleName[i] << 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],""); 138 157 } 139 158 } 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)); 144 165 G4String fileNameROOT = histName + G4String(".root"); 145 166 hfileROOT = new TFile(fileNameROOT.c_str() ,"RECREATE","ROOT file for exRDM"); 146 167 G4cout << "Root file: " << fileNameROOT << G4endl; 147 168 // Creating an 1-dimensional histograms in the root directory of the tree 148 169 for(G4int i=0; i<nHisto; i++) { … … 157 178 if(tupleListROOT[i] != "") { 158 179 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; 160 182 ROOTntup[i] = new TNtuple(id, tupleName[i], tupleListROOT[i]); 183 G4cout << "ROOT Ntuple " << id << " " << tupleName[i] <<" "<< tupleListROOT[i]<< " booked " << G4endl; 161 184 } 162 185 } … … 169 192 void exrdmHisto::save() 170 193 { 171 #ifdef G4ANALYSIS_USE _AIDA194 #ifdef G4ANALYSIS_USE 172 195 // Write histogram file 173 196 tree->commit(); … … 175 198 tree->close(); 176 199 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;} 177 206 #endif 178 207 #ifdef G4ANALYSIS_USE_ROOT … … 181 210 G4cout << "ROOT: files closing..." << G4endl; 182 211 hfileROOT->Close(); 212 // 213 // F.Lei added following Guy's suggestion! 214 delete hfileROOT; 215 183 216 #endif 184 217 } … … 205 238 ids.push_back(id); 206 239 titles.push_back(name); 207 #ifdef G4ANALYSIS_USE _AIDA240 #ifdef G4ANALYSIS_USE 208 241 histo.push_back(0); 209 242 #endif … … 241 274 << G4endl; 242 275 } 243 #ifdef G4ANALYSIS_USE _AIDA276 #ifdef G4ANALYSIS_USE 244 277 if(i>=0 && i<nHisto) { 245 histo[i]->fill( (float)(x/unit[i]), (float)w);278 histo[i]->fill(x/unit[i], w); 246 279 } else { 247 280 G4cout << "exrdmHisto::fill: WARNING! wrong AIDA histogram index " << i << G4endl; … … 264 297 G4cout << "Scale histogram: #" << i << " by factor " << x << G4endl; 265 298 } 266 #ifdef G4ANALYSIS_USE _AIDA299 #ifdef G4ANALYSIS_USE 267 300 if(i>=0 && i<nHisto) { 268 301 histo[i]->scale(x); … … 281 314 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 282 315 283 void exrdmHisto::addTuple(const G4String& w1, const G4String& w2, const G4String& w3) 284 { 285 // G4cout << w1 << " " << w2 << " " << w3 << G4endl; 316 #ifdef G4ANALYSIS_USE 317 void exrdmHisto::addTuple(const G4String& w1, const G4String& w2, const G4String& w3 ) 318 #else 319 void 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 286 333 std::vector<float> ar; 287 334 ar.clear(); 288 335 for (size_t i = 0; i < 20; i++) ar.push_back(0.); 289 nTuple++;290 #ifdef G4ANALYSIS_USE_ROOT291 336 Rarray.push_back(ar); 292 #endif293 tupleId.push_back(w1);294 tupleName.push_back(w2) ;295 337 // convert AIDA header to ROOT header for ntuple 296 338 G4Tokenizer next(w3); … … 300 342 while ( token != "") { 301 343 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(":"); 303 347 col++; 304 348 } … … 306 350 // G4cout << ROOTList << G4endl; 307 351 tupleListROOT.push_back(ROOTList); 308 //309 #ifdef G4ANALYSIS_USE_AIDA310 ntup.push_back(0);311 #endif312 #ifdef G4ANALYSIS_USE_ROOT313 352 ROOTntup.push_back(0); 314 353 Rcol.push_back(col-1); … … 323 362 G4cout << "fill tuple # " << i 324 363 <<" with parameter <" << parname << "> = " << x << G4endl; 325 #ifdef G4ANALYSIS_USE _AIDA326 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); 327 366 #endif 328 367 } … … 336 375 <<" in column < " << col << "> = " << x << G4endl; 337 376 } 338 #ifdef G4ANALYSIS_USE _AIDA339 if(ntup[i]) ntup[i]->fill(col, (float)x);377 #ifdef G4ANALYSIS_USE 378 if(ntup[i]) ntup[i]->fill(col,double(x)); 340 379 #endif 341 380 … … 348 387 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 349 388 350 void exrdmHisto::fillTuple(G4int i, const G4String& parname, G4String x)389 void exrdmHisto::fillTuple(G4int i, const G4String& parname, G4String& x) 351 390 { 352 391 if(verbose > 1) { … … 354 393 <<" with parameter <" << parname << "> = " << x << G4endl; 355 394 } 356 #ifdef G4ANALYSIS_USE _AIDA395 #ifdef G4ANALYSIS_USE 357 396 if(ntup[i]) ntup[i]->fill(ntup[i]->findColumn(parname), x); 358 397 #endif 398 359 399 } 360 400 … … 363 403 void exrdmHisto::addRow(G4int i) 364 404 { 365 #ifdef G4ANALYSIS_USE_AIDA 405 if(verbose > 1) G4cout << "Added a raw #" << i << " to tuple" << G4endl; 406 #ifdef G4ANALYSIS_USE 366 407 if(ntup[i]) ntup[i]->addRow(); 367 408 #endif -
trunk/examples/extended/radioactivedecay/exrdm/src/exrdmHistoMessenger.cc
r807 r1230 49 49 50 50 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"); 52 52 fileCmd->AvailableForStates(G4State_PreInit,G4State_Idle); 53 53 -
trunk/examples/extended/radioactivedecay/exrdm/src/exrdmMaterial.cc
r807 r1230 115 115 116 116 G4Material* aMaterial = 0; 117 //G4cout << name <<" "<< formula << " " << density/(g/cm3) << " " << tem <<" " <<pres << G4endl;117 G4cout << name <<" "<< formula << " " << density/(g/cm3) << " " << tem <<" " <<pres << G4endl; 118 118 119 119 if (state == "") { … … 237 237 } else { 238 238 if (natoms>0) { 239 aMaterial->AddElement( G4Element::GetElement(isotopename ) , natoms);239 aMaterial->AddElement( G4Element::GetElement(isotopename,false) , natoms); 240 240 } else { 241 aMaterial->AddElement( G4Element::GetElement(isotopename ) , fatoms);241 aMaterial->AddElement( G4Element::GetElement(isotopename,false) , fatoms); 242 242 } 243 243 } 244 244 } else { 245 if ( G4Element::GetElement(element ) == NULL) {245 if ( G4Element::GetElement(element,false) == NULL) { 246 246 G4Element* aElement = new G4Element(element, element, Z, A[Z-1]*g/mole); 247 247 if (natoms>0) { … … 253 253 } else { 254 254 if (natoms>0) { 255 aMaterial->AddElement( G4Element::GetElement(element ) , natoms);255 aMaterial->AddElement( G4Element::GetElement(element,false) , natoms); 256 256 } else { 257 aMaterial->AddElement( G4Element::GetElement(element ) , fatoms);257 aMaterial->AddElement( G4Element::GetElement(element,false) , fatoms); 258 258 } 259 259 } -
trunk/examples/extended/radioactivedecay/exrdm/src/exrdmMaterialMessenger.cc
r807 r1230 130 130 // G4cout<< "stat = " <<state<< "tem = " << tem<< " pre = " << pres << G4endl; 131 131 // tick *= G4UIcommand::ValueOf(unt); 132 materialsManager->AddMaterial(material,formula,den ,state,tem,pres);132 materialsManager->AddMaterial(material,formula,den*g/cm3,state,tem,pres); 133 133 } 134 134 } -
trunk/examples/extended/radioactivedecay/exrdm/src/exrdmPhysListHadron.cc
r807 r1230 253 253 theAlphaInelasticProcess->RegisterMe(theTheoModel); 254 254 pManager->AddDiscreteProcess(theAlphaInelasticProcess); 255 255 256 // GenericIon 256 257 pManager = G4GenericIon::GenericIon()->GetProcessManager(); … … 266 267 theIonInelasticProcess->RegisterMe(theIonBC); 267 268 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); 276 270 } -
trunk/examples/extended/radioactivedecay/exrdm/src/exrdmPhysicsList.cc
r807 r1230 75 75 pMessenger = new exrdmPhysicsListMessenger(this); 76 76 77 SetVerboseLevel( 2);77 SetVerboseLevel(1); 78 78 79 79 //default physics … … 87 87 88 88 // Had physics 89 hadPhysicsList = new exrdmPhysListHadron("hadron");89 hadPhysicsList = 0; 90 90 nhadcomp = 0; 91 91 … … 131 131 } 132 132 if (hadPhysicsList) hadPhysicsList->ConstructProcess(); 133 G4cout << "### exrdmPhysicsList::ConstructProcess is done" << G4endl; 134 133 135 } 134 136 … … 141 143 } 142 144 // default Had physics 143 if (name == "Hadron" && nhadcomp == 0) { 144 if (hadPhysicsList) delete hadPhysicsList; 145 if (name == "Hadron" && !hadPhysicsList) { 145 146 hadPhysicsList = new exrdmPhysListHadron("hadron"); 146 147 } else if (name == "QGSP_BERT") { 147 148 AddExtraBuilders(false); 148 149 hadPhysicsList = new HadronPhysicsQGSP_BERT("std-hadron"); 149 } else if (name == "QGSP_BIC" && nhadcomp == 0) {150 } else if (name == "QGSP_BIC" && !hadPhysicsList) { 150 151 AddExtraBuilders(false); 151 152 hadPhysicsList = new HadronPhysicsQGSP_BIC("std-hadron"); 152 } else if (name == "QGSP_BERT_HP" && nhadcomp == 0) {153 } else if (name == "QGSP_BERT_HP" && !hadPhysicsList) { 153 154 AddExtraBuilders(true); 154 155 hadPhysicsList = new HadronPhysicsQGSP_BERT_HP("std-hadron"); 155 } else if (name == "QGSP_BIC_HP" && nhadcomp == 0) {156 } else if (name == "QGSP_BIC_HP" && !hadPhysicsList) { 156 157 AddExtraBuilders(true); 157 158 hadPhysicsList = new HadronPhysicsQGSP_BIC_HP("std-hadron"); 158 159 } else if (name == "LowEnergy_EM") { 159 if (!hadPhysicsList ||(hadPhysicsList->GetPhysicsName()=="hadron") ) { 160 if (emPhysicsList) delete emPhysicsList; 160 delete emPhysicsList; 161 161 emPhysicsList = new exrdmPhysListEmLowEnergy("lowe-em"); 162 } else {163 G4cout << "exrdmPhysicsList: using EM comes with Std-hadron" <<G4endl;164 }165 162 } else if (name == "Standard_EM") { 166 if (!hadPhysicsList ||(hadPhysicsList->GetPhysicsName()=="hadron") ) { 167 if (emPhysicsList) delete emPhysicsList; 163 delete emPhysicsList; 168 164 emPhysicsList = new G4EmStandardPhysics(); 169 } else {170 G4cout << "exrdmPhysicsList: using EM comes with Std-hadron" <<G4endl;171 }172 165 } else { 173 166 G4cout << "exrdmPhysicsList WARNING wrong or unkonwn <" … … 180 173 void exrdmPhysicsList::AddExtraBuilders(G4bool flagHP) 181 174 { 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; 191 176 hadronPhys.push_back( new G4EmExtraPhysics("extra EM")); 192 177 hadronPhys.push_back( new G4HadronElasticPhysics("elastic",verboseLevel, … … 194 179 hadronPhys.push_back( new G4QStoppingPhysics("stopping",verboseLevel)); 195 180 hadronPhys.push_back( new G4IonBinaryCascadePhysics("ionBIC")); 196 hadronPhys.push_back( new G4RadioactiveDecayPhysics("radioactiveDecay"));197 181 hadronPhys.push_back( new G4NeutronTrackingCut("Neutron tracking cut")); 198 182 } … … 202 186 void exrdmPhysicsList::SetCuts() 203 187 { 204 205 188 SetCutValue(cutForGamma, "gamma"); 206 189 SetCutValue(cutForElectron, "e-"); … … 226 209 { 227 210 cutForGamma = cut; 211 SetParticleCuts(cutForGamma, G4Gamma::Gamma()); 228 212 } 229 213 … … 233 217 { 234 218 cutForElectron = cut; 219 SetParticleCuts(cutForElectron, G4Electron::Electron()); 235 220 } 236 221 … … 240 225 { 241 226 cutForPositron = cut; 227 SetParticleCuts(cutForPositron, G4Positron::Positron()); 242 228 } 243 229 -
trunk/examples/extended/radioactivedecay/exrdm/src/exrdmRunAction.cc
r807 r1230 58 58 G4cout << "### Run : " << RunN << G4endl; 59 59 60 #ifdef G4VIS_USE 60 61 if (G4VVisManager::GetConcreteInstance()) 61 62 { … … 64 65 UI->ApplyCommand("/vis/draw/current"); 65 66 } 67 #endif 66 68 } 67 69 … … 74 76 analysis->EndOfRun(); 75 77 78 #ifdef G4VIS_USE 76 79 if (G4VVisManager::GetConcreteInstance()) 77 80 G4UImanager::GetUIpointer()->ApplyCommand("/vis/show/view"); 81 #endif 78 82 } 79 83 -
trunk/examples/extended/radioactivedecay/exrdm/src/exrdmSteppingAction.cc
r807 r1230 46 46 void exrdmSteppingAction::UserSteppingAction(const G4Step* fStep) 47 47 { 48 #ifdef G4ANALYSIS_USE49 48 G4Track* fTrack = fStep->GetTrack(); 50 49 G4int StepNo = fTrack->GetCurrentStepNumber(); 51 50 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 52 62 if (StepNo == 1) { 53 63 if ( (fTrack->GetDefinition()->GetParticleType() == "nucleus") && … … 80 90 } 81 91 } 82 // energy deposition : collect energy deposited by decay products only92 // energy deposition 83 93 if (fTrack->GetTrackID() != 1 ) { 84 if (fTrack->GetCreatorProcess()->GetProcessName() == "RadioactiveDecay") {94 // if (fTrack->GetCreatorProcess()->GetProcessName() == "RadioactiveDecay") { 85 95 if (fStep->GetTotalEnergyDeposit() ) { 86 96 G4double time = fStep->GetPreStepPoint()->GetGlobalTime() ; … … 92 102 exrdmAnalysisManager::getInstance()->AddEnergy(edep,weight,time); 93 103 } 94 }104 // } 95 105 } 96 #endif 106 #endif 97 107 } 98 108 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
Note: See TracChangeset
for help on using the changeset viewer.