Skip to content
This repository was archived by the owner on May 6, 2024. It is now read-only.

Commit 299e73a

Browse files
EinarElentomeichlersmith
authored andcommitted
One last round of virtual/override/destructors
1 parent 5ab6fc5 commit 299e73a

11 files changed

Lines changed: 13 additions & 21 deletions

include/SimCore/Generators/GeneralParticleSource.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ class GeneralParticleSource : public simcore::PrimaryGenerator {
4040
GeneralParticleSource(const std::string& name, const framework::config::Parameters& parameters);
4141

4242
/// Destructor
43-
~GeneralParticleSource();
43+
virtual ~GeneralParticleSource() = default;
4444

4545
/**
4646
* Generate the primary vertices in the Geant4 event.

include/SimCore/Generators/LHEPrimaryGenerator.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,10 @@ class LHEPrimaryGenerator : public simcore::PrimaryGenerator {
3838
* Generate vertices in the Geant4 event.
3939
* @param anEvent The Geant4 event.
4040
*/
41-
void GeneratePrimaryVertex(G4Event* anEvent);
41+
void GeneratePrimaryVertex(G4Event* anEvent) final override;
4242

4343
void RecordConfig(const std::string& id, ldmx::RunHeader& rh) final override;
44+
4445
private:
4546
/**
4647
* The LHE reader with the event data.

include/SimCore/Generators/MultiParticleGunPrimaryGenerator.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -64,20 +64,20 @@ class MultiParticleGunPrimaryGenerator : public simcore::PrimaryGenerator {
6464
* pdgID : pdgID of particle to shoot
6565
* enablePoisson : whether to poisson distribute the number of particles
6666
*/
67-
MultiParticleGunPrimaryGenerator(const std::string& name,
68-
const framework::config::Parameters& parameters);
67+
MultiParticleGunPrimaryGenerator(
68+
const std::string& name, const framework::config::Parameters& parameters);
6969

7070
/** Destructor */
7171
virtual ~MultiParticleGunPrimaryGenerator();
72-
7372
/**
7473
* Generate vertices in the Geant4 event.
7574
*
7675
* @param anEvent The Geant4 event.
7776
*/
78-
void GeneratePrimaryVertex(G4Event* anEvent);
77+
void GeneratePrimaryVertex(G4Event* anEvent) final override;
7978

8079
void RecordConfig(const std::string& id, ldmx::RunHeader& rh) final override;
80+
8181
private:
8282
/** Random number generator. */
8383
TRandom* random_;

include/SimCore/Generators/ParticleGun.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ class ParticleGun : public simcore::PrimaryGenerator {
4646
ParticleGun(const std::string& name, const framework::config::Parameters& parameters);
4747

4848
/// Destructor
49-
~ParticleGun();
49+
virtual ~ParticleGun() = default;
5050

5151
/**
5252
* Generate the primary vertices in the Geant4 event.

include/SimCore/Generators/RootSimFromEcalSP.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,9 +67,10 @@ class RootSimFromEcalSP : public PrimaryGenerator {
6767
* Generate vertices in the Geant4 event.
6868
* @param anEvent The Geant4 event.
6969
*/
70-
void GeneratePrimaryVertex(G4Event* anEvent);
70+
void GeneratePrimaryVertex(G4Event* anEvent) final override;
7171

7272
void RecordConfig(const std::string& id, ldmx::RunHeader& rh) final override;
73+
7374
private:
7475
/**
7576
* The cutoff time

include/SimCore/UserAction.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ class UserAction {
5656
framework::config::Parameters&>;
5757

5858
/// Destructor
59-
virtual ~UserAction();
59+
virtual ~UserAction() = default;
6060

6161
/**
6262
* Method called at the beginning of every event.

include/SimCore/UserEventInformation.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,10 @@ namespace simcore {
1111
class UserEventInformation : public G4VUserEventInformation {
1212
public:
1313
/// Constructor
14-
UserEventInformation();
14+
UserEventInformation() = default;
1515

1616
/// Destructor
17-
~UserEventInformation();
17+
virtual ~UserEventInformation() = default;
1818

1919
/// Print the information associated with the track
2020
void Print() const final override;

src/SimCore/Generators/GeneralParticleSource.cxx

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,6 @@ GeneralParticleSource::GeneralParticleSource(const std::string& name,
3535
}
3636
}
3737

38-
GeneralParticleSource::~GeneralParticleSource() {}
39-
4038
void GeneralParticleSource::GeneratePrimaryVertex(G4Event* event) {
4139
// just pass to the Geant4 implementation
4240
theG4Source_.GeneratePrimaryVertex(event);

src/SimCore/Generators/ParticleGun.cxx

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,8 +79,6 @@ ParticleGun::ParticleGun(const std::string& name,
7979
}
8080
}
8181

82-
ParticleGun::~ParticleGun() {}
83-
8482
void ParticleGun::GeneratePrimaryVertex(G4Event* event) {
8583
// Call G4 class method to generate primaries.
8684
theGun_.GeneratePrimaryVertex(event);

src/SimCore/UserAction.cxx

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,6 @@ UserAction::UserAction(const std::string& name,
1919
parameters_ = parameters;
2020
}
2121

22-
UserAction::~UserAction() {}
23-
2422
UserEventInformation* UserAction::getEventInfo() const {
2523
return static_cast<UserEventInformation*>(
2624
G4EventManager::GetEventManager()->GetUserInformation());

0 commit comments

Comments
 (0)