Skip to content

Commit

Permalink
Remove override warnings from DDG4 compilation
Browse files Browse the repository at this point in the history
  • Loading branch information
MarkusFrankATcernch committed Nov 4, 2024
1 parent f6f5b1c commit 4281175
Show file tree
Hide file tree
Showing 29 changed files with 81 additions and 79 deletions.
2 changes: 1 addition & 1 deletion DDG4/include/DDG4/Geant4DataConversion.h
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ namespace dd4hep {
this->self_t::conversions().emplace(&typeid(TAG),this);
//std::cout << "Registered " << typeName(typeid(*this)) << std::endl;
}
virtual OUTPUT* operator()(const ARGS& args) const;
virtual OUTPUT* operator()(const ARGS& args) const override;
};

} // End namespace sim
Expand Down
2 changes: 1 addition & 1 deletion DDG4/include/DDG4/Geant4DetectorConstruction.h
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ namespace dd4hep {
/// Default destructor
virtual ~Geant4DetectorConstructionSequence();
/// Set or update client context
virtual void updateContext(Geant4Context* ctxt);
virtual void updateContext(Geant4Context* ctxt) override;
/// Add an actor responding to all callbacks. Sequence takes ownership.
void adopt(Geant4DetectorConstruction* action);
/// Access an actor by name
Expand Down
10 changes: 5 additions & 5 deletions DDG4/include/DDG4/Geant4EventAction.h
Original file line number Diff line number Diff line change
Expand Up @@ -97,13 +97,13 @@ namespace dd4hep {
/// Default destructor
virtual ~Geant4SharedEventAction();
/// Set or update client for the use in a new thread fiber
virtual void configureFiber(Geant4Context* thread_context);
virtual void configureFiber(Geant4Context* thread_context) override;
/// Underlying object to be used during the execution of this thread
virtual void use(Geant4EventAction* action);
/// Begin-of-event callback
virtual void begin(const G4Event* event);
virtual void begin(const G4Event* event) override;
/// End-of-event callback
virtual void end(const G4Event* event);
virtual void end(const G4Event* event) override;
};

/// Concrete implementation of the Geant4 event action sequence
Expand Down Expand Up @@ -142,9 +142,9 @@ namespace dd4hep {
/// Default destructor
virtual ~Geant4EventActionSequence();
/// Set or update client context
virtual void updateContext(Geant4Context* ctxt);
virtual void updateContext(Geant4Context* ctxt) override;
/// Set or update client for the use in a new thread fiber
virtual void configureFiber(Geant4Context* thread_context);
virtual void configureFiber(Geant4Context* thread_context) override;
/// Get an action by name
Geant4EventAction* get(const std::string& name) const;
/// Register begin-of-event callback
Expand Down
6 changes: 3 additions & 3 deletions DDG4/include/DDG4/Geant4FastSimShowerModel.h
Original file line number Diff line number Diff line change
Expand Up @@ -103,11 +103,11 @@ namespace dd4hep {
virtual ~Geant4FastSimShowerModel();

/// Geometry construction callback. Called at "Construct()"
virtual void constructGeo(Geant4DetectorConstructionContext* ctxt);
virtual void constructGeo(Geant4DetectorConstructionContext* ctxt) override;
/// Electromagnetic field construction callback. Called at "ConstructSDandField()"
virtual void constructField(Geant4DetectorConstructionContext* ctxt);
virtual void constructField(Geant4DetectorConstructionContext* ctxt) override;
/// Sensitive detector construction callback. Called at "ConstructSDandField()"
virtual void constructSensitives(Geant4DetectorConstructionContext* ctxt);
virtual void constructSensitives(Geant4DetectorConstructionContext* ctxt) override;

/// User callback to determine if the model is applicable for the particle type
virtual bool check_applicability(const G4ParticleDefinition& particle);
Expand Down
4 changes: 2 additions & 2 deletions DDG4/include/DDG4/Geant4Field.h
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,9 @@ namespace dd4hep {
/// Standard destructor
virtual ~Geant4Field() { }
/// Access field values at a given point
virtual void GetFieldValue(const double pos[4], double *arr) const;
virtual void GetFieldValue(const double pos[4], double *arr) const override;
/// Does field change energy ?
virtual G4bool DoesFieldChangeEnergy() const;
virtual G4bool DoesFieldChangeEnergy() const override;
};

} // End namespace sim
Expand Down
2 changes: 1 addition & 1 deletion DDG4/include/DDG4/Geant4GDMLDetector.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ namespace dd4hep {
/// Default destructor
virtual ~Geant4GDMLDetector() {
}
G4VPhysicalVolume* Construct();
G4VPhysicalVolume* Construct() override;
private:
std::string m_fileName;
G4VPhysicalVolume* m_world { nullptr };
Expand Down
2 changes: 1 addition & 1 deletion DDG4/include/DDG4/Geant4GeneratorWrapper.h
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ namespace dd4hep {
/// Access the G4VPrimaryGenerator instance
G4VPrimaryGenerator* generator();
/// Event generation action callback
virtual void operator()(G4Event* event);
virtual void operator()(G4Event* event) override;
};
} // End namespace sim
} // End namespace dd4hep
Expand Down
4 changes: 2 additions & 2 deletions DDG4/include/DDG4/Geant4HitCollection.h
Original file line number Diff line number Diff line change
Expand Up @@ -314,11 +314,11 @@ namespace dd4hep {
return m_detector;
}
/// Access individual hits
virtual G4VHit* GetHit(size_t which) const {
virtual G4VHit* GetHit(size_t which) const override {
return (G4VHit*) &m_hits.at(which);
}
/// Access the collection size
virtual size_t GetSize() const {
virtual size_t GetSize() const override {
return m_hits.size();
}
/// Access the hit wrapper
Expand Down
2 changes: 1 addition & 1 deletion DDG4/include/DDG4/Geant4InteractionMerger.h
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ namespace dd4hep {
/// Default destructor
virtual ~Geant4InteractionMerger();
/// Event generation action callback
virtual void operator()(G4Event* event);
virtual void operator()(G4Event* event) override;
};
} // End namespace sim
} // End namespace dd4hep
Expand Down
2 changes: 1 addition & 1 deletion DDG4/include/DDG4/Geant4InteractionVertexBoost.h
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ namespace dd4hep {
/// Default destructor
virtual ~Geant4InteractionVertexBoost();
/// Callback to generate primary particles
virtual void operator()(G4Event* event);
virtual void operator()(G4Event* event) override;
};
} // End namespace sim
} // End namespace dd4hep
Expand Down
2 changes: 1 addition & 1 deletion DDG4/include/DDG4/Geant4IsotropeGenerator.h
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ namespace dd4hep {
/** Use this function to implement isotrop guns, multiple guns etc.
User must return a UNIT vector, which gets scaled with momentum.
*/
virtual void getParticleDirection(int num, ROOT::Math::XYZVector& direction, double& momentum) const;
virtual void getParticleDirection(int num, ROOT::Math::XYZVector& direction, double& momentum) const override;
/// e+e- --> ffbar particle distribution ~ 1 + cos^2(theta)
void getParticleDirectionFFbar(int num, ROOT::Math::XYZVector& direction, double& momentum) const;
/// e+e- --> ffbar particle distribution ~ 1 + cos^2(theta)
Expand Down
10 changes: 5 additions & 5 deletions DDG4/include/DDG4/Geant4Kernel.h
Original file line number Diff line number Diff line change
Expand Up @@ -43,14 +43,14 @@ namespace dd4hep {
class DD4hep_End_Of_File : public std::exception {
public:
DD4hep_End_Of_File() : std::exception() {}
virtual const char* what() const noexcept { return "Reached end of input file"; }
virtual const char* what() const noexcept override { return "Reached end of input file"; }
};

/// Helper class to indicate the stop of processing
class DD4hep_Stop_Processing : public std::exception {
public:
DD4hep_Stop_Processing() : std::exception() {}
virtual const char* what() const noexcept { return "Event loop STOP signalled. Processing stops"; }
virtual const char* what() const noexcept override { return "Event loop STOP signalled. Processing stops"; }
};

/// Class, which allows all Geant4Action derivatives to access the DDG4 kernel structures.
Expand All @@ -71,8 +71,8 @@ namespace dd4hep {
using UserCallbacks = std::vector<std::function<void()> >;

enum event_loop_status {
EVENTLOOP_HALT = 0,
EVENTLOOP_RUNNING = 1,
EVENTLOOP_HALT = 0,
EVENTLOOP_RUNNING = 1,
};

protected:
Expand Down Expand Up @@ -349,7 +349,7 @@ namespace dd4hep {
/// Run the simulation: Simulate the number of events "num_events" and modify the property "NumEvents"
virtual int runEvents(int num_events);
/// Run the simulation: Terminate Geant4
virtual int terminate();
virtual int terminate() override;
};
/// Declare property
template <typename T> Geant4Kernel& Geant4Kernel::declareProperty(const std::string& nam, T& val) {
Expand Down
8 changes: 4 additions & 4 deletions DDG4/include/DDG4/Geant4MonteCarloTruth.h
Original file line number Diff line number Diff line change
Expand Up @@ -70,13 +70,13 @@ namespace dd4hep {
/// Default destructor
virtual ~Geant4DummyTruthHandler();
/// Mark a Geant4 track to be kept for later MC truth analysis. Default flag: CREATED_HIT
virtual void mark(const G4Track* track);
virtual void mark(const G4Track* track) override;
/// Store a track, with a flag
virtual void mark(const G4Track* track, int reason);
virtual void mark(const G4Track* track, int reason) override;
/// Mark a Geant4 track of the step to be kept for later MC truth analysis. Default flag: CREATED_HIT
virtual void mark(const G4Step* step);
virtual void mark(const G4Step* step) override;
/// Store a track produced in a step to be kept for later MC truth analysis
virtual void mark(const G4Step* step, int reason);
virtual void mark(const G4Step* step, int reason) override;
};

} // End namespace sim
Expand Down
8 changes: 4 additions & 4 deletions DDG4/include/DDG4/Geant4Output2ROOT.h
Original file line number Diff line number Diff line change
Expand Up @@ -72,14 +72,14 @@ namespace dd4hep {
/// Close current output file
virtual void closeOutput();
/// Callback to store the Geant4 run information
virtual void beginRun(const G4Run* run);
virtual void beginRun(const G4Run* run) override;
/// Callback to store each Geant4 hit collection
virtual void saveCollection(OutputContext<G4Event>& ctxt, G4VHitsCollection* collection);
virtual void saveCollection(OutputContext<G4Event>& ctxt, G4VHitsCollection* collection) override;
/// Callback to store the Geant4 event
virtual void saveEvent(OutputContext<G4Event>& ctxt);
virtual void saveEvent(OutputContext<G4Event>& ctxt) override;

/// Commit data at end of filling procedure
virtual void commit(OutputContext<G4Event>& ctxt);
virtual void commit(OutputContext<G4Event>& ctxt) override;
};

} // End namespace sim
Expand Down
2 changes: 1 addition & 1 deletion DDG4/include/DDG4/Geant4ParticleGenerator.h
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ namespace dd4hep {
/// Default destructor
virtual ~Geant4ParticleGenerator();
/// Callback to generate primary particles
virtual void operator()(G4Event* event);
virtual void operator()(G4Event* event) override;
};
} // End namespace sim
} // End namespace dd4hep
Expand Down
10 changes: 5 additions & 5 deletions DDG4/include/DDG4/Geant4ParticleHandler.h
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ namespace dd4hep {
/// Adopt the user particle handler
bool adopt(Geant4Action* action);
/// Event generation action callback
virtual void operator()(G4Event* event);
virtual void operator()(G4Event* event) override;
/// User stepping callback
virtual void step(const G4Step* step, G4SteppingManager* mgr);
/// Pre-event action callback
Expand All @@ -161,13 +161,13 @@ namespace dd4hep {
virtual void end(const G4Track* track);

/// Mark a Geant4 track to be kept for later MC truth analysis. Default flag: CREATED_HIT
virtual void mark(const G4Track* track);
virtual void mark(const G4Track* track) override;
/// Store a track
virtual void mark(const G4Track* track, int reason);
virtual void mark(const G4Track* track, int reason) override;
/// Mark a Geant4 track of the step to be kept for later MC truth analysis. Default flag: CREATED_HIT
virtual void mark(const G4Step* step);
virtual void mark(const G4Step* step) override;
/// Store a track produced in a step to be kept for later MC truth analysis
virtual void mark(const G4Step* step, int reason);
virtual void mark(const G4Step* step, int reason) override;

/// Default callback to be answered if the particle should be kept if NO user handler is installed
static bool defaultKeepParticle(Particle& particle);
Expand Down
4 changes: 2 additions & 2 deletions DDG4/include/DDG4/Geant4ParticlePrint.h
Original file line number Diff line number Diff line change
Expand Up @@ -69,9 +69,9 @@ namespace dd4hep {
/// Default destructor
virtual ~Geant4ParticlePrint();
/// Pre-event action callback
virtual void begin(const G4Event* event);
virtual void begin(const G4Event* event) override;
/// Post-event action callback
virtual void end(const G4Event* event);
virtual void end(const G4Event* event) override;
/// Generation action callback
virtual void operator()(G4Event* event);

Expand Down
2 changes: 1 addition & 1 deletion DDG4/include/DDG4/Geant4PhysicsConstructor.h
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ namespace dd4hep {
/// Default destructor
virtual ~Geant4PhysicsConstructor();
/// constructPhysics callback
virtual void constructPhysics(G4VModularPhysicsList* physics);
virtual void constructPhysics(G4VModularPhysicsList* physics) override;
/// Callback to construct processes (uses the G4 particle table)
virtual void constructProcess(Constructor& ctor);
/// Callback to construct particles
Expand Down
4 changes: 2 additions & 2 deletions DDG4/include/DDG4/Geant4PhysicsList.h
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ namespace dd4hep {
void dump();

/// Install command control messenger if wanted
virtual void installCommandMessenger();
virtual void installCommandMessenger() override;
/// Access all physics processes
PhysicsProcesses& processes() {
return m_processes;
Expand Down Expand Up @@ -253,7 +253,7 @@ namespace dd4hep {
/// Dump content to stdout
void dump();
/// Install command control messenger if wanted
virtual void installCommandMessenger();
virtual void installCommandMessenger() override;
/// Update transportation flag
void setTransportation(bool value) {
m_transportation = value;
Expand Down
2 changes: 1 addition & 1 deletion DDG4/include/DDG4/Geant4PrimaryHandler.h
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ namespace dd4hep {
/// Default destructor
virtual ~Geant4PrimaryHandler();
/// Event generation action callback
virtual void operator()(G4Event* event);
virtual void operator()(G4Event* event) override;

public:
Geant4PrimaryConfig m_primaryConfig{};
Expand Down
10 changes: 5 additions & 5 deletions DDG4/include/DDG4/Geant4RunAction.h
Original file line number Diff line number Diff line change
Expand Up @@ -90,13 +90,13 @@ namespace dd4hep {
/// Default destructor
virtual ~Geant4SharedRunAction();
/// Set or update client for the use in a new thread fiber
virtual void configureFiber(Geant4Context* thread_context);
virtual void configureFiber(Geant4Context* thread_context) override;
/// Underlying object to be used during the execution of this thread
virtual void use(Geant4RunAction* action);
/// Begin-of-run callback
virtual void begin(const G4Run* run);
virtual void begin(const G4Run* run) override;
/// End-of-run callback
virtual void end(const G4Run* run);
virtual void end(const G4Run* run) override;
};

/// Concrete basic implementation of the Geant4 run action sequencer.
Expand Down Expand Up @@ -134,9 +134,9 @@ namespace dd4hep {
/// Default destructor
virtual ~Geant4RunActionSequence();
/// Set or update client context
virtual void updateContext(Geant4Context* ctxt);
virtual void updateContext(Geant4Context* ctxt) override;
/// Set or update client for the use in a new thread fiber
virtual void configureFiber(Geant4Context* thread_context);
virtual void configureFiber(Geant4Context* thread_context) override;
/// Get an action by name
Geant4RunAction* get(const std::string& name) const;
/// Register begin-of-run callback. Types Q and T must be polymorph!
Expand Down
10 changes: 5 additions & 5 deletions DDG4/include/DDG4/Geant4TestActions.h
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ namespace dd4hep {
/// Default destructor
virtual ~Geant4TestGeneratorAction();
/// Callback to generate primary particles
virtual void operator()(G4Event*);
virtual void operator()(G4Event*) override;
};

/// Example run action doing nothing, but print
Expand All @@ -82,9 +82,9 @@ namespace dd4hep {
/// Default destructor
virtual ~Geant4TestRunAction();
/// begin-of-run callback
void begin(const G4Run*);
void begin(const G4Run*) override;
/// End-of-run callback
void end(const G4Run*);
void end(const G4Run*) override;
/// begin-of-event callback
void beginEvent(const G4Event*);
/// End-of-event callback
Expand All @@ -104,9 +104,9 @@ namespace dd4hep {
/// Default destructor
virtual ~Geant4TestEventAction();
/// begin-of-event callback
virtual void begin(const G4Event*);
virtual void begin(const G4Event*) override;
/// End-of-event callback
virtual void end(const G4Event*);
virtual void end(const G4Event*) override;
/// begin-of-run callback
void beginRun(const G4Run*);
/// End-of-run callback
Expand Down
4 changes: 2 additions & 2 deletions DDG4/include/DDG4/Geant4UIMessenger.h
Original file line number Diff line number Diff line change
Expand Up @@ -72,9 +72,9 @@ namespace dd4hep {
/// Export all properties to the Geant4 UI
void exportProperties(PropertyManager& mgr);
/// Accept ne property value from Geant4 UI
void SetNewValue(G4UIcommand *c, G4String val);
void SetNewValue(G4UIcommand *c, G4String val) override;
/// Pass current property value to Geant4 UI
G4String GetCurrentValue(G4UIcommand *c);
G4String GetCurrentValue(G4UIcommand *c) override;
};

} // End namespace sim
Expand Down
6 changes: 3 additions & 3 deletions DDG4/include/DDG4/Geant4UserInitialization.h
Original file line number Diff line number Diff line change
Expand Up @@ -75,11 +75,11 @@ namespace dd4hep {
void adopt(Geant4UserInitialization* action);

/// Set client context
virtual void updateContext(Geant4Context* ctxt);
virtual void updateContext(Geant4Context* ctxt) override;
/// Callback function to build setup for the MT worker thread
virtual void build() const;
virtual void build() const override;
/// Callback function to build setup for the MT master thread
virtual void buildMaster() const;
virtual void buildMaster() const override;
};

} // End namespace sim
Expand Down
Loading

0 comments on commit 4281175

Please sign in to comment.