- Timestamp:
- Jun 18, 2010, 11:42:07 AM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/source/processes/hadronic/models/cascade/cascade/src/G4InuclEvaporation.cc
r962 r1315 23 23 // * acceptance of all terms of the Geant4 Software license. * 24 24 // ******************************************************************** 25 // $Id: G4InuclEvaporation.cc,v 1.18 2010/05/21 18:26:16 mkelsey Exp $ 26 // Geant4 tag: $Name: geant4-09-04-beta-cand-01 $ 25 27 // 26 // $Id: G4InuclEvaporation.cc,v 1.8 2008/10/24 20:49:07 dennis Exp $ 27 // 28 // 20100114 M. Kelsey -- Remove G4CascadeMomentum, use G4LorentzVector directly 29 // 20100405 M. Kelsey -- Pass const-ref std::vector<> 30 // 20100413 M. Kelsey -- Pass G4CollisionOutput by ref to ::collide(), use 31 // const_iterator. 32 // 20100428 M. Kelsey -- Use G4InuclParticleNames enum 33 // 20100429 M. Kelsey -- Change "case gamma:" to "case photon:" 34 // 20100517 M. Kelsey -- Follow new ctors for G4*Collider family. Make 35 // G4EvaporationInuclCollider a data member. 36 // 20100520 M. Kelsey -- Simplify collision loop, move momentum rotations to 37 // G4CollisionOutput, copy G4DynamicParticle directly from 38 // G4InuclParticle, no switch-block required. Fix scaling factors. 39 28 40 #include <numeric> 29 41 #include "G4IonTable.hh" … … 41 53 #include "G4LorentzVector.hh" 42 54 #include "G4EquilibriumEvaporator.hh" 43 #include "G4Fissioner.hh"44 #include "G4BigBanger.hh"45 55 #include "G4InuclElementaryParticle.hh" 46 56 #include "G4InuclParticle.hh" 47 57 #include "G4CollisionOutput.hh" 58 #include "G4InuclParticleNames.hh" 48 59 49 typedef std::vector<G4InuclElementaryParticle>::iterator particleIterator; 50 typedef std::vector<G4InuclNuclei>::iterator nucleiIterator; 60 using namespace G4InuclParticleNames; 61 62 typedef std::vector<G4InuclElementaryParticle>::const_iterator particleIterator; 63 typedef std::vector<G4InuclNuclei>::const_iterator nucleiIterator; 51 64 52 65 53 G4InuclEvaporation::G4InuclEvaporation() { 54 verboseLevel=0; 55 } 66 G4InuclEvaporation::G4InuclEvaporation() 67 : verboseLevel(0), evaporator(new G4EvaporationInuclCollider) {} 56 68 57 69 G4InuclEvaporation::G4InuclEvaporation(const G4InuclEvaporation &) : G4VEvaporation() { … … 59 71 } 60 72 61 62 73 G4InuclEvaporation::~G4InuclEvaporation() { 74 delete evaporator; 63 75 } 64 76 … … 81 93 } 82 94 83 G4FragmentVector * G4InuclEvaporation::BreakItUp(const G4Fragment &theNucleus) { 84 85 enum particleType { nuclei = 0, proton = 1, neutron = 2, pionPlus = 3, 86 pionMinus = 5, pionZero = 7, photon = 10, 87 kaonPlus = 11, kaonMinus = 13, kaonZero = 15, 88 kaonZeroBar = 17, lambda = 21, sigmaPlus = 23, 89 sigmaZero = 25, sigmaMinus = 27, xiZero = 29, xiMinus = 31 }; 90 91 std::vector< G4DynamicParticle * > secondaryParticleVector; 92 G4FragmentVector * theResult = new G4FragmentVector; 95 G4FragmentVector* G4InuclEvaporation::BreakItUp(const G4Fragment &theNucleus) { 96 G4FragmentVector* theResult = new G4FragmentVector; 93 97 94 98 if (theNucleus.GetExcitationEnergy() <= 0.0) { // Check that Excitation Energy > 0 … … 100 104 G4double Z = theNucleus.GetZ(); 101 105 G4double mTar = G4NucleiProperties::GetNuclearMass(A, Z); // Mass of the target nucleus 102 G4LorentzVector tmp =theNucleus.GetMomentum();103 106 104 G4ThreeVector momentum = tmp.vect();107 G4ThreeVector momentum = theNucleus.GetMomentum().vect() / GeV; 105 108 // G4double energy = tmp.e(); 106 109 G4double exitationE = theNucleus.GetExcitationEnergy(); … … 108 111 // Move to CMS frame, save initial velocity of the nucleus to boostToLab vector. 109 112 // G4ThreeVector boostToLab( ( 1/G4NucleiProperties::GetNuclearMass( A, Z ) ) * momentum ); 110 G4InuclNuclei* tempNuc = new G4InuclNuclei(A, Z); 111 G4double mass =tempNuc->getMass()*1000;112 G4ThreeVector boostToLab( ( 1/mass) * momentum);113 114 G4double mass = mTar / GeV; 115 G4ThreeVector boostToLab( momentum/mass ); 113 116 114 117 if ( verboseLevel > 2 ) … … 122 125 123 126 G4InuclNuclei* nucleus = new G4InuclNuclei(A, Z); 124 nucleus->setExitationEnergy(exitationE/1000); 125 G4CascadeMomentum tmom; 126 nucleus->setMomentum(tmom); 127 nucleus->setEnergy(); 127 nucleus->setExitationEnergy(exitationE); 128 128 129 G4EquilibriumEvaporator* eqil = new G4EquilibriumEvaporator;130 G4Fissioner* fiss = new G4Fissioner;131 G4BigBanger* bigb = new G4BigBanger;132 G4EvaporationInuclCollider* evaporator = new G4EvaporationInuclCollider(eqil, fiss, bigb);133 129 G4CollisionOutput output; 130 evaporator->collide(0, nucleus, output); 134 131 135 output = evaporator->collide(0, nucleus); 132 const std::vector<G4InuclNuclei>& nucleiFragments = output.getNucleiFragments(); 133 const std::vector<G4InuclElementaryParticle>& particles = output.getOutgoingParticles(); 136 134 137 std::vector<G4InuclNuclei> nucleiFragments = output.getNucleiFragments();138 std::vector<G4InuclElementaryParticle> particles = output.getOutgoingParticles();135 G4double eTot=0.0; 136 G4int i=1; 139 137 140 G4double ekin,emas;141 G4double eTot=0.0;142 G4DynamicParticle* cascadeParticle = 0;143 G4int i=1;144 //G4cout << "# particles: " << output.getOutgoingParticles().size() << G4endl;145 138 if (!particles.empty()) { 146 particleIterator ipart; 147 G4int outgoingParticle; 148 149 for (ipart = particles.begin(); ipart != particles.end(); ipart++) { 150 151 outgoingParticle = ipart->type(); 139 G4int outgoingType; 140 particleIterator ipart = particles.begin(); 141 for (; ipart != particles.end(); ipart++) { 142 outgoingType = ipart->type(); 152 143 153 144 if (verboseLevel > 2) { 154 G4cout << "Evaporated particle: " << i << " of type: " << outgoing Particle << G4endl;145 G4cout << "Evaporated particle: " << i << " of type: " << outgoingType << G4endl; 155 146 i++; 156 147 // ipart->printParticle(); 157 148 } 158 149 159 const G4CascadeMomentum& mom = ipart->getMomentum(); 160 eTot += std::sqrt(mom[0]*1000 * mom[0]*1000); 150 eTot += ipart->getEnergy(); 151 152 G4LorentzVector vlab = ipart->getMomentum().boost(boostToLab); 161 153 162 ekin = ipart->getKineticEnergy()*1000; 163 emas = ipart->getMass()*1000; 164 165 G4ThreeVector aMom(mom[1]*1000, mom[2]*1000, mom[3]*1000); 166 167 G4LorentzVector v(aMom, (ekin+emas)); 168 v.boost( boostToLab ); 169 170 switch(outgoingParticle) { 171 172 case proton: 173 cascadeParticle = new G4DynamicParticle(G4Proton::ProtonDefinition(), v.vect(), v.e()); 174 break; 175 176 case neutron: 177 cascadeParticle = new G4DynamicParticle(G4Neutron::NeutronDefinition(), v.vect(), v.e()); 178 break; 179 180 case photon: 181 cascadeParticle = new G4DynamicParticle(G4Gamma::Gamma(), v.vect(), v.e()); 182 break; 183 default: 184 G4cout << " ERROR: GInuclEvapration::Propagate undefined particle type" << G4endl; 185 }; 186 187 secondaryParticleVector.push_back( cascadeParticle ); 154 theResult->push_back( new G4Fragment(vlab, ipart->getDefinition()) ); 188 155 // theResult.AddSecondary(cascadeParticle); 189 156 } 190 157 } 191 fillResult( secondaryParticleVector, theResult);192 193 158 194 159 // G4cout << "# fragments " << output.getNucleiFragments().size() << G4endl; 195 160 i=1; 196 161 if (!nucleiFragments.empty()) { 197 nucleiIterator ifrag; 198 199 for (ifrag = nucleiFragments.begin(); ifrag != nucleiFragments.end(); ifrag++) { 200 201 ekin = ifrag->getKineticEnergy()*1000; 202 emas = ifrag->getMass()*1000; 203 const G4CascadeMomentum& mom = ifrag->getMomentum(); 204 eTot += std::sqrt(mom[0]*1000 * mom[0]*1000); 205 206 G4ThreeVector aMom(mom[1]*1000, mom[2]*1000, mom[3]*1000); 207 // aMom = aMom.unit(); 208 209 G4LorentzVector v(aMom, (ekin+emas)); 210 v.boost( boostToLab ); 211 162 nucleiIterator ifrag = nucleiFragments.begin(); 163 for (; ifrag != nucleiFragments.end(); ifrag++) { 212 164 if (verboseLevel > 2) { 213 165 G4cout << " Nuclei fragment: " << i << G4endl; i++; 214 // ifrag->printParticle();215 166 } 216 167 168 eTot += ifrag->getEnergy(); 169 170 G4LorentzVector vlab = ifrag->getMomentum().boost(boostToLab); 171 217 172 G4int A = G4int(ifrag->getA()); 218 173 G4int Z = G4int(ifrag->getZ()); 219 // cascadeParticle = new G4DynamicParticle(G4Proton::ProtonDefinition(), v.vect(), v.e());220 174 if (verboseLevel > 2) { 221 G4cout << "boosted v" << v << G4endl;175 G4cout << "boosted v" << vlab << G4endl; 222 176 } 223 // theResult->push_back( new G4Fragment(A, Z, tmp) ); 224 theResult->push_back( new G4Fragment(A, Z, v) ); 177 theResult->push_back( new G4Fragment(A, Z, vlab) ); 225 178 } 226 179 } … … 229 182 return theResult; 230 183 } 231 232 void G4InuclEvaporation::fillResult( std::vector<G4DynamicParticle *> secondaryParticleVector,233 G4FragmentVector * aResult )234 {235 // Fill the vector pParticleChange with secondary particles stored in vector.236 for ( size_t i = 0 ; i < secondaryParticleVector.size() ; i++ )237 {238 G4int aZ = static_cast<G4int> (secondaryParticleVector[i]->GetDefinition()->GetPDGCharge() );239 G4int aA = static_cast<G4int> (secondaryParticleVector[i]->GetDefinition()->GetBaryonNumber());240 G4LorentzVector aMomentum = secondaryParticleVector[i]->Get4Momentum();241 if(aA>0) {242 aResult->push_back( new G4Fragment(aA, aZ, aMomentum) );243 } else {244 aResult->push_back( new G4Fragment(aMomentum, secondaryParticleVector[i]->GetDefinition()) );245 }246 }247 return;248 }249 250 251
Note: See TracChangeset
for help on using the changeset viewer.