Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Misc code improvements: override, destructor, small mistakes #1447

Merged
merged 2 commits into from
Sep 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions Biasing/include/Biasing/DeepEcalProcessFilter.h
Original file line number Diff line number Diff line change
Expand Up @@ -42,24 +42,24 @@ class DeepEcalProcessFilter : public simcore::UserAction {
virtual ~DeepEcalProcessFilter() = default;

/// Method to set flags in the beginning of the event
void BeginOfEventAction(const G4Event* event) final override;
void BeginOfEventAction(const G4Event* event) override;

/**
* Implement the stepping action which performs the target volume biasing.
* @param step The Geant4 step.
*/
void stepping(const G4Step* step) final override;
void stepping(const G4Step* step) override;

// /**
// * Method called at the end of every event.
// * @param event Geant4 event object.
// */
// void EndOfEventAction(const G4Event*) final override;
// void EndOfEventAction(const G4Event*) override;

void NewStage() final override;
void NewStage() override;

/// Retrieve the type of actions this class defines
std::vector<simcore::TYPE> getTypes() final override {
std::vector<simcore::TYPE> getTypes() override {
return {simcore::TYPE::STACKING, simcore::TYPE::STEPPING,
simcore::TYPE::EVENT};
}
Expand Down
10 changes: 5 additions & 5 deletions Biasing/include/Biasing/EcalDarkBremFilter.h
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ class EcalDarkBremFilter : public simcore::UserAction {
*
* @return list of action types this class does
*/
std::vector<simcore::TYPE> getTypes() final override {
std::vector<simcore::TYPE> getTypes() override {
return {simcore::TYPE::STACKING, simcore::TYPE::EVENT,
simcore::TYPE::TRACKING};
}
Expand All @@ -73,7 +73,7 @@ class EcalDarkBremFilter : public simcore::UserAction {
*
* @param event unused
*/
void BeginOfEventAction(const G4Event* event) final override;
void BeginOfEventAction(const G4Event* event) override;

/**
* We return the classification of the track done by the PartialEnergySorter,
Expand All @@ -90,7 +90,7 @@ class EcalDarkBremFilter : public simcore::UserAction {
*/
G4ClassificationOfNewTrack ClassifyNewTrack(
const G4Track* aTrack,
const G4ClassificationOfNewTrack& currentTrackClass) final override;
const G4ClassificationOfNewTrack& currentTrackClass) override;

/**
* When using the PartialEnergySorter,
Expand All @@ -102,7 +102,7 @@ class EcalDarkBremFilter : public simcore::UserAction {
*
* @see PartialEnergySort::NewStage
*/
void NewStage() final override;
void NewStage() override;

/**
* Make sure A' is saved.
Expand All @@ -114,7 +114,7 @@ class EcalDarkBremFilter : public simcore::UserAction {
*
* @param track G4Track to check if it is an A'
*/
void PostUserTrackingAction(const G4Track* track) final override;
void PostUserTrackingAction(const G4Track* track) override;

private:
/**
Expand Down
8 changes: 4 additions & 4 deletions Biasing/include/Biasing/EcalProcessFilter.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,9 @@ class EcalProcessFilter : public simcore::UserAction {
/// Destructor
~EcalProcessFilter();

void stepping(const G4Step* step) final override;
void stepping(const G4Step* step) override;

// void PostUserTrackingAction(const G4Track*) final override;
// void PostUserTrackingAction(const G4Track*) override;

/**
* Classify a new track which postpones track processing.
Expand All @@ -50,10 +50,10 @@ class EcalProcessFilter : public simcore::UserAction {
*/
G4ClassificationOfNewTrack ClassifyNewTrack(
const G4Track* aTrack,
const G4ClassificationOfNewTrack& currentTrackClass) final override;
const G4ClassificationOfNewTrack& currentTrackClass) override;

/// Retrieve the type of actions this class defines
std::vector<simcore::TYPE> getTypes() final override {
std::vector<simcore::TYPE> getTypes() override {
return {simcore::TYPE::STACKING, simcore::TYPE::STEPPING};
}

Expand Down
8 changes: 4 additions & 4 deletions Biasing/include/Biasing/MidShowerDiMuonBkgdFilter.h
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ class MidShowerDiMuonBkgdFilter : public simcore::UserAction {
*
* @return list of action types this class does
*/
std::vector<simcore::TYPE> getTypes() final override {
std::vector<simcore::TYPE> getTypes() override {
return {simcore::TYPE::STACKING, simcore::TYPE::STEPPING,
simcore::TYPE::EVENT};
}
Expand All @@ -54,7 +54,7 @@ class MidShowerDiMuonBkgdFilter : public simcore::UserAction {
*
* @param[in] event not used
*/
void BeginOfEventAction(const G4Event* event) final override;
void BeginOfEventAction(const G4Event* event) override;

/**
* We follow the simulation along each step and check
Expand All @@ -72,7 +72,7 @@ class MidShowerDiMuonBkgdFilter : public simcore::UserAction {
*
* @param[in] step current G4Step
*/
void stepping(const G4Step* step) final override;
void stepping(const G4Step* step) override;

/**
* When using the PartialEnergySorter,
Expand All @@ -86,7 +86,7 @@ class MidShowerDiMuonBkgdFilter : public simcore::UserAction {
* @see PartialEnergySort::NewStage
* @see AbortEvent
*/
void NewStage() final override;
void NewStage() override;

private:
/**
Expand Down
8 changes: 4 additions & 4 deletions Biasing/include/Biasing/MidShowerNuclearBkgdFilter.h
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ class MidShowerNuclearBkgdFilter : public simcore::UserAction {
*
* @return list of action types this class does
*/
std::vector<simcore::TYPE> getTypes() final override {
std::vector<simcore::TYPE> getTypes() override {
return {simcore::TYPE::STACKING, simcore::TYPE::STEPPING,
simcore::TYPE::EVENT};
}
Expand All @@ -56,7 +56,7 @@ class MidShowerNuclearBkgdFilter : public simcore::UserAction {
*
* @param[in] event not used
*/
void BeginOfEventAction(const G4Event* event) final override;
void BeginOfEventAction(const G4Event* event) override;

/**
* We follow the simulation along each step and check
Expand All @@ -74,7 +74,7 @@ class MidShowerNuclearBkgdFilter : public simcore::UserAction {
*
* @param[in] step current G4Step
*/
void stepping(const G4Step* step) final override;
void stepping(const G4Step* step) override;

/**
* When using the PartialEnergySorter,
Expand All @@ -88,7 +88,7 @@ class MidShowerNuclearBkgdFilter : public simcore::UserAction {
* @see PartialEnergySort::NewStage
* @see AbortEvent
*/
void NewStage() final override;
void NewStage() override;

private:
/**
Expand Down
6 changes: 3 additions & 3 deletions Biasing/include/Biasing/NonFiducialFilter.h
Original file line number Diff line number Diff line change
Expand Up @@ -46,16 +46,16 @@ class NonFiducialFilter : public simcore::UserAction {
* Implement the stepping action which performs the target volume biasing.
* @param step The Geant4 step.
*/
void stepping(const G4Step* step) final override;
void stepping(const G4Step* step) override;

/**
* Method called at the end of every event.
* @param event Geant4 event object.
*/
void EndOfEventAction(const G4Event*) final override;
void EndOfEventAction(const G4Event*) override;

/// Retrieve the type of actions this class defines
std::vector<simcore::TYPE> getTypes() final override {
std::vector<simcore::TYPE> getTypes() override {
return {simcore::TYPE::EVENT, simcore::TYPE::STACKING,
simcore::TYPE::STEPPING};
}
Expand Down
4 changes: 2 additions & 2 deletions Biasing/include/Biasing/PhotoNuclearProductsFilter.h
Original file line number Diff line number Diff line change
Expand Up @@ -48,10 +48,10 @@ class PhotoNuclearProductsFilter : public simcore::UserAction {
* @param[in] step The Geant4 step containing transient information
* about the step taken by a track.
*/
void stepping(const G4Step* step) final override;
void stepping(const G4Step* step) override;

/// Retrieve the type of actions this class defines
std::vector<simcore::TYPE> getTypes() final override {
std::vector<simcore::TYPE> getTypes() override {
return {simcore::TYPE::STEPPING};
}

Expand Down
2 changes: 1 addition & 1 deletion Biasing/include/Biasing/PhotoNuclearTopologyFilters.h
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ class PhotoNuclearTopologyFilter : public simcore::UserAction {
virtual bool rejectEvent(const std::vector<G4Track*>& secondaries) const = 0;

/// Retrieve the type of actions this class defines
std::vector<simcore::TYPE> getTypes() final override {
std::vector<simcore::TYPE> getTypes() override {
return {simcore::TYPE::STEPPING};
}

Expand Down
4 changes: 2 additions & 2 deletions Biasing/include/Biasing/PrimaryToEcalFilter.h
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,10 @@ class PrimaryToEcalFilter : public simcore::UserAction {
*
* @param[in] step Geant4 step
*/
void stepping(const G4Step* step) final override;
void stepping(const G4Step* step) override;

/// Retrieve the type of actions this class defines
std::vector<simcore::TYPE> getTypes() final override {
std::vector<simcore::TYPE> getTypes() override {
return {simcore::TYPE::STEPPING};
}

Expand Down
6 changes: 3 additions & 3 deletions Biasing/include/Biasing/TaggerHitFilter.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,16 +41,16 @@ class TaggerHitFilter : public simcore::UserAction {
*
* @param[in] step Geant4 step
*/
void stepping(const G4Step* step) final override;
void stepping(const G4Step* step) override;

/**
* Action called once tracking of all particles has concluded. This is being
* used to clear the hit count set in preparation for the next event.
*/
void EndOfEventAction(const G4Event* event) final override;
void EndOfEventAction(const G4Event* event) override;

/// Retrieve the type of actions this class defines
std::vector<simcore::TYPE> getTypes() final override {
std::vector<simcore::TYPE> getTypes() override {
return {simcore::TYPE::STEPPING, simcore::TYPE::EVENT};
}

Expand Down
8 changes: 4 additions & 4 deletions Biasing/include/Biasing/TaggerVetoFilter.h
Original file line number Diff line number Diff line change
Expand Up @@ -46,25 +46,25 @@ class TaggerVetoFilter : public simcore::UserAction {
* Action called at the start of an event to reset
*
*/
void BeginOfEventAction(const G4Event *) final override;
void BeginOfEventAction(const G4Event *) override;
/**
*
* Action called at the end of an event to veto events where the primary
* particle never entered the tagger region.
*
*/

void EndOfEventAction(const G4Event *) final override;
void EndOfEventAction(const G4Event *) override;
/**
* Stepping action called when a step is taken during tracking of
* a particle.
*
* @param[in] step Geant4 step
*/
void stepping(const G4Step *step) final override;
void stepping(const G4Step *step) override;

/// Retrieve the type of actions this class defines
std::vector<simcore::TYPE> getTypes() final override {
std::vector<simcore::TYPE> getTypes() override {
return {simcore::TYPE::STEPPING, simcore::TYPE::EVENT};
}

Expand Down
8 changes: 4 additions & 4 deletions Biasing/include/Biasing/TargetBremFilter.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,14 +35,14 @@ class TargetBremFilter : public simcore::UserAction {
* Implement the stepping action which performs the target volume biasing.
* @param step The Geant4 step.
*/
void stepping(const G4Step* step) final override;
void stepping(const G4Step* step) override;

/**
* Method called at the end of every event.
*
* @param event Geant4 event object.
*/
void EndOfEventAction(const G4Event*) final override;
void EndOfEventAction(const G4Event*) override;

/**
* Classify a new track which postpones track processing.
Expand All @@ -52,10 +52,10 @@ class TargetBremFilter : public simcore::UserAction {
*/
G4ClassificationOfNewTrack ClassifyNewTrack(
const G4Track* aTrack,
const G4ClassificationOfNewTrack& currentTrackClass) final override;
const G4ClassificationOfNewTrack& currentTrackClass) override;

/// Retrieve the type of actions this class defines
std::vector<simcore::TYPE> getTypes() final override {
std::vector<simcore::TYPE> getTypes() override {
return {simcore::TYPE::EVENT, simcore::TYPE::STACKING,
simcore::TYPE::STEPPING};
}
Expand Down
10 changes: 5 additions & 5 deletions Biasing/include/Biasing/TargetDarkBremFilter.h
Original file line number Diff line number Diff line change
Expand Up @@ -54,14 +54,14 @@ class TargetDarkBremFilter : public simcore::UserAction {
/**
* Class destructor.
*/
~TargetDarkBremFilter() {}
~TargetDarkBremFilter() = default;

/**
* Get the types of actions this class can do
*
* @return list of action types this class does
*/
std::vector<simcore::TYPE> getTypes() final override {
std::vector<simcore::TYPE> getTypes() override {
return {simcore::TYPE::STEPPING, simcore::TYPE::EVENT};
}

Expand All @@ -70,7 +70,7 @@ class TargetDarkBremFilter : public simcore::UserAction {
*
* @param[in] e event being started, unused
*/
void BeginOfEventAction(const G4Event* e) final override;
void BeginOfEventAction(const G4Event* e) override;

/**
* Looking for A' while primary is stepping.
Expand All @@ -83,15 +83,15 @@ class TargetDarkBremFilter : public simcore::UserAction {
*
* @param[in] step current G4Step
*/
void stepping(const G4Step* step);
void stepping(const G4Step* step) override;

/**
* Check flag signaling finding of A', if false,
* abort the event so it isn't saved.
*
* @param[in] event being ended, check if it is already aborted
*/
void EndOfEventAction(const G4Event* event) final override;
void EndOfEventAction(const G4Event* event) override;

private:
/**
Expand Down
6 changes: 3 additions & 3 deletions Biasing/include/Biasing/TargetENProcessFilter.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,15 +34,15 @@ class TargetENProcessFilter : public simcore::UserAction {
* Implementmthe stepping action which performs the target volume biasing.
* @param step The Geant4 step.
*/
void stepping(const G4Step* step) final override;
void stepping(const G4Step* step) override;

/**
* End of event action.
*/
void EndOfEventAction(const G4Event*) final override;
void EndOfEventAction(const G4Event*) override;

/// Retrieve the type of actions this class defines
std::vector<simcore::TYPE> getTypes() final override {
std::vector<simcore::TYPE> getTypes() override {
return {simcore::TYPE::EVENT, simcore::TYPE::STEPPING};
}

Expand Down
8 changes: 4 additions & 4 deletions Biasing/include/Biasing/TargetProcessFilter.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,12 +38,12 @@ class TargetProcessFilter : public simcore::UserAction {
* Implementmthe stepping action which performs the target volume biasing.
* @param step The Geant4 step.
*/
void stepping(const G4Step *step) final override;
void stepping(const G4Step *step) override;

/**
* End of event action.
*/
void EndOfEventAction(const G4Event *) final override;
void EndOfEventAction(const G4Event *) override;

/**
* Classify a new track which postpones track processing.
Expand All @@ -53,10 +53,10 @@ class TargetProcessFilter : public simcore::UserAction {
*/
G4ClassificationOfNewTrack ClassifyNewTrack(
const G4Track *aTrack,
const G4ClassificationOfNewTrack &currentTrackClass) final override;
const G4ClassificationOfNewTrack &currentTrackClass) override;

/// Retrieve the type of actions this class defines
std::vector<simcore::TYPE> getTypes() final override {
std::vector<simcore::TYPE> getTypes() override {
return {simcore::TYPE::EVENT, simcore::TYPE::STACKING,
simcore::TYPE::STEPPING};
}
Expand Down
Loading
Loading