Skip to content

Commit

Permalink
Fix unused variable in MuDISGenerator
Browse files Browse the repository at this point in the history
First argument of SetPositions was unused and as a result silently
ignored. As we are already changing it, remove default parameters,
which are probably outdated, and could lead to surprising behaviour.
Code using the old signature should break noticeably, and should be
trivial to fix by removing the first argument.
  • Loading branch information
olantwin committed Oct 3, 2024
1 parent 30755a7 commit ea5c998
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ it in future.
* Cleaned up Veto Implementation
* Fix crash of event display, PID when no entrance lid present
* Close ShipReco.py output file
* Remove unused (silently ignored!) argument for MuDISGenerator::SetPositions

### Changed

Expand Down
2 changes: 1 addition & 1 deletion macro/run_simScript.py
Original file line number Diff line number Diff line change
Expand Up @@ -403,7 +403,7 @@
# in front of UVT up to tracking station 1
mu_start, mu_end = ship_geo.Chamber1.z-ship_geo.chambers.Tub1length-10.*u.cm,ship_geo.TrackStation1.z
print('MuDIS position info input=',mu_start, mu_end)
DISgen.SetPositions(ship_geo.target.z0, mu_start, mu_end)
DISgen.SetPositions(mu_start, mu_end)
DISgen.Init(inputFile,options.firstEvent)
primGen.AddGenerator(DISgen)
options.nEvents = min(options.nEvents,DISgen.GetNevents())
Expand Down
7 changes: 4 additions & 3 deletions shipgen/MuDISGenerator.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,10 @@ class MuDISGenerator : public FairGenerator
virtual Bool_t Init(const char*); //!
Int_t GetNevents();

void SetPositions(Double_t zTa, Double_t zS=-3400., Double_t zE=2650.){
startZ = zS;
endZ = zE;
void SetPositions(Double_t z_start, Double_t z_end)
{
startZ = z_start;
endZ = z_end;
}

private:
Expand Down

0 comments on commit ea5c998

Please sign in to comment.