From 34ca139a7db243d1f59f7e21d6d8ba47a1e272be Mon Sep 17 00:00:00 2001
From: Dmitry Popov <Dmitry.Popov@cern.ch>
Date: Tue, 23 Jan 2018 14:40:47 +0100
Subject: [PATCH] Fix warnings in G4SamplingCaloTest

---
 .../include/ActionInitialization.hh                 |  6 +++---
 .../include/DetectorConstruction.hh                 |  4 ++--
 .../G4SamplingCaloTest/include/DetectorMessenger.hh |  2 +-
 .../G4SamplingCaloTest/include/EventAction.hh       |  4 ++--
 .../include/PhysListEmStandard.hh                   |  4 ++--
 .../G4SamplingCaloTest/include/PhysicsList.hh       |  4 ++--
 .../include/PhysicsListMessenger.hh                 |  2 +-
 .../include/PrimaryGeneratorAction.hh               | 11 +++++------
 .../include/PrimaryGeneratorMessenger.hh            |  2 +-
 LHCbG4Tests/G4SamplingCaloTest/include/Run.hh       |  2 +-
 LHCbG4Tests/G4SamplingCaloTest/include/RunAction.hh |  6 +++---
 LHCbG4Tests/G4SamplingCaloTest/include/StepMax.hh   | 13 ++++++-------
 .../G4SamplingCaloTest/include/StepMaxMessenger.hh  |  2 +-
 .../G4SamplingCaloTest/include/SteppingAction.hh    |  2 +-
 .../G4SamplingCaloTest/include/SteppingVerbose.hh   |  4 ++--
 .../G4SamplingCaloTest/include/TrackingAction.hh    |  4 ++--
 16 files changed, 35 insertions(+), 37 deletions(-)

diff --git a/LHCbG4Tests/G4SamplingCaloTest/include/ActionInitialization.hh b/LHCbG4Tests/G4SamplingCaloTest/include/ActionInitialization.hh
index 6807b1c..e7c018f 100644
--- a/LHCbG4Tests/G4SamplingCaloTest/include/ActionInitialization.hh
+++ b/LHCbG4Tests/G4SamplingCaloTest/include/ActionInitialization.hh
@@ -45,10 +45,10 @@ class ActionInitialization : public G4VUserActionInitialization
     ActionInitialization(DetectorConstruction*);
     virtual ~ActionInitialization();
 
-    virtual void BuildForMaster() const;
-    virtual void Build() const;
+    void BuildForMaster() const override;
+    void Build() const override;
     
-    virtual G4VSteppingVerbose* InitializeSteppingVerbose() const;
+    G4VSteppingVerbose* InitializeSteppingVerbose() const override;
     
   private:
     DetectorConstruction* fDetector;
diff --git a/LHCbG4Tests/G4SamplingCaloTest/include/DetectorConstruction.hh b/LHCbG4Tests/G4SamplingCaloTest/include/DetectorConstruction.hh
index d5239e5..ff889f1 100644
--- a/LHCbG4Tests/G4SamplingCaloTest/include/DetectorConstruction.hh
+++ b/LHCbG4Tests/G4SamplingCaloTest/include/DetectorConstruction.hh
@@ -67,8 +67,8 @@ public:
   void SetCalorSizeYZ   (G4double);          
   void SetNbOfLayers    (G4int);   
   
-  virtual G4VPhysicalVolume* Construct();
-  virtual void ConstructSDandField();
+  G4VPhysicalVolume* Construct() override;
+  void ConstructSDandField() override;
      
 public:
   
diff --git a/LHCbG4Tests/G4SamplingCaloTest/include/DetectorMessenger.hh b/LHCbG4Tests/G4SamplingCaloTest/include/DetectorMessenger.hh
index 60ec8d0..eaedd43 100644
--- a/LHCbG4Tests/G4SamplingCaloTest/include/DetectorMessenger.hh
+++ b/LHCbG4Tests/G4SamplingCaloTest/include/DetectorMessenger.hh
@@ -52,7 +52,7 @@ class DetectorMessenger: public G4UImessenger
     DetectorMessenger(DetectorConstruction* );
    ~DetectorMessenger();
 
-    virtual void SetNewValue(G4UIcommand*, G4String);
+    void SetNewValue(G4UIcommand*, G4String) override;
 
   private:
     DetectorConstruction*      fDetector;
diff --git a/LHCbG4Tests/G4SamplingCaloTest/include/EventAction.hh b/LHCbG4Tests/G4SamplingCaloTest/include/EventAction.hh
index f2e98ac..bfd899b 100644
--- a/LHCbG4Tests/G4SamplingCaloTest/include/EventAction.hh
+++ b/LHCbG4Tests/G4SamplingCaloTest/include/EventAction.hh
@@ -46,8 +46,8 @@ class EventAction : public G4UserEventAction
     EventAction(DetectorConstruction*);
    ~EventAction();
 
-    virtual void BeginOfEventAction(const G4Event*);
-    virtual void   EndOfEventAction(const G4Event*);
+    void BeginOfEventAction(const G4Event*) override;
+    void EndOfEventAction(const G4Event*) override;
     
     void SumEnergy(G4int k, G4double de, G4double dl)
         {fEnergyDeposit[k] += de; fTrackLengthCh[k] += dl;};          
diff --git a/LHCbG4Tests/G4SamplingCaloTest/include/PhysListEmStandard.hh b/LHCbG4Tests/G4SamplingCaloTest/include/PhysListEmStandard.hh
index 1ee366b..5832458 100644
--- a/LHCbG4Tests/G4SamplingCaloTest/include/PhysListEmStandard.hh
+++ b/LHCbG4Tests/G4SamplingCaloTest/include/PhysListEmStandard.hh
@@ -47,12 +47,12 @@ class PhysListEmStandard : public G4VPhysicsConstructor
 
   public: 
     // This method is dummy for physics
-    virtual void ConstructParticle() {};
+    void ConstructParticle() override {};
  
     // This method will be invoked in the Construct() method.
     // each physics process will be instantiated and
     // registered to the process manager of each particle type 
-    virtual void ConstructProcess();
+    void ConstructProcess() override;
 };
 
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
diff --git a/LHCbG4Tests/G4SamplingCaloTest/include/PhysicsList.hh b/LHCbG4Tests/G4SamplingCaloTest/include/PhysicsList.hh
index cf5eef8..2a6ff2c 100644
--- a/LHCbG4Tests/G4SamplingCaloTest/include/PhysicsList.hh
+++ b/LHCbG4Tests/G4SamplingCaloTest/include/PhysicsList.hh
@@ -50,8 +50,8 @@ public:
     PhysicsList();
    ~PhysicsList();
 
-    virtual void ConstructParticle();
-    virtual void ConstructProcess();
+    void ConstructParticle() override;
+    void ConstructProcess() override;
     
     void AddPhysicsList(const G4String& name);
     void AddDecay();
diff --git a/LHCbG4Tests/G4SamplingCaloTest/include/PhysicsListMessenger.hh b/LHCbG4Tests/G4SamplingCaloTest/include/PhysicsListMessenger.hh
index 84684e4..ca9e8a1 100644
--- a/LHCbG4Tests/G4SamplingCaloTest/include/PhysicsListMessenger.hh
+++ b/LHCbG4Tests/G4SamplingCaloTest/include/PhysicsListMessenger.hh
@@ -51,7 +51,7 @@ class PhysicsListMessenger: public G4UImessenger
     PhysicsListMessenger(PhysicsList* );
    ~PhysicsListMessenger();
     
-    virtual void SetNewValue(G4UIcommand*, G4String);
+    void SetNewValue(G4UIcommand*, G4String) override;
     
   private:
   
diff --git a/LHCbG4Tests/G4SamplingCaloTest/include/PrimaryGeneratorAction.hh b/LHCbG4Tests/G4SamplingCaloTest/include/PrimaryGeneratorAction.hh
index 33780e3..b5c0a12 100644
--- a/LHCbG4Tests/G4SamplingCaloTest/include/PrimaryGeneratorAction.hh
+++ b/LHCbG4Tests/G4SamplingCaloTest/include/PrimaryGeneratorAction.hh
@@ -53,17 +53,16 @@ class PrimaryGeneratorAction : public G4VUserPrimaryGeneratorAction
   public:
     void SetDefaultKinematic();
     void SetRndmBeam(G4double val) { fRndmBeam = val;}
-    virtual 
-    void GeneratePrimaries(G4Event*);
-    
+    void GeneratePrimaries(G4Event*) override;
+
     G4ParticleGun* GetParticleGun() {return fParticleGun;};
-    
+
   private:
     G4ParticleGun*         fParticleGun;
-    DetectorConstruction*  fDetector;   
+    DetectorConstruction*  fDetector;
     G4double fRndmBeam;   //lateral random beam extension in fraction sizeYZ/2
 
-    PrimaryGeneratorMessenger* fGunMessenger; 
+    PrimaryGeneratorMessenger* fGunMessenger;
 };
 
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
diff --git a/LHCbG4Tests/G4SamplingCaloTest/include/PrimaryGeneratorMessenger.hh b/LHCbG4Tests/G4SamplingCaloTest/include/PrimaryGeneratorMessenger.hh
index 4b3f6be..07c6530 100644
--- a/LHCbG4Tests/G4SamplingCaloTest/include/PrimaryGeneratorMessenger.hh
+++ b/LHCbG4Tests/G4SamplingCaloTest/include/PrimaryGeneratorMessenger.hh
@@ -50,7 +50,7 @@ class PrimaryGeneratorMessenger: public G4UImessenger
     PrimaryGeneratorMessenger(PrimaryGeneratorAction*);
    ~PrimaryGeneratorMessenger();
     
-    virtual void SetNewValue(G4UIcommand*, G4String);
+    void SetNewValue(G4UIcommand*, G4String) override;
     
   private:
     PrimaryGeneratorAction*    fAction;
diff --git a/LHCbG4Tests/G4SamplingCaloTest/include/Run.hh b/LHCbG4Tests/G4SamplingCaloTest/include/Run.hh
index eb9ffdc..bd5beb5 100644
--- a/LHCbG4Tests/G4SamplingCaloTest/include/Run.hh
+++ b/LHCbG4Tests/G4SamplingCaloTest/include/Run.hh
@@ -66,7 +66,7 @@ class Run : public G4Run
     void SetEdepAndRMS(G4int, G4double, G4double, G4double);
     void SetApplyLimit(G4bool);
                 
-    virtual void Merge(const G4Run*);
+    void Merge(const G4Run*) override;
     void EndOfRun();
      
   private:
diff --git a/LHCbG4Tests/G4SamplingCaloTest/include/RunAction.hh b/LHCbG4Tests/G4SamplingCaloTest/include/RunAction.hh
index 1c766ae..314ff6c 100644
--- a/LHCbG4Tests/G4SamplingCaloTest/include/RunAction.hh
+++ b/LHCbG4Tests/G4SamplingCaloTest/include/RunAction.hh
@@ -55,9 +55,9 @@ public:
   RunAction(DetectorConstruction*, PrimaryGeneratorAction* prim=0);
  ~RunAction();
 
-  virtual G4Run* GenerateRun();
-  virtual void BeginOfRunAction(const G4Run*);
-  virtual void   EndOfRunAction(const G4Run*);
+  G4Run* GenerateRun() override;
+  void BeginOfRunAction(const G4Run*) override;
+  void EndOfRunAction(const G4Run*) override;
    
   // Acceptance parameters
   void SetEdepAndRMS(G4int, G4double, G4double, G4double);
diff --git a/LHCbG4Tests/G4SamplingCaloTest/include/StepMax.hh b/LHCbG4Tests/G4SamplingCaloTest/include/StepMax.hh
index 4bfc358..3895a68 100644
--- a/LHCbG4Tests/G4SamplingCaloTest/include/StepMax.hh
+++ b/LHCbG4Tests/G4SamplingCaloTest/include/StepMax.hh
@@ -52,20 +52,19 @@ public:
   StepMax(const G4String& processName = "UserStepMax");
  ~StepMax();
 
-  G4bool   IsApplicable(const G4ParticleDefinition&);
+  G4bool IsApplicable(const G4ParticleDefinition&) override;
 
   void     SetStepMax(G4int, G4double);
 
   G4double GetStepMax(G4int k) { return fStepMax[k];};
 
-  G4double PostStepGetPhysicalInteractionLength( const G4Track& track,
-                                               G4double previousStepSize,
-                                               G4ForceCondition* condition);
+  G4double PostStepGetPhysicalInteractionLength(const G4Track& track,
+                                                G4double previousStepSize,
+                                                G4ForceCondition* condition) override;
 
-  G4VParticleChange* PostStepDoIt(const G4Track&, const G4Step&);
+  G4VParticleChange* PostStepDoIt(const G4Track&, const G4Step&) override;
 
-  G4double GetMeanFreePath(const G4Track&, G4double,G4ForceCondition*)
-     {return DBL_MAX;};    
+  G4double GetMeanFreePath(const G4Track&, G4double,G4ForceCondition*) override { return DBL_MAX; };
 
 private:
 
diff --git a/LHCbG4Tests/G4SamplingCaloTest/include/StepMaxMessenger.hh b/LHCbG4Tests/G4SamplingCaloTest/include/StepMaxMessenger.hh
index 67d5cdb..8ad4466 100644
--- a/LHCbG4Tests/G4SamplingCaloTest/include/StepMaxMessenger.hh
+++ b/LHCbG4Tests/G4SamplingCaloTest/include/StepMaxMessenger.hh
@@ -49,7 +49,7 @@ class StepMaxMessenger: public G4UImessenger
     StepMaxMessenger(StepMax*);
    ~StepMaxMessenger();
     
-    void SetNewValue(G4UIcommand*, G4String);
+    void SetNewValue(G4UIcommand*, G4String) override;
     
   private:
     StepMax*       fStepMax;
diff --git a/LHCbG4Tests/G4SamplingCaloTest/include/SteppingAction.hh b/LHCbG4Tests/G4SamplingCaloTest/include/SteppingAction.hh
index c7e5844..71baf41 100644
--- a/LHCbG4Tests/G4SamplingCaloTest/include/SteppingAction.hh
+++ b/LHCbG4Tests/G4SamplingCaloTest/include/SteppingAction.hh
@@ -48,7 +48,7 @@ class SteppingAction : public G4UserSteppingAction
     SteppingAction(DetectorConstruction*, EventAction*);
    ~SteppingAction();
 
-    virtual void UserSteppingAction(const G4Step*);
+    void UserSteppingAction(const G4Step*) override;
     
     G4double BirksAttenuation(const G4Step*);
     
diff --git a/LHCbG4Tests/G4SamplingCaloTest/include/SteppingVerbose.hh b/LHCbG4Tests/G4SamplingCaloTest/include/SteppingVerbose.hh
index 0c533b7..31d3809 100644
--- a/LHCbG4Tests/G4SamplingCaloTest/include/SteppingVerbose.hh
+++ b/LHCbG4Tests/G4SamplingCaloTest/include/SteppingVerbose.hh
@@ -46,8 +46,8 @@ public:
   SteppingVerbose();
  ~SteppingVerbose();
  
-  virtual void TrackingStarted();
-  virtual void StepInfo();
+  void TrackingStarted() override;
+  void StepInfo() override;
 };
 
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
diff --git a/LHCbG4Tests/G4SamplingCaloTest/include/TrackingAction.hh b/LHCbG4Tests/G4SamplingCaloTest/include/TrackingAction.hh
index f140650..fefc690 100644
--- a/LHCbG4Tests/G4SamplingCaloTest/include/TrackingAction.hh
+++ b/LHCbG4Tests/G4SamplingCaloTest/include/TrackingAction.hh
@@ -47,8 +47,8 @@ class TrackingAction : public G4UserTrackingAction {
     TrackingAction(DetectorConstruction*);
    ~TrackingAction() {};
    
-    virtual void  PreUserTrackingAction(const G4Track*);   
-    virtual void PostUserTrackingAction(const G4Track*);
+    void PreUserTrackingAction(const G4Track*) override;
+    void PostUserTrackingAction(const G4Track*) override;
     
   private:
     DetectorConstruction* fDetector;
-- 
GitLab