Changeset 921 for trunk/source/global/management/src/G4PhysicsLogVector.cc
- Timestamp:
- Feb 16, 2009, 10:14:30 AM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/source/global/management/src/G4PhysicsLogVector.cc
r850 r921 25 25 // 26 26 // 27 // $Id: G4PhysicsLogVector.cc,v 1. 16 2008/09/06 19:52:16 vnivanchExp $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 $ 29 29 // 30 30 // … … 40 40 // 26 Sep. 1996, K.Amako : Constructor with only 'bin size' added 41 41 // 11 Nov. 2000, H.Kurashige : use STL vector for dataVector and binVector 42 // 9 Mar. 2001, H.Kurashige : add PhysicsVector type and Retrieve42 // 9 Mar. 2001, H.Kurashige : added PhysicsVector type and Retrieve 43 43 // 05 Sep. 2008, V.Ivanchenko : added protections for zero-length vector 44 44 // … … 60 60 // Add extra one bin (hidden to user) to handle correctly when 61 61 // Energy=theEmax in getValue. 62 dataVector.reserve(theNbin+1); 63 binVector.reserve(theNbin+1); 62 64 63 65 numberOfBin = theNbin; 64 66 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); 74 71 } 75 72 } … … 84 81 // Add extra one bin (hidden to user) to handle correctly when 85 82 // Energy=theEmax in getValue. 86 dataVector.res ize(theNbin+1);87 binVector.res ize(theNbin+1);83 dataVector.reserve(theNbin+1); 84 binVector.reserve(theNbin+1); 88 85 89 86 numberOfBin = theNbin; 90 87 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); 98 92 } 93 edgeMin = binVector[0]; 94 edgeMax = binVector[numberOfBin-1]; 99 95 } 100 96 101 G4PhysicsLogVector::~G4PhysicsLogVector(){} 97 G4PhysicsLogVector::~G4PhysicsLogVector() 98 { 99 } 102 100 103 101 G4bool G4PhysicsLogVector::Retrieve(std::ifstream& fIn, G4bool ascii) … … 112 110 return success; 113 111 } 112 113 G4PhysicsLogVector::G4PhysicsLogVector(const G4PhysicsLogVector& right) 114 : G4PhysicsVector(right) 115 { 116 dBin = right.dBin; 117 baseBin = right.baseBin; 118 } 119 120 G4PhysicsLogVector& 121 G4PhysicsLogVector::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.