Ignore:
Timestamp:
Dec 22, 2010, 3:52:27 PM (13 years ago)
Author:
garnier
Message:

geant4 tag 9.4

File:
1 edited

Legend:

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

    r1337 r1347  
    2424// ********************************************************************
    2525//
    26 // $Id: G4PenelopeComptonModel.cc,v 1.9 2010/03/26 09:32:50 pandola Exp $
    27 // GEANT4 tag $Name: geant4-09-04-beta-01 $
     26// $Id: G4PenelopeComptonModel.cc,v 1.11 2010/12/01 15:20:26 pandola Exp $
     27// GEANT4 tag $Name: geant4-09-04-ref-00 $
    2828//
    2929// Author: Luciano Pandola
     
    108108
    109109  std::map <G4int,G4DataVector*>::iterator i;
    110   for (i=ionizationEnergy->begin();i != ionizationEnergy->end();i++)
    111     if (i->second) delete i->second;
    112   for (i=hartreeFunction->begin();i != hartreeFunction->end();i++)
    113     if (i->second) delete i->second;
    114   for (i=occupationNumber->begin();i != occupationNumber->end();i++)
    115     if (i->second) delete i->second;
    116 
    117 
    118110  if (ionizationEnergy)
    119     delete ionizationEnergy;
     111    {
     112      for (i=ionizationEnergy->begin();i != ionizationEnergy->end();i++)
     113        if (i->second) delete i->second;
     114      delete ionizationEnergy;
     115    }
    120116  if (hartreeFunction)
    121     delete hartreeFunction;
     117    {
     118      for (i=hartreeFunction->begin();i != hartreeFunction->end();i++)
     119        if (i->second) delete i->second;
     120      delete hartreeFunction;
     121    }
    122122  if (occupationNumber)
    123     delete occupationNumber;
     123    {
     124      for (i=occupationNumber->begin();i != occupationNumber->end();i++)
     125        if (i->second) delete i->second;
     126      delete occupationNumber;
     127    }
    124128}
    125129
     
    265269
    266270  const G4int nmax = 64;
    267   G4double rn[nmax],pac[nmax];
     271  G4double rn[nmax]={0.0};
     272  G4double pac[nmax]={0.0};
    268273 
    269274  G4double ki,ki1,ki2,ki3,taumin,a1,a2;
     
    629634      G4String excep = "G4PenelopeComptonModel - G4LEDATA environment variable not set!";
    630635      G4Exception(excep);
     636      return;
    631637    }
    632638  G4String pathString(path);
     
    648654      G4String excep = "G4PenelopeComptonModel: problem with reading data from file";
    649655      G4Exception(excep);
     656      return;
    650657    }
    651658
    652659  do{
    653660    G4double harOfElectronsBelowThreshold = 0;
    654     G4int nbOfElectronsBelowThreshold = 0;
     661    G4int nbOfElectronsBelowThreshold = 0;
     662    file >> Z >> nLevels;
     663    //Check for nLevels validity, before using it in a loop
     664    if (nLevels<0 || nLevels>64)
     665      {
     666        G4String excep = "G4PenelopeComptonModel: corrupted data file?";
     667        G4Exception(excep);
     668        return;
     669      }
    655670    G4DataVector* occVector = new G4DataVector;
    656671    G4DataVector* harVector = new G4DataVector;
    657672    G4DataVector* bindingEVector = new G4DataVector;
    658     file >> Z >> nLevels;
    659673    for (G4int h=0;h<nLevels;h++)
    660674      {
Note: See TracChangeset for help on using the changeset viewer.