Skip to content

Commit

Permalink
Merge pull request #20527 from ianna/sim-clang-checks-all-step2-v2
Browse files Browse the repository at this point in the history
Step 2 amendment: Simulation Clang tidy code-checks-all and Clang Warnings Removed
  • Loading branch information
cmsbuild committed Sep 16, 2017
2 parents 824a4f8 + 8687ed4 commit 390ffe7
Show file tree
Hide file tree
Showing 133 changed files with 428 additions and 429 deletions.
6 changes: 3 additions & 3 deletions SimG4Core/Application/interface/CMSGDMLWriteStructure.h
Expand Up @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion SimG4Core/Application/interface/CustomUIsession.h
Expand Up @@ -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;
Expand Down
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion SimG4Core/Application/interface/CustomUIsessionToFile.h
Expand Up @@ -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;
Expand Down
12 changes: 6 additions & 6 deletions SimG4Core/Application/interface/ElectronLimiter.h
Expand Up @@ -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);

Expand Down
6 changes: 3 additions & 3 deletions SimG4Core/Application/interface/EventAction.h
Expand Up @@ -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();

Expand Down
6 changes: 3 additions & 3 deletions SimG4Core/Application/interface/ExceptionHandler.h
Expand Up @@ -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; }
Expand Down
8 changes: 4 additions & 4 deletions SimG4Core/Application/interface/GFlashEMShowerModel.h
Expand Up @@ -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:

Expand Down
8 changes: 4 additions & 4 deletions SimG4Core/Application/interface/GFlashHadronShowerModel.h
Expand Up @@ -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);
Expand Down
6 changes: 3 additions & 3 deletions SimG4Core/Application/interface/OscarMTProducer.h
Expand Up @@ -24,15 +24,15 @@ class OscarMTProducer : public edm::stream::EDProducer<
typedef std::vector<std::shared_ptr<SimProducer> > Producers;

explicit OscarMTProducer(edm::ParameterSet const & p, const OscarMTMasterThread *);
virtual ~OscarMTProducer();
~OscarMTProducer() override;

static std::unique_ptr<OscarMTMasterThread> initializeGlobalCache(const edm::ParameterSet& iConfig);
static std::shared_ptr<int> 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;
Expand Down
8 changes: 4 additions & 4 deletions SimG4Core/Application/interface/OscarProducer.h
Expand Up @@ -19,10 +19,10 @@ class OscarProducer : public edm::one::EDProducer<edm::one::SharedResources, edm
typedef std::vector<std::shared_ptr<SimProducer> > 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<RunManager> m_runManager;
Expand Down
6 changes: 3 additions & 3 deletions SimG4Core/Application/interface/ParametrisedEMPhysics.h
Expand Up @@ -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:

Expand Down
4 changes: 2 additions & 2 deletions SimG4Core/Application/interface/PrimaryTransformer.h
Expand Up @@ -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
6 changes: 3 additions & 3 deletions SimG4Core/Application/interface/RunAction.h
Expand Up @@ -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;
Expand Down
4 changes: 2 additions & 2 deletions SimG4Core/Application/interface/SimTrackManager.h
Expand Up @@ -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);
Expand Down
8 changes: 4 additions & 4 deletions SimG4Core/Application/interface/StackingAction.h
Expand Up @@ -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:

Expand Down
4 changes: 2 additions & 2 deletions SimG4Core/Application/interface/SteppingAction.h
Expand Up @@ -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;

Expand Down
6 changes: 3 additions & 3 deletions SimG4Core/Application/interface/TrackingAction.h
Expand Up @@ -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_; }
Expand Down
2 changes: 1 addition & 1 deletion SimG4Core/Application/src/CMSGDMLWriteStructure.cc
Expand Up @@ -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"};

Expand Down
2 changes: 1 addition & 1 deletion SimG4Core/Application/src/CustomUIsession.cc
Expand Up @@ -12,7 +12,7 @@ CustomUIsession::~CustomUIsession()
{

G4UImanager *UI = G4UImanager::GetUIpointer();
UI->SetCoutDestination(NULL);
UI->SetCoutDestination(nullptr);

}

Expand Down
4 changes: 2 additions & 2 deletions SimG4Core/Application/src/ElectronLimiter.cc
Expand Up @@ -23,8 +23,8 @@ ElectronLimiter::ElectronLimiter(const edm::ParameterSet & p)
fieldCheckFlag = false;
killTrack = false;

fIonisation = 0;
particle = 0;
fIonisation = nullptr;
particle = nullptr;
}

ElectronLimiter::~ElectronLimiter()
Expand Down
4 changes: 2 additions & 2 deletions SimG4Core/Application/src/ExceptionHandler.cc
Expand Up @@ -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() {}
Expand Down
6 changes: 3 additions & 3 deletions SimG4Core/Application/src/G4SimEvent.cc
Expand Up @@ -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) {}
Expand Down Expand Up @@ -40,14 +40,14 @@ G4SimEvent::~G4SimEvent()
for ( i=0; i<g4tracks.size(); i++ )
{
delete g4tracks[i] ;
g4tracks[i] = 0 ;
g4tracks[i] = nullptr ;
}
g4tracks.clear() ;

for ( i=0; i<g4vertices.size(); i++ )
{
delete g4vertices[i] ;
g4vertices[i] = 0 ;
g4vertices[i] = nullptr ;
}
g4vertices.clear();
}
Expand Down
6 changes: 3 additions & 3 deletions SimG4Core/Application/src/GFlashEMShowerModel.cc
Expand Up @@ -66,7 +66,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; }
Expand Down Expand Up @@ -151,15 +151,15 @@ 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; }

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);
Expand Down
8 changes: 4 additions & 4 deletions SimG4Core/Application/src/GFlashHadronShowerModel.cc
Expand Up @@ -38,7 +38,7 @@ GFlashHadronShowerModel::GFlashHadronShowerModel(G4String modelName, G4Region* e
{
theWatcherOn = parSet.getParameter<bool>("watcherOn");

theProfile = 0;
theProfile = nullptr;
thePiKProfile = new GflashPiKShowerProfile(parSet);
theKaonPlusProfile = new GflashKaonPlusShowerProfile(parSet);
theKaonMinusProfile = new GflashKaonMinusShowerProfile(parSet);
Expand Down Expand Up @@ -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; }
Expand Down Expand Up @@ -170,15 +170,15 @@ 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; }

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);
Expand Down

0 comments on commit 390ffe7

Please sign in to comment.