Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- G4double G4RKFieldIntegrator::CalculateTotalEnergy(
- const G4KineticTrackVector& Barions)
- {
- G4double Etot = 0;
- ....
- for(G4int c2 = c1 + 1; c2 < nBarion; c2++)
- {
- ....
- // Esk2
- Etot += t1*std::pow(Alpha/pi, 3/2)*std::exp(-Alpha*r12*r12);
- // Eyuk
- Etot += ....;
- // Ecoul
- Etot += 1.44*p1->GetDefinition()->GetPDGCharge()*
- p2->GetDefinition()->GetPDGCharge()/r12*
- Erf(std::sqrt(Alpha)*r12);
- // Epaul
- Etot = 0;
- ....
- }
- ....
- }
- This suspicious code was found in Geant4 project by PVS-Studio static code analyzer.
- Warning message is:
- V519 The 'Etot' variable is assigned values twice successively. Perhaps this is a mistake. Check lines: 80, 83. _G4processes-archive g4rkfieldintegrator.cc 83
- PVS-Studio is a static analyzer for detecting bugs in the source code of applications written in C, C++, C++11, C++/CX. Site: http://www.viva64.com/en/pvs-studio/
Advertisement
Add Comment
Please, Sign In to add comment