Ignore:
Timestamp:
Nov 5, 2010, 3:45:55 PM (14 years ago)
Author:
garnier
Message:

update ti head

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/source/processes/electromagnetic/lowenergy/src/G4LivermoreIonisationModel.cc

    r1337 r1340  
    2424// ********************************************************************
    2525//
    26 // $Id: G4LivermoreIonisationModel.cc,v 1.8 2010/03/26 09:32:50 pandola Exp $
    27 // GEANT4 tag $Name: geant4-09-04-beta-01 $
     26// $Id: G4LivermoreIonisationModel.cc,v 1.9 2010/10/13 07:28:47 pandola Exp $
     27// GEANT4 tag $Name: emlowen-V09-03-54 $
    2828//
    2929// Author: Luciano Pandola
     
    4444//                  - atomic deexcitation managed via G4VEmModel::DeexcitationFlag() is
    4545//                    set as "true" (default would be false)
     46// 12 Oct 2010   L Pandola
     47//                  - add debugging information about energy in
     48//                    SampleDeexcitationAlongStep()
     49//                  - generate fluorescence SampleDeexcitationAlongStep() only above
     50//                    the cuts.
     51//
    4652//
    4753
     
    125131    }
    126132  energySpectrum = new G4eIonisationSpectrum();
    127   if (verboseLevel > 0)
     133  if (verboseLevel > 3)
    128134    G4cout << "G4VEnergySpectrum is initialized" << G4endl;
    129135
     
    159165    }
    160166
    161   if (verboseLevel > 1)
     167  if (verboseLevel > 3)
    162168    {
    163169      G4cout << "Cross section data: " << G4endl;
     
    440446  //secondaries. The eloss value is updated.
    441447  G4double energyLossBefore = eloss;
     448
    442449  if (verboseLevel > 2)
    443     G4cout << "Energy loss along step before deexcitation : " << energyLossBefore/keV <<
    444       " keV" << G4endl;
    445 
     450    {
     451      G4cout << "-----------------------------------------------------------" << G4endl;
     452      G4cout << " SampleDeexcitationAlongStep() from G4LivermoreIonisation" << G4endl;
     453      G4cout << "Energy loss along step before deexcitation : " << energyLossBefore/keV <<
     454        " keV" << G4endl;
     455    }
    446456  G4double incidentEnergy = theTrack.GetDynamicParticle()->GetKineticEnergy();
    447457
     
    453463  G4double cute = (*(theCoupleTable->GetEnergyCutsVector(1)))[index];
    454464 
    455   //Notice: in LowEnergyIonisation, fluorescence is always generated above 250 eV
    456   //not above the tracking cut.
    457   //G4double cutForLowEnergySecondaryParticles = 250.0*eV;
    458465
    459466  std::vector<G4DynamicParticle*>* deexcitationProducts =
     
    505512                              {
    506513                                e = aSecondary->GetKineticEnergy();
    507                                 if ( eTot + e <= eloss )
     514                                G4double itsCut = cutg;
     515                                if (aSecondary->GetParticleDefinition() == G4Electron::Electron())
     516                                  itsCut = cute;
     517                                if ( eTot + e <= eloss && e > itsCut )
    508518                                  {
    509519                                    eTot += e;
     
    524534    }
    525535
     536  G4double energyLossInFluorescence = 0.0;
    526537  size_t nSecondaries = deexcitationProducts->size();
    527538  if (nSecondaries > 0)
    528539    {
    529       fParticleChange->SetNumberOfSecondaries(nSecondaries);
     540      //You may have already secondaries produced by SampleSubCutSecondaries()
     541      //at the process G4VEnergyLossProcess
     542      G4int secondariesBefore = fParticleChange->GetNumberOfSecondaries();
     543      fParticleChange->SetNumberOfSecondaries(nSecondaries+secondariesBefore);
    530544      const G4StepPoint* preStep = theTrack.GetStep()->GetPreStepPoint();
    531545      const G4StepPoint* postStep = theTrack.GetStep()->GetPostStepPoint();
     
    538552      G4double time, q;
    539553      G4ThreeVector position;
    540      
     554
    541555      for (size_t i=0; i<nSecondaries; i++)
    542556        {
     
    553567                  position += r;
    554568                  G4Track* newTrack = new G4Track(part, time, position);
     569                  energyLossInFluorescence += eSecondary;
    555570                  pParticleChange->AddSecondary(newTrack);
    556571                }
     
    566581  delete deexcitationProducts;
    567582 
     583  //Check and verbosities. Ensure energy conservation
    568584  if (verboseLevel > 2)
    569     G4cout << "Energy loss along step after deexcitation : " << eloss/keV << 
    570       " keV" << G4endl;
     585    {
     586      G4cout << "Energy loss along step after deexcitation : " << eloss/keV << 
     587        " keV" << G4endl;
     588    }
     589  if (verboseLevel > 1)
     590    {
     591      G4cout << "------------------------------------------------------------------" << G4endl;
     592      G4cout << "Energy in fluorescence: " << energyLossInFluorescence/keV << " keV" << G4endl;
     593      G4cout << "Residual energy loss: " << eloss/keV << " keV " << G4endl;
     594      G4cout << "Total final: " << (energyLossInFluorescence+eloss)/keV << " keV" << G4endl;
     595      G4cout << "Total initial: " << energyLossBefore/keV << " keV" << G4endl; 
     596      G4cout << "------------------------------------------------------------------" << G4endl;
     597    }
     598  if (verboseLevel > 0)
     599    {
     600      if (std::fabs(energyLossBefore-energyLossInFluorescence-eloss)>10*eV)
     601        {
     602          G4cout << "Found energy non-conservation at SampleDeexcitationAlongStep() " << G4endl;
     603          G4cout << "Energy in fluorescence: " << energyLossInFluorescence/keV << " keV" << G4endl;
     604          G4cout << "Residual energy loss: " << eloss/keV << " keV " << G4endl;
     605          G4cout << "Total final: " << (energyLossInFluorescence+eloss)/keV << " keV" << G4endl;
     606          G4cout << "Total initial: " << energyLossBefore/keV << " keV" << G4endl;     
     607        }
     608    }
    571609}
    572610
     
    655693           xsis->AddComponent(p);
    656694         }
    657        if(verboseLevel>0) xsis->PrintData();
     695       if(verboseLevel>3) xsis->PrintData();
    658696       shellVacancy->AddXsiTable(xsis);
    659697    }
Note: See TracChangeset for help on using the changeset viewer.