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

tag geant4.9.4 beta 1 + modifs locales

Location:
trunk/examples/advanced/underground_physics/src
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/examples/advanced/underground_physics/src/DMXAnalysisManager.cc

    r807 r1337  
    3535// 17 June 2002 Alex Howard    Successfully Modified to AIDA 2.2
    3636// 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)
    3740//
    3841// -------------------------------------------------------------------
     
    4649
    4750DMXAnalysisManager::DMXAnalysisManager() :
    48   af(0), tree(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),
    5053  hEsourcep(0), hEdepp(0), hEdepRecoil(0), hNumPhLow(0), hNumPhHigh(0),
    5154  hAvPhArrival(0), hPhArrival(0), hPMTHits(0), h1stPMTHit(0),hGammaEdep(0),
    5255  hNeutronEdep(0), hElectronEdep(0), hPositronEdep(0), hOtherEdep(0)
    5356  //,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{;}
    5858
    5959//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
    6060
    6161DMXAnalysisManager::~DMXAnalysisManager()
    62 {
    63   delete tpf;
    64   delete hf;
    65   delete tree;
    66   delete af;
    67  }
     62{;}
    6863
    6964//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
     
    9287  G4bool readOnly   = false;
    9388
    94   AIDA::ITreeFactory     * tf = af->createTreeFactory();
     89  tf = af->createTreeFactory();
    9590
    9691  tree = tf->create(histogramfile, "hbook", readOnly, fileExists);
     
    109104                             "double energy" );
    110105
    111   //  assert(ntuple1);
    112 
    113106  // ---- secondary ntuple ------   
    114107
    115108  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" );
    119110
    120111  // ---- tertiary ntuple ------   
     
    122113  ntuple3 = tpf->create( "3", "PMT Hits Info",
    123114                                "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 
    133115
    134116  // Creating an 1-dimensional histogram in the root directory of the tree
     
    165147
    166148  hOtherEdep    = hf->createHistogram1D("95","Other Ener Deposit/keV", 1000,0.,1000.);
    167  
    168   delete tf;
    169149
    170150 //  // Creating the plotter factory
     
    204184
    205185//   G4cout << " Created e_fitter " << G4endl;
     186  return;
    206187
    207188}
     
    210191
    211192void DMXAnalysisManager::Init()
    212 {
    213 }
     193{;}
    214194
    215195//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
     
    227207  // close (will again commit)
    228208  tree->close();
     209
     210 
     211  delete tpf;
     212  delete hf;
     213  delete tree;
     214  delete tf;
     215  delete af;
    229216
    230217  // extra delete as objects are created in book() method rather than during
     
    339326  hAvPhArrival->fill(aveTimePmtHits/ns);
    340327
    341   // AIDA::ITuple * ntuple = dynamic_cast<AIDA::ITuple *> ( tree->find("2") );
    342 
    343328 // Fill the ntuple
    344329  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)    );
    346331  ntuple2->fill( ntuple2->findColumn( "tot_e"   ), (G4float) totEnergy         );
    347332  ntuple2->fill( ntuple2->findColumn( "s_hits"  ), (G4float) S_hits            );
     
    349334  ntuple2->fill( ntuple2->findColumn( "num_ph"  ), (G4float) P_hits            );
    350335  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    );
    353338  ntuple2->fill( ntuple2->findColumn( "gamma"   ), (G4float) gamma_ev          );
    354339  ntuple2->fill( ntuple2->findColumn( "neutron" ), (G4float) neutron_ev        );
     
    361346  //Values of attributes are prepared; store them to the nTuple:
    362347  ntuple2->addRow();
    363 
    364348}
    365349
     
    375359  }
    376360
    377   //AIDA::ITuple * ntuple = dynamic_cast<AIDA::ITuple *> ( tree->find("3") );
    378   // Fill the secondaries ntuple
     361  // Fill the ntuple
    379362  ntuple3->fill( ntuple3->findColumn( "event" ), (G4float) event );
    380363  ntuple3->fill( ntuple3->findColumn( "hits"  ), (G4float) i     );
     
    384367
    385368  // NEW: Values of attributes are prepared; store them to the nTuple:
    386   ntuple3->addRow(); // check for returning true ...
     369  ntuple3->addRow();
    387370
    388371}
     
    391374{
    392375
    393   // AIDA::ITuple * ntuple1 = dynamic_cast<AIDA::ITuple *> ( tree->find("1") );
    394376  // Fill energy ntple:
    395377  ntuple1->fill( ntuple1->findColumn( "energy" ), energy );
    396378
    397379  // NEW: Values of attributes are prepared; store them to the nTuple:
    398   ntuple1->addRow(); // check for returning true ...
     380  ntuple1->addRow();
    399381
    400382}
  • trunk/examples/advanced/underground_physics/src/DMXMinEkineCuts.cc

    r1230 r1337  
    2626//
    2727// $Id: DMXMinEkineCuts.cc,v 1.6 2006/06/29 16:26:39 gunter Exp $
    28 // GEANT4 tag $Name: geant4-09-03-cand-01 $
     28// GEANT4 tag $Name: geant4-09-04-beta-01 $
    2929//
    3030//
  • trunk/examples/advanced/underground_physics/src/DMXPhysicsList.cc

    r1230 r1337  
    4646//          and redefined particles to allow non-static creation
    4747//          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.
    4851//
    4952// --------------------------------------------------------------
     
    214217// Electromagnetic Processes ////////////////////////////////////////////////
    215218// all charged particles
    216 #include "G4MultipleScattering.hh"
    217219
    218220// 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"
    223232
    224233
    225234// 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
    228243
    229244// e+
     
    246261
    247262//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"
    249268
    250269//em process options to allow msc step-limitation to be switched off
     
    252271
    253272void 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, therefore
    262   // cannot specify different LowEnergyIonisation models for different
    263   // particles, but can change model globally for Ion, Alpha and Proton.
    264 
    265 
    266   //fluorescence apply specific cut for fluorescence from photons, electrons
    267   //and bremsstrahlung photons:
    268   G4double fluorcut = 250*eV;
    269   lowePhot->SetCutForLowEnSecPhotons(fluorcut);
    270   loweIon->SetCutForLowEnSecPhotons(fluorcut);
    271   loweBrem->SetCutForLowEnSecPhotons(fluorcut);
    272273 
    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);
    282280
    283281  theParticleIterator->reset();
     
    292290      {
    293291        //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
    298308      }
    299309    else if (particleName == "e-")
     
    301311        //electron
    302312        // 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);
    308328      }
    309329    else if (particleName == "e+")
    310330      {
    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)
    315342        pmanager->AddProcess(new G4eBremsstrahlung(), -1,-1, 3);
     343
     344        //Annihilation
    316345        pmanager->AddProcess(new G4eplusAnnihilation(),0,-1, 4);     
    317346      }
     
    320349      {
    321350        //muon 
    322         G4MultipleScattering* aMultipleScattering = new G4MultipleScattering();
    323         pmanager->AddProcess(aMultipleScattering,           -1, 1, 1);
     351        pmanager->AddProcess(new G4eMultipleScattering,           -1, 1, 1);
    324352        pmanager->AddProcess(new G4MuIonisation(),          -1, 2, 2);
    325353        pmanager->AddProcess(new G4MuBremsstrahlung(),      -1,-1, 3);
     
    328356          pmanager->AddProcess(new G4MuonMinusCaptureAtRest(), 0,-1,-1);
    329357      }
    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"      ||
    332374             particleName == "deuteron"   ||
    333375             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")
    337387      {
    338388        // OBJECT may be dynamically created as either a GenericIon or nucleus
    339389        // G4Nucleus exists and therefore has particle type nucleus
    340390        // 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);
    353400      }
     401
    354402    else if ((!particle->IsShortLived()) &&
    355403             (charge != 0.0) &&
     
    357405      {
    358406        //all others charged particles except geantino
    359         G4MultipleScattering* aMultipleScattering = new G4MultipleScattering();
    360         //hIonisation        G4hLowEnergyIonisation* ahadronLowEIon = new G4hLowEnergyIonisation();
     407        G4hMultipleScattering* aMultipleScattering = new G4hMultipleScattering();
    361408        G4hIonisation* ahadronIon = new G4hIonisation();
     409       
     410        //multiple scattering
    362411        pmanager->AddProcess(aMultipleScattering,-1,1,1);
    363         //hIonisation   pmanager->AddProcess(ahadronLowEIon,       -1,2,2);     
     412
     413        //ionisation
    364414        pmanager->AddProcess(ahadronIon,       -1,2,2);     
    365         //      pmanager->AddProcess(new G4hIonisation(),       -1,2,2);     
    366415      }
    367416   
     
    369418
    370419  // turn off msc step-limitation - especially as electron cut 1nm
    371   G4EmProcessOptions opt;
    372   //  opt.SetMscStepLimitation(false);
    373420  opt.SetMscStepLimitation(fMinimal);
    374421
  • trunk/examples/advanced/underground_physics/src/DMXRunAction.cc

    r807 r1337  
    3939// History:
    4040// 17 Jan 2002 Alex Howard Added Analysis
     41// 23 Oct 2009 Luciano Pandola Removed un-necessary calls from EndOfRun()
    4142//
    4243// RunAction program
     
    104105void DMXRunAction::EndOfRunAction(const G4Run*)
    105106{
    106 
    107 #ifdef G4ANALYSIS_USE
    108   DMXAnalysisManager* analysis = DMXAnalysisManager::getInstance();
    109   //analysis->PlotHistos(interactplot);
    110   //analysis->PulseTimeFit();
    111   analysis->Finish();
    112 #endif
    113 
    114107  if (G4VVisManager::GetConcreteInstance()) {
    115108     G4UImanager::GetUIpointer()->ApplyCommand("/vis/viewer/update");
Note: See TracChangeset for help on using the changeset viewer.