Changeset 1337 for trunk/examples/advanced/underground_physics/src
- Timestamp:
- Sep 30, 2010, 2:47:17 PM (14 years ago)
- Location:
- trunk/examples/advanced/underground_physics/src
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/examples/advanced/underground_physics/src/DMXAnalysisManager.cc
r807 r1337 35 35 // 17 June 2002 Alex Howard Successfully Modified to AIDA 2.2 36 36 // 17 November 2002 Alex Howard Migrated to AIDA 3.0 and added fitting 37 // 22 October 2009 Luciano Pandola Changed variables names for ntuple2 38 // (avoid problem with columns) and some 39 // clean-up (e.g. remove ntuple4) 37 40 // 38 41 // ------------------------------------------------------------------- … … 46 49 47 50 DMXAnalysisManager::DMXAnalysisManager() : 48 af(0), t ree(0), hf(0), tpf(0),49 ntuple1(0), ntuple2(0), ntuple3(0), ntuple4(0),51 af(0), tf(0),tree(0), hf(0), tpf(0), 52 ntuple1(0), ntuple2(0), ntuple3(0), 50 53 hEsourcep(0), hEdepp(0), hEdepRecoil(0), hNumPhLow(0), hNumPhHigh(0), 51 54 hAvPhArrival(0), hPhArrival(0), hPMTHits(0), h1stPMTHit(0),hGammaEdep(0), 52 55 hNeutronEdep(0), hElectronEdep(0), hPositronEdep(0), hOtherEdep(0) 53 56 //,funFact(0),fitFact(0),exponFun(0),gaussFun(0),e_fitter(0),fitResult(0) 54 { 55 // tree is created and booked inside book() 56 ; 57 } 57 {;} 58 58 59 59 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 60 60 61 61 DMXAnalysisManager::~DMXAnalysisManager() 62 { 63 delete tpf; 64 delete hf; 65 delete tree; 66 delete af; 67 } 62 {;} 68 63 69 64 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... … … 92 87 G4bool readOnly = false; 93 88 94 AIDA::ITreeFactory *tf = af->createTreeFactory();89 tf = af->createTreeFactory(); 95 90 96 91 tree = tf->create(histogramfile, "hbook", readOnly, fileExists); … … 109 104 "double energy" ); 110 105 111 // assert(ntuple1);112 113 106 // ---- secondary ntuple ------ 114 107 115 108 ntuple2 = tpf->create( "2", "Scintillation Hits Info", 116 "float Event,e_prim,tot_e,s_hits,xe_time,num_ph,avphtime,1stpart,1stparte,gamma,neutron,posi,elec,other,seed1,seed2" ); 117 118 //assert(ntuple2); 109 "float Event,e_prim,tot_e,s_hits,xe_time,num_ph,avphtime,firstpart,firstparte,gamma,neutron,posi,elec,other,seed1,seed2" ); 119 110 120 111 // ---- tertiary ntuple ------ … … 122 113 ntuple3 = tpf->create( "3", "PMT Hits Info", 123 114 "float event, hits, xpos, ypos, zpos" ); 124 125 //assert(ntuple3);126 127 // ---- extra ntuple ------128 ntuple4 = tpf->create( "4", "Particles energy type",129 "float energy, NameIdx" );130 131 //assert(ntuple4);132 133 115 134 116 // Creating an 1-dimensional histogram in the root directory of the tree … … 165 147 166 148 hOtherEdep = hf->createHistogram1D("95","Other Ener Deposit/keV", 1000,0.,1000.); 167 168 delete tf;169 149 170 150 // // Creating the plotter factory … … 204 184 205 185 // G4cout << " Created e_fitter " << G4endl; 186 return; 206 187 207 188 } … … 210 191 211 192 void DMXAnalysisManager::Init() 212 { 213 } 193 {;} 214 194 215 195 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... … … 227 207 // close (will again commit) 228 208 tree->close(); 209 210 211 delete tpf; 212 delete hf; 213 delete tree; 214 delete tf; 215 delete af; 229 216 230 217 // extra delete as objects are created in book() method rather than during … … 339 326 hAvPhArrival->fill(aveTimePmtHits/ns); 340 327 341 // AIDA::ITuple * ntuple = dynamic_cast<AIDA::ITuple *> ( tree->find("2") );342 343 328 // Fill the ntuple 344 329 ntuple2->fill( ntuple2->findColumn( "Event" ), (G4float) event_id ); 345 ntuple2->fill( ntuple2->findColumn( "e_prim" ), (G4float) energy_pri/keV);330 ntuple2->fill( ntuple2->findColumn( "e_prim" ), (G4float) (energy_pri/keV) ); 346 331 ntuple2->fill( ntuple2->findColumn( "tot_e" ), (G4float) totEnergy ); 347 332 ntuple2->fill( ntuple2->findColumn( "s_hits" ), (G4float) S_hits ); … … 349 334 ntuple2->fill( ntuple2->findColumn( "num_ph" ), (G4float) P_hits ); 350 335 ntuple2->fill( ntuple2->findColumn( "avphtime"), (G4float) aveTimePmtHits ); 351 ntuple2->fill( ntuple2->findColumn( " 1stpart" ), (G4float) firstparticleIndex);352 ntuple2->fill( ntuple2->findColumn( " 1stparte"), (G4float) firstParticleE );336 ntuple2->fill( ntuple2->findColumn( "firstpart" ), (G4float) firstparticleIndex); 337 ntuple2->fill( ntuple2->findColumn( "firstparte"), (G4float) firstParticleE ); 353 338 ntuple2->fill( ntuple2->findColumn( "gamma" ), (G4float) gamma_ev ); 354 339 ntuple2->fill( ntuple2->findColumn( "neutron" ), (G4float) neutron_ev ); … … 361 346 //Values of attributes are prepared; store them to the nTuple: 362 347 ntuple2->addRow(); 363 364 348 } 365 349 … … 375 359 } 376 360 377 //AIDA::ITuple * ntuple = dynamic_cast<AIDA::ITuple *> ( tree->find("3") ); 378 // Fill the secondaries ntuple 361 // Fill the ntuple 379 362 ntuple3->fill( ntuple3->findColumn( "event" ), (G4float) event ); 380 363 ntuple3->fill( ntuple3->findColumn( "hits" ), (G4float) i ); … … 384 367 385 368 // NEW: Values of attributes are prepared; store them to the nTuple: 386 ntuple3->addRow(); // check for returning true ...369 ntuple3->addRow(); 387 370 388 371 } … … 391 374 { 392 375 393 // AIDA::ITuple * ntuple1 = dynamic_cast<AIDA::ITuple *> ( tree->find("1") );394 376 // Fill energy ntple: 395 377 ntuple1->fill( ntuple1->findColumn( "energy" ), energy ); 396 378 397 379 // NEW: Values of attributes are prepared; store them to the nTuple: 398 ntuple1->addRow(); // check for returning true ...380 ntuple1->addRow(); 399 381 400 382 } -
trunk/examples/advanced/underground_physics/src/DMXMinEkineCuts.cc
r1230 r1337 26 26 // 27 27 // $Id: DMXMinEkineCuts.cc,v 1.6 2006/06/29 16:26:39 gunter Exp $ 28 // GEANT4 tag $Name: geant4-09-0 3-cand-01 $28 // GEANT4 tag $Name: geant4-09-04-beta-01 $ 29 29 // 30 30 // -
trunk/examples/advanced/underground_physics/src/DMXPhysicsList.cc
r1230 r1337 46 46 // and redefined particles to allow non-static creation 47 47 // i.e. changed construction to G4MesonConstructor, G4BaryonConstructor 48 // 49 // 23-10-09 LP - migrated EM physics from the LowEnergy processes (not supported) to 50 // the new G4Livermore model implementation. Results unchanged. 48 51 // 49 52 // -------------------------------------------------------------- … … 214 217 // Electromagnetic Processes //////////////////////////////////////////////// 215 218 // all charged particles 216 #include "G4MultipleScattering.hh"217 219 218 220 // gamma 219 #include "G4LowEnergyRayleigh.hh" 220 #include "G4LowEnergyPhotoElectric.hh" 221 #include "G4LowEnergyCompton.hh" 222 #include "G4LowEnergyGammaConversion.hh" 221 #include "G4PhotoElectricEffect.hh" 222 #include "G4LivermorePhotoElectricModel.hh" 223 224 #include "G4ComptonScattering.hh" 225 #include "G4LivermoreComptonModel.hh" 226 227 #include "G4GammaConversion.hh" 228 #include "G4LivermoreGammaConversionModel.hh" 229 230 #include "G4RayleighScattering.hh" 231 #include "G4LivermoreRayleighModel.hh" 223 232 224 233 225 234 // e- 226 #include "G4LowEnergyIonisation.hh" 227 #include "G4LowEnergyBremsstrahlung.hh" 235 #include "G4eMultipleScattering.hh" 236 237 #include "G4eIonisation.hh" 238 #include "G4LivermoreIonisationModel.hh" 239 240 #include "G4eBremsstrahlung.hh" 241 #include "G4LivermoreBremsstrahlungModel.hh" 242 228 243 229 244 // e+ … … 246 261 247 262 //OTHERS: 248 #include "G4hIonisation.hh" // standard hadron ionisation 263 #include "G4hIonisation.hh" 264 #include "G4hMultipleScattering.hh" 265 #include "G4hBremsstrahlung.hh" 266 #include "G4ionIonisation.hh" 267 #include "G4IonParametrisedLossModel.hh" 249 268 250 269 //em process options to allow msc step-limitation to be switched off … … 252 271 253 272 void DMXPhysicsList::ConstructEM() { 254 255 // processes:256 257 G4LowEnergyPhotoElectric* lowePhot = new G4LowEnergyPhotoElectric();258 G4LowEnergyIonisation* loweIon = new G4LowEnergyIonisation();259 G4LowEnergyBremsstrahlung* loweBrem = new G4LowEnergyBremsstrahlung();260 261 // note LowEIon uses proton as basis for its data-base, therefore262 // cannot specify different LowEnergyIonisation models for different263 // particles, but can change model globally for Ion, Alpha and Proton.264 265 266 //fluorescence apply specific cut for fluorescence from photons, electrons267 //and bremsstrahlung photons:268 G4double fluorcut = 250*eV;269 lowePhot->SetCutForLowEnSecPhotons(fluorcut);270 loweIon->SetCutForLowEnSecPhotons(fluorcut);271 loweBrem->SetCutForLowEnSecPhotons(fluorcut);272 273 273 // setting tables explicitly for electronic stopping power 274 // ahadronLowEIon->SetElectronicStoppingPowerModel 275 // (G4GenericIon::GenericIonDefinition(), "ICRU_R49p") ; 276 // ahadronLowEIon->SetElectronicStoppingPowerModel 277 // (G4Proton::ProtonDefinition(), "ICRU_R49p") ; 278 279 // Switch off the Barkas and Bloch corrections 280 // ahadronLowEIon->SetBarkasOff(); 281 274 //set a finer grid of the physic tables in order to improve precision 275 //former LowEnergy models have 200 bins up to 100 GeV 276 G4EmProcessOptions opt; 277 opt.SetMaxEnergy(100*GeV); 278 opt.SetDEDXBinning(200); 279 opt.SetLambdaBinning(200); 282 280 283 281 theParticleIterator->reset(); … … 292 290 { 293 291 //gamma 294 pmanager->AddDiscreteProcess(new G4LowEnergyRayleigh()); 295 pmanager->AddDiscreteProcess(lowePhot); 296 pmanager->AddDiscreteProcess(new G4LowEnergyCompton()); 297 pmanager->AddDiscreteProcess(new G4LowEnergyGammaConversion()); 292 G4RayleighScattering* theRayleigh = new G4RayleighScattering(); 293 theRayleigh->SetModel(new G4LivermoreRayleighModel()); //not strictly necessary 294 pmanager->AddDiscreteProcess(theRayleigh); 295 296 G4PhotoElectricEffect* thePhotoElectricEffect = new G4PhotoElectricEffect(); 297 thePhotoElectricEffect->SetModel(new G4LivermorePhotoElectricModel()); 298 pmanager->AddDiscreteProcess(thePhotoElectricEffect); 299 300 G4ComptonScattering* theComptonScattering = new G4ComptonScattering(); 301 theComptonScattering->SetModel(new G4LivermoreComptonModel()); 302 pmanager->AddDiscreteProcess(theComptonScattering); 303 304 G4GammaConversion* theGammaConversion = new G4GammaConversion(); 305 theGammaConversion->SetModel(new G4LivermoreGammaConversionModel()); 306 pmanager->AddDiscreteProcess(theGammaConversion); 307 298 308 } 299 309 else if (particleName == "e-") … … 301 311 //electron 302 312 // process ordering: AddProcess(name, at rest, along step, post step) 303 // -1 = not implemented, then ordering 304 G4MultipleScattering* aMultipleScattering = new G4MultipleScattering(); 305 pmanager->AddProcess(aMultipleScattering, -1, 1, 1); 306 pmanager->AddProcess(loweIon, -1, 2, 2); 307 pmanager->AddProcess(loweBrem, -1,-1, 3); 313 // Multiple scattering 314 G4eMultipleScattering* msc = new G4eMultipleScattering(); 315 msc->SetStepLimitType(fUseDistanceToBoundary); 316 pmanager->AddProcess(msc,-1, 1, 1); 317 318 // Ionisation 319 G4eIonisation* eIonisation = new G4eIonisation(); 320 eIonisation->SetEmModel(new G4LivermoreIonisationModel()); 321 eIonisation->SetStepFunction(0.2, 100*um); //improved precision in tracking 322 pmanager->AddProcess(eIonisation,-1, 2, 2); 323 324 // Bremsstrahlung 325 G4eBremsstrahlung* eBremsstrahlung = new G4eBremsstrahlung(); 326 eBremsstrahlung->SetEmModel(new G4LivermoreBremsstrahlungModel()); 327 pmanager->AddProcess(eBremsstrahlung, -1,-3, 3); 308 328 } 309 329 else if (particleName == "e+") 310 330 { 311 //positron 312 G4MultipleScattering* aMultipleScattering = new G4MultipleScattering(); 313 pmanager->AddProcess(aMultipleScattering, -1, 1, 1); 314 pmanager->AddProcess(new G4eIonisation(), -1, 2, 2); 331 //positron 332 G4eMultipleScattering* msc = new G4eMultipleScattering(); 333 msc->SetStepLimitType(fUseDistanceToBoundary); 334 pmanager->AddProcess(msc,-1, 1, 1); 335 336 // Ionisation 337 G4eIonisation* eIonisation = new G4eIonisation(); 338 eIonisation->SetStepFunction(0.2, 100*um); // 339 pmanager->AddProcess(eIonisation, -1, 2, 2); 340 341 //Bremsstrahlung (use default, no low-energy available) 315 342 pmanager->AddProcess(new G4eBremsstrahlung(), -1,-1, 3); 343 344 //Annihilation 316 345 pmanager->AddProcess(new G4eplusAnnihilation(),0,-1, 4); 317 346 } … … 320 349 { 321 350 //muon 322 G4MultipleScattering* aMultipleScattering = new G4MultipleScattering(); 323 pmanager->AddProcess(aMultipleScattering, -1, 1, 1); 351 pmanager->AddProcess(new G4eMultipleScattering, -1, 1, 1); 324 352 pmanager->AddProcess(new G4MuIonisation(), -1, 2, 2); 325 353 pmanager->AddProcess(new G4MuBremsstrahlung(), -1,-1, 3); … … 328 356 pmanager->AddProcess(new G4MuonMinusCaptureAtRest(), 0,-1,-1); 329 357 } 330 else if (particleName == "proton" || 331 particleName == "alpha" || 358 else if (particleName == "proton" || 359 particleName == "pi+" || 360 particleName == "pi-") 361 { 362 //multiple scattering 363 pmanager->AddProcess(new G4hMultipleScattering, -1, 1, 1); 364 365 //ionisation 366 G4hIonisation* hIonisation = new G4hIonisation(); 367 hIonisation->SetStepFunction(0.2, 50*um); 368 pmanager->AddProcess(hIonisation, -1, 2, 2); 369 370 //bremmstrahlung 371 pmanager->AddProcess(new G4hBremsstrahlung, -1,-3, 3); 372 } 373 else if(particleName == "alpha" || 332 374 particleName == "deuteron" || 333 375 particleName == "triton" || 334 particleName == "He3" || 335 particleName == "GenericIon" || 336 (particleType == "nucleus" && charge != 0)) 376 particleName == "He3") 377 { 378 //multiple scattering 379 pmanager->AddProcess(new G4hMultipleScattering,-1,1,1); 380 381 //ionisation 382 G4ionIonisation* ionIoni = new G4ionIonisation(); 383 ionIoni->SetStepFunction(0.1, 20*um); 384 pmanager->AddProcess(ionIoni, -1, 2, 2); 385 } 386 else if (particleName == "GenericIon") 337 387 { 338 388 // OBJECT may be dynamically created as either a GenericIon or nucleus 339 389 // G4Nucleus exists and therefore has particle type nucleus 340 390 // genericIon: 341 G4MultipleScattering* aMultipleScattering = new G4MultipleScattering(); 342 //hIonisation G4hLowEnergyIonisation* ahadronLowEIon = new G4hLowEnergyIonisation(); 343 G4hIonisation* ahadronIon = new G4hIonisation(); 344 pmanager->AddProcess(aMultipleScattering,-1,1,1); 345 //hIonisation pmanager->AddProcess(ahadronLowEIon,-1,2,2); 346 pmanager->AddProcess(ahadronIon,-1,2,2); 347 // ahadronLowEIon->SetNuclearStoppingOff() ; 348 // ahadronLowEIon->SetNuclearStoppingPowerModel("ICRU_R49") ; 349 // ahadronLowEIon->SetNuclearStoppingOn() ; 350 351 //fluorescence switch off for hadrons (for now) PIXE: 352 //hIonisation ahadronLowEIon->SetFluorescence(false); 391 392 //multiple scattering 393 pmanager->AddProcess(new G4hMultipleScattering,-1,1,1); 394 395 //ionisation 396 G4ionIonisation* ionIoni = new G4ionIonisation(); 397 ionIoni->SetEmModel(new G4IonParametrisedLossModel()); 398 ionIoni->SetStepFunction(0.1, 20*um); 399 pmanager->AddProcess(ionIoni, -1, 2, 2); 353 400 } 401 354 402 else if ((!particle->IsShortLived()) && 355 403 (charge != 0.0) && … … 357 405 { 358 406 //all others charged particles except geantino 359 G4MultipleScattering* aMultipleScattering = new G4MultipleScattering(); 360 //hIonisation G4hLowEnergyIonisation* ahadronLowEIon = new G4hLowEnergyIonisation(); 407 G4hMultipleScattering* aMultipleScattering = new G4hMultipleScattering(); 361 408 G4hIonisation* ahadronIon = new G4hIonisation(); 409 410 //multiple scattering 362 411 pmanager->AddProcess(aMultipleScattering,-1,1,1); 363 //hIonisation pmanager->AddProcess(ahadronLowEIon, -1,2,2); 412 413 //ionisation 364 414 pmanager->AddProcess(ahadronIon, -1,2,2); 365 // pmanager->AddProcess(new G4hIonisation(), -1,2,2);366 415 } 367 416 … … 369 418 370 419 // turn off msc step-limitation - especially as electron cut 1nm 371 G4EmProcessOptions opt;372 // opt.SetMscStepLimitation(false);373 420 opt.SetMscStepLimitation(fMinimal); 374 421 -
trunk/examples/advanced/underground_physics/src/DMXRunAction.cc
r807 r1337 39 39 // History: 40 40 // 17 Jan 2002 Alex Howard Added Analysis 41 // 23 Oct 2009 Luciano Pandola Removed un-necessary calls from EndOfRun() 41 42 // 42 43 // RunAction program … … 104 105 void DMXRunAction::EndOfRunAction(const G4Run*) 105 106 { 106 107 #ifdef G4ANALYSIS_USE108 DMXAnalysisManager* analysis = DMXAnalysisManager::getInstance();109 //analysis->PlotHistos(interactplot);110 //analysis->PulseTimeFit();111 analysis->Finish();112 #endif113 114 107 if (G4VVisManager::GetConcreteInstance()) { 115 108 G4UImanager::GetUIpointer()->ApplyCommand("/vis/viewer/update");
Note: See TracChangeset
for help on using the changeset viewer.