Ignore:
Timestamp:
Feb 16, 2009, 10:14:30 AM (15 years ago)
Author:
garnier
Message:

en test de gl2ps. Problemes de libraries

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/source/global/management/src/G4PhysicsLogVector.cc

    r850 r921  
    2525//
    2626//
    27 // $Id: G4PhysicsLogVector.cc,v 1.16 2008/09/06 19:52:16 vnivanch Exp $
    28 // GEANT4 tag $Name: HEAD $
     27// $Id: G4PhysicsLogVector.cc,v 1.21 2008/09/22 08:26:33 gcosmo Exp $
     28// GEANT4 tag $Name: geant4-09-02-cand-01 $
    2929//
    3030//
     
    4040//    26 Sep. 1996, K.Amako : Constructor with only 'bin size' added
    4141//    11 Nov. 2000, H.Kurashige : use STL vector for dataVector and binVector
    42 //    9  Mar. 2001, H.Kurashige : add PhysicsVector type and Retrieve
     42//    9  Mar. 2001, H.Kurashige : added PhysicsVector type and Retrieve
    4343//    05 Sep. 2008, V.Ivanchenko : added protections for zero-length vector
    4444//
     
    6060  // Add extra one bin (hidden to user) to handle correctly when
    6161  // Energy=theEmax in getValue.
     62  dataVector.reserve(theNbin+1);
     63  binVector.reserve(theNbin+1);
    6264
    6365  numberOfBin = theNbin;
    6466
    65   if(numberOfBin > 0) {
    66     dataVector.resize(theNbin+1);
    67     binVector.resize(theNbin+1);
    68     edgeMin = 1;
    69     edgeMax = numberOfBin;
    70     for (size_t i=0; i<=numberOfBin; i++) {
    71       binVector[i] = i + 1;
    72       dataVector[i]= 0.0;
    73     }
     67  for (size_t i=0; i<=numberOfBin; i++)
     68  {
     69     binVector.push_back(0.0);
     70     dataVector.push_back(0.0);
    7471  }
    7572
     
    8481  // Add extra one bin (hidden to user) to handle correctly when
    8582  // Energy=theEmax in getValue.
    86   dataVector.resize(theNbin+1);
    87   binVector.resize(theNbin+1);
     83  dataVector.reserve(theNbin+1);
     84  binVector.reserve(theNbin+1);
    8885
    8986  numberOfBin = theNbin;
    9087
    91   if(numberOfBin > 0) {
    92     for (size_t i=0; i<=numberOfBin; i++) {
    93       binVector[i] = std::pow(10., std::log10(theEmin)+i*dBin);
    94       dataVector[i]= 0.0;
    95     }
    96     edgeMin = binVector[0];
    97     edgeMax = binVector[numberOfBin-1];
     88  for (size_t i=0; i<numberOfBin+1; i++)
     89  {
     90    binVector.push_back(std::pow(10., std::log10(theEmin)+i*dBin));
     91    dataVector.push_back(0.0);
    9892  }
     93  edgeMin = binVector[0];
     94  edgeMax = binVector[numberOfBin-1];
    9995
    10096
    101 G4PhysicsLogVector::~G4PhysicsLogVector(){}
     97G4PhysicsLogVector::~G4PhysicsLogVector()
     98{
     99}
    102100
    103101G4bool G4PhysicsLogVector::Retrieve(std::ifstream& fIn, G4bool ascii)
     
    112110  return success;
    113111}
     112
     113G4PhysicsLogVector::G4PhysicsLogVector(const G4PhysicsLogVector& right)
     114  : G4PhysicsVector(right)
     115{
     116  dBin = right.dBin;
     117  baseBin = right.baseBin;
     118}
     119
     120G4PhysicsLogVector&
     121G4PhysicsLogVector::operator=(const G4PhysicsLogVector& right)
     122{
     123  // Check assignment to self
     124  //
     125  if(this == &right) { return *this; }
     126
     127  DeleteData();
     128  CopyData(right);
     129
     130  dBin    = right.dBin;
     131  baseBin = right.baseBin;
     132  return *this;
     133}
Note: See TracChangeset for help on using the changeset viewer.