Skip to content

Commit

Permalink
code review
Browse files Browse the repository at this point in the history
  • Loading branch information
smuzaffar committed Oct 3, 2024
1 parent 3259c68 commit 71187dc
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 17 deletions.
17 changes: 7 additions & 10 deletions SimG4Core/CustomPhysics/src/CMSSQNeutronAnnih.cc
Original file line number Diff line number Diff line change
Expand Up @@ -86,19 +86,16 @@ G4double CMSSQNeutronAnnih::momDistr(G4double x_in) {
1};

//now interpolate the above points for x_in
G4double result = 9999;
if (x_in <= 0.0)
return 0.;
if (x_in >= 1.0)
return CDF_k[n_entries - 1];
for (int i = 1; i < n_entries; i++) {
if (x[i] > x_in) {
result = (CDF_k[i] - CDF_k[i - 1]) / (x[i] - x[i - 1]) * (x_in - x[i - 1]) + CDF_k[i - 1];
break;
if (x[i] >= x_in) {
return (CDF_k[i] - CDF_k[i - 1]) / (x[i] - x[i - 1]) * (x_in - x[i - 1]) + CDF_k[i - 1];
}
}
//ROOT::Math::Interpolator inter(n_entries, ROOT::Math::Interpolation::kAKIMA);
//inter.SetData(n_entries,x,CDF_k);
//result = inter.Eval(x_in);

return result;
//return 1;
return 0.0;
}

G4HadFinalState* CMSSQNeutronAnnih::ApplyYourself(const G4HadProjectile& aTrack, G4Nucleus& targetNucleus) {
Expand Down
7 changes: 0 additions & 7 deletions SimG4Core/Geometry/src/CMSG4CheckOverlap.cc
Original file line number Diff line number Diff line change
Expand Up @@ -237,13 +237,6 @@ void CMSG4CheckOverlap::makeReportForOverlaps(std::ofstream& fout,
<< "\n";
fout << "### Check overlaps for G4Region Node[" << ii << "] : " << nodeNames[ii] << "\n";
G4Region* reg = regStore->GetRegion((G4String)nodeNames[ii]);
if (!reg) {
fout << "### NO G4Region found - EXIT"
<< "\n";
if (gdml)
delete gdml;
return;
}
std::vector<G4LogicalVolume*>::iterator rootLVItr = reg->GetRootLogicalVolumeIterator();
unsigned int numRootLV = reg->GetNumberOfRootVolumes();
fout << " " << numRootLV << " Root Logical Volumes in this region"
Expand Down

0 comments on commit 71187dc

Please sign in to comment.