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/exoticphysics/monopole/src/RunAction.cc

    r1230 r1337  
    2424// ********************************************************************
    2525//
    26 // $Id: RunAction.cc,v 1.2 2008/06/11 14:34:19 vnivanch Exp $
    27 // GEANT4 tag $Name: geant4-09-03-cand-01 $
     26// $Id: RunAction.cc,v 1.4 2010/06/04 19:03:36 vnivanch Exp $
     27// GEANT4 tag $Name: geant4-09-04-beta-01 $
    2828//
    2929//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
     
    5050//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
    5151
    52 RunAction::RunAction(DetectorConstruction* det, PrimaryGeneratorAction* kin):detector(det), kinematic(kin), af(0), tree(0)
     52RunAction::RunAction(DetectorConstruction* det, PrimaryGeneratorAction* kin)
     53  :detector(det), kinematic(kin), af(0), tree(0)
    5354{
    54   verboseLevel = 0;
     55  verboseLevel = 1;
    5556  binLength = offsetX = 0.;
    5657  histo[0] = 0;
     
    6061  // Creating the analysis factory
    6162  af = AIDA_createAnalysisFactory();
    62         ftype   = "hbook";
     63  ftype   = "root";
    6364  fname   = "monopole";
    6465#endif
     
    6869}
    6970
    70 
    71 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
     71//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
     72
    7273RunAction::~RunAction()
    7374{
     
    7778}
    7879
    79 
    80 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
     80//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
     81
    8182void RunAction::bookHisto()
    8283{
    8384  G4double length  = detector->GetAbsorSizeX();
    84   if(!binLength) binLength = 5 * mm;
    85         if(binLength > detector->GetMaxStepSize()) binLength = detector->GetMaxStepSize();
     85  if(!binLength) { binLength = 5 * mm; }
     86  if(binLength > detector->GetMaxStepSize()) {
     87    binLength = detector->GetMaxStepSize();
     88  }
    8689  offsetX   = 0.5 * length;
    8790 
    8891#ifdef G4ANALYSIS_USE
    89   if(GetVerbose() > 0) G4cout << "\n----> Histogram Tree opened" << G4endl;
    90 
    91   G4int nbBins = (int)(0.5 + length / binLength);
     92  if(GetVerbose() > 0) { G4cout << "\n----> Histogram Tree opened" << G4endl; }
     93
     94  G4int nbBins = (G4int)(0.5 + length / binLength);
    9295
    9396  // Create the tree factory
     
    120123}
    121124
    122 
    123 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
     125//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
     126
    124127void RunAction::saveHisto()
    125128{
     
    133136}
    134137
    135 
    136 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
     138//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
     139
    137140void RunAction::SetBinSize(G4double size)
    138141{
     
    180183  G4Material* material = detector->GetAbsorMaterial();
    181184  G4double density = material->GetDensity();
    182    
    183   G4String particle = kinematic->GetParticleGun()->GetParticleDefinition()->GetParticleName();   
     185  const G4ParticleDefinition* part =
     186    kinematic->GetParticleGun()->GetParticleDefinition();
     187  G4String particle = part->GetParticleName();   
    184188  G4double energy = kinematic->GetParticleGun()->GetParticleEnergy();
    185189
     
    209213  calc.SetVerbose(0);
    210214  G4int i;
    211   for(i = 0; i < 100; i++) {
     215  for(i = 0; i < 100; ++i) {
    212216    ekin[i] = std::pow(10., 0.1*G4double(i)) * keV;
    213217    dedxproton[i] = calc.ComputeElectronicDEDX(ekin[i], "proton",  material->GetName());
     
    215219  }
    216220
    217   if(GetVerbose() > 1){
     221  if(GetVerbose() > 0){
    218222    G4cout << "### Stopping Powers" << G4endl;
    219223    for(i=0; i<100; i++) {
     
    223227    }
    224228  };
    225 
     229  G4cout << "### End of stopping power table" << G4endl;
    226230#ifdef G4ANALYSIS_USE
    227231  // normalize histogram
     
    234238        };
    235239
    236 
    237   for(i=0; i<100; i++) {
     240  for(i=0; i<100; ++i) {
    238241    G4double e = std::log10(ekin[i] / MeV) + 0.05;
    239242    histo[1]->fill(e, dedxproton[i]);
Note: See TracChangeset for help on using the changeset viewer.