Skip to content

Commit

Permalink
feat(Base): Improve FairGenericStack::Reset
Browse files Browse the repository at this point in the history
FairGenericStack::Reset should reset the appropriate member
variables of FairGenericStack.

Use this in derived Reset functions.
  • Loading branch information
ChristianTackeGSI committed Sep 19, 2024
1 parent 986ceb9 commit 9676612
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 4 deletions.
2 changes: 1 addition & 1 deletion examples/common/mcstack/FairStack.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -309,8 +309,8 @@ void FairStack::Reset()
}
fParticles->Clear();
fTracks->Clear();
fFSTrackMap.clear();
fPointsMap.clear();
FairGenericStack::Reset();
}

void FairStack::Register()
Expand Down
2 changes: 1 addition & 1 deletion fairroot/base/sim/FairGenericStack.h
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ class FairGenericStack : public TVirtualMCStack
virtual void FinishPrimary() {}

/** Resets arrays and stack and deletes particles and tracks **/
virtual void Reset() {}
virtual void Reset() { fFSTrackMap.clear(); }

/** Register the MCTrack array to the Root Manager **/
virtual void Register() {}
Expand Down
3 changes: 2 additions & 1 deletion templates/project_root_containers/MyProjData/MyProjStack.cxx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/********************************************************************************
* Copyright (C) 2014-2023 GSI Helmholtzzentrum fuer Schwerionenforschung GmbH *
* Copyright (C) 2014-2024 GSI Helmholtzzentrum fuer Schwerionenforschung GmbH *
* *
* This software is distributed under the terms of the *
* GNU Lesser General Public Licence (LGPL) version 3, *
Expand Down Expand Up @@ -350,6 +350,7 @@ void MyProjStack::Reset()
fParticles->Clear();
fTracks->Clear();
fPointsMap.clear();
FairGenericStack::Reset();
}
// -------------------------------------------------------------------------

Expand Down
3 changes: 2 additions & 1 deletion templates/project_stl_containers/MyProjData/MyProjStack.cxx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/********************************************************************************
* Copyright (C) 2014-2023 GSI Helmholtzzentrum fuer Schwerionenforschung GmbH *
* Copyright (C) 2014-2024 GSI Helmholtzzentrum fuer Schwerionenforschung GmbH *
* *
* This software is distributed under the terms of the *
* GNU Lesser General Public Licence (LGPL) version 3, *
Expand Down Expand Up @@ -355,6 +355,7 @@ void MyProjStack::Reset()
fParticles->Clear();
fTracks->Clear();
fPointsMap.clear();
FairGenericStack::Reset();
}
// -------------------------------------------------------------------------

Expand Down

0 comments on commit 9676612

Please sign in to comment.