From d208ed89e232108963ebf53266b77fd55ab25edb Mon Sep 17 00:00:00 2001 From: Ianna Osborne Date: Fri, 15 Sep 2017 09:30:14 +0200 Subject: [PATCH 1/2] Second step for simulation clang tidy code checks all --- .../interface/CMSGDMLWriteStructure.h | 6 ++-- .../Application/interface/CustomUIsession.h | 2 +- .../interface/CustomUIsessionThreadPrefix.h | 2 +- .../interface/CustomUIsessionToFile.h | 2 +- .../Application/interface/ElectronLimiter.h | 12 ++++---- SimG4Core/Application/interface/EventAction.h | 6 ++-- .../Application/interface/ExceptionHandler.h | 6 ++-- .../interface/GFlashEMShowerModel.h | 8 ++--- .../interface/GFlashHadronShowerModel.h | 8 ++--- .../Application/interface/OscarMTProducer.h | 6 ++-- .../Application/interface/OscarProducer.h | 8 ++--- .../interface/ParametrisedEMPhysics.h | 6 ++-- .../interface/PrimaryTransformer.h | 4 +-- SimG4Core/Application/interface/RunAction.h | 6 ++-- .../Application/interface/SimTrackManager.h | 4 +-- .../Application/interface/StackingAction.h | 8 ++--- .../Application/interface/SteppingAction.h | 4 +-- .../Application/interface/TrackingAction.h | 6 ++-- .../Application/src/CMSGDMLWriteStructure.cc | 2 +- SimG4Core/Application/src/CustomUIsession.cc | 2 +- SimG4Core/Application/src/ElectronLimiter.cc | 4 +-- SimG4Core/Application/src/ExceptionHandler.cc | 4 +-- SimG4Core/Application/src/G4SimEvent.cc | 6 ++-- .../Application/src/GFlashEMShowerModel.cc | 6 ++-- .../src/GFlashHadronShowerModel.cc | 8 ++--- SimG4Core/Application/src/RunManager.cc | 16 +++++----- SimG4Core/Application/src/RunManagerMT.cc | 2 +- SimG4Core/Application/src/SimRunInterface.cc | 2 +- SimG4Core/Application/src/SimTrackManager.cc | 20 ++++++------- SimG4Core/Application/src/StackingAction.cc | 12 ++++---- SimG4Core/Application/src/SteppingAction.cc | 6 ++-- .../Application/test/SimHitCaloHitDumper.h | 8 ++--- .../test/SimTrackSimVertexDumper.h | 8 ++--- .../CheckSecondary/interface/CheckSecondary.h | 14 ++++----- .../CheckSecondary/interface/StoreSecondary.h | 14 ++++----- .../CheckSecondary/interface/TreatSecondary.h | 4 +-- .../CheckSecondary/src/CheckSecondary.cc | 14 ++++----- .../CheckSecondary/src/StoreSecondary.cc | 2 +- .../CheckSecondary/src/TreatSecondary.cc | 2 +- .../interface/CountProcessesAction.h | 10 +++---- .../src/CountProcessesAction.cc | 10 +++---- .../interface/CMSDarkPairProduction.hh | 6 ++-- .../interface/CMSDarkPairProductionProcess.hh | 12 ++++---- .../CustomPhysics/interface/CustomParticle.h | 2 +- .../interface/CustomPhysicsList.h | 6 ++-- .../interface/CustomPhysicsListSS.h | 6 ++-- .../interface/DummyChargeFlipProcess.h | 8 ++--- .../interface/FullModelHadronicProcess.hh | 8 ++--- .../CustomPhysics/interface/RHStopDump.h | 4 +-- .../CustomPhysics/interface/RHStopTracer.h | 12 ++++---- .../interface/ToyModelHadronicProcess.hh | 8 ++--- .../src/CustomParticleFactory.cc | 8 ++--- .../CustomPhysics/src/CustomPhysicsListSS.cc | 2 +- .../src/DummyChargeFlipProcess.cc | 4 +-- .../src/FullModelHadronicProcess.cc | 30 +++++++++---------- .../src/FullModelReactionDynamics.cc | 2 +- .../CustomPhysics/src/G4ProcessHelper.cc | 2 +- .../src/HadronicProcessHelper.cc | 2 +- .../src/ToyModelHadronicProcess.cc | 10 +++---- SimG4Core/GFlash/interface/GFlash.h | 2 +- .../GFlash/interface/GflashEMShowerModel.h | 8 ++--- SimG4Core/GFlash/interface/GflashG4Watcher.h | 8 ++--- .../interface/GflashHadronShowerModel.h | 8 ++--- .../interface/GflashHadronWrapperProcess.h | 4 +-- .../GFlash/interface/ParametrisedPhysics.h | 6 ++-- SimG4Core/GFlash/plugins/GflashG4Watcher.cc | 2 +- SimG4Core/GFlash/src/GflashEMShowerModel.cc | 6 ++-- .../GFlash/src/GflashHadronShowerModel.cc | 4 +-- .../GFlash/src/GflashHadronWrapperProcess.cc | 8 ++--- SimG4Core/GFlash/src/ParametrisedPhysics.cc | 2 +- SimG4Core/Generators/src/Generator.cc | 10 +++---- SimG4Core/Geometry/src/DDDWorld.cc | 2 +- SimG4Core/Geometry/src/DDG4Builder.cc | 8 ++--- .../interface/GeometryProducer.h | 8 ++--- .../GeometryProducer/src/GeometryProducer.cc | 4 +-- .../interface/MonopoleSteppingAction.h | 10 +++---- .../HelpfulWatchers/src/BeginOfTrackCounter.h | 8 ++--- .../HelpfulWatchers/src/G4StepStatistics.h | 4 +-- .../src/MonopoleSteppingAction.cc | 4 +-- SimG4Core/HelpfulWatchers/src/SimTracer.h | 4 +-- .../interface/KillSecondariesRunAction.h | 4 +-- .../interface/KillSecondariesStackingAction.h | 4 +-- .../interface/KillSecondariesTrackAction.h | 4 +-- .../src/KillSecondariesStackingAction.cc | 2 +- .../MagneticField/interface/CMSFieldManager.h | 8 ++--- SimG4Core/MagneticField/interface/Field.h | 4 +-- .../MagneticField/interface/FieldStepper.h | 10 +++---- .../interface/G4MonopoleEquation.hh | 10 +++---- .../interface/LocalFieldManager.h | 4 +-- .../MagneticField/src/LocalFieldManager.cc | 4 +-- .../MagneticField/test/FieldStepWatcher.cc | 4 +-- .../MagneticField/test/FieldStepWatcher.h | 10 +++---- .../Notification/interface/GenParticleInfo.h | 2 +- SimG4Core/Notification/interface/Signaler.h | 8 ++--- .../interface/SimActivityRegistry.h | 4 +-- .../interface/SimActivityRegistryEnroller.h | 4 +-- .../Notification/interface/SimG4Exception.h | 4 +-- .../Notification/interface/TrackInformation.h | 4 +-- .../Notification/src/CMSSteppingVerbose.cc | 4 +-- SimG4Core/Notification/src/CurrentG4Track.cc | 2 +- .../Notification/src/TrackInformation.cc | 2 +- .../src/TrackInformationExtractor.cc | 8 ++--- .../Notification/src/TrackWithHistory.cc | 8 ++--- .../test/simactivityregistry_t.cppunit.cpp | 12 ++++---- SimG4Core/Physics/interface/G4Monopole.hh | 2 +- SimG4Core/Physics/interface/PhysicsList.h | 4 +-- .../Physics/interface/PhysicsListMaker.h | 4 +-- SimG4Core/Physics/src/G4Monopole.cc | 2 +- .../interface/CMSEmStandardPhysics.h | 6 ++-- .../interface/CMSEmStandardPhysicsLPM.h | 6 ++-- .../interface/CMSEmStandardPhysicsXS.h | 6 ++-- .../interface/CMSFTFPNeutronBuilder.hh | 10 +++---- .../interface/CMSFTFPPiKBuilder.hh | 16 +++++----- .../interface/CMSFTFPProtonBuilder.hh | 6 ++-- .../HadronPhysicsQGSPCMS_FTFP_BERT.h | 6 ++-- .../PhysicsLists/plugins/DummyPhysics.hh | 2 +- .../PhysicsLists/src/CMSG4mplIonisation.hh | 14 ++++----- .../src/G4MonopoleTransportation.hh | 16 +++++----- .../interface/PrintGeomInfoAction.h | 6 ++-- .../interface/PrintGeomSummary.h | 6 ++-- .../interface/PrintMaterialBudgetInfo.h | 6 ++-- .../PrintGeomInfo/interface/PrintSensitive.h | 4 +-- .../PrintGeomInfo/src/PrintGeomInfoAction.cc | 12 ++++---- .../PrintGeomInfo/src/PrintGeomSummary.cc | 4 +-- .../src/PrintMaterialBudgetInfo.cc | 2 +- .../interface/PrintTrackNumberAction.h | 6 ++-- .../src/PrintTrackNumberAction.cc | 6 ++-- .../interface/SaveSimTrack.h | 4 +-- .../interface/TrackingVerboseAction.h | 12 ++++---- .../src/TrackingVerboseAction.cc | 24 +++++++-------- SimG4Core/Watcher/interface/SimProducer.h | 6 ++-- SimG4Core/Watcher/interface/SimWatcher.h | 4 +-- SimG4Core/Watcher/interface/SimWatcherMaker.h | 4 +-- SimG4Core/Watcher/test/IntSimProducer.cc | 2 +- 134 files changed, 435 insertions(+), 435 deletions(-) diff --git a/SimG4Core/Application/interface/CMSGDMLWriteStructure.h b/SimG4Core/Application/interface/CMSGDMLWriteStructure.h index 20fbbcfba5d90..51c7d0d5688c0 100644 --- a/SimG4Core/Application/interface/CMSGDMLWriteStructure.h +++ b/SimG4Core/Application/interface/CMSGDMLWriteStructure.h @@ -13,10 +13,10 @@ class CMSGDMLWriteStructure : public G4GDMLWriteStructure CMSGDMLWriteStructure(); - virtual ~CMSGDMLWriteStructure(); + ~CMSGDMLWriteStructure() override; - virtual void AddExtension(xercesc::DOMElement* volumeElement, - const G4LogicalVolume* const glv); + void AddExtension(xercesc::DOMElement* volumeElement, + const G4LogicalVolume* const glv) override; private: diff --git a/SimG4Core/Application/interface/CustomUIsession.h b/SimG4Core/Application/interface/CustomUIsession.h index 54ef58c732d8f..c08a3e5b5e874 100644 --- a/SimG4Core/Application/interface/CustomUIsession.h +++ b/SimG4Core/Application/interface/CustomUIsession.h @@ -12,7 +12,7 @@ class CustomUIsession : public G4UIsession public: CustomUIsession(); - ~CustomUIsession(); + ~CustomUIsession() override; G4int ReceiveG4cout(const G4String& coutString) override; G4int ReceiveG4cerr(const G4String& cerrString) override; diff --git a/SimG4Core/Application/interface/CustomUIsessionThreadPrefix.h b/SimG4Core/Application/interface/CustomUIsessionThreadPrefix.h index 9b9e7759fcc2d..88bbab9507d17 100644 --- a/SimG4Core/Application/interface/CustomUIsessionThreadPrefix.h +++ b/SimG4Core/Application/interface/CustomUIsessionThreadPrefix.h @@ -17,7 +17,7 @@ class CustomUIsessionThreadPrefix : public CustomUIsession public: explicit CustomUIsessionThreadPrefix(const std::string& threadPrefix, int threadId); - virtual ~CustomUIsessionThreadPrefix(); + ~CustomUIsessionThreadPrefix() override; G4int ReceiveG4cout(const G4String& coutString) override; G4int ReceiveG4cerr(const G4String& cerrString) override; diff --git a/SimG4Core/Application/interface/CustomUIsessionToFile.h b/SimG4Core/Application/interface/CustomUIsessionToFile.h index 168089079e7d6..f01bc000556df 100644 --- a/SimG4Core/Application/interface/CustomUIsessionToFile.h +++ b/SimG4Core/Application/interface/CustomUIsessionToFile.h @@ -22,7 +22,7 @@ class CustomUIsessionToFile : public CustomUIsession public: CustomUIsessionToFile(const std::string& filePrefix, int threadId); - ~CustomUIsessionToFile(); + ~CustomUIsessionToFile() override; G4int ReceiveG4cout(const G4String& coutString) override; G4int ReceiveG4cerr(const G4String& cerrString) override; diff --git a/SimG4Core/Application/interface/ElectronLimiter.h b/SimG4Core/Application/interface/ElectronLimiter.h index d94b8f269a057..073969ebbfff9 100644 --- a/SimG4Core/Application/interface/ElectronLimiter.h +++ b/SimG4Core/Application/interface/ElectronLimiter.h @@ -20,17 +20,17 @@ class ElectronLimiter : public G4VDiscreteProcess ElectronLimiter(const edm::ParameterSet & p); - virtual ~ElectronLimiter(); + ~ElectronLimiter() override; - virtual void BuildPhysicsTable(const G4ParticleDefinition&); + void BuildPhysicsTable(const G4ParticleDefinition&) override; - virtual G4double PostStepGetPhysicalInteractionLength(const G4Track& track, + G4double PostStepGetPhysicalInteractionLength(const G4Track& track, G4double previousStepSize, - G4ForceCondition* condition); + G4ForceCondition* condition) override; - virtual G4VParticleChange* PostStepDoIt(const G4Track&, const G4Step&); + G4VParticleChange* PostStepDoIt(const G4Track&, const G4Step&) override; - virtual G4double GetMeanFreePath(const G4Track&, G4double,G4ForceCondition*); + G4double GetMeanFreePath(const G4Track&, G4double,G4ForceCondition*) override; inline void SetRangeCheckFlag(G4bool); diff --git a/SimG4Core/Application/interface/EventAction.h b/SimG4Core/Application/interface/EventAction.h index 51e538bd67cd5..7fbdb6b2402a1 100644 --- a/SimG4Core/Application/interface/EventAction.h +++ b/SimG4Core/Application/interface/EventAction.h @@ -30,10 +30,10 @@ class EventAction: public G4UserEventAction explicit EventAction(const edm::ParameterSet& ps, SimRunInterface*, SimTrackManager*, CMSSteppingVerbose*); - virtual ~EventAction(); + ~EventAction() override; - virtual void BeginOfEventAction(const G4Event * evt); - virtual void EndOfEventAction(const G4Event * evt); + void BeginOfEventAction(const G4Event * evt) override; + void EndOfEventAction(const G4Event * evt) override; void abortEvent(); diff --git a/SimG4Core/Application/interface/ExceptionHandler.h b/SimG4Core/Application/interface/ExceptionHandler.h index 23c318269f0cd..12a8e042de4bb 100644 --- a/SimG4Core/Application/interface/ExceptionHandler.h +++ b/SimG4Core/Application/interface/ExceptionHandler.h @@ -13,11 +13,11 @@ class ExceptionHandler : public G4VExceptionHandler ExceptionHandler(RunManager * rm); ExceptionHandler(RunManagerMT * rm); ExceptionHandler() {} ; - virtual ~ExceptionHandler(); + ~ExceptionHandler() override; int operator==(const ExceptionHandler & right) const { return (this == &right); } int operator!=(const ExceptionHandler & right) const { return (this != &right); } - virtual bool Notify(const char * exceptionOrigin, const char * exceptionCode, - G4ExceptionSeverity severity, const char * description); + bool Notify(const char * exceptionOrigin, const char * exceptionCode, + G4ExceptionSeverity severity, const char * description) override; private: ExceptionHandler(const ExceptionHandler &) : G4VExceptionHandler() {} ExceptionHandler& operator=(const ExceptionHandler &right) { return *this; } diff --git a/SimG4Core/Application/interface/GFlashEMShowerModel.h b/SimG4Core/Application/interface/GFlashEMShowerModel.h index dfd2d63514429..5de7cbb0fb777 100644 --- a/SimG4Core/Application/interface/GFlashEMShowerModel.h +++ b/SimG4Core/Application/interface/GFlashEMShowerModel.h @@ -32,11 +32,11 @@ class GFlashEMShowerModel : public G4VFastSimulationModel { GFlashEMShowerModel (const G4String& name, G4Envelope* env, const edm::ParameterSet& parSet); - virtual ~GFlashEMShowerModel (); + ~GFlashEMShowerModel () override; - G4bool ModelTrigger(const G4FastTrack &); - G4bool IsApplicable(const G4ParticleDefinition&); - void DoIt(const G4FastTrack&, G4FastStep&); + G4bool ModelTrigger(const G4FastTrack &) override; + G4bool IsApplicable(const G4ParticleDefinition&) override; + void DoIt(const G4FastTrack&, G4FastStep&) override; private: diff --git a/SimG4Core/Application/interface/GFlashHadronShowerModel.h b/SimG4Core/Application/interface/GFlashHadronShowerModel.h index e659b7617f16a..1bbe12454776e 100644 --- a/SimG4Core/Application/interface/GFlashHadronShowerModel.h +++ b/SimG4Core/Application/interface/GFlashHadronShowerModel.h @@ -25,15 +25,15 @@ class GFlashHadronShowerModel : public G4VFastSimulationModel //------------------------- GFlashHadronShowerModel (G4String modelName, G4Region* envelope, const edm::ParameterSet& parSet); - ~GFlashHadronShowerModel (); + ~GFlashHadronShowerModel () override; //------------------------------------------------------------------------ // Virtual methods that should be implemented for this hadron shower model //------------------------------------------------------------------------ - G4bool IsApplicable(const G4ParticleDefinition&); - G4bool ModelTrigger(const G4FastTrack &); - void DoIt(const G4FastTrack&, G4FastStep&); + G4bool IsApplicable(const G4ParticleDefinition&) override; + G4bool ModelTrigger(const G4FastTrack &) override; + void DoIt(const G4FastTrack&, G4FastStep&) override; private: G4bool isFirstInelasticInteraction(const G4FastTrack& fastTrack); diff --git a/SimG4Core/Application/interface/OscarMTProducer.h b/SimG4Core/Application/interface/OscarMTProducer.h index 9636df2d2f74b..094e8e8744014 100644 --- a/SimG4Core/Application/interface/OscarMTProducer.h +++ b/SimG4Core/Application/interface/OscarMTProducer.h @@ -24,15 +24,15 @@ class OscarMTProducer : public edm::stream::EDProducer< typedef std::vector > Producers; explicit OscarMTProducer(edm::ParameterSet const & p, const OscarMTMasterThread *); - virtual ~OscarMTProducer(); + ~OscarMTProducer() override; static std::unique_ptr initializeGlobalCache(const edm::ParameterSet& iConfig); static std::shared_ptr globalBeginRun(const edm::Run& iRun, const edm::EventSetup& iSetup, const OscarMTMasterThread *masterThread); static void globalEndRun(const edm::Run& iRun, const edm::EventSetup& iSetup, const RunContext *iContext); static void globalEndJob(OscarMTMasterThread *masterThread); - virtual void endRun(const edm::Run & r,const edm::EventSetup& c) override; - virtual void produce(edm::Event & e, const edm::EventSetup& c) override; + void endRun(const edm::Run & r,const edm::EventSetup& c) override; + void produce(edm::Event & e, const edm::EventSetup& c) override; private: Producers m_producers; diff --git a/SimG4Core/Application/interface/OscarProducer.h b/SimG4Core/Application/interface/OscarProducer.h index f4cb16bd5267b..4a0259b787bc3 100644 --- a/SimG4Core/Application/interface/OscarProducer.h +++ b/SimG4Core/Application/interface/OscarProducer.h @@ -19,10 +19,10 @@ class OscarProducer : public edm::one::EDProducer > Producers; explicit OscarProducer(edm::ParameterSet const & p); - virtual ~OscarProducer(); - virtual void beginRun(const edm::Run & r,const edm::EventSetup& c) override; - virtual void endRun(const edm::Run & r,const edm::EventSetup& c) override; - virtual void produce(edm::Event & e, const edm::EventSetup& c) override; + ~OscarProducer() override; + void beginRun(const edm::Run & r,const edm::EventSetup& c) override; + void endRun(const edm::Run & r,const edm::EventSetup& c) override; + void produce(edm::Event & e, const edm::EventSetup& c) override; private: std::unique_ptr m_runManager; diff --git a/SimG4Core/Application/interface/ParametrisedEMPhysics.h b/SimG4Core/Application/interface/ParametrisedEMPhysics.h index 8ef93e19929cf..c4bcaa1baa173 100644 --- a/SimG4Core/Application/interface/ParametrisedEMPhysics.h +++ b/SimG4Core/Application/interface/ParametrisedEMPhysics.h @@ -20,10 +20,10 @@ class ParametrisedEMPhysics : public G4VPhysicsConstructor public: ParametrisedEMPhysics(std::string name, const edm::ParameterSet & p); - virtual ~ParametrisedEMPhysics(); + ~ParametrisedEMPhysics() override; - virtual void ConstructParticle(); - virtual void ConstructProcess(); + void ConstructParticle() override; + void ConstructProcess() override; private: diff --git a/SimG4Core/Application/interface/PrimaryTransformer.h b/SimG4Core/Application/interface/PrimaryTransformer.h index 7113f7a5a141f..cbc42829202f1 100644 --- a/SimG4Core/Application/interface/PrimaryTransformer.h +++ b/SimG4Core/Application/interface/PrimaryTransformer.h @@ -7,9 +7,9 @@ class PrimaryTransformer : public G4PrimaryTransformer { public: PrimaryTransformer(); - virtual ~PrimaryTransformer(); + ~PrimaryTransformer() override; protected: - virtual G4ParticleDefinition * GetDefinition(G4PrimaryParticle * pp); + G4ParticleDefinition * GetDefinition(G4PrimaryParticle * pp) override; }; #endif diff --git a/SimG4Core/Application/interface/RunAction.h b/SimG4Core/Application/interface/RunAction.h index 4a84b938721d5..940c31db78794 100644 --- a/SimG4Core/Application/interface/RunAction.h +++ b/SimG4Core/Application/interface/RunAction.h @@ -17,10 +17,10 @@ class RunAction: public G4UserRunAction { public: explicit RunAction(const edm::ParameterSet & ps, SimRunInterface*, bool master); - virtual ~RunAction(); + ~RunAction() override; - void BeginOfRunAction(const G4Run * aRun); - void EndOfRunAction(const G4Run * aRun); + void BeginOfRunAction(const G4Run * aRun) override; + void EndOfRunAction(const G4Run * aRun) override; SimActivityRegistry::BeginOfRunSignal m_beginOfRunSignal; SimActivityRegistry::EndOfRunSignal m_endOfRunSignal; diff --git a/SimG4Core/Application/interface/SimTrackManager.h b/SimG4Core/Application/interface/SimTrackManager.h index d69023dcfbabf..4477c744d7c78 100644 --- a/SimG4Core/Application/interface/SimTrackManager.h +++ b/SimG4Core/Application/interface/SimTrackManager.h @@ -111,8 +111,8 @@ class SimTrackManager private: // stop default - SimTrackManager(const SimTrackManager&); - const SimTrackManager& operator=(const SimTrackManager&); + SimTrackManager(const SimTrackManager&) = delete; + const SimTrackManager& operator=(const SimTrackManager&) = delete; void saveTrackAndItsBranch(TrackWithHistory *); int getOrCreateVertex(TrackWithHistory *,int,G4SimEvent * simEvent); diff --git a/SimG4Core/Application/interface/StackingAction.h b/SimG4Core/Application/interface/StackingAction.h index fe21c714feb4b..ad19fa695cd76 100644 --- a/SimG4Core/Application/interface/StackingAction.h +++ b/SimG4Core/Application/interface/StackingAction.h @@ -22,12 +22,12 @@ class StackingAction : public G4UserStackingAction { explicit StackingAction(const TrackingAction*, const edm::ParameterSet & ps, const CMSSteppingVerbose*); - virtual ~StackingAction(); + ~StackingAction() override; - virtual G4ClassificationOfNewTrack ClassifyNewTrack(const G4Track * aTrack) final; + G4ClassificationOfNewTrack ClassifyNewTrack(const G4Track * aTrack) final; - void NewStage(); - void PrepareNewEvent(); + void NewStage() override; + void PrepareNewEvent() override; private: diff --git a/SimG4Core/Application/interface/SteppingAction.h b/SimG4Core/Application/interface/SteppingAction.h index cf5bd9d7ecc20..3c329322d3276 100644 --- a/SimG4Core/Application/interface/SteppingAction.h +++ b/SimG4Core/Application/interface/SteppingAction.h @@ -31,9 +31,9 @@ class SteppingAction: public G4UserSteppingAction { public: explicit SteppingAction(EventAction * ea, const edm::ParameterSet & ps, const CMSSteppingVerbose*, bool hasW); - virtual ~SteppingAction(); + ~SteppingAction() override; - virtual void UserSteppingAction(const G4Step * aStep) final; + void UserSteppingAction(const G4Step * aStep) final; SimActivityRegistry::G4StepSignal m_g4StepSignal; diff --git a/SimG4Core/Application/interface/TrackingAction.h b/SimG4Core/Application/interface/TrackingAction.h index 31404b8b1364f..c1fb51398d875 100644 --- a/SimG4Core/Application/interface/TrackingAction.h +++ b/SimG4Core/Application/interface/TrackingAction.h @@ -18,10 +18,10 @@ class TrackingAction : public G4UserTrackingAction public: explicit TrackingAction(EventAction * ea, const edm::ParameterSet & ps, CMSSteppingVerbose*); - virtual ~TrackingAction(); + ~TrackingAction() override; - virtual void PreUserTrackingAction(const G4Track * aTrack); - virtual void PostUserTrackingAction(const G4Track * aTrack); + void PreUserTrackingAction(const G4Track * aTrack) override; + void PostUserTrackingAction(const G4Track * aTrack) override; inline TrackWithHistory* currentTrackWithHistory() { return currentTrack_; } inline const G4Track* geant4Track() const { return g4Track_; } diff --git a/SimG4Core/Application/src/CMSGDMLWriteStructure.cc b/SimG4Core/Application/src/CMSGDMLWriteStructure.cc index cd120a463dbb3..59b2c428415fe 100644 --- a/SimG4Core/Application/src/CMSGDMLWriteStructure.cc +++ b/SimG4Core/Application/src/CMSGDMLWriteStructure.cc @@ -25,7 +25,7 @@ void CMSGDMLWriteStructure::AddExtension(xercesc::DOMElement* volumeElement, const G4LogicalVolume* const glv) { - xercesc::DOMElement* auxiliaryElement = 0; + xercesc::DOMElement* auxiliaryElement = nullptr; std::stringstream ss; const char* cutnames[4] = {"pcutg","pcutem","pcutep","pcutp"}; diff --git a/SimG4Core/Application/src/CustomUIsession.cc b/SimG4Core/Application/src/CustomUIsession.cc index 3b6af528b8f3b..da8fe85de287b 100644 --- a/SimG4Core/Application/src/CustomUIsession.cc +++ b/SimG4Core/Application/src/CustomUIsession.cc @@ -12,7 +12,7 @@ CustomUIsession::~CustomUIsession() { G4UImanager *UI = G4UImanager::GetUIpointer(); - UI->SetCoutDestination(NULL); + UI->SetCoutDestination(nullptr); } diff --git a/SimG4Core/Application/src/ElectronLimiter.cc b/SimG4Core/Application/src/ElectronLimiter.cc index 0c76e04abeb85..3c5b4e1c1b2ad 100644 --- a/SimG4Core/Application/src/ElectronLimiter.cc +++ b/SimG4Core/Application/src/ElectronLimiter.cc @@ -23,8 +23,8 @@ ElectronLimiter::ElectronLimiter(const edm::ParameterSet & p) fieldCheckFlag = false; killTrack = false; - fIonisation = 0; - particle = 0; + fIonisation = nullptr; + particle = nullptr; } ElectronLimiter::~ElectronLimiter() diff --git a/SimG4Core/Application/src/ExceptionHandler.cc b/SimG4Core/Application/src/ExceptionHandler.cc index ffa09e5f798fb..07d13f0c60ac0 100644 --- a/SimG4Core/Application/src/ExceptionHandler.cc +++ b/SimG4Core/Application/src/ExceptionHandler.cc @@ -13,11 +13,11 @@ using std::endl; using std::string; ExceptionHandler::ExceptionHandler(RunManager* rm) - : fRunManager(rm),fRunManagerMT(0) + : fRunManager(rm),fRunManagerMT(nullptr) {} ExceptionHandler::ExceptionHandler(RunManagerMT* rm) - : fRunManager(0),fRunManagerMT(rm) + : fRunManager(nullptr),fRunManagerMT(rm) {} ExceptionHandler::~ExceptionHandler() {} diff --git a/SimG4Core/Application/src/G4SimEvent.cc b/SimG4Core/Application/src/G4SimEvent.cc index 38fe21a5664e8..902f0c5c77d3a 100644 --- a/SimG4Core/Application/src/G4SimEvent.cc +++ b/SimG4Core/Application/src/G4SimEvent.cc @@ -11,7 +11,7 @@ class IdSort{ }; -G4SimEvent::G4SimEvent() : hepMCEvent(0), +G4SimEvent::G4SimEvent() : hepMCEvent(nullptr), weight_(0), collisionPoint_(math::XYZTLorentzVectorD(0.,0.,0.,0.)), nparam_(0),param_(0) {} @@ -40,14 +40,14 @@ G4SimEvent::~G4SimEvent() for ( i=0; iGetTouchable()); G4VPhysicalVolume* pCurrentVolume = touch->GetVolume(); - if( pCurrentVolume == 0) { return false; } + if( pCurrentVolume == nullptr) { return false; } G4LogicalVolume* lv = pCurrentVolume->GetLogicalVolume(); if(lv->GetRegion() != theRegion) { return false; } @@ -151,7 +151,7 @@ void GFlashEMShowerModel::makeHits(const G4FastTrack& fastTrack) G4VPhysicalVolume* aCurrentVolume = theGflashStep->GetPreStepPoint()->GetPhysicalVolume(); - if( aCurrentVolume == 0 ) { continue; } + if( aCurrentVolume == nullptr ) { continue; } G4LogicalVolume* lv = aCurrentVolume->GetLogicalVolume(); if(lv->GetRegion() != theRegion) { continue; } @@ -159,7 +159,7 @@ void GFlashEMShowerModel::makeHits(const G4FastTrack& fastTrack) theGflashStep->GetPreStepPoint()->SetSensitiveDetector(aCurrentVolume->GetLogicalVolume()->GetSensitiveDetector()); G4VSensitiveDetector* aSensitive = theGflashStep->GetPreStepPoint()->GetSensitiveDetector(); - if( aSensitive == 0 ) { continue; } + if( aSensitive == nullptr ) { continue; } theGflashStep->SetTotalEnergyDeposit(spotIter->getEnergy()); aSensitive->Hit(theGflashStep); diff --git a/SimG4Core/Application/src/GFlashHadronShowerModel.cc b/SimG4Core/Application/src/GFlashHadronShowerModel.cc index 0958ff824e198..d05823980c7a4 100644 --- a/SimG4Core/Application/src/GFlashHadronShowerModel.cc +++ b/SimG4Core/Application/src/GFlashHadronShowerModel.cc @@ -38,7 +38,7 @@ GFlashHadronShowerModel::GFlashHadronShowerModel(G4String modelName, G4Region* e { theWatcherOn = parSet.getParameter("watcherOn"); - theProfile = 0; + theProfile = nullptr; thePiKProfile = new GflashPiKShowerProfile(parSet); theKaonPlusProfile = new GflashKaonPlusShowerProfile(parSet); theKaonMinusProfile = new GflashKaonMinusShowerProfile(parSet); @@ -94,7 +94,7 @@ G4bool GFlashHadronShowerModel::ModelTrigger(const G4FastTrack& fastTrack) G4TouchableHistory* touch = (G4TouchableHistory*)(fastTrack.GetPrimaryTrack()->GetTouchable()); G4VPhysicalVolume* pCurrentVolume = touch->GetVolume(); - if( pCurrentVolume == 0) { return false; } + if( pCurrentVolume == nullptr) { return false; } G4LogicalVolume* lv = pCurrentVolume->GetLogicalVolume(); if(lv->GetRegion() != theRegion) { return false; } @@ -170,7 +170,7 @@ void GFlashHadronShowerModel::makeHits(const G4FastTrack& fastTrack) { } G4VPhysicalVolume* aCurrentVolume = theGflashStep->GetPreStepPoint()->GetPhysicalVolume(); - if( aCurrentVolume == 0 ) { continue; } + if( aCurrentVolume == nullptr ) { continue; } G4LogicalVolume* lv = aCurrentVolume->GetLogicalVolume(); if(lv->GetRegion() != theRegion) { continue; } @@ -178,7 +178,7 @@ void GFlashHadronShowerModel::makeHits(const G4FastTrack& fastTrack) { theGflashStep->GetPreStepPoint()->SetSensitiveDetector(aCurrentVolume->GetLogicalVolume()->GetSensitiveDetector()); G4VSensitiveDetector* aSensitive = theGflashStep->GetPreStepPoint()->GetSensitiveDetector(); - if( aSensitive == 0 ) continue; + if( aSensitive == nullptr ) continue; G4String nameCalor = aCurrentVolume->GetName(); nameCalor.assign(nameCalor,0,2); diff --git a/SimG4Core/Application/src/RunManager.cc b/SimG4Core/Application/src/RunManager.cc index e22e50b845d76..6bc3cf43947c8 100644 --- a/SimG4Core/Application/src/RunManager.cc +++ b/SimG4Core/Application/src/RunManager.cc @@ -122,7 +122,7 @@ RunManager::RunManager(edm::ParameterSet const & p, edm::ConsumesCollector&& iC) m_runInitialized(false), m_runTerminated(false), m_runAborted(false), firstRun(true), m_pUseMagneticField(p.getParameter("UseMagneticField")), - m_currentRun(0), m_currentEvent(0), m_simEvent(0), + m_currentRun(nullptr), m_currentEvent(nullptr), m_simEvent(nullptr), m_PhysicsTablesDir(p.getParameter("PhysicsTablesDirectory")), m_StorePhysicsTables(p.getParameter("StorePhysicsTables")), m_RestorePhysicsTables(p.getParameter("RestorePhysicsTables")), @@ -327,7 +327,7 @@ void RunManager::initG4(const edm::EventSetup & es) } initializeUserActions(); - if(0 < m_G4Commands.size()) { + if(!m_G4Commands.empty()) { G4cout << "RunManager: Requested UI commands: " << G4endl; for (unsigned it=0; ithepEvent(m_generator->genEvent()); m_simEvent->weight(m_generator->eventWeight()); - if (m_generator->genVertex() !=0 ) { + if (m_generator->genVertex() !=nullptr ) { m_simEvent->collisionPoint( math::XYZTLorentzVectorD(m_generator->genVertex()->x()/centimeter, m_generator->genVertex()->y()/centimeter, @@ -401,10 +401,10 @@ void RunManager::produce(edm::Event& inpevt, const edm::EventSetup & es) G4Event * RunManager::generateEvent(edm::Event & inpevt) { - if (m_currentEvent!=0) { delete m_currentEvent; } - m_currentEvent = 0; - if (m_simEvent!=0) { delete m_simEvent; } - m_simEvent = 0; + if (m_currentEvent!=nullptr) { delete m_currentEvent; } + m_currentEvent = nullptr; + if (m_simEvent!=nullptr) { delete m_simEvent; } + m_simEvent = nullptr; // 64 bits event ID in CMSSW converted into Geant4 event ID G4int evtid = (G4int)inpevt.id().event(); @@ -522,7 +522,7 @@ void RunManager::abortRun(bool softAbort) { if(m_runAborted) { return; } if (!softAbort) { abortEvent(); } - if (m_currentRun!=0) { delete m_currentRun; m_currentRun = 0; } + if (m_currentRun!=nullptr) { delete m_currentRun; m_currentRun = nullptr; } terminateRun(); m_runAborted = true; } diff --git a/SimG4Core/Application/src/RunManagerMT.cc b/SimG4Core/Application/src/RunManagerMT.cc index 4addbc086e28f..1f413ce71a695 100644 --- a/SimG4Core/Application/src/RunManagerMT.cc +++ b/SimG4Core/Application/src/RunManagerMT.cc @@ -193,7 +193,7 @@ void RunManagerMT::initG4(const DDCompactView *pDD, const MagneticField *pMF, initializeUserActions(); - if(0 < m_G4Commands.size()) { + if(!m_G4Commands.empty()) { G4cout << "RunManagerMT: Requested UI commands: " << G4endl; for (unsigned it=0; itsimEvent(); } else if(m_runManagerMTWorker) { diff --git a/SimG4Core/Application/src/SimTrackManager.cc b/SimG4Core/Application/src/SimTrackManager.cc index 155f485433aa0..24932324605f1 100644 --- a/SimG4Core/Application/src/SimTrackManager.cc +++ b/SimG4Core/Application/src/SimTrackManager.cc @@ -37,14 +37,14 @@ // constructors and destructor // SimTrackManager::SimTrackManager(bool iCollapsePrimaryVertices) : - m_trksForThisEvent(0),m_nVertices(0), + m_trksForThisEvent(nullptr),m_nVertices(0), m_collapsePrimaryVertices(iCollapsePrimaryVertices), - lastTrack(0),lastHist(0),theLHCTlink(0){} + lastTrack(0),lastHist(0),theLHCTlink(nullptr){} SimTrackManager::~SimTrackManager() { - if ( m_trksForThisEvent != 0 ) deleteTracks() ; + if ( m_trksForThisEvent != nullptr ) deleteTracks() ; } // @@ -52,7 +52,7 @@ SimTrackManager::~SimTrackManager() // void SimTrackManager::reset() { - if (m_trksForThisEvent==0) { m_trksForThisEvent = new TrackContainer(); } + if (m_trksForThisEvent==nullptr) { m_trksForThisEvent = new TrackContainer(); } else { for (unsigned int i = 0; i < m_trksForThisEvent->size(); i++) { @@ -75,7 +75,7 @@ void SimTrackManager::deleteTracks() delete (*m_trksForThisEvent)[i]; } delete m_trksForThisEvent; - m_trksForThisEvent = 0; + m_trksForThisEvent = nullptr; } /// this saves a track and all its parents looping over the non ordered vector @@ -83,7 +83,7 @@ void SimTrackManager::saveTrackAndItsBranch(TrackWithHistory * trkWHist) { using namespace std; TrackWithHistory * trkH = trkWHist; - if (trkH == 0) + if (trkH == nullptr) { edm::LogError("SimTrackManager") << " SimTrackManager::saveTrackAndItsBranch got 0 pointer "; @@ -269,7 +269,7 @@ int SimTrackManager::idSavedTrack (int id) const void SimTrackManager::fillMotherList() { - if ( ancestorList.size() > 0 && lastHist > ancestorList.size() ) { + if ( !ancestorList.empty() && lastHist > ancestorList.size() ) { lastHist = ancestorList.size(); edm::LogError("SimTrackManager") << " SimTrackManager::fillMotherList track index corrupted"; @@ -305,7 +305,7 @@ void SimTrackManager::fillMotherList() void SimTrackManager::cleanTracksWithHistory(){ - if ((*m_trksForThisEvent).size() == 0 && idsave.size() == 0) { return; } + if ((*m_trksForThisEvent).empty() && idsave.empty()) { return; } #ifdef DebugLog LogDebug("SimTrackManager") @@ -388,7 +388,7 @@ void SimTrackManager::cleanTracksWithHistory(){ void SimTrackManager::resetGenID() { - if ( theLHCTlink == 0 ) return; + if ( theLHCTlink == nullptr ) return; for (unsigned int it = 0; it < m_trksForThisEvent->size(); it++) { @@ -405,6 +405,6 @@ void SimTrackManager::resetGenID() } } - theLHCTlink = 0; + theLHCTlink = nullptr; } diff --git a/SimG4Core/Application/src/StackingAction.cc b/SimG4Core/Application/src/StackingAction.cc index ec5467d728d97..dd9416825ceff 100644 --- a/SimG4Core/Application/src/StackingAction.cc +++ b/SimG4Core/Application/src/StackingAction.cc @@ -50,12 +50,12 @@ StackingAction::StackingAction(const TrackingAction* trka, const edm::ParameterS killInCaloEfH = false; // Russian Roulette - regionEcal = 0; - regionHcal = 0; - regionMuonIron = 0; - regionPreShower= 0; - regionCastor = 0; - regionWorld = 0; + regionEcal = nullptr; + regionHcal = nullptr; + regionMuonIron = nullptr; + regionPreShower= nullptr; + regionCastor = nullptr; + regionWorld = nullptr; gRusRoEnerLim = p.getParameter("RusRoGammaEnergyLimit")*MeV; nRusRoEnerLim = p.getParameter("RusRoNeutronEnergyLimit")*MeV; diff --git a/SimG4Core/Application/src/SteppingAction.cc b/SimG4Core/Application/src/SteppingAction.cc index 5318c7f4b0394..4096aa29c0dbc 100644 --- a/SimG4Core/Application/src/SteppingAction.cc +++ b/SimG4Core/Application/src/SteppingAction.cc @@ -202,7 +202,7 @@ bool SteppingAction::initPointer() const G4LogicalVolumeStore * lvs = G4LogicalVolumeStore::GetInstance(); if (numberEkins > 0) { if (lvs) { - ekinVolumes.resize(numberEkins, 0); + ekinVolumes.resize(numberEkins, nullptr); std::vector::const_iterator lvcite; for (lvcite = lvs->begin(); lvcite != lvs->end(); ++lvcite) { for (unsigned int i=0; i 0) { - maxTimeRegions.resize(numberTimes, 0); + maxTimeRegions.resize(numberTimes, nullptr); std::vector::const_iterator rcite; for (rcite = rs->begin(); rcite != rs->end(); ++rcite) { for (unsigned int i=0; i 0) { - deadRegions.resize(ndeadRegions, 0); + deadRegions.resize(ndeadRegions, nullptr); std::vector::const_iterator rcite; for (rcite = rs->begin(); rcite != rs->end(); ++rcite) { for (unsigned int i=0; i("processName")){}; - virtual ~SimHitCaloHitDumper() {}; + ~SimHitCaloHitDumper() override {}; - virtual void analyze( const edm::Event&, const edm::EventSetup&) override; - virtual void beginJob() override{}; - virtual void endJob() override{}; + void analyze( const edm::Event&, const edm::EventSetup&) override; + void beginJob() override{}; + void endJob() override{}; private: std::string processName; diff --git a/SimG4Core/Application/test/SimTrackSimVertexDumper.h b/SimG4Core/Application/test/SimTrackSimVertexDumper.h index 5a9aa4de26c41..c13de8148c8bd 100644 --- a/SimG4Core/Application/test/SimTrackSimVertexDumper.h +++ b/SimG4Core/Application/test/SimTrackSimVertexDumper.h @@ -16,11 +16,11 @@ class SimTrackSimVertexDumper : public edm::EDAnalyzer{ public: explicit SimTrackSimVertexDumper( const edm::ParameterSet& ); - virtual ~SimTrackSimVertexDumper() {}; + ~SimTrackSimVertexDumper() override {}; - virtual void analyze( const edm::Event&, const edm::EventSetup&) override; - virtual void beginJob() override{}; - virtual void endJob() override{}; + void analyze( const edm::Event&, const edm::EventSetup&) override; + void beginJob() override{}; + void endJob() override{}; private: edm::InputTag HepMCLabel; edm::InputTag SimTkLabel; diff --git a/SimG4Core/CheckSecondary/interface/CheckSecondary.h b/SimG4Core/CheckSecondary/interface/CheckSecondary.h index 7b056c61a8898..c1a191401ac54 100644 --- a/SimG4Core/CheckSecondary/interface/CheckSecondary.h +++ b/SimG4Core/CheckSecondary/interface/CheckSecondary.h @@ -30,19 +30,19 @@ class CheckSecondary : public SimWatcher, public: CheckSecondary(const edm::ParameterSet &p); - virtual ~CheckSecondary(); + ~CheckSecondary() override; private: - CheckSecondary(const CheckSecondary&); // stop default - const CheckSecondary& operator=(const CheckSecondary&); + CheckSecondary(const CheckSecondary&) = delete; // stop default + const CheckSecondary& operator=(const CheckSecondary&) = delete; // observer classes TTree * bookTree(std::string); void endTree(); - void update(const BeginOfEvent * evt); - void update(const BeginOfTrack * trk); - void update(const G4Step * step); - void update(const EndOfEvent * evt); + void update(const BeginOfEvent * evt) override; + void update(const BeginOfTrack * trk) override; + void update(const G4Step * step) override; + void update(const EndOfEvent * evt) override; private: TreatSecondary *treatSecondary; diff --git a/SimG4Core/CheckSecondary/interface/StoreSecondary.h b/SimG4Core/CheckSecondary/interface/StoreSecondary.h index b31a1b9ae8511..38ad0208dbe2b 100644 --- a/SimG4Core/CheckSecondary/interface/StoreSecondary.h +++ b/SimG4Core/CheckSecondary/interface/StoreSecondary.h @@ -23,18 +23,18 @@ class StoreSecondary : public SimProducer, public: StoreSecondary(const edm::ParameterSet &p); - virtual ~StoreSecondary(); + ~StoreSecondary() override; - void produce(edm::Event&, const edm::EventSetup&); + void produce(edm::Event&, const edm::EventSetup&) override; private: - StoreSecondary(const StoreSecondary&); // stop default - const StoreSecondary& operator=(const StoreSecondary&); + StoreSecondary(const StoreSecondary&) = delete; // stop default + const StoreSecondary& operator=(const StoreSecondary&) = delete; // observer classes - void update(const BeginOfEvent * evt); - void update(const BeginOfTrack * trk); - void update(const G4Step * step); + void update(const BeginOfEvent * evt) override; + void update(const BeginOfTrack * trk) override; + void update(const G4Step * step) override; private: int verbosity, killAfter; diff --git a/SimG4Core/CheckSecondary/interface/TreatSecondary.h b/SimG4Core/CheckSecondary/interface/TreatSecondary.h index c2433832121d5..f8370c53d4d35 100644 --- a/SimG4Core/CheckSecondary/interface/TreatSecondary.h +++ b/SimG4Core/CheckSecondary/interface/TreatSecondary.h @@ -27,8 +27,8 @@ class TreatSecondary { std::vector & charges); private: - TreatSecondary(const TreatSecondary&); // stop default - const TreatSecondary& operator=(const TreatSecondary&); + TreatSecondary(const TreatSecondary&) = delete; // stop default + const TreatSecondary& operator=(const TreatSecondary&) = delete; private: int verbosity, minSec, killAfter; diff --git a/SimG4Core/CheckSecondary/src/CheckSecondary.cc b/SimG4Core/CheckSecondary/src/CheckSecondary.cc index bcc4829385eb9..f0581999953d3 100644 --- a/SimG4Core/CheckSecondary/src/CheckSecondary.cc +++ b/SimG4Core/CheckSecondary/src/CheckSecondary.cc @@ -22,13 +22,13 @@ #include #include -CheckSecondary::CheckSecondary(const edm::ParameterSet &p): treatSecondary(0), - typeEnumerator(0), - nsec(0),procids(0), - px(0),py(0),pz(0), - mass(0),deltae(0), - procs(0),file(0), - tree(0) { +CheckSecondary::CheckSecondary(const edm::ParameterSet &p): treatSecondary(nullptr), + typeEnumerator(nullptr), + nsec(nullptr),procids(nullptr), + px(nullptr),py(nullptr),pz(nullptr), + mass(nullptr),deltae(nullptr), + procs(nullptr),file(nullptr), + tree(nullptr) { edm::ParameterSet m_p = p.getParameter("CheckSecondary"); std::string saveFile = m_p.getUntrackedParameter("SaveInFile", "None"); diff --git a/SimG4Core/CheckSecondary/src/StoreSecondary.cc b/SimG4Core/CheckSecondary/src/StoreSecondary.cc index 8a9701166057e..80407a415ea1f 100644 --- a/SimG4Core/CheckSecondary/src/StoreSecondary.cc +++ b/SimG4Core/CheckSecondary/src/StoreSecondary.cc @@ -69,7 +69,7 @@ void StoreSecondary::update(const BeginOfTrack * trk) { const G4Track * thTk = (*trk)(); treatSecondary->initTrack(thTk); - if (nsecs.size() == 0 && thTk->GetParentID() <= 0) storeIt = true; + if (nsecs.empty() && thTk->GetParentID() <= 0) storeIt = true; else storeIt = false; nHad = 0; } diff --git a/SimG4Core/CheckSecondary/src/TreatSecondary.cc b/SimG4Core/CheckSecondary/src/TreatSecondary.cc index 88e5431dd83d6..88a95a33a6965 100644 --- a/SimG4Core/CheckSecondary/src/TreatSecondary.cc +++ b/SimG4Core/CheckSecondary/src/TreatSecondary.cc @@ -14,7 +14,7 @@ #include #include -TreatSecondary::TreatSecondary(const edm::ParameterSet &p): typeEnumerator(0) { +TreatSecondary::TreatSecondary(const edm::ParameterSet &p): typeEnumerator(nullptr) { verbosity = p.getUntrackedParameter("Verbosity",0); killAfter = p.getUntrackedParameter("KillAfter", -1); diff --git a/SimG4Core/CountProcesses/interface/CountProcessesAction.h b/SimG4Core/CountProcesses/interface/CountProcessesAction.h index fa2e4245ca2e6..685d1ad3842ea 100644 --- a/SimG4Core/CountProcesses/interface/CountProcessesAction.h +++ b/SimG4Core/CountProcesses/interface/CountProcessesAction.h @@ -28,11 +28,11 @@ class CountProcessesAction : public SimWatcher, { public: CountProcessesAction(edm::ParameterSet const & p); - ~CountProcessesAction(); - void update(const BeginOfRun * run); - void update(const BeginOfTrack * trk); - void update(const EndOfRun * track); - void update(const G4Step * track); + ~CountProcessesAction() override; + void update(const BeginOfRun * run) override; + void update(const BeginOfTrack * trk) override; + void update(const EndOfRun * track) override; + void update(const G4Step * track) override; //---- Dump list of processes for each particle. // printNsteps = 1 print in how many step the process was called, // print only those processes with this number <> 0 diff --git a/SimG4Core/CountProcesses/src/CountProcessesAction.cc b/SimG4Core/CountProcesses/src/CountProcessesAction.cc index 12ce2336ea324..589a3fe8ef69c 100644 --- a/SimG4Core/CountProcesses/src/CountProcessesAction.cc +++ b/SimG4Core/CountProcesses/src/CountProcessesAction.cc @@ -42,7 +42,7 @@ void CountProcessesAction::update(const BeginOfRun * run) theProcessList[pss(particleName,processName)] = 0; } } - DumpProcessList(0); + DumpProcessList(false); } void CountProcessesAction::update(const BeginOfTrack * trk) @@ -55,7 +55,7 @@ void CountProcessesAction::update(const BeginOfTrack * trk) //----- Fill counter of Creator Processes const G4VProcess * proc = aTrack->GetCreatorProcess(); std::string processName; - if (proc != 0) processName = proc->GetProcessName(); + if (proc != nullptr) processName = proc->GetProcessName(); else processName = "Primary"; pss parproc(particleName,processName); mpssi::iterator ite = theCreatorProcessList.find(parproc); @@ -69,7 +69,7 @@ void CountProcessesAction::update(const BeginOfTrack * trk) void CountProcessesAction::update(const G4Step* aStep ) { std::string processName; - if(aStep->GetPostStepPoint()->GetProcessDefinedStep() != 0) + if(aStep->GetPostStepPoint()->GetProcessDefinedStep() != nullptr) processName = aStep->GetPostStepPoint()->GetProcessDefinedStep()->GetProcessName(); else processName = "User Limit"; std::string particleName = aStep->GetTrack()->GetDefinition()->GetParticleName(); @@ -78,8 +78,8 @@ void CountProcessesAction::update(const G4Step* aStep ) void CountProcessesAction::update(const EndOfRun * run) { - DumpProcessList(1); - DumpCreatorProcessList(1); + DumpProcessList(true); + DumpCreatorProcessList(true); DumpParticleList(); } diff --git a/SimG4Core/CustomPhysics/interface/CMSDarkPairProduction.hh b/SimG4Core/CustomPhysics/interface/CMSDarkPairProduction.hh index 0d2789344fae3..d551f1194d418 100644 --- a/SimG4Core/CustomPhysics/interface/CMSDarkPairProduction.hh +++ b/SimG4Core/CustomPhysics/interface/CMSDarkPairProduction.hh @@ -23,15 +23,15 @@ public: G4double df = 1.0, const G4String& nam = "BetheHeitlerLPM"); - virtual ~CMSDarkPairProduction(); + ~CMSDarkPairProduction() override; - virtual G4double ComputeCrossSectionPerAtom( + G4double ComputeCrossSectionPerAtom( const G4ParticleDefinition*, G4double kinEnergy, G4double Z, G4double A=0., G4double cut=0., - G4double emax=DBL_MAX); + G4double emax=DBL_MAX) override; private: diff --git a/SimG4Core/CustomPhysics/interface/CMSDarkPairProductionProcess.hh b/SimG4Core/CustomPhysics/interface/CMSDarkPairProductionProcess.hh index 94e4504518843..6f57c8d71e886 100644 --- a/SimG4Core/CustomPhysics/interface/CMSDarkPairProductionProcess.hh +++ b/SimG4Core/CustomPhysics/interface/CMSDarkPairProductionProcess.hh @@ -27,20 +27,20 @@ public: // with description const G4String& processName ="conv", G4ProcessType type = fElectromagnetic); - virtual ~CMSDarkPairProductionProcess(); + ~CMSDarkPairProductionProcess() override; // true for Gamma only. - virtual G4bool IsApplicable(const G4ParticleDefinition&); + G4bool IsApplicable(const G4ParticleDefinition&) override; - virtual G4double MinPrimaryEnergy(const G4ParticleDefinition*, - const G4Material*); + G4double MinPrimaryEnergy(const G4ParticleDefinition*, + const G4Material*) override; // Print few lines of informations about the process: validity range, - virtual void PrintInfo(); + void PrintInfo() override; protected: - virtual void InitialiseProcess(const G4ParticleDefinition*); + void InitialiseProcess(const G4ParticleDefinition*) override; private: G4bool isInitialised; diff --git a/SimG4Core/CustomPhysics/interface/CustomParticle.h b/SimG4Core/CustomPhysics/interface/CustomParticle.h index f6d125d05f0ba..475fd94b73db0 100644 --- a/SimG4Core/CustomPhysics/interface/CustomParticle.h +++ b/SimG4Core/CustomPhysics/interface/CustomParticle.h @@ -31,7 +31,7 @@ class CustomParticle : public G4ParticleDefinition void SetSpectator(G4ParticleDefinition* theSpectator); G4ParticleDefinition* GetCloud(); G4ParticleDefinition* GetSpectator(); - virtual ~CustomParticle() {} + ~CustomParticle() override {} }; inline void CustomParticle::SetCloud(G4ParticleDefinition* theCloud){ m_cloud = theCloud; } diff --git a/SimG4Core/CustomPhysics/interface/CustomPhysicsList.h b/SimG4Core/CustomPhysics/interface/CustomPhysicsList.h index 36599adf851ba..520200e5512a7 100644 --- a/SimG4Core/CustomPhysics/interface/CustomPhysicsList.h +++ b/SimG4Core/CustomPhysics/interface/CustomPhysicsList.h @@ -16,10 +16,10 @@ class CustomPhysicsList : public G4VPhysicsConstructor { public: CustomPhysicsList(std::string name, const edm::ParameterSet & p); - virtual ~CustomPhysicsList(); + ~CustomPhysicsList() override; - virtual void ConstructParticle(); - virtual void ConstructProcess(); + void ConstructParticle() override; + void ConstructProcess() override; private: diff --git a/SimG4Core/CustomPhysics/interface/CustomPhysicsListSS.h b/SimG4Core/CustomPhysics/interface/CustomPhysicsListSS.h index 651b3683240e5..14f74437b6b3b 100644 --- a/SimG4Core/CustomPhysics/interface/CustomPhysicsListSS.h +++ b/SimG4Core/CustomPhysics/interface/CustomPhysicsListSS.h @@ -16,10 +16,10 @@ class CustomPhysicsListSS : public G4VPhysicsConstructor { public: CustomPhysicsListSS(std::string name, const edm::ParameterSet & p); - virtual ~CustomPhysicsListSS(); + ~CustomPhysicsListSS() override; - virtual void ConstructParticle(); - virtual void ConstructProcess(); + void ConstructParticle() override; + void ConstructProcess() override; private: diff --git a/SimG4Core/CustomPhysics/interface/DummyChargeFlipProcess.h b/SimG4Core/CustomPhysics/interface/DummyChargeFlipProcess.h index e3b4ebab855a5..c7af7288b56f7 100644 --- a/SimG4Core/CustomPhysics/interface/DummyChargeFlipProcess.h +++ b/SimG4Core/CustomPhysics/interface/DummyChargeFlipProcess.h @@ -21,14 +21,14 @@ class DummyChargeFlipProcess : public G4HadronicProcess DummyChargeFlipProcess(const G4String& processName = "Dummy"); - ~DummyChargeFlipProcess(); + ~DummyChargeFlipProcess() override; - G4VParticleChange* PostStepDoIt(const G4Track& aTrack, const G4Step& aStep); + G4VParticleChange* PostStepDoIt(const G4Track& aTrack, const G4Step& aStep) override; - G4bool IsApplicable(const G4ParticleDefinition& aParticleType); + G4bool IsApplicable(const G4ParticleDefinition& aParticleType) override; - void BuildPhysicsTable(const G4ParticleDefinition& aParticleType); + void BuildPhysicsTable(const G4ParticleDefinition& aParticleType) override; void DumpPhysicsTable(const G4ParticleDefinition& aParticleType); diff --git a/SimG4Core/CustomPhysics/interface/FullModelHadronicProcess.hh b/SimG4Core/CustomPhysics/interface/FullModelHadronicProcess.hh index b4aa14edbcf0c..d57285a3234c4 100644 --- a/SimG4Core/CustomPhysics/interface/FullModelHadronicProcess.hh +++ b/SimG4Core/CustomPhysics/interface/FullModelHadronicProcess.hh @@ -20,12 +20,12 @@ public: FullModelHadronicProcess(G4ProcessHelper * aHelper, const G4String& processName = "FullModelHadronicProcess"); - virtual ~FullModelHadronicProcess(); + ~FullModelHadronicProcess() override; - G4bool IsApplicable(const G4ParticleDefinition& aP); + G4bool IsApplicable(const G4ParticleDefinition& aP) override; - G4VParticleChange *PostStepDoIt(const G4Track &aTrack, const G4Step &aStep); + G4VParticleChange *PostStepDoIt(const G4Track &aTrack, const G4Step &aStep) override; protected: @@ -40,7 +40,7 @@ private: const G4Element *anElement, G4double aTemp ); - G4double GetMeanFreePath(const G4Track& aTrack, G4double, G4ForceCondition*); + G4double GetMeanFreePath(const G4Track& aTrack, G4double, G4ForceCondition*) override; void CalculateMomenta( G4FastVector &vec, G4int &vecLen, diff --git a/SimG4Core/CustomPhysics/interface/RHStopDump.h b/SimG4Core/CustomPhysics/interface/RHStopDump.h index b8233154b2d00..9f7d905fa3c0c 100644 --- a/SimG4Core/CustomPhysics/interface/RHStopDump.h +++ b/SimG4Core/CustomPhysics/interface/RHStopDump.h @@ -12,8 +12,8 @@ class RHStopDump : public edm::one::EDAnalyzer { public: explicit RHStopDump(const edm::ParameterSet&); - virtual ~RHStopDump() {}; - virtual void analyze(const edm::Event&, const edm::EventSetup&) override; + ~RHStopDump() override {}; + void analyze(const edm::Event&, const edm::EventSetup&) override; private: std::ofstream mStream; std::string mProducer; diff --git a/SimG4Core/CustomPhysics/interface/RHStopTracer.h b/SimG4Core/CustomPhysics/interface/RHStopTracer.h index cd72d00da6877..00403450d5417 100644 --- a/SimG4Core/CustomPhysics/interface/RHStopTracer.h +++ b/SimG4Core/CustomPhysics/interface/RHStopTracer.h @@ -21,12 +21,12 @@ class RHStopTracer : public SimProducer, { public: RHStopTracer(edm::ParameterSet const & p); - virtual ~RHStopTracer(); - void update(const BeginOfRun *); - void update(const BeginOfEvent *); - void update(const BeginOfTrack *); - void update(const EndOfTrack *); - void produce(edm::Event&, const edm::EventSetup&); + ~RHStopTracer() override; + void update(const BeginOfRun *) override; + void update(const BeginOfEvent *) override; + void update(const BeginOfTrack *) override; + void update(const EndOfTrack *) override; + void produce(edm::Event&, const edm::EventSetup&) override; private: struct StopPoint { StopPoint (const std::string& fName, double fX, double fY, double fZ, double fT, int fId, double fMass, double fCharge) diff --git a/SimG4Core/CustomPhysics/interface/ToyModelHadronicProcess.hh b/SimG4Core/CustomPhysics/interface/ToyModelHadronicProcess.hh index 108843ed9cd85..ba7acfb47ae99 100644 --- a/SimG4Core/CustomPhysics/interface/ToyModelHadronicProcess.hh +++ b/SimG4Core/CustomPhysics/interface/ToyModelHadronicProcess.hh @@ -16,11 +16,11 @@ public: ToyModelHadronicProcess(HadronicProcessHelper * aHelper, const G4String& processName = "ToyModelHadronicProcess"); - virtual ~ToyModelHadronicProcess(){}; + ~ToyModelHadronicProcess() override{}; - G4bool IsApplicable(const G4ParticleDefinition& aP); + G4bool IsApplicable(const G4ParticleDefinition& aP) override; - G4VParticleChange *PostStepDoIt(const G4Track &aTrack, const G4Step &aStep); + G4VParticleChange *PostStepDoIt(const G4Track &aTrack, const G4Step &aStep) override; void setVerbosity(int level) { m_verboseLevel = level; } private: @@ -29,7 +29,7 @@ private: const G4Element *anElement, G4double aTemp ); - G4double GetMeanFreePath(const G4Track& aTrack, G4double, G4ForceCondition*); + G4double GetMeanFreePath(const G4Track& aTrack, G4double, G4ForceCondition*) override; int m_verboseLevel; HadronicProcessHelper* m_helper; diff --git a/SimG4Core/CustomPhysics/src/CustomParticleFactory.cc b/SimG4Core/CustomPhysics/src/CustomParticleFactory.cc index 3400b9c6e2596..15208484746da 100644 --- a/SimG4Core/CustomPhysics/src/CustomParticleFactory.cc +++ b/SimG4Core/CustomPhysics/src/CustomParticleFactory.cc @@ -155,7 +155,7 @@ void CustomParticleFactory::addCustomParticle(int pdgCode, double mass, const st 0, +1, 0, 0, 0, 0, cloudtype, 0, +1, 0, - true, -1.0, NULL ); + true, -1.0, nullptr ); particle->SetCloud(tmpParticle); particle->SetSpectator(spectator); @@ -190,7 +190,7 @@ void CustomParticleFactory::addCustomParticle(int pdgCode, double mass, const st 0, +1, 0, 0, 0, 0, cloudtype, 0, +1, 0, - true, -1.0, NULL ); + true, -1.0, nullptr ); particle->SetCloud(tmpParticle); particle->SetSpectator(spectator); @@ -204,8 +204,8 @@ void CustomParticleFactory::addCustomParticle(int pdgCode, double mass, const st <GetSpectator()->GetPDGMass()/GeV<<" GeV."; } else{ - particle->SetCloud(0); - particle->SetSpectator(0); + particle->SetCloud(nullptr); + particle->SetSpectator(nullptr); } m_particles.push_back(particle); } diff --git a/SimG4Core/CustomPhysics/src/CustomPhysicsListSS.cc b/SimG4Core/CustomPhysics/src/CustomPhysicsListSS.cc index 8e666cfe06efa..f865f8e6972ca 100644 --- a/SimG4Core/CustomPhysics/src/CustomPhysicsListSS.cc +++ b/SimG4Core/CustomPhysics/src/CustomPhysicsListSS.cc @@ -32,7 +32,7 @@ CustomPhysicsListSS::CustomPhysicsListSS(std::string name, const edm::ParameterS edm::LogInfo("SimG4CoreCustomPhysics") <<"CustomPhysicsListSS: Path for custom particle definition file: \n" <GetDefinition(); G4double ParentEnergy = aParticle->GetTotalEnergy(); - G4ThreeVector ParentDirection(aParticle->GetMomentumDirection()); + const G4ThreeVector& ParentDirection(aParticle->GetMomentumDirection()); G4double energyDeposit = 0.0; G4double finalGlobalTime = aTrack.GetGlobalTime(); G4int numberOfSecondaries = 1; pc->SetNumberOfSecondaries(numberOfSecondaries); - const G4TouchableHandle thand = aTrack.GetTouchableHandle(); + const G4TouchableHandle& thand = aTrack.GetTouchableHandle(); // get current position of the track aTrack.GetPosition(); diff --git a/SimG4Core/CustomPhysics/src/FullModelHadronicProcess.cc b/SimG4Core/CustomPhysics/src/FullModelHadronicProcess.cc index 698cf7365b07a..4f4fc295d23c3 100644 --- a/SimG4Core/CustomPhysics/src/FullModelHadronicProcess.cc +++ b/SimG4Core/CustomPhysics/src/FullModelHadronicProcess.cc @@ -61,13 +61,13 @@ G4VParticleChange* FullModelHadronicProcess::PostStepDoIt(const G4Track& aTrack, const G4Step& aStep) { // G4cout<<"**** Entering FullModelHadronicProcess::PostStepDoIt ******"<(IncidentRhadron->GetDefinition()); - const G4ThreeVector aPosition = aTrack.GetPosition(); + const G4ThreeVector& aPosition = aTrack.GetPosition(); // G4cout<<"G: "<GetDefinition()->GetPDGEncoding(); G4ParticleTable* theParticleTable = G4ParticleTable::GetParticleTable(); @@ -75,9 +75,9 @@ G4VParticleChange* FullModelHadronicProcess::PostStepDoIt(const G4Track& aTrack, G4bool IncidentSurvives = false; G4bool TargetSurvives = false; G4Nucleus targetNucleus(aTrack.GetMaterial()); - G4ParticleDefinition* outgoingRhadron=0; - G4ParticleDefinition* outgoingCloud=0; - G4ParticleDefinition* outgoingTarget=0; + G4ParticleDefinition* outgoingRhadron=nullptr; + G4ParticleDefinition* outgoingCloud=nullptr; + G4ParticleDefinition* outgoingTarget=nullptr; G4ThreeVector p_0 = IncidentRhadron->GetMomentum(); G4double e_kin_0 = IncidentRhadron->GetKineticEnergy(); @@ -92,7 +92,7 @@ G4VParticleChange* FullModelHadronicProcess::PostStepDoIt(const G4Track& aTrack, */ cloudParticle->SetDefinition(CustomIncident->GetCloud()); - if(cloudParticle->GetDefinition() == 0) + if(cloudParticle->GetDefinition() == nullptr) { G4cout << "FullModelHadronicProcess::PostStepDoIt Definition of particle cloud not available!!" << G4endl; } @@ -111,7 +111,7 @@ G4VParticleChange* FullModelHadronicProcess::PostStepDoIt(const G4Track& aTrack, //These two for getting CMS transforms later (histogramming purposes...) G4LorentzVector FullRhadron4Momentum = IncidentRhadron->Get4Momentum(); - G4LorentzVector Cloud4Momentum = cloudMomentum; + const G4LorentzVector& Cloud4Momentum = cloudMomentum; cloudParticle->Set4Momentum(cloudMomentum); @@ -178,11 +178,11 @@ G4VParticleChange* FullModelHadronicProcess::PostStepDoIt(const G4Track& aTrack, if (tempDef==aTarget) TargetSurvives = true; // if (tempDef->GetParticleType()=="rhadron") - if (tempCust!=0) { + if (tempCust!=nullptr) { outgoingRhadron = tempDef; //Setting outgoing cloud definition outgoingCloud=tempCust->GetCloud(); - if(outgoingCloud == 0) { + if(outgoingCloud == nullptr) { G4cout << "FullModelHadronicProcess::PostStepDoIt Definition of outgoing particle cloud not available!" << G4endl; } /* @@ -192,7 +192,7 @@ G4VParticleChange* FullModelHadronicProcess::PostStepDoIt(const G4Track& aTrack, } if (tempDef==G4Proton::Proton()||tempDef==G4Neutron::Neutron()) outgoingTarget = tempDef; - if (tempCust==0&&rp.size()==2) outgoingTarget = tempDef; + if (tempCust==nullptr&&rp.size()==2) outgoingTarget = tempDef; if (tempDef->GetPDGEncoding()==theIncidentPDG) { IncidentSurvives = true; } else { @@ -200,7 +200,7 @@ G4VParticleChange* FullModelHadronicProcess::PostStepDoIt(const G4Track& aTrack, } } - if (outgoingTarget==0) outgoingTarget = theParticleTable->FindParticle(rp[1]); + if (outgoingTarget==nullptr) outgoingTarget = theParticleTable->FindParticle(rp[1]); // A little debug information /* @@ -444,7 +444,7 @@ G4VParticleChange* FullModelHadronicProcess::PostStepDoIt(const G4Track& aTrack, // Histogram filling const G4DynamicParticle* theRhadron = FindRhadron(&aParticleChange); - if (theRhadron!=NULL||IncidentSurvives) { + if (theRhadron!=nullptr||IncidentSurvives) { double E_new; if(IncidentSurvives) { E_new = e_kin; @@ -678,17 +678,17 @@ void FullModelHadronicProcess::Rotate(G4FastVectorGetNumberOfSecondaries(); - if (nsec==0) return 0; + if (nsec==0) return nullptr; int i = 0; G4bool found = false; while (i!=nsec && !found){ // G4cout<<"Checking "<GetSecondary(i)->GetDynamicParticle()->GetDefinition()->GetParticleName()<GetSecondary(i)->GetDynamicParticle()->GetDefinition()->GetParticleType()=="rhadron") found = true; - if (dynamic_cast(aParticleChange->GetSecondary(i)->GetDynamicParticle()->GetDefinition())!=0) found = true; + if (dynamic_cast(aParticleChange->GetSecondary(i)->GetDynamicParticle()->GetDefinition())!=nullptr) found = true; i++; } i--; if(found) return aParticleChange->GetSecondary(i)->GetDynamicParticle(); - return 0; + return nullptr; } diff --git a/SimG4Core/CustomPhysics/src/FullModelReactionDynamics.cc b/SimG4Core/CustomPhysics/src/FullModelReactionDynamics.cc index c6697cd665b50..3f3b6de8dab42 100644 --- a/SimG4Core/CustomPhysics/src/FullModelReactionDynamics.cc +++ b/SimG4Core/CustomPhysics/src/FullModelReactionDynamics.cc @@ -54,7 +54,7 @@ #include "Randomize.hh" #include #include "G4HadReentrentException.hh" -#include +#include #include "G4ParticleTable.hh" using namespace CLHEP; diff --git a/SimG4Core/CustomPhysics/src/G4ProcessHelper.cc b/SimG4Core/CustomPhysics/src/G4ProcessHelper.cc index d154c4988fb3a..dc7adea91a348 100644 --- a/SimG4Core/CustomPhysics/src/G4ProcessHelper.cc +++ b/SimG4Core/CustomPhysics/src/G4ProcessHelper.cc @@ -292,7 +292,7 @@ ReactionProduct G4ProcessHelper::GetFinalState(const G4Track& aTrack, G4Particle } // edm::LogInfo("SimG4CoreCustomPhysics")<<"The size of the ReactionProductList is: "<2 is 0.15*1/n_22 2->3 uses phase space diff --git a/SimG4Core/CustomPhysics/src/ToyModelHadronicProcess.cc b/SimG4Core/CustomPhysics/src/ToyModelHadronicProcess.cc index 4a910df83c4ca..5394dcb1a4f17 100644 --- a/SimG4Core/CustomPhysics/src/ToyModelHadronicProcess.cc +++ b/SimG4Core/CustomPhysics/src/ToyModelHadronicProcess.cc @@ -67,7 +67,7 @@ G4double ToyModelHadronicProcess::GetMeanFreePath(const G4Track& aTrack, G4doubl G4VParticleChange* ToyModelHadronicProcess::PostStepDoIt(const G4Track& track, const G4Step& /* step*/) { - const G4TouchableHandle thisTouchable(track.GetTouchableHandle()); + const G4TouchableHandle& thisTouchable(track.GetTouchableHandle()); // A little setting up G4ParticleTable* theParticleTable = G4ParticleTable::GetParticleTable(); @@ -75,7 +75,7 @@ G4VParticleChange* ToyModelHadronicProcess::PostStepDoIt(const G4Track& track, //This will contain RHadron Def + RHad momentum const G4DynamicParticle* incidentRHadron = track.GetDynamicParticle(); - const G4ThreeVector aPosition = track.GetPosition(); + const G4ThreeVector& aPosition = track.GetPosition(); CustomParticle* CustomIncident = dynamic_cast(incidentRHadron->GetDefinition()); @@ -83,7 +83,7 @@ G4VParticleChange* ToyModelHadronicProcess::PostStepDoIt(const G4Track& track, G4DynamicParticle* cloudParticle = new G4DynamicParticle(); //set cloud definition - if(CustomIncident==0) { + if(CustomIncident==nullptr) { G4cout << "ToyModelHadronicProcess::PostStepDoIt Definition of particle cloud not available!" << G4endl; } else { @@ -121,7 +121,7 @@ G4VParticleChange* ToyModelHadronicProcess::PostStepDoIt(const G4Track& track, << incidentParticle->Get4Momentum().m() / GeV < newParticles; // this will contain clouds std::vector newParticlesRHadron; // this will contain r-hadron @@ -139,7 +139,7 @@ G4VParticleChange* ToyModelHadronicProcess::PostStepDoIt(const G4Track& track, newParticlesRHadron.push_back(productDefinition); CustomParticle* cProd = dynamic_cast(productDefinition); - if( cProd!=0 && m_detachCloud) + if( cProd!=nullptr && m_detachCloud) productDefinition=cProd->GetCloud(); newParticles.push_back(productDefinition); diff --git a/SimG4Core/GFlash/interface/GFlash.h b/SimG4Core/GFlash/interface/GFlash.h index 8cad9cc9aa55f..31de7f02ee2fe 100644 --- a/SimG4Core/GFlash/interface/GFlash.h +++ b/SimG4Core/GFlash/interface/GFlash.h @@ -12,7 +12,7 @@ class GFlash : public PhysicsList { public: GFlash(G4LogicalVolumeToDDLogicalPartMap& map, const HepPDT::ParticleDataTable * table_, sim::ChordFinderSetter *chordFinderSetter_, const edm::ParameterSet & p); - virtual ~GFlash(); + ~GFlash() override; private: GflashHistogram* theHisto; diff --git a/SimG4Core/GFlash/interface/GflashEMShowerModel.h b/SimG4Core/GFlash/interface/GflashEMShowerModel.h index 993cf8e5123c8..3b3f7a1c984f6 100644 --- a/SimG4Core/GFlash/interface/GflashEMShowerModel.h +++ b/SimG4Core/GFlash/interface/GflashEMShowerModel.h @@ -31,11 +31,11 @@ class GflashEMShowerModel : public G4VFastSimulationModel { GflashEMShowerModel (const G4String& name, G4Envelope* env, const edm::ParameterSet& parSet); - virtual ~GflashEMShowerModel (); + ~GflashEMShowerModel () override; - G4bool ModelTrigger(const G4FastTrack &); - G4bool IsApplicable(const G4ParticleDefinition&); - void DoIt(const G4FastTrack&, G4FastStep&); + G4bool ModelTrigger(const G4FastTrack &) override; + G4bool IsApplicable(const G4ParticleDefinition&) override; + void DoIt(const G4FastTrack&, G4FastStep&) override; private: G4bool excludeDetectorRegion(const G4FastTrack& fastTrack); diff --git a/SimG4Core/GFlash/interface/GflashG4Watcher.h b/SimG4Core/GFlash/interface/GflashG4Watcher.h index 38e0ecb614405..e8f050af432e4 100644 --- a/SimG4Core/GFlash/interface/GflashG4Watcher.h +++ b/SimG4Core/GFlash/interface/GflashG4Watcher.h @@ -26,7 +26,7 @@ class GflashG4Watcher : public SimWatcher, public: GflashG4Watcher(const edm::ParameterSet& p); - ~GflashG4Watcher(); + ~GflashG4Watcher() override; private: @@ -37,9 +37,9 @@ class GflashG4Watcher : public SimWatcher, G4ThreeVector inc_direction; G4ThreeVector inc_position; - void update(const BeginOfEvent* ); - void update(const EndOfEvent* ); - void update(const G4Step* ); + void update(const BeginOfEvent* ) override; + void update(const EndOfEvent* ) override; + void update(const G4Step* ) override; // histograms for GflashG4Watcher diff --git a/SimG4Core/GFlash/interface/GflashHadronShowerModel.h b/SimG4Core/GFlash/interface/GflashHadronShowerModel.h index 4cf41db104f4f..a22f85cc4011a 100644 --- a/SimG4Core/GFlash/interface/GflashHadronShowerModel.h +++ b/SimG4Core/GFlash/interface/GflashHadronShowerModel.h @@ -23,15 +23,15 @@ class GflashHadronShowerModel : public G4VFastSimulationModel // Constructor, destructor //------------------------- GflashHadronShowerModel (G4String modelName, G4Region* envelope, const edm::ParameterSet& parSet); - ~GflashHadronShowerModel (); + ~GflashHadronShowerModel () override; //------------------------------------------------------------------------ // Virtual methods that should be implemented for this hadron shower model //------------------------------------------------------------------------ - G4bool IsApplicable(const G4ParticleDefinition&); - G4bool ModelTrigger(const G4FastTrack &); - void DoIt(const G4FastTrack&, G4FastStep&); + G4bool IsApplicable(const G4ParticleDefinition&) override; + G4bool ModelTrigger(const G4FastTrack &) override; + void DoIt(const G4FastTrack&, G4FastStep&) override; private: G4bool isFirstInelasticInteraction(const G4FastTrack& fastTrack); diff --git a/SimG4Core/GFlash/interface/GflashHadronWrapperProcess.h b/SimG4Core/GFlash/interface/GflashHadronWrapperProcess.h index 3120ea4b11064..19ecdced3c746 100644 --- a/SimG4Core/GFlash/interface/GflashHadronWrapperProcess.h +++ b/SimG4Core/GFlash/interface/GflashHadronWrapperProcess.h @@ -18,10 +18,10 @@ class GflashHadronWrapperProcess : public G4WrapperProcess { GflashHadronWrapperProcess(G4String processName); // GflashHadronWrapperProcess(); - virtual ~GflashHadronWrapperProcess(); + ~GflashHadronWrapperProcess() override; // Override PostStepDoIt method - G4VParticleChange* PostStepDoIt(const G4Track& track, const G4Step& step); + G4VParticleChange* PostStepDoIt(const G4Track& track, const G4Step& step) override; G4String GetName() { return theProcessName; }; diff --git a/SimG4Core/GFlash/interface/ParametrisedPhysics.h b/SimG4Core/GFlash/interface/ParametrisedPhysics.h index c32a5c86b2358..8ca17a4fc95f0 100644 --- a/SimG4Core/GFlash/interface/ParametrisedPhysics.h +++ b/SimG4Core/GFlash/interface/ParametrisedPhysics.h @@ -15,11 +15,11 @@ class ParametrisedPhysics : public G4VPhysicsConstructor { public: ParametrisedPhysics(std::string name, const edm::ParameterSet & p); - virtual ~ParametrisedPhysics(); + ~ParametrisedPhysics() override; protected: - virtual void ConstructParticle(); - virtual void ConstructProcess(); + void ConstructParticle() override; + void ConstructProcess() override; private: edm::ParameterSet theParSet; diff --git a/SimG4Core/GFlash/plugins/GflashG4Watcher.cc b/SimG4Core/GFlash/plugins/GflashG4Watcher.cc index 0831b3f990148..892d020af6a8d 100644 --- a/SimG4Core/GFlash/plugins/GflashG4Watcher.cc +++ b/SimG4Core/GFlash/plugins/GflashG4Watcher.cc @@ -87,7 +87,7 @@ void GflashG4Watcher::update(const EndOfEvent* g4Event){ } void GflashG4Watcher::update(const G4Step* aStep){ - if(aStep == NULL) return; + if(aStep == nullptr) return; double hitEnergy = aStep->GetTotalEnergyDeposit(); diff --git a/SimG4Core/GFlash/src/GflashEMShowerModel.cc b/SimG4Core/GFlash/src/GflashEMShowerModel.cc index 45519aeed1b47..2c6ef3050d98b 100644 --- a/SimG4Core/GFlash/src/GflashEMShowerModel.cc +++ b/SimG4Core/GFlash/src/GflashEMShowerModel.cc @@ -62,7 +62,7 @@ G4bool GflashEMShowerModel::ModelTrigger(const G4FastTrack & fastTrack ) { G4TouchableHistory* touch = (G4TouchableHistory*)(fastTrack.GetPrimaryTrack()->GetTouchable()); G4VPhysicalVolume* pCurrentVolume = touch->GetVolume(); - if( pCurrentVolume == 0) { return false; } + if( pCurrentVolume == nullptr) { return false; } G4LogicalVolume* lv = pCurrentVolume->GetLogicalVolume(); if(lv->GetRegion() != theRegion) { return false; } @@ -116,7 +116,7 @@ void GflashEMShowerModel::makeHits(const G4FastTrack& fastTrack) { // Copied from G4SteppingManager.cc G4VPhysicalVolume* aCurrentVolume = theGflashStep->GetPreStepPoint()->GetPhysicalVolume(); - if( aCurrentVolume == 0 ) continue; + if( aCurrentVolume == nullptr ) continue; G4LogicalVolume* lv = aCurrentVolume->GetLogicalVolume(); if(lv->GetRegion() != theRegion) continue; @@ -124,7 +124,7 @@ void GflashEMShowerModel::makeHits(const G4FastTrack& fastTrack) { theGflashStep->GetPreStepPoint()->SetSensitiveDetector(aCurrentVolume->GetLogicalVolume()->GetSensitiveDetector()); G4VSensitiveDetector* aSensitive = theGflashStep->GetPreStepPoint()->GetSensitiveDetector(); - if( aSensitive == 0 ) continue; + if( aSensitive == nullptr ) continue; theGflashStep->SetTotalEnergyDeposit(spotIter->getEnergy()); aSensitive->Hit(theGflashStep); diff --git a/SimG4Core/GFlash/src/GflashHadronShowerModel.cc b/SimG4Core/GFlash/src/GflashHadronShowerModel.cc index aa77b743d873c..3ce7120f94746 100644 --- a/SimG4Core/GFlash/src/GflashHadronShowerModel.cc +++ b/SimG4Core/GFlash/src/GflashHadronShowerModel.cc @@ -157,7 +157,7 @@ void GflashHadronShowerModel::makeHits(const G4FastTrack& fastTrack) { } G4VPhysicalVolume* aCurrentVolume = theGflashStep->GetPreStepPoint()->GetPhysicalVolume(); - if( aCurrentVolume == 0 ) continue; + if( aCurrentVolume == nullptr ) continue; G4LogicalVolume* lv = aCurrentVolume->GetLogicalVolume(); if(lv->GetRegion()->GetName() != "CaloRegion") continue; @@ -165,7 +165,7 @@ void GflashHadronShowerModel::makeHits(const G4FastTrack& fastTrack) { theGflashStep->GetPreStepPoint()->SetSensitiveDetector(aCurrentVolume->GetLogicalVolume()->GetSensitiveDetector()); G4VSensitiveDetector* aSensitive = theGflashStep->GetPreStepPoint()->GetSensitiveDetector(); - if( aSensitive == 0 ) continue; + if( aSensitive == nullptr ) continue; G4String nameCalor = aCurrentVolume->GetName(); nameCalor.assign(nameCalor,0,2); diff --git a/SimG4Core/GFlash/src/GflashHadronWrapperProcess.cc b/SimG4Core/GFlash/src/GflashHadronWrapperProcess.cc index 4c452f9b6f1ae..050e2e74cbf8a 100644 --- a/SimG4Core/GFlash/src/GflashHadronWrapperProcess.cc +++ b/SimG4Core/GFlash/src/GflashHadronWrapperProcess.cc @@ -13,10 +13,10 @@ using namespace CLHEP; GflashHadronWrapperProcess::GflashHadronWrapperProcess(G4String processName) : - particleChange(0), - pmanager(0), - fProcessVector(0), - fProcess(0) + particleChange(nullptr), + pmanager(nullptr), + fProcessVector(nullptr), + fProcess(nullptr) { theProcessName = processName; } diff --git a/SimG4Core/GFlash/src/ParametrisedPhysics.cc b/SimG4Core/GFlash/src/ParametrisedPhysics.cc index 0fe3a717fb39b..1cf43a49ed128 100644 --- a/SimG4Core/GFlash/src/ParametrisedPhysics.cc +++ b/SimG4Core/GFlash/src/ParametrisedPhysics.cc @@ -68,7 +68,7 @@ void ParametrisedPhysics::ConstructProcess() { for(const auto& particleName : emList.PartNames()) { G4ParticleDefinition* particle = table->FindParticle(particleName); G4ProcessManager * pmanager = particle->GetProcessManager(); - G4String pname = particle->GetParticleName(); + const G4String& pname = particle->GetParticleName(); if(pname == "e-" || pname == "e+") { pmanager->AddDiscreteProcess(tpdata->theFastSimulationManagerProcess); } diff --git a/SimG4Core/Generators/src/Generator.cc b/SimG4Core/Generators/src/Generator.cc index db80bd4bc71a9..63da3622ab0f7 100644 --- a/SimG4Core/Generators/src/Generator.cc +++ b/SimG4Core/Generators/src/Generator.cc @@ -60,7 +60,7 @@ Generator::Generator(const ParameterSet & p) : getParameter("PDGfilterSel"); pdgFilter = (p.getParameter("PDGselection")). getParameter >("PDGfilter"); - if(0 < pdgFilter.size()) { + if(!pdgFilter.empty()) { fPDGFilter = true; for ( unsigned int ii = 0; ii < pdgFilter.size(); ++ii) { if (pdgFilterSel) { @@ -108,7 +108,7 @@ void Generator::HepMC2G4(const HepMC::GenEvent * evt_orig, G4Event * g4evt) throw SimG4Exception("SimG4CoreGenerator: Corrupted Event - GenEvent with no vertex"); } - if (evt->weights().size() > 0) { + if (!evt->weights().empty()) { weight_ = evt->weights()[0] ; for (unsigned int iw=1; iwweights().size(); ++iw) { @@ -173,7 +173,7 @@ void Generator::HepMC2G4(const HepMC::GenEvent * evt_orig, G4Event * g4evt) // have the end_vertex with a radius greater than the radius of beampipe // cylinder (no requirement on the Z of the vertex is applyed). else if (status == 2) { - if ( (*pitr)->end_vertex() != 0 ) { + if ( (*pitr)->end_vertex() != nullptr ) { double xx = (*pitr)->end_vertex()->position().x(); double yy = (*pitr)->end_vertex()->position().y(); double r_dd = xx*xx+yy*yy; @@ -451,7 +451,7 @@ void Generator::particleAssignDaughters( G4PrimaryParticle* g4p, new G4PrimaryParticle((*vpdec)->pdg_id(), pdec.x()*GeV, pdec.y()*GeV, pdec.z()*GeV); - if ( g4daught->GetG4code() != 0 ) + if ( g4daught->GetG4code() != nullptr ) { g4daught->SetMass( g4daught->GetG4code()->GetPDGMass() ) ; g4daught->SetCharge( g4daught->GetG4code()->GetPDGCharge() ) ; @@ -557,7 +557,7 @@ void Generator::nonBeamEvent2G4(const HepMC::GenEvent * evt, G4Event * g4evt) new G4PrimaryParticle(g_id,gp->momentum().px()*GeV, gp->momentum().py()*GeV, gp->momentum().pz()*GeV); - if (g4p->GetG4code() != 0) { + if (g4p->GetG4code() != nullptr) { g4p->SetMass(g4p->GetG4code()->GetPDGMass()); g4p->SetCharge(g4p->GetG4code()->GetPDGCharge()); } diff --git a/SimG4Core/Geometry/src/DDDWorld.cc b/SimG4Core/Geometry/src/DDDWorld.cc index 2370db4a12983..413ca09354e23 100644 --- a/SimG4Core/Geometry/src/DDDWorld.cc +++ b/SimG4Core/Geometry/src/DDDWorld.cc @@ -20,7 +20,7 @@ DDDWorld::DDDWorld(const DDCompactView* cpv, DDGeometryReturnType ret = theBuilder->BuildGeometry(); G4LogicalVolume * world = ret.logicalVolume(); - m_world = new G4PVPlacement(0,G4ThreeVector(),world,"DDDWorld",0,false,0); + m_world = new G4PVPlacement(nullptr,G4ThreeVector(),world,"DDDWorld",nullptr,false,0); SetAsWorld(m_world); map = ret.lvToDDLPMap(); catalog = ret.sdCatalog(); diff --git a/SimG4Core/Geometry/src/DDG4Builder.cc b/SimG4Core/Geometry/src/DDG4Builder.cc index 145a36b0b9e49..9b8ba8a9aa6c1 100644 --- a/SimG4Core/Geometry/src/DDG4Builder.cc +++ b/SimG4Core/Geometry/src/DDG4Builder.cc @@ -25,7 +25,7 @@ #include "FWCore/MessageLogger/interface/MessageLogger.h" -DDG4DispContainer * DDG4Builder::theVectorOfDDG4Dispatchables_ = 0; +DDG4DispContainer * DDG4Builder::theVectorOfDDG4Dispatchables_ = nullptr; DDG4DispContainer * DDG4Builder::theVectorOfDDG4Dispatchables() { return theVectorOfDDG4Dispatchables_; @@ -67,7 +67,7 @@ G4VSolid * DDG4Builder::convertSolid(const DDSolid & solid) { G4Material * DDG4Builder::convertMaterial(const DDMaterial & material) { LogDebug("SimG4CoreGeometry") << "DDDetConstr::ConvertMaterial: material=" << material << "\n"; - G4Material * result = 0; + G4Material * result = nullptr; if (material) { // only if it's a valid DDD-material if ((result = mats_[material])) { @@ -124,7 +124,7 @@ DDGeometryReturnType DDG4Builder::BuildGeometry() { } G4LogicalVolume * g4LV = convertLV(ddLP); ++i; - if (git->size()) { + if (!git->empty()) { // ask for children of ddLP graph_type::edge_list::const_iterator cit = git->begin(); graph_type::edge_list::const_iterator cend = git->end(); @@ -233,7 +233,7 @@ double DDG4Builder::getDouble(const std::string & s, } double v; std::string unit; - std::istringstream is(temp[0].c_str()); + std::istringstream is(temp[0]); is >> v >> unit; v = v*G4UnitDefinition::GetValueOf(unit.substr(1,unit.size())); return v; diff --git a/SimG4Core/GeometryProducer/interface/GeometryProducer.h b/SimG4Core/GeometryProducer/interface/GeometryProducer.h index fc66ac605225e..2c26a9a685395 100644 --- a/SimG4Core/GeometryProducer/interface/GeometryProducer.h +++ b/SimG4Core/GeometryProducer/interface/GeometryProducer.h @@ -31,10 +31,10 @@ class GeometryProducer : public edm::one::EDProducer > Producers; explicit GeometryProducer(edm::ParameterSet const & p); - virtual ~GeometryProducer() override; - virtual void beginRun(const edm::Run & r,const edm::EventSetup& c) override; - virtual void endRun(const edm::Run & r,const edm::EventSetup& c) override; - virtual void produce(edm::Event & e, const edm::EventSetup & c) override; + ~GeometryProducer() override; + void beginRun(const edm::Run & r,const edm::EventSetup& c) override; + void endRun(const edm::Run & r,const edm::EventSetup& c) override; + void produce(edm::Event & e, const edm::EventSetup & c) override; void beginLuminosityBlock(edm::LuminosityBlock&, edm::EventSetup const&); std::vector > producers() const diff --git a/SimG4Core/GeometryProducer/src/GeometryProducer.cc b/SimG4Core/GeometryProducer/src/GeometryProducer.cc index ee54f89e2bcde..0fe5597fa4864 100644 --- a/SimG4Core/GeometryProducer/src/GeometryProducer.cc +++ b/SimG4Core/GeometryProducer/src/GeometryProducer.cc @@ -117,7 +117,7 @@ void GeometryProducer::produce(edm::Event & e, const edm::EventSetup & es) edm::LogInfo("GeometryProducer") << "Producing G4 Geom"; m_kernel = G4RunManagerKernel::GetRunManagerKernel(); - if (m_kernel==0) m_kernel = new G4RunManagerKernel(); + if (m_kernel==nullptr) m_kernel = new G4RunManagerKernel(); edm::LogInfo("GeometryProducer") << " GeometryProducer initializing "; // DDDWorld: get the DDCV from the ES and use it to build the World edm::ESTransientHandle pDD; @@ -135,7 +135,7 @@ void GeometryProducer::produce(edm::Event & e, const edm::EventSetup & es) edm::LogInfo("GeometryProducer") << " instantiating sensitive detectors "; // instantiate and attach the sensitive detectors m_trackManager = std::auto_ptr(new SimTrackManager); - if (m_attach==0) m_attach = new AttachSD; + if (m_attach==nullptr) m_attach = new AttachSD; { std::pair< std::vector, std::vector > diff --git a/SimG4Core/HelpfulWatchers/interface/MonopoleSteppingAction.h b/SimG4Core/HelpfulWatchers/interface/MonopoleSteppingAction.h index 09465d6369ecd..44d3a8527726f 100644 --- a/SimG4Core/HelpfulWatchers/interface/MonopoleSteppingAction.h +++ b/SimG4Core/HelpfulWatchers/interface/MonopoleSteppingAction.h @@ -19,11 +19,11 @@ class MonopoleSteppingAction : public SimWatcher, public Observer { public: MonopoleSteppingAction(edm::ParameterSet const & p); - ~MonopoleSteppingAction(); - void update(const BeginOfJob*); - void update(const BeginOfRun*); - void update(const BeginOfTrack*); - void update(const G4Step*); + ~MonopoleSteppingAction() override; + void update(const BeginOfJob*) override; + void update(const BeginOfRun*) override; + void update(const BeginOfTrack*) override; + void update(const G4Step*) override; private: bool mode, actOnTrack; diff --git a/SimG4Core/HelpfulWatchers/src/BeginOfTrackCounter.h b/SimG4Core/HelpfulWatchers/src/BeginOfTrackCounter.h index 4e4434cc175a6..f87f224ded447 100644 --- a/SimG4Core/HelpfulWatchers/src/BeginOfTrackCounter.h +++ b/SimG4Core/HelpfulWatchers/src/BeginOfTrackCounter.h @@ -45,14 +45,14 @@ namespace simwatcher { // ---------- static member functions -------------------- // ---------- member functions --------------------------- - void produce(edm::Event&, const edm::EventSetup&); + void produce(edm::Event&, const edm::EventSetup&) override; private: - BeginOfTrackCounter(const BeginOfTrackCounter&); // stop default + BeginOfTrackCounter(const BeginOfTrackCounter&) = delete; // stop default - const BeginOfTrackCounter& operator=(const BeginOfTrackCounter&); // stop default + const BeginOfTrackCounter& operator=(const BeginOfTrackCounter&) = delete; // stop default - void update(const BeginOfTrack*); + void update(const BeginOfTrack*) override; // ---------- member data -------------------------------- int m_count; std::string m_label; diff --git a/SimG4Core/HelpfulWatchers/src/G4StepStatistics.h b/SimG4Core/HelpfulWatchers/src/G4StepStatistics.h index 4c2030364c40e..b882d30adf593 100644 --- a/SimG4Core/HelpfulWatchers/src/G4StepStatistics.h +++ b/SimG4Core/HelpfulWatchers/src/G4StepStatistics.h @@ -161,7 +161,7 @@ UPDATE(BeginOfRun) //} UPDATE(BeginOfEvent) UPDATE(BeginOfTrack) - void update(const G4Step* iStep) { + void update(const G4Step* iStep) override { std::cout <<"++ signal G4Step " ; //Dump the relevant information from the G4 step in the object mysteptest StepID mysteptest(iStep); @@ -195,7 +195,7 @@ UPDATE(EndOfRun) //} //UPDATE(EndOfEvent) - void update(const EndOfEvent* iRun) { + void update(const EndOfEvent* iRun) override { std::cout <<"++ signal EndOfEvent " < 0) { + if (!pdgCode.empty()) { const G4Track * aTrack = (*trk)(); int code = aTrack->GetDefinition()->GetPDGEncoding(); if (std::count(pdgCode.begin(),pdgCode.end(),code) > 0) { @@ -107,7 +107,7 @@ void MonopoleSteppingAction::update(const G4Step* aStep) { pT = std::sqrt(pxStart*pxStart+pyStart*pyStart); pZ = pzStart; } else { - G4ThreeVector dirStep = aTrack->GetMomentumDirection(); + const G4ThreeVector& dirStep = aTrack->GetMomentumDirection(); double lStep = aTrack->GetStepLength(); double xStep = aTrack->GetPosition().x()-lStep*dirStep.x(); double yStep = aTrack->GetPosition().y()-lStep*dirStep.y(); diff --git a/SimG4Core/HelpfulWatchers/src/SimTracer.h b/SimG4Core/HelpfulWatchers/src/SimTracer.h index 42cecfcb47316..c01650a3f7377 100644 --- a/SimG4Core/HelpfulWatchers/src/SimTracer.h +++ b/SimG4Core/HelpfulWatchers/src/SimTracer.h @@ -69,11 +69,11 @@ UPDATE(BeginOfJob) UPDATE(BeginOfRun) UPDATE(BeginOfEvent) UPDATE(BeginOfTrack) - void update(const G4Step* iStep) { + void update(const G4Step* iStep) override { std::cout <<"++ signal G4Step " ; if(m_verbose) { const G4StepPoint* post = iStep->GetPostStepPoint(); - const G4ThreeVector pos = post->GetPosition(); + const G4ThreeVector& pos = post->GetPosition(); std::cout << "( "<GetPhysicalVolume()) { std::cout << post->GetPhysicalVolume()->GetName(); diff --git a/SimG4Core/KillSecondaries/interface/KillSecondariesRunAction.h b/SimG4Core/KillSecondaries/interface/KillSecondariesRunAction.h index 1abacc532c29e..5ed93dcd276dd 100644 --- a/SimG4Core/KillSecondaries/interface/KillSecondariesRunAction.h +++ b/SimG4Core/KillSecondaries/interface/KillSecondariesRunAction.h @@ -12,8 +12,8 @@ class KillSecondariesRunAction : public SimWatcher, { public: KillSecondariesRunAction(edm::ParameterSet const & p); - ~KillSecondariesRunAction(); - void update(const BeginOfRun * run); + ~KillSecondariesRunAction() override; + void update(const BeginOfRun * run) override; }; #endif diff --git a/SimG4Core/KillSecondaries/interface/KillSecondariesStackingAction.h b/SimG4Core/KillSecondaries/interface/KillSecondariesStackingAction.h index 41e977ddcc8f4..d23d94a415825 100644 --- a/SimG4Core/KillSecondaries/interface/KillSecondariesStackingAction.h +++ b/SimG4Core/KillSecondaries/interface/KillSecondariesStackingAction.h @@ -9,8 +9,8 @@ class KillSecondariesStackingAction : public G4UserStackingAction { public: KillSecondariesStackingAction() {} - ~KillSecondariesStackingAction() {} - virtual G4ClassificationOfNewTrack ClassifyNewTrack(const G4Track *); + ~KillSecondariesStackingAction() override {} + G4ClassificationOfNewTrack ClassifyNewTrack(const G4Track *) override; }; #endif diff --git a/SimG4Core/KillSecondaries/interface/KillSecondariesTrackAction.h b/SimG4Core/KillSecondaries/interface/KillSecondariesTrackAction.h index 61ff41b217a22..641c20dec2b1c 100644 --- a/SimG4Core/KillSecondaries/interface/KillSecondariesTrackAction.h +++ b/SimG4Core/KillSecondaries/interface/KillSecondariesTrackAction.h @@ -12,8 +12,8 @@ class KillSecondariesTrackAction : public SimWatcher, public: KillSecondariesTrackAction(edm::ParameterSet const & p); - ~KillSecondariesTrackAction(); - void update(const BeginOfTrack * trk); + ~KillSecondariesTrackAction() override; + void update(const BeginOfTrack * trk) override; private: bool killHeavy; diff --git a/SimG4Core/KillSecondaries/src/KillSecondariesStackingAction.cc b/SimG4Core/KillSecondaries/src/KillSecondariesStackingAction.cc index 2e8e76e1ecd9b..994fb2e5106d9 100644 --- a/SimG4Core/KillSecondaries/src/KillSecondariesStackingAction.cc +++ b/SimG4Core/KillSecondaries/src/KillSecondariesStackingAction.cc @@ -7,7 +7,7 @@ G4ClassificationOfNewTrack KillSecondariesStackingAction::ClassifyNewTrack(const G4Track * aTrack) { NewTrackAction newTA; - if (aTrack->GetCreatorProcess()==0 || aTrack->GetParentID()==0) { + if (aTrack->GetCreatorProcess()==nullptr || aTrack->GetParentID()==0) { newTA.primary(aTrack); return fUrgent; } else { diff --git a/SimG4Core/MagneticField/interface/CMSFieldManager.h b/SimG4Core/MagneticField/interface/CMSFieldManager.h index b965b301524a4..9fa6b6d17eb9a 100644 --- a/SimG4Core/MagneticField/interface/CMSFieldManager.h +++ b/SimG4Core/MagneticField/interface/CMSFieldManager.h @@ -20,9 +20,9 @@ class CMSFieldManager : public G4FieldManager explicit CMSFieldManager(); - virtual ~CMSFieldManager(); + ~CMSFieldManager() override; - virtual void ConfigureForTrack(const G4Track*); + void ConfigureForTrack(const G4Track*) override; void InitialiseForVolume(const edm::ParameterSet&, sim::Field*, G4ChordFinder*, G4ChordFinder*, const std::string& vol, const std::string& type, @@ -32,8 +32,8 @@ class CMSFieldManager : public G4FieldManager private: - CMSFieldManager(const CMSFieldManager&); - CMSFieldManager& operator=(const CMSFieldManager&); + CMSFieldManager(const CMSFieldManager&) = delete; + CMSFieldManager& operator=(const CMSFieldManager&) = delete; std::unique_ptr theField; diff --git a/SimG4Core/MagneticField/interface/Field.h b/SimG4Core/MagneticField/interface/Field.h index 05a507371e038..a35c308f95732 100644 --- a/SimG4Core/MagneticField/interface/Field.h +++ b/SimG4Core/MagneticField/interface/Field.h @@ -10,8 +10,8 @@ namespace sim { { public: Field(const MagneticField * f, double d); - virtual ~Field(); - virtual void GetFieldValue(const G4double p[4], G4double b[3]) const; + ~Field() override; + void GetFieldValue(const G4double p[4], G4double b[3]) const override; private: const MagneticField* theCMSMagneticField; diff --git a/SimG4Core/MagneticField/interface/FieldStepper.h b/SimG4Core/MagneticField/interface/FieldStepper.h index 68caa0aa643ab..38be2088bac1b 100644 --- a/SimG4Core/MagneticField/interface/FieldStepper.h +++ b/SimG4Core/MagneticField/interface/FieldStepper.h @@ -10,11 +10,11 @@ namespace sim { { public: FieldStepper(G4Mag_UsualEqRhs * eq, double del = 0.0); - ~FieldStepper(); - virtual void Stepper(const double y[],const double dydx[],double h, - double yout[],double yerr[]); - virtual double DistChord() const; - virtual int IntegratorOrder() const; + ~FieldStepper() override; + void Stepper(const double y[],const double dydx[],double h, + double yout[],double yerr[]) override; + double DistChord() const override; + int IntegratorOrder() const override; G4MagIntegratorStepper * select(const std::string & s); private: G4MagIntegratorStepper * theStepper; diff --git a/SimG4Core/MagneticField/interface/G4MonopoleEquation.hh b/SimG4Core/MagneticField/interface/G4MonopoleEquation.hh index 78c444ed70d48..d2ecbd821da4a 100644 --- a/SimG4Core/MagneticField/interface/G4MonopoleEquation.hh +++ b/SimG4Core/MagneticField/interface/G4MonopoleEquation.hh @@ -57,16 +57,16 @@ public: // with description G4MonopoleEquation(G4ElectroMagneticField *emField ); - ~G4MonopoleEquation(); + ~G4MonopoleEquation() override; - virtual void SetChargeMomentumMass( G4ChargeState particleChargeState, + void SetChargeMomentumMass( G4ChargeState particleChargeState, G4double momentum, - G4double mass); + G4double mass) override; // magnetic charge in e+ units - virtual void EvaluateRhsGivenB(const G4double y[], + void EvaluateRhsGivenB(const G4double y[], const G4double Field[], - G4double dydx[] ) const; + G4double dydx[] ) const override; // Given the value of the electromagnetic field, this function // calculates the value of the derivative dydx. diff --git a/SimG4Core/MagneticField/interface/LocalFieldManager.h b/SimG4Core/MagneticField/interface/LocalFieldManager.h index b62b6e7e2642d..99c7bf79039e5 100644 --- a/SimG4Core/MagneticField/interface/LocalFieldManager.h +++ b/SimG4Core/MagneticField/interface/LocalFieldManager.h @@ -10,11 +10,11 @@ namespace sim { public: // ctor & dtor LocalFieldManager() : G4FieldManager() {} - virtual ~LocalFieldManager() {} + ~LocalFieldManager() override {} LocalFieldManager(G4Field* commonField, G4FieldManager* priFM, G4FieldManager* altFM); - virtual void ConfigureForTrack(const G4Track* trk); + void ConfigureForTrack(const G4Track* trk) override; void SetVerbosity(bool flag) { fVerbosity=flag; return; } protected: // diff --git a/SimG4Core/MagneticField/src/LocalFieldManager.cc b/SimG4Core/MagneticField/src/LocalFieldManager.cc index 309bcfca7bb0d..b578ebc395937 100644 --- a/SimG4Core/MagneticField/src/LocalFieldManager.cc +++ b/SimG4Core/MagneticField/src/LocalFieldManager.cc @@ -14,9 +14,9 @@ using namespace sim; LocalFieldManager::LocalFieldManager(G4Field* commonField, G4FieldManager* priFM, G4FieldManager* altFM) - : G4FieldManager(commonField,0,false), + : G4FieldManager(commonField,nullptr,false), fPrimaryFM(priFM), fAlternativeFM(altFM), - fCurrentFM(0), + fCurrentFM(nullptr), fVerbosity(false) { this->CopyValuesAndChordFinder(priFM); diff --git a/SimG4Core/MagneticField/test/FieldStepWatcher.cc b/SimG4Core/MagneticField/test/FieldStepWatcher.cc index 7cf2bcc921f95..8d888ee798527 100644 --- a/SimG4Core/MagneticField/test/FieldStepWatcher.cc +++ b/SimG4Core/MagneticField/test/FieldStepWatcher.cc @@ -22,7 +22,7 @@ FieldStepWatcher::FieldStepWatcher(const edm::ParameterSet &p) { } FieldStepWatcher::~FieldStepWatcher() { - if (dbe_ && outFile.size() > 0) dbe_->save(outFile); + if (dbe_ && !outFile.empty()) dbe_->save(outFile); } @@ -179,7 +179,7 @@ void FieldStepWatcher::findTouch(G4VPhysicalVolume * pv, int leafDepth) { LogDebug("FieldStepWatcher") << "FieldStepWatcher::find Touch " << lv->GetName() << " at level " << leafDepth; if (leafDepth == level-1) { - std::string lvname = lv->GetName(); + const std::string& lvname = lv->GetName(); if (findName(lvname) < 0) lvnames.push_back(lvname); } else if (leafDepth < level-1) { int noDaughters = lv->GetNoDaughters(); diff --git a/SimG4Core/MagneticField/test/FieldStepWatcher.h b/SimG4Core/MagneticField/test/FieldStepWatcher.h index 2f809d2de3ce1..25aa38318f3f5 100644 --- a/SimG4Core/MagneticField/test/FieldStepWatcher.h +++ b/SimG4Core/MagneticField/test/FieldStepWatcher.h @@ -29,12 +29,12 @@ class FieldStepWatcher : public SimWatcher, public: FieldStepWatcher(edm::ParameterSet const & p); - ~FieldStepWatcher(); + ~FieldStepWatcher() override; private: - void update(const BeginOfRun * ); - void update(const BeginOfEvent * ); - void update(const EndOfEvent * ); - void update(const G4Step * ); + void update(const BeginOfRun * ) override; + void update(const BeginOfEvent * ) override; + void update(const EndOfEvent * ) override; + void update(const G4Step * ) override; void findTouch(G4VPhysicalVolume * , int ); int findName(std::string); private: diff --git a/SimG4Core/Notification/interface/GenParticleInfo.h b/SimG4Core/Notification/interface/GenParticleInfo.h index 7dbbe17d1609f..d32d0399b1356 100644 --- a/SimG4Core/Notification/interface/GenParticleInfo.h +++ b/SimG4Core/Notification/interface/GenParticleInfo.h @@ -8,7 +8,7 @@ class GenParticleInfo : public G4VUserPrimaryParticleInformation public: explicit GenParticleInfo(int id) : id_(id) {} int id() const { return id_; } - virtual void Print() const {} + void Print() const override {} private: int id_; }; diff --git a/SimG4Core/Notification/interface/Signaler.h b/SimG4Core/Notification/interface/Signaler.h index dcbe3cae83496..d24e588c66c36 100644 --- a/SimG4Core/Notification/interface/Signaler.h +++ b/SimG4Core/Notification/interface/Signaler.h @@ -39,7 +39,7 @@ namespace sim_act { public: typedef Observer* slot_type; Signaler() {} - virtual ~Signaler() {} + ~Signaler() override {} // ---------- const member functions --------------------- void operator()(const T* iSignal) const { @@ -66,11 +66,11 @@ namespace sim_act { } private: - Signaler(const Signaler&); // stop default + Signaler(const Signaler&) = delete; // stop default - const Signaler& operator=(const Signaler&); // stop default + const Signaler& operator=(const Signaler&) = delete; // stop default - void update(const T* iData) { + void update(const T* iData) override { this->operator()(iData); } // ---------- member data -------------------------------- diff --git a/SimG4Core/Notification/interface/SimActivityRegistry.h b/SimG4Core/Notification/interface/SimActivityRegistry.h index bb3e98233ca08..0ab301610ef79 100644 --- a/SimG4Core/Notification/interface/SimActivityRegistry.h +++ b/SimG4Core/Notification/interface/SimActivityRegistry.h @@ -114,9 +114,9 @@ class SimActivityRegistry void connect(SimActivityRegistry& iOther); private: - SimActivityRegistry(const SimActivityRegistry&); // stop default + SimActivityRegistry(const SimActivityRegistry&) = delete; // stop default - const SimActivityRegistry& operator=(const SimActivityRegistry&); // stop default + const SimActivityRegistry& operator=(const SimActivityRegistry&) = delete; // stop default // ---------- member data -------------------------------- diff --git a/SimG4Core/Notification/interface/SimActivityRegistryEnroller.h b/SimG4Core/Notification/interface/SimActivityRegistryEnroller.h index 10ad784a8dcb7..9dae53f68a6a7 100644 --- a/SimG4Core/Notification/interface/SimActivityRegistryEnroller.h +++ b/SimG4Core/Notification/interface/SimActivityRegistryEnroller.h @@ -87,9 +87,9 @@ class SimActivityRegistryEnroller // ---------- member functions --------------------------- private: - SimActivityRegistryEnroller(const SimActivityRegistryEnroller&); // stop default + SimActivityRegistryEnroller(const SimActivityRegistryEnroller&) = delete; // stop default - const SimActivityRegistryEnroller& operator=(const SimActivityRegistryEnroller&); // stop default + const SimActivityRegistryEnroller& operator=(const SimActivityRegistryEnroller&) = delete; // stop default // ---------- member data -------------------------------- diff --git a/SimG4Core/Notification/interface/SimG4Exception.h b/SimG4Core/Notification/interface/SimG4Exception.h index 0e35460dd82f0..bc37844a9cc2e 100644 --- a/SimG4Core/Notification/interface/SimG4Exception.h +++ b/SimG4Core/Notification/interface/SimG4Exception.h @@ -14,8 +14,8 @@ class SimG4Exception : public std::exception { public: SimG4Exception(const std::string & message) : error_(message) {} - virtual ~SimG4Exception() throw() {} - virtual const char * what () const throw() { return error_.c_str(); } + ~SimG4Exception() throw() override {} + const char * what () const throw() override { return error_.c_str(); } private: std::string error_; }; diff --git a/SimG4Core/Notification/interface/TrackInformation.h b/SimG4Core/Notification/interface/TrackInformation.h index 0caaf38a12213..5aa44613016f3 100644 --- a/SimG4Core/Notification/interface/TrackInformation.h +++ b/SimG4Core/Notification/interface/TrackInformation.h @@ -8,7 +8,7 @@ class TrackInformation : public G4VUserTrackInformation { public: - virtual ~TrackInformation() {} + ~TrackInformation() override {} inline void * operator new(size_t); inline void operator delete(void * TrackInformation); @@ -58,7 +58,7 @@ class TrackInformation : public G4VUserTrackInformation { void setCastorHitPID(const int pid) { hasCastorHit_=true; castorHitPID_ = pid; } int getCastorHitPID() const { return castorHitPID_; } - virtual void Print() const; + void Print() const override; private: bool storeTrack_; bool isPrimary_; diff --git a/SimG4Core/Notification/src/CMSSteppingVerbose.cc b/SimG4Core/Notification/src/CMSSteppingVerbose.cc index 7e0e6a591ca53..f447c1aa6bcec 100644 --- a/SimG4Core/Notification/src/CMSSteppingVerbose.cc +++ b/SimG4Core/Notification/src/CMSSteppingVerbose.cc @@ -262,13 +262,13 @@ void CMSSteppingVerbose::NextStep(const G4Step* step, G4cout << G4endl; G4cout << " Process defined Step: " ; - if( preStep->GetProcessDefinedStep() == 0 ){ + if( preStep->GetProcessDefinedStep() == nullptr ){ G4cout << std::setw(30) << "Undefined"; } else { G4cout << std::setw(30) << preStep->GetProcessDefinedStep()->GetProcessName(); } - if( postStep->GetProcessDefinedStep() == 0){ + if( postStep->GetProcessDefinedStep() == nullptr){ G4cout << std::setw(30) << "Undefined"; } else { G4cout << std::setw(30) diff --git a/SimG4Core/Notification/src/CurrentG4Track.cc b/SimG4Core/Notification/src/CurrentG4Track.cc index 2a0b7dac90c35..29495fd262584 100644 --- a/SimG4Core/Notification/src/CurrentG4Track.cc +++ b/SimG4Core/Notification/src/CurrentG4Track.cc @@ -1,6 +1,6 @@ #include "SimG4Core/Notification/interface/CurrentG4Track.h" -thread_local const G4Track * CurrentG4Track::m_track = 0; +thread_local const G4Track * CurrentG4Track::m_track = nullptr; void CurrentG4Track::setTrack(const G4Track * t) { diff --git a/SimG4Core/Notification/src/TrackInformation.cc b/SimG4Core/Notification/src/TrackInformation.cc index 7f0b63339ec60..12c46aba4a044 100644 --- a/SimG4Core/Notification/src/TrackInformation.cc +++ b/SimG4Core/Notification/src/TrackInformation.cc @@ -3,7 +3,7 @@ #include -G4ThreadLocal G4Allocator *fpTrackInformationAllocator = 0; +G4ThreadLocal G4Allocator *fpTrackInformationAllocator = nullptr; void TrackInformation::Print() const { LogDebug("TrackInformation") << " TrackInformation : storeTrack = " << storeTrack_ << "\n" diff --git a/SimG4Core/Notification/src/TrackInformationExtractor.cc b/SimG4Core/Notification/src/TrackInformationExtractor.cc index 324b1bd638249..9c86f9a825d3f 100644 --- a/SimG4Core/Notification/src/TrackInformationExtractor.cc +++ b/SimG4Core/Notification/src/TrackInformationExtractor.cc @@ -6,9 +6,9 @@ const TrackInformation & TrackInformationExtractor::operator()(const G4Track & gtk) const { G4VUserTrackInformation * gui = gtk.GetUserInformation(); - if (gui == 0) missing(gtk); + if (gui == nullptr) missing(gtk); const TrackInformation * tkInfo = dynamic_cast(gui); - if (tkInfo == 0) wrongType(); + if (tkInfo == nullptr) wrongType(); return * tkInfo; } @@ -16,9 +16,9 @@ TrackInformation & TrackInformationExtractor::operator()(G4Track & gtk) const { G4VUserTrackInformation * gui = gtk.GetUserInformation(); - if (gui == 0) missing(gtk); + if (gui == nullptr) missing(gtk); TrackInformation * tkInfo = dynamic_cast(gui); - if (tkInfo == 0) wrongType(); + if (tkInfo == nullptr) wrongType(); return * tkInfo; } diff --git a/SimG4Core/Notification/src/TrackWithHistory.cc b/SimG4Core/Notification/src/TrackWithHistory.cc index f19f805ed8bb1..a5616a9e2a51f 100644 --- a/SimG4Core/Notification/src/TrackWithHistory.cc +++ b/SimG4Core/Notification/src/TrackWithHistory.cc @@ -10,17 +10,17 @@ #include -G4ThreadLocal G4Allocator *fpTrackWithHistoryAllocator = 0; +G4ThreadLocal G4Allocator *fpTrackWithHistoryAllocator = nullptr; //#define DEBUG TrackWithHistory::TrackWithHistory(const G4Track * g4trk) : trackID_(0),particleID_(0),parentID_(0),momentum_(math::XYZVectorD(0.,0.,0.)), totalEnergy_(0),vertexPosition_(math::XYZVectorD(0.,0.,0.)),globalTime_(0), - localTime_(0),properTime_(0),creatorProcess_(0),weight_(0), + localTime_(0),properTime_(0),creatorProcess_(nullptr),weight_(0), storeTrack_(false),saved_(false) { - if (g4trk!=0) { + if (g4trk!=nullptr) { TrackInformationExtractor extractor; trackID_ = g4trk->GetTrackID(); particleID_ = G4TrackToParticleID::particleID(g4trk); @@ -70,7 +70,7 @@ void TrackWithHistory::checkAtEnd(const G4Track * gt) { int TrackWithHistory::extractGenID(const G4Track* gt) const { void * vgprimary = gt->GetDynamicParticle()->GetPrimaryParticle(); - if (vgprimary == 0) return -1; + if (vgprimary == nullptr) return -1; // replace old-style cast with appropriate new-style cast... G4PrimaryParticle* gprimary = (G4PrimaryParticle*) vgprimary; GenParticleInfoExtractor ext; diff --git a/SimG4Core/Notification/test/simactivityregistry_t.cppunit.cpp b/SimG4Core/Notification/test/simactivityregistry_t.cppunit.cpp index d2263ec8d7f1e..397d2b794e556 100644 --- a/SimG4Core/Notification/test/simactivityregistry_t.cppunit.cpp +++ b/SimG4Core/Notification/test/simactivityregistry_t.cppunit.cpp @@ -23,8 +23,8 @@ class testSimActivityRegistry: public CppUnit::TestFixture CPPUNIT_TEST_SUITE_END(); public: - void setUp(){} - void tearDown(){} + void setUp() override{} + void tearDown() override{} void signalTest(); void signalForwardingTest(); @@ -38,7 +38,7 @@ namespace { template struct MyObserver : public Observer { mutable bool saw_; MyObserver() : saw_(false) {} - void update(const T*) { + void update(const T*) override { saw_=true; } }; @@ -101,7 +101,7 @@ namespace { template struct Counting : public Observer { int& count_; Counting(int& iCount) : count_(iCount) {} - void update(const T*) { + void update(const T*) override { ++count_; } }; @@ -141,10 +141,10 @@ testSimActivityRegistry::enrollerTest() TwoSignals twoSignals(int2Signals); enroller.enroll(registry, &twoSignals); - const BeginOfEvent* pBegin=0; + const BeginOfEvent* pBegin=nullptr; registry.beginOfEventSignal_(pBegin); - const EndOfEvent* pEnd=0; + const EndOfEvent* pEnd=nullptr; registry.endOfEventSignal_(pEnd); CPPUNIT_ASSERT(1==int1Signal); diff --git a/SimG4Core/Physics/interface/G4Monopole.hh b/SimG4Core/Physics/interface/G4Monopole.hh index d564a0d87492b..43786dd4df952 100644 --- a/SimG4Core/Physics/interface/G4Monopole.hh +++ b/SimG4Core/Physics/interface/G4Monopole.hh @@ -20,7 +20,7 @@ public: private: - virtual ~G4Monopole(); + ~G4Monopole() override; private: diff --git a/SimG4Core/Physics/interface/PhysicsList.h b/SimG4Core/Physics/interface/PhysicsList.h index e878280ab6d4d..66e837e9695ec 100644 --- a/SimG4Core/Physics/interface/PhysicsList.h +++ b/SimG4Core/Physics/interface/PhysicsList.h @@ -18,8 +18,8 @@ class PhysicsList : public G4VModularPhysicsList { const HepPDT::ParticleDataTable * table_, sim::ChordFinderSetter *chordFinderSetter_, const edm::ParameterSet & p); - virtual ~PhysicsList(); - virtual void SetCuts(); + ~PhysicsList() override; + void SetCuts() override; }; diff --git a/SimG4Core/Physics/interface/PhysicsListMaker.h b/SimG4Core/Physics/interface/PhysicsListMaker.h index babbb8ef07ad8..e1717660e4044 100644 --- a/SimG4Core/Physics/interface/PhysicsListMaker.h +++ b/SimG4Core/Physics/interface/PhysicsListMaker.h @@ -35,11 +35,11 @@ class PhysicsListMaker : public PhysicsListMakerBase PhysicsListMaker(){} // ---------- const member functions --------------------- - virtual std::unique_ptr make(G4LogicalVolumeToDDLogicalPartMap& map_, + std::unique_ptr make(G4LogicalVolumeToDDLogicalPartMap& map_, const HepPDT::ParticleDataTable * table_, sim::ChordFinderSetter * chordFinderSetter_, const edm::ParameterSet& p, - SimActivityRegistry& reg) const + SimActivityRegistry& reg) const override { std::unique_ptr returnValue(new T(map_, table_, chordFinderSetter_, p)); SimActivityRegistryEnroller::enroll(reg, returnValue.get()); diff --git a/SimG4Core/Physics/src/G4Monopole.cc b/SimG4Core/Physics/src/G4Monopole.cc index 99d9a2be5b328..d076186010fe2 100644 --- a/SimG4Core/Physics/src/G4Monopole.cc +++ b/SimG4Core/Physics/src/G4Monopole.cc @@ -6,7 +6,7 @@ G4Monopole::G4Monopole(const G4String aName, G4int pdgEncoding, G4double mass, G4int mCharge, G4int eCharge) : G4ParticleDefinition(aName, mass, 0.0*MeV, eplus*eCharge, 0, 0, 0, - 0, 0, 0, "boson", 0, 0, pdgEncoding, true, -1.0, 0) { + 0, 0, 0, "boson", 0, 0, pdgEncoding, true, -1.0, nullptr) { magCharge = eplus * G4double(mCharge) / fine_structure_const * 0.5; diff --git a/SimG4Core/PhysicsLists/interface/CMSEmStandardPhysics.h b/SimG4Core/PhysicsLists/interface/CMSEmStandardPhysics.h index 306e8fa6449ae..9dcff3931057a 100644 --- a/SimG4Core/PhysicsLists/interface/CMSEmStandardPhysics.h +++ b/SimG4Core/PhysicsLists/interface/CMSEmStandardPhysics.h @@ -8,10 +8,10 @@ class CMSEmStandardPhysics : public G4VPhysicsConstructor { public: CMSEmStandardPhysics(G4int ver); - virtual ~CMSEmStandardPhysics(); + ~CMSEmStandardPhysics() override; - virtual void ConstructParticle(); - virtual void ConstructProcess(); + void ConstructParticle() override; + void ConstructProcess() override; private: G4int verbose; diff --git a/SimG4Core/PhysicsLists/interface/CMSEmStandardPhysicsLPM.h b/SimG4Core/PhysicsLists/interface/CMSEmStandardPhysicsLPM.h index 164caff274003..3727ece2b7c9d 100644 --- a/SimG4Core/PhysicsLists/interface/CMSEmStandardPhysicsLPM.h +++ b/SimG4Core/PhysicsLists/interface/CMSEmStandardPhysicsLPM.h @@ -9,10 +9,10 @@ class CMSEmStandardPhysicsLPM : public G4VPhysicsConstructor { public: CMSEmStandardPhysicsLPM(G4int ver); - virtual ~CMSEmStandardPhysicsLPM(); + ~CMSEmStandardPhysicsLPM() override; - virtual void ConstructParticle(); - virtual void ConstructProcess(); + void ConstructParticle() override; + void ConstructProcess() override; private: G4int verbose; diff --git a/SimG4Core/PhysicsLists/interface/CMSEmStandardPhysicsXS.h b/SimG4Core/PhysicsLists/interface/CMSEmStandardPhysicsXS.h index 55996878ddab8..ffa75285c61c1 100644 --- a/SimG4Core/PhysicsLists/interface/CMSEmStandardPhysicsXS.h +++ b/SimG4Core/PhysicsLists/interface/CMSEmStandardPhysicsXS.h @@ -8,10 +8,10 @@ class CMSEmStandardPhysicsXS : public G4VPhysicsConstructor { public: CMSEmStandardPhysicsXS(G4int ver); - virtual ~CMSEmStandardPhysicsXS(); + ~CMSEmStandardPhysicsXS() override; - virtual void ConstructParticle(); - virtual void ConstructProcess(); + void ConstructParticle() override; + void ConstructProcess() override; private: G4int verbose; diff --git a/SimG4Core/PhysicsLists/interface/CMSFTFPNeutronBuilder.hh b/SimG4Core/PhysicsLists/interface/CMSFTFPNeutronBuilder.hh index ee67a3462a93d..d2b4d6aa60587 100644 --- a/SimG4Core/PhysicsLists/interface/CMSFTFPNeutronBuilder.hh +++ b/SimG4Core/PhysicsLists/interface/CMSFTFPNeutronBuilder.hh @@ -22,13 +22,13 @@ class CMSFTFPNeutronBuilder : public G4VNeutronBuilder { public: CMSFTFPNeutronBuilder(G4bool quasiElastic=false); - virtual ~CMSFTFPNeutronBuilder(); + ~CMSFTFPNeutronBuilder() override; public: - virtual void Build(G4HadronElasticProcess * aP); - virtual void Build(G4HadronFissionProcess * aP); - virtual void Build(G4HadronCaptureProcess * aP); - virtual void Build(G4NeutronInelasticProcess * aP); + void Build(G4HadronElasticProcess * aP) override; + void Build(G4HadronFissionProcess * aP) override; + void Build(G4HadronCaptureProcess * aP) override; + void Build(G4NeutronInelasticProcess * aP) override; void SetMinEnergy(G4double aM) {theMin = aM;} void SetMaxEnergy(G4double aM) {theMax = aM;} diff --git a/SimG4Core/PhysicsLists/interface/CMSFTFPPiKBuilder.hh b/SimG4Core/PhysicsLists/interface/CMSFTFPPiKBuilder.hh index 294517d7951cb..75fc9546fd36d 100644 --- a/SimG4Core/PhysicsLists/interface/CMSFTFPPiKBuilder.hh +++ b/SimG4Core/PhysicsLists/interface/CMSFTFPPiKBuilder.hh @@ -24,16 +24,16 @@ class CMSFTFPPiKBuilder : public G4VPiKBuilder { public: CMSFTFPPiKBuilder(G4bool quasiElastic=false); - virtual ~CMSFTFPPiKBuilder(); + ~CMSFTFPPiKBuilder() override; public: - virtual void Build(G4HadronElasticProcess * aP); - virtual void Build(G4PionPlusInelasticProcess * aP); - virtual void Build(G4PionMinusInelasticProcess * aP); - virtual void Build(G4KaonPlusInelasticProcess * aP); - virtual void Build(G4KaonMinusInelasticProcess * aP); - virtual void Build(G4KaonZeroLInelasticProcess * aP); - virtual void Build(G4KaonZeroSInelasticProcess * aP); + void Build(G4HadronElasticProcess * aP) override; + void Build(G4PionPlusInelasticProcess * aP) override; + void Build(G4PionMinusInelasticProcess * aP) override; + void Build(G4KaonPlusInelasticProcess * aP) override; + void Build(G4KaonMinusInelasticProcess * aP) override; + void Build(G4KaonZeroLInelasticProcess * aP) override; + void Build(G4KaonZeroSInelasticProcess * aP) override; void SetMinEnergy(G4double aM) {theMin = aM;} void SetMaxEnergy(G4double aM) {theMax = aM;} diff --git a/SimG4Core/PhysicsLists/interface/CMSFTFPProtonBuilder.hh b/SimG4Core/PhysicsLists/interface/CMSFTFPProtonBuilder.hh index 799532f971e1b..a55cd383c3440 100644 --- a/SimG4Core/PhysicsLists/interface/CMSFTFPProtonBuilder.hh +++ b/SimG4Core/PhysicsLists/interface/CMSFTFPProtonBuilder.hh @@ -22,11 +22,11 @@ class CMSFTFPProtonBuilder : public G4VProtonBuilder { public: CMSFTFPProtonBuilder(G4bool quasiElastic=false); - virtual ~CMSFTFPProtonBuilder(); + ~CMSFTFPProtonBuilder() override; public: - virtual void Build(G4HadronElasticProcess * aP); - virtual void Build(G4ProtonInelasticProcess * aP); + void Build(G4HadronElasticProcess * aP) override; + void Build(G4ProtonInelasticProcess * aP) override; void SetMinEnergy(G4double aM) {theMin = aM;} void SetMaxEnergy(G4double aM) {theMax = aM;} diff --git a/SimG4Core/PhysicsLists/interface/HadronPhysicsQGSPCMS_FTFP_BERT.h b/SimG4Core/PhysicsLists/interface/HadronPhysicsQGSPCMS_FTFP_BERT.h index 040c2a3b1d323..098d9ddd5caf5 100644 --- a/SimG4Core/PhysicsLists/interface/HadronPhysicsQGSPCMS_FTFP_BERT.h +++ b/SimG4Core/PhysicsLists/interface/HadronPhysicsQGSPCMS_FTFP_BERT.h @@ -29,10 +29,10 @@ class HadronPhysicsQGSPCMS_FTFP_BERT : public G4VPhysicsConstructor { public: HadronPhysicsQGSPCMS_FTFP_BERT(G4int verbose); - virtual ~HadronPhysicsQGSPCMS_FTFP_BERT(); + ~HadronPhysicsQGSPCMS_FTFP_BERT() override; - virtual void ConstructParticle(); - virtual void ConstructProcess(); + void ConstructParticle() override; + void ConstructProcess() override; private: void CreateModels(); diff --git a/SimG4Core/PhysicsLists/plugins/DummyPhysics.hh b/SimG4Core/PhysicsLists/plugins/DummyPhysics.hh index 1cacbf74e4790..bd738b488bf2b 100644 --- a/SimG4Core/PhysicsLists/plugins/DummyPhysics.hh +++ b/SimG4Core/PhysicsLists/plugins/DummyPhysics.hh @@ -8,7 +8,7 @@ class DummyPhysics : public PhysicsList { public: DummyPhysics(G4LogicalVolumeToDDLogicalPartMap&, const HepPDT::ParticleDataTable *, sim::ChordFinderSetter *, const edm::ParameterSet &); - virtual ~DummyPhysics(); + ~DummyPhysics() override; }; #endif diff --git a/SimG4Core/PhysicsLists/src/CMSG4mplIonisation.hh b/SimG4Core/PhysicsLists/src/CMSG4mplIonisation.hh index 717cd8950d48d..afe045077d887 100644 --- a/SimG4Core/PhysicsLists/src/CMSG4mplIonisation.hh +++ b/SimG4Core/PhysicsLists/src/CMSG4mplIonisation.hh @@ -68,23 +68,23 @@ public: CMSG4mplIonisation(G4double mCharge = 0.0, const G4String& name = "mplIoni"); - virtual ~CMSG4mplIonisation(); + ~CMSG4mplIonisation() override; - virtual G4bool IsApplicable(const G4ParticleDefinition& p); + G4bool IsApplicable(const G4ParticleDefinition& p) override; // Print out of the class parameters - virtual void PrintInfo(); + void PrintInfo() override; protected: - virtual void InitialiseEnergyLossProcess(const G4ParticleDefinition*, - const G4ParticleDefinition*); + void InitialiseEnergyLossProcess(const G4ParticleDefinition*, + const G4ParticleDefinition*) override; private: // hide assignment operator - CMSG4mplIonisation & operator=(const CMSG4mplIonisation &right); - CMSG4mplIonisation(const CMSG4mplIonisation&); + CMSG4mplIonisation & operator=(const CMSG4mplIonisation &right) = delete; + CMSG4mplIonisation(const CMSG4mplIonisation&) = delete; G4double magneticCharge; G4bool isInitialised; diff --git a/SimG4Core/PhysicsLists/src/G4MonopoleTransportation.hh b/SimG4Core/PhysicsLists/src/G4MonopoleTransportation.hh index efc56ac63522b..69a1388475861 100644 --- a/SimG4Core/PhysicsLists/src/G4MonopoleTransportation.hh +++ b/SimG4Core/PhysicsLists/src/G4MonopoleTransportation.hh @@ -74,7 +74,7 @@ class G4MonopoleTransportation : public G4VProcess public: // with description G4MonopoleTransportation(const G4Monopole* p, sim::ChordFinderSetter *chordFinderSetter, G4int verbosityLevel= 1); - ~G4MonopoleTransportation(); + ~G4MonopoleTransportation() override; G4double AlongStepGetPhysicalInteractionLength( const G4Track& track, @@ -82,24 +82,24 @@ class G4MonopoleTransportation : public G4VProcess G4double currentMinimumStep, G4double& currentSafety, G4GPILSelection* selection - ); + ) override; G4VParticleChange* AlongStepDoIt( const G4Track& track, const G4Step& stepData - ); + ) override; G4VParticleChange* PostStepDoIt( const G4Track& track, const G4Step& stepData - ); + ) override; // Responsible for the relocation. G4double PostStepGetPhysicalInteractionLength( const G4Track& , G4double previousStepSize, G4ForceCondition* pForceCond - ); + ) override; // Forces the PostStepDoIt action to be called, // but does not limit the step. @@ -138,16 +138,16 @@ class G4MonopoleTransportation : public G4VProcess G4double AtRestGetPhysicalInteractionLength( const G4Track& , G4ForceCondition* - ) { return -1.0; }; + ) override { return -1.0; }; // No operation in AtRestDoIt. G4VParticleChange* AtRestDoIt( const G4Track& , const G4Step& - ) {return 0;}; + ) override {return nullptr;}; // No operation in AtRestDoIt. - void StartTracking(G4Track* aTrack); + void StartTracking(G4Track* aTrack) override; // Reset state for new (potentially resumed) track protected: diff --git a/SimG4Core/PrintGeomInfo/interface/PrintGeomInfoAction.h b/SimG4Core/PrintGeomInfo/interface/PrintGeomInfoAction.h index 64d11c46f5b24..80057c5a964a8 100644 --- a/SimG4Core/PrintGeomInfo/interface/PrintGeomInfoAction.h +++ b/SimG4Core/PrintGeomInfo/interface/PrintGeomInfoAction.h @@ -27,10 +27,10 @@ class PrintGeomInfoAction : public SimWatcher, public: PrintGeomInfoAction(edm::ParameterSet const & p); - ~PrintGeomInfoAction(); + ~PrintGeomInfoAction() override; private: - void update(const BeginOfJob * job); - void update(const BeginOfRun * run); + void update(const BeginOfJob * job) override; + void update(const BeginOfRun * run) override; void dumpSummary(std::ostream& out = std::cout); void dumpG4LVList(std::ostream& out = std::cout); void dumpG4LVTree(std::ostream& out = std::cout); diff --git a/SimG4Core/PrintGeomInfo/interface/PrintGeomSummary.h b/SimG4Core/PrintGeomInfo/interface/PrintGeomSummary.h index ea7f38882fd73..0bd033c367ecb 100644 --- a/SimG4Core/PrintGeomInfo/interface/PrintGeomSummary.h +++ b/SimG4Core/PrintGeomInfo/interface/PrintGeomSummary.h @@ -27,11 +27,11 @@ class PrintGeomSummary : public SimWatcher, public: PrintGeomSummary(edm::ParameterSet const & p); - ~PrintGeomSummary(); + ~PrintGeomSummary() override; private: - void update(const BeginOfJob * job); - void update(const BeginOfRun * run); + void update(const BeginOfJob * job) override; + void update(const BeginOfRun * run) override; void addSolid(const DDLogicalPart & part); void fillLV(G4LogicalVolume * lv); void dumpSummary(std::ostream& out, std::string name); diff --git a/SimG4Core/PrintGeomInfo/interface/PrintMaterialBudgetInfo.h b/SimG4Core/PrintGeomInfo/interface/PrintMaterialBudgetInfo.h index 406d466edb16e..ddc993538170e 100644 --- a/SimG4Core/PrintGeomInfo/interface/PrintMaterialBudgetInfo.h +++ b/SimG4Core/PrintGeomInfo/interface/PrintMaterialBudgetInfo.h @@ -27,10 +27,10 @@ class PrintMaterialBudgetInfo : public SimWatcher, public: PrintMaterialBudgetInfo(edm::ParameterSet const & p); - ~PrintMaterialBudgetInfo(); + ~PrintMaterialBudgetInfo() override; private: - void update(const BeginOfJob* job) {}; - void update(const BeginOfRun* run); + void update(const BeginOfJob* job) override {}; + void update(const BeginOfRun* run) override; void dumpHeader(std::ostream& out = std::cout); void dumpLaTeXHeader(std::ostream& out = std::cout); void dumpHierarchyLeaf(G4VPhysicalVolume* pv, G4LogicalVolume* lv, unsigned int leafDepth, diff --git a/SimG4Core/PrintGeomInfo/interface/PrintSensitive.h b/SimG4Core/PrintGeomInfo/interface/PrintSensitive.h index 0758cd5a1504d..70d124ffcaaa4 100644 --- a/SimG4Core/PrintGeomInfo/interface/PrintSensitive.h +++ b/SimG4Core/PrintGeomInfo/interface/PrintSensitive.h @@ -19,11 +19,11 @@ class PrintSensitive : public SimWatcher, public: PrintSensitive(edm::ParameterSet const & p); - ~PrintSensitive(); + ~PrintSensitive() override; private: - void update(const BeginOfRun * run); + void update(const BeginOfRun * run) override; void dumpTouch(G4VPhysicalVolume * pv, unsigned int leafDepth, bool printIt, std::ostream & out = std::cout); G4VPhysicalVolume * getTopPV(); diff --git a/SimG4Core/PrintGeomInfo/src/PrintGeomInfoAction.cc b/SimG4Core/PrintGeomInfo/src/PrintGeomInfoAction.cc index e0dca147cd524..e0b257e655751 100644 --- a/SimG4Core/PrintGeomInfo/src/PrintGeomInfoAction.cc +++ b/SimG4Core/PrintGeomInfo/src/PrintGeomInfoAction.cc @@ -125,7 +125,7 @@ void PrintGeomInfoAction::dumpSummary(std::ostream & out) { //---------- Dump number of objects of each class out << " @@@@@@@@@@@@@@@@@@ Dumping G4 geometry objects Summary " << G4endl; - if (theTopPV == 0) { + if (theTopPV == nullptr) { out << " No volume created " << G4endl; return; } @@ -267,7 +267,7 @@ void PrintGeomInfoAction::dumpLV(G4LogicalVolume * lv, unsigned int leafDepth, s if (_dumpAtts) { //--- Visualisation attributes const G4VisAttributes * fVA = lv->GetVisAttributes(); - if (fVA!=0) { + if (fVA!=nullptr) { out << spaces << " VISUALISATION ATTRIBUTES: " << G4endl; out << spaces << " IsVisible " << fVA->IsVisible() << G4endl; out << spaces << " IsDaughtersInvisible " << fVA->IsDaughtersInvisible() << G4endl; @@ -281,7 +281,7 @@ void PrintGeomInfoAction::dumpLV(G4LogicalVolume * lv, unsigned int leafDepth, s //--- User Limits G4UserLimits * fUL = lv->GetUserLimits(); G4Track dummy; - if (fUL!=0) { + if (fUL!=nullptr) { out << spaces << " MaxAllowedStep " << fUL->GetMaxAllowedStep(dummy) << G4endl; out << spaces << " UserMaxTrackLength " << fUL->GetUserMaxTrackLength(dummy) << G4endl; out << spaces << " UserMaxTime " << fUL->GetUserMaxTime(dummy) << G4endl; @@ -324,7 +324,7 @@ void PrintGeomInfoAction::dumpPV(G4VPhysicalVolume * pv, unsigned int leafDepth, } if (!pv->IsReplicated()) { if (_dumpPV) { - if(pv->GetRotation() == 0) out << " with no rotation" << G4endl; + if(pv->GetRotation() == nullptr) out << " with no rotation" << G4endl; else if(!_dumpRotation) out << " with rotation" << G4endl; //just rotation name else out << " with rotation " << *(pv->GetRotation()) << G4endl; } @@ -339,13 +339,13 @@ void PrintGeomInfoAction::dumpPV(G4VPhysicalVolume * pv, unsigned int leafDepth, pv->GetReplicationData(axis, nReplicas, width, offset, consuming); out << spaces << " axis " << axis << G4endl << spaces << " nReplicas " << nReplicas << G4endl; - if (pv->GetParameterisation() != 0) + if (pv->GetParameterisation() != nullptr) out << spaces << " It is parameterisation " << G4endl; else out << spaces << " width " << width << G4endl << spaces << " offset " << offset << G4endl << spaces << " consuming" << consuming << G4endl; - if (pv->GetParameterisation() != 0) + if (pv->GetParameterisation() != nullptr) out << spaces << " It is parameterisation " << G4endl; } } diff --git a/SimG4Core/PrintGeomInfo/src/PrintGeomSummary.cc b/SimG4Core/PrintGeomInfo/src/PrintGeomSummary.cc index 20103cc01a653..adbcca4ef5490 100644 --- a/SimG4Core/PrintGeomInfo/src/PrintGeomSummary.cc +++ b/SimG4Core/PrintGeomInfo/src/PrintGeomSummary.cc @@ -29,7 +29,7 @@ #include #include -PrintGeomSummary::PrintGeomSummary(const edm::ParameterSet &p) : theTopPV_(0) { +PrintGeomSummary::PrintGeomSummary(const edm::ParameterSet &p) : theTopPV_(nullptr) { std::vector defNames; nodeNames_ = p.getUntrackedParameter >("NodeNames",defNames); G4cout << "PrintGeomSummary:: initialised for " << nodeNames_.size() @@ -79,7 +79,7 @@ void PrintGeomSummary::update(const BeginOfJob * job) { const DDLogicalPart & ddLP = gra.nodeData(git); addSolid(ddLP); ++i; - if (git->size()) { + if (!git->empty()) { // ask for children of ddLP for (DDCompactView::graph_type::edge_list::const_iterator cit = git->begin(); cit != git->end(); ++cit) { diff --git a/SimG4Core/PrintGeomInfo/src/PrintMaterialBudgetInfo.cc b/SimG4Core/PrintGeomInfo/src/PrintMaterialBudgetInfo.cc index bb636955d8d64..6be34022c8454 100644 --- a/SimG4Core/PrintGeomInfo/src/PrintMaterialBudgetInfo.cc +++ b/SimG4Core/PrintGeomInfo/src/PrintMaterialBudgetInfo.cc @@ -61,7 +61,7 @@ void PrintMaterialBudgetInfo::update(const BeginOfRun* run) { G4LogicalVolume* lv = theTopPV->GetLogicalVolume(); unsigned int leafDepth = 0; // the first time fill the vectors of elements - if( elementNames.size()==0 && elementTotalWeight.size()==0 && elementWeightFraction.size()==0) { + if( elementNames.empty() && elementTotalWeight.empty() && elementWeightFraction.empty()) { for(unsigned int iElement = 0; iElement < G4Element::GetNumberOfElements(); iElement++) { // first element in table is 0 diff --git a/SimG4Core/PrintTrackNumber/interface/PrintTrackNumberAction.h b/SimG4Core/PrintTrackNumber/interface/PrintTrackNumberAction.h index 6ceba264b69ce..328f1bb0b67f4 100644 --- a/SimG4Core/PrintTrackNumber/interface/PrintTrackNumberAction.h +++ b/SimG4Core/PrintTrackNumber/interface/PrintTrackNumberAction.h @@ -14,9 +14,9 @@ class PrintTrackNumberAction : public SimWatcher, { public: PrintTrackNumberAction(edm::ParameterSet const & p); - ~PrintTrackNumberAction(); - void update(const EndOfTrack * trk); - void update(const EndOfEvent * trk); + ~PrintTrackNumberAction() override; + void update(const EndOfTrack * trk) override; + void update(const EndOfEvent * trk) override; private: int theNoTracks; int theNoTracksThisEvent; diff --git a/SimG4Core/PrintTrackNumber/src/PrintTrackNumberAction.cc b/SimG4Core/PrintTrackNumber/src/PrintTrackNumberAction.cc index 1964b38e4b089..764af1a4cd6b5 100644 --- a/SimG4Core/PrintTrackNumber/src/PrintTrackNumberAction.cc +++ b/SimG4Core/PrintTrackNumber/src/PrintTrackNumberAction.cc @@ -28,7 +28,7 @@ void PrintTrackNumberAction::update(const EndOfTrack * trk) if (bNoUserLimits) { - bool countTrk = 1; + bool countTrk = true; // tracks that have been killed before first step (by MinEkineCut). // In fact the track makes the first step, MinEkineCut process determines // that the energy is too low, set it to 0, and then at the next step @@ -37,7 +37,7 @@ void PrintTrackNumberAction::update(const EndOfTrack * trk) { const G4VProcess* proccur = aTrack->GetStep()->GetPostStepPoint()->GetProcessDefinedStep(); - if (proccur != 0) + if (proccur != nullptr) { if (proccur->GetProcessName() == "MinEkineCut") { @@ -48,7 +48,7 @@ void PrintTrackNumberAction::update(const EndOfTrack * trk) // for e+, last step is annihil, while previous is MinEkineCut const G4VProcess* procprev = aTrack->GetStep()->GetPreStepPoint()->GetProcessDefinedStep(); - if (procprev != 0) + if (procprev != nullptr) { if (procprev->GetProcessName() == "MinEkineCut") { diff --git a/SimG4Core/SaveSimTrackAction/interface/SaveSimTrack.h b/SimG4Core/SaveSimTrackAction/interface/SaveSimTrack.h index f3a5b06b0f3ba..6262ae4affbb9 100644 --- a/SimG4Core/SaveSimTrackAction/interface/SaveSimTrack.h +++ b/SimG4Core/SaveSimTrackAction/interface/SaveSimTrack.h @@ -13,8 +13,8 @@ class SaveSimTrack : public SimWatcher, public: SaveSimTrack(edm::ParameterSet const & p); - ~SaveSimTrack(); - void update(const BeginOfTrack * trk); + ~SaveSimTrack() override; + void update(const BeginOfTrack * trk) override; private: std::vector pdgs_; diff --git a/SimG4Core/TrackingVerbose/interface/TrackingVerboseAction.h b/SimG4Core/TrackingVerbose/interface/TrackingVerboseAction.h index d5dc183206d6b..5ffc565028320 100644 --- a/SimG4Core/TrackingVerbose/interface/TrackingVerboseAction.h +++ b/SimG4Core/TrackingVerbose/interface/TrackingVerboseAction.h @@ -43,12 +43,12 @@ class TrackingVerboseAction : public SimWatcher, public: TrackingVerboseAction(edm::ParameterSet const & p); - ~TrackingVerboseAction(); - void update(const BeginOfRun *); - void update(const BeginOfEvent *); - void update(const BeginOfTrack *); - void update(const EndOfTrack *); - void update(const G4Step*); + ~TrackingVerboseAction() override; + void update(const BeginOfRun *) override; + void update(const BeginOfEvent *) override; + void update(const BeginOfTrack *) override; + void update(const EndOfTrack *) override; + void update(const G4Step*) override; private: void setTrackingVerbose(int verblev); bool checkTrackingVerbose(const G4Track*); diff --git a/SimG4Core/TrackingVerbose/src/TrackingVerboseAction.cc b/SimG4Core/TrackingVerbose/src/TrackingVerboseAction.cc index 26ab308cdee72..8c45ccc43aac1 100644 --- a/SimG4Core/TrackingVerbose/src/TrackingVerboseAction.cc +++ b/SimG4Core/TrackingVerbose/src/TrackingVerboseAction.cc @@ -27,7 +27,7 @@ using namespace CLHEP; TrackingVerboseAction::TrackingVerboseAction(edm::ParameterSet const & p) : - theTrackingManager(0), fVerbose(0) { + theTrackingManager(nullptr), fVerbose(nullptr) { fLarge = int(1E10); fDEBUG = p.getUntrackedParameter("DEBUG",false); @@ -81,9 +81,9 @@ void TrackingVerboseAction::update(const BeginOfRun * run) { } void TrackingVerboseAction::update(const BeginOfEvent * evt) { - if (evt==0) return; + if (evt==nullptr) return; const G4Event * anEvent = (*evt)(); - if (anEvent==0) return; + if (anEvent==nullptr) return; //----------- Set /tracking/verbose for this event int eventNo = anEvent->GetEventID(); @@ -160,8 +160,8 @@ void TrackingVerboseAction::update(const BeginOfTrack * trk) { && aTrack->GetCreatorProcess()->GetProcessName() != "LCapture") G4cout << " KineE > 1 GeV !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!" << G4endl; const G4VTouchable* touchable=aTrack->GetTouchable(); - if (touchable!=0 && touchable->GetVolume()!=0 && - touchable->GetVolume()->GetLogicalVolume()!=0) { + if (touchable!=nullptr && touchable->GetVolume()!=nullptr && + touchable->GetVolume()->GetLogicalVolume()!=nullptr) { G4Material* material=touchable->GetVolume()->GetLogicalVolume()->GetMaterial(); G4cout << "G4LCapture Gamma E(GeV) " << aTrack->GetTotalEnergy()/GeV << " " @@ -189,9 +189,9 @@ void TrackingVerboseAction::update(const BeginOfTrack * trk) { if (Tgamma > 2.5*GeV ) { //&& ProcName!="Decay" && ProcName!="eBrem") std::string volumeName("_Unknown_Vol_"); std::string materialName("_Unknown_Mat_"); - G4Material * material = 0; - G4VPhysicalVolume * pvolume = 0; - G4LogicalVolume * lvolume = 0; + G4Material * material = nullptr; + G4VPhysicalVolume * pvolume = nullptr; + G4LogicalVolume * lvolume = nullptr; const G4VTouchable * touchable = aTrack->GetTouchable(); if (touchable) pvolume = touchable->GetVolume(); if (pvolume) { @@ -263,12 +263,12 @@ void TrackingVerboseAction::update(const G4Step* fStep) { << std::setw( 9) << G4BestUnit(fTrack->GetGlobalTime(), "Time") << " "; // Put cut comment here - if( fTrack->GetNextVolume() != 0 ) { + if( fTrack->GetNextVolume() != nullptr ) { G4cout << std::setw(11) << fTrack->GetNextVolume()->GetName() << " "; } else { G4cout << std::setw(11) << "OutOfWorld" << " "; } - if(fStep->GetPostStepPoint()->GetProcessDefinedStep() != NULL){ + if(fStep->GetPostStepPoint()->GetProcessDefinedStep() != nullptr){ G4cout << fStep->GetPostStepPoint()->GetProcessDefinedStep()->GetProcessName(); } else { G4cout << "User Limit"; @@ -279,7 +279,7 @@ void TrackingVerboseAction::update(const G4Step* fStep) { void TrackingVerboseAction::setTrackingVerbose(int verblev) { if (fDEBUG) G4cout << " setting verbose level " << verblev << G4endl; - if (theTrackingManager!=0) theTrackingManager->SetVerboseLevel(verblev); + if (theTrackingManager!=nullptr) theTrackingManager->SetVerboseLevel(verblev); } bool TrackingVerboseAction::checkTrackingVerbose(const G4Track* aTrack) { @@ -289,7 +289,7 @@ bool TrackingVerboseAction::checkTrackingVerbose(const G4Track* aTrack) { if (trackNo >= fTVTrackMin && trackNo <= fTVTrackMax) { if ((trackNo-fTVTrackMin) % fTVTrackStep == 0) trackingVerboseThisTrack = true; } - if (trackingVerboseThisTrack && (fPdgIds.size()>0)) { + if (trackingVerboseThisTrack && (!fPdgIds.empty())) { int pdgId = aTrack->GetDefinition()->GetPDGEncoding(); if (std::count(fPdgIds.begin(),fPdgIds.end(),pdgId) == 0) trackingVerboseThisTrack = false; } diff --git a/SimG4Core/Watcher/interface/SimProducer.h b/SimG4Core/Watcher/interface/SimProducer.h index cb986a8e09f44..7a16f1b0e60c7 100644 --- a/SimG4Core/Watcher/interface/SimProducer.h +++ b/SimG4Core/Watcher/interface/SimProducer.h @@ -57,7 +57,7 @@ namespace simproducer { ProductInfo(const std::string& iInstanceName) : ProductInfoBase(iInstanceName) {} - void registerProduct(edm::ProducerBase* iProd) const { + void registerProduct(edm::ProducerBase* iProd) const override { (*iProd). template produces(this->instanceName()); } }; @@ -94,9 +94,9 @@ class SimProducer : public SimWatcher } private: - SimProducer(const SimProducer&); // stop default + SimProducer(const SimProducer&) = delete; // stop default - const SimProducer& operator=(const SimProducer&); // stop default + const SimProducer& operator=(const SimProducer&) = delete; // stop default // ---------- member data -------------------------------- std::vector > m_info; diff --git a/SimG4Core/Watcher/interface/SimWatcher.h b/SimG4Core/Watcher/interface/SimWatcher.h index 24162be5205d7..0ad1bf8a96d54 100644 --- a/SimG4Core/Watcher/interface/SimWatcher.h +++ b/SimG4Core/Watcher/interface/SimWatcher.h @@ -43,9 +43,9 @@ class SimWatcher // ---------- member functions --------------------------- private: - SimWatcher(const SimWatcher&); // stop default + SimWatcher(const SimWatcher&) = delete; // stop default - const SimWatcher& operator=(const SimWatcher&); // stop default + const SimWatcher& operator=(const SimWatcher&) = delete; // stop default // ---------- member data -------------------------------- diff --git a/SimG4Core/Watcher/interface/SimWatcherMaker.h b/SimG4Core/Watcher/interface/SimWatcherMaker.h index d76754d1e55d3..9bd5f81c2f856 100644 --- a/SimG4Core/Watcher/interface/SimWatcherMaker.h +++ b/SimG4Core/Watcher/interface/SimWatcherMaker.h @@ -35,11 +35,11 @@ class SimWatcherMaker : public SimWatcherMakerBase SimWatcherMaker(){} // ---------- const member functions --------------------- - virtual void make(const edm::ParameterSet& p, + void make(const edm::ParameterSet& p, SimActivityRegistry& reg, std::shared_ptr& oWatcher, std::shared_ptr& oProd - ) const + ) const override { auto returnValue = std::make_shared(p); SimActivityRegistryEnroller::enroll(reg, returnValue.get()); diff --git a/SimG4Core/Watcher/test/IntSimProducer.cc b/SimG4Core/Watcher/test/IntSimProducer.cc index f6ee1f463d63e..86d9b0c00ea86 100644 --- a/SimG4Core/Watcher/test/IntSimProducer.cc +++ b/SimG4Core/Watcher/test/IntSimProducer.cc @@ -22,7 +22,7 @@ class IntSimProducer : public SimProducer { public: IntSimProducer(const edm::ParameterSet&); - void produce(edm::Event& e, const edm::EventSetup&) { + void produce(edm::Event& e, const edm::EventSetup&) override { std::unique_ptr newInt(new int(++m_int)); e.put(std::move(newInt)); } From 8687ed45a6fbdd0f99dbc6fade82182c7ceac1c4 Mon Sep 17 00:00:00 2001 From: Ianna Osborne Date: Fri, 15 Sep 2017 09:51:27 +0200 Subject: [PATCH 2/2] Remove unused variable --- SimG4Core/CustomPhysics/src/ToyModelHadronicProcess.cc | 1 - 1 file changed, 1 deletion(-) diff --git a/SimG4Core/CustomPhysics/src/ToyModelHadronicProcess.cc b/SimG4Core/CustomPhysics/src/ToyModelHadronicProcess.cc index 5394dcb1a4f17..237168f55837b 100644 --- a/SimG4Core/CustomPhysics/src/ToyModelHadronicProcess.cc +++ b/SimG4Core/CustomPhysics/src/ToyModelHadronicProcess.cc @@ -75,7 +75,6 @@ G4VParticleChange* ToyModelHadronicProcess::PostStepDoIt(const G4Track& track, //This will contain RHadron Def + RHad momentum const G4DynamicParticle* incidentRHadron = track.GetDynamicParticle(); - const G4ThreeVector& aPosition = track.GetPosition(); CustomParticle* CustomIncident = dynamic_cast(incidentRHadron->GetDefinition());