Skip to content

Commit c5e1460

Browse files
chore(templates/Stack): Add override
1 parent d16b36a commit c5e1460

2 files changed

Lines changed: 106 additions & 106 deletions

File tree

templates/project_root_containers/MyProjData/MyProjStack.h

Lines changed: 53 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/********************************************************************************
2-
* Copyright (C) 2014 GSI Helmholtzzentrum fuer Schwerionenforschung GmbH *
2+
* Copyright (C) 2014-2025 GSI Helmholtzzentrum fuer Schwerionenforschung GmbH *
33
* *
44
* This software is distributed under the terms of the *
55
* GNU Lesser General Public Licence (LGPL) version 3, *
@@ -55,7 +55,7 @@ class MyProjStack : public FairGenericStack
5555
MyProjStack(Int_t size = 100);
5656

5757
/** Destructor **/
58-
virtual ~MyProjStack();
58+
~MyProjStack() override;
5959

6060
/** Add a TParticle to the stack.
6161
** Declared in TVirtualMCStack
@@ -72,93 +72,93 @@ class MyProjStack : public FairGenericStack
7272
*@param weight Particle weight
7373
*@param is Generation status code (whatever that means)
7474
**/
75-
virtual void PushTrack(Int_t toBeDone,
76-
Int_t parentID,
77-
Int_t pdgCode,
78-
Double_t px,
79-
Double_t py,
80-
Double_t pz,
81-
Double_t e,
82-
Double_t vx,
83-
Double_t vy,
84-
Double_t vz,
85-
Double_t time,
86-
Double_t polx,
87-
Double_t poly,
88-
Double_t polz,
89-
TMCProcess proc,
90-
Int_t& ntr,
91-
Double_t weight,
92-
Int_t is);
93-
94-
virtual void PushTrack(Int_t toBeDone,
95-
Int_t parentID,
96-
Int_t pdgCode,
97-
Double_t px,
98-
Double_t py,
99-
Double_t pz,
100-
Double_t e,
101-
Double_t vx,
102-
Double_t vy,
103-
Double_t vz,
104-
Double_t time,
105-
Double_t polx,
106-
Double_t poly,
107-
Double_t polz,
108-
TMCProcess proc,
109-
Int_t& ntr,
110-
Double_t weight,
111-
Int_t is,
112-
Int_t secondParentId);
75+
void PushTrack(Int_t toBeDone,
76+
Int_t parentID,
77+
Int_t pdgCode,
78+
Double_t px,
79+
Double_t py,
80+
Double_t pz,
81+
Double_t e,
82+
Double_t vx,
83+
Double_t vy,
84+
Double_t vz,
85+
Double_t time,
86+
Double_t polx,
87+
Double_t poly,
88+
Double_t polz,
89+
TMCProcess proc,
90+
Int_t& ntr,
91+
Double_t weight,
92+
Int_t is) override;
93+
94+
void PushTrack(Int_t toBeDone,
95+
Int_t parentID,
96+
Int_t pdgCode,
97+
Double_t px,
98+
Double_t py,
99+
Double_t pz,
100+
Double_t e,
101+
Double_t vx,
102+
Double_t vy,
103+
Double_t vz,
104+
Double_t time,
105+
Double_t polx,
106+
Double_t poly,
107+
Double_t polz,
108+
TMCProcess proc,
109+
Int_t& ntr,
110+
Double_t weight,
111+
Int_t is,
112+
Int_t secondParentId) override;
113113

114114
/** Get next particle for tracking from the stack.
115115
** Declared in TVirtualMCStack
116116
*@param iTrack index of popped track (return)
117117
*@return Pointer to the TParticle of the track
118118
**/
119-
virtual TParticle* PopNextTrack(Int_t& iTrack);
119+
TParticle* PopNextTrack(Int_t& iTrack) override;
120120

121121
/** Get primary particle by index for tracking from stack
122122
** Declared in TVirtualMCStack
123123
*@param iPrim index of primary particle
124124
*@return Pointer to the TParticle of the track
125125
**/
126-
virtual TParticle* PopPrimaryForTracking(Int_t iPrim);
126+
TParticle* PopPrimaryForTracking(Int_t iPrim) override;
127127

128128
/** Get total number of tracks
129129
** Declared in TVirtualMCStack
130130
**/
131-
virtual Int_t GetNtrack() const { return fNParticles; }
131+
Int_t GetNtrack() const override { return fNParticles; }
132132

133133
/** Get number of primary tracks
134134
** Declared in TVirtualMCStack
135135
**/
136-
virtual Int_t GetNprimary() const { return fNPrimaries; }
136+
Int_t GetNprimary() const override { return fNPrimaries; }
137137

138138
/** Get the current track's particle
139139
** Declared in TVirtualMCStack
140140
**/
141-
virtual TParticle* GetCurrentTrack() const;
141+
TParticle* GetCurrentTrack() const override;
142142

143143
/** Get the track number of the parent of the current track
144144
** Declared in TVirtualMCStack
145145
**/
146-
virtual Int_t GetCurrentParentTrackNumber() const;
146+
Int_t GetCurrentParentTrackNumber() const override;
147147

148148
/** Add a TParticle to the fParticles array **/
149149
virtual void AddParticle(TParticle* part);
150150

151151
/** Fill the MCTrack output array, applying filter criteria **/
152-
virtual void FillTrackArray();
152+
void FillTrackArray() override;
153153

154154
/** Update the track index in the MCTracks and MCPoints **/
155-
virtual void UpdateTrackIndex(TRefArray* detArray = 0);
155+
void UpdateTrackIndex(TRefArray* detArray = 0) override;
156156

157157
/** Resets arrays and stack and deletes particles and tracks **/
158-
virtual void Reset();
158+
void Reset() override;
159159

160160
/** Register the MCTrack array to the Root Manager **/
161-
virtual void Register();
161+
void Register() override;
162162

163163
/** Output to screen
164164
**@param iVerbose: 0=events summary, 1=track info
@@ -184,10 +184,10 @@ class MyProjStack : public FairGenericStack
184184

185185
/** Accessors **/
186186
TParticle* GetParticle(Int_t trackId) const;
187-
TClonesArray* GetListOfParticles() { return fParticles; }
187+
TClonesArray* GetListOfParticles() override { return fParticles; }
188188

189189
/** Clone this object (used in MT mode only) */
190-
virtual FairGenericStack* CloneStack() const { return new MyProjStack(*this); }
190+
FairGenericStack* CloneStack() const override { return new MyProjStack(*this); }
191191

192192
private:
193193
/** STL stack (FILO) used to handle the TParticles for tracking **/
@@ -230,7 +230,7 @@ class MyProjStack : public FairGenericStack
230230
MyProjStack(const MyProjStack&);
231231
MyProjStack& operator=(const MyProjStack&);
232232

233-
ClassDef(MyProjStack, 1);
233+
ClassDefOverride(MyProjStack, 1);
234234
};
235235

236236
#endif

templates/project_stl_containers/MyProjData/MyProjStack.h

Lines changed: 53 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/********************************************************************************
2-
* Copyright (C) 2014 GSI Helmholtzzentrum fuer Schwerionenforschung GmbH *
2+
* Copyright (C) 2014-2025 GSI Helmholtzzentrum fuer Schwerionenforschung GmbH *
33
* *
44
* This software is distributed under the terms of the *
55
* GNU Lesser General Public Licence (LGPL) version 3, *
@@ -55,7 +55,7 @@ class MyProjStack : public FairGenericStack
5555
MyProjStack(Int_t size = 100);
5656

5757
/** Destructor **/
58-
virtual ~MyProjStack();
58+
~MyProjStack() override;
5959

6060
/** Add a TParticle to the stack.
6161
** Declared in TVirtualMCStack
@@ -72,93 +72,93 @@ class MyProjStack : public FairGenericStack
7272
*@param weight Particle weight
7373
*@param is Generation status code (whatever that means)
7474
**/
75-
virtual void PushTrack(Int_t toBeDone,
76-
Int_t parentID,
77-
Int_t pdgCode,
78-
Double_t px,
79-
Double_t py,
80-
Double_t pz,
81-
Double_t e,
82-
Double_t vx,
83-
Double_t vy,
84-
Double_t vz,
85-
Double_t time,
86-
Double_t polx,
87-
Double_t poly,
88-
Double_t polz,
89-
TMCProcess proc,
90-
Int_t& ntr,
91-
Double_t weight,
92-
Int_t is);
93-
94-
virtual void PushTrack(Int_t toBeDone,
95-
Int_t parentID,
96-
Int_t pdgCode,
97-
Double_t px,
98-
Double_t py,
99-
Double_t pz,
100-
Double_t e,
101-
Double_t vx,
102-
Double_t vy,
103-
Double_t vz,
104-
Double_t time,
105-
Double_t polx,
106-
Double_t poly,
107-
Double_t polz,
108-
TMCProcess proc,
109-
Int_t& ntr,
110-
Double_t weight,
111-
Int_t is,
112-
Int_t secondParentId);
75+
void PushTrack(Int_t toBeDone,
76+
Int_t parentID,
77+
Int_t pdgCode,
78+
Double_t px,
79+
Double_t py,
80+
Double_t pz,
81+
Double_t e,
82+
Double_t vx,
83+
Double_t vy,
84+
Double_t vz,
85+
Double_t time,
86+
Double_t polx,
87+
Double_t poly,
88+
Double_t polz,
89+
TMCProcess proc,
90+
Int_t& ntr,
91+
Double_t weight,
92+
Int_t is) override;
93+
94+
void PushTrack(Int_t toBeDone,
95+
Int_t parentID,
96+
Int_t pdgCode,
97+
Double_t px,
98+
Double_t py,
99+
Double_t pz,
100+
Double_t e,
101+
Double_t vx,
102+
Double_t vy,
103+
Double_t vz,
104+
Double_t time,
105+
Double_t polx,
106+
Double_t poly,
107+
Double_t polz,
108+
TMCProcess proc,
109+
Int_t& ntr,
110+
Double_t weight,
111+
Int_t is,
112+
Int_t secondParentId) override;
113113

114114
/** Get next particle for tracking from the stack.
115115
** Declared in TVirtualMCStack
116116
*@param iTrack index of popped track (return)
117117
*@return Pointer to the TParticle of the track
118118
**/
119-
virtual TParticle* PopNextTrack(Int_t& iTrack);
119+
TParticle* PopNextTrack(Int_t& iTrack) override;
120120

121121
/** Get primary particle by index for tracking from stack
122122
** Declared in TVirtualMCStack
123123
*@param iPrim index of primary particle
124124
*@return Pointer to the TParticle of the track
125125
**/
126-
virtual TParticle* PopPrimaryForTracking(Int_t iPrim);
126+
TParticle* PopPrimaryForTracking(Int_t iPrim) override;
127127

128128
/** Get total number of tracks
129129
** Declared in TVirtualMCStack
130130
**/
131-
virtual Int_t GetNtrack() const { return fNParticles; }
131+
Int_t GetNtrack() const override { return fNParticles; }
132132

133133
/** Get number of primary tracks
134134
** Declared in TVirtualMCStack
135135
**/
136-
virtual Int_t GetNprimary() const { return fNPrimaries; }
136+
Int_t GetNprimary() const override { return fNPrimaries; }
137137

138138
/** Get the current track's particle
139139
** Declared in TVirtualMCStack
140140
**/
141-
virtual TParticle* GetCurrentTrack() const;
141+
TParticle* GetCurrentTrack() const override;
142142

143143
/** Get the track number of the parent of the current track
144144
** Declared in TVirtualMCStack
145145
**/
146-
virtual Int_t GetCurrentParentTrackNumber() const;
146+
Int_t GetCurrentParentTrackNumber() const override;
147147

148148
/** Add a TParticle to the fParticles array **/
149149
virtual void AddParticle(TParticle* part);
150150

151151
/** Fill the MCTrack output array, applying filter criteria **/
152-
virtual void FillTrackArray();
152+
void FillTrackArray() override;
153153

154154
/** Update the track index in the MCTracks and MCPoints **/
155-
virtual void UpdateTrackIndex(TRefArray* detArray = 0);
155+
void UpdateTrackIndex(TRefArray* detArray = 0) override;
156156

157157
/** Resets arrays and stack and deletes particles and tracks **/
158-
virtual void Reset();
158+
void Reset() override;
159159

160160
/** Register the MCTrack array to the Root Manager **/
161-
virtual void Register();
161+
void Register() override;
162162

163163
/** Output to screen
164164
**@param iVerbose: 0=events summary, 1=track info
@@ -184,10 +184,10 @@ class MyProjStack : public FairGenericStack
184184

185185
/** Accessors **/
186186
TParticle* GetParticle(Int_t trackId) const;
187-
TClonesArray* GetListOfParticles() { return fParticles; }
187+
TClonesArray* GetListOfParticles() override { return fParticles; }
188188

189189
/** Clone this object (used in MT mode only) */
190-
virtual FairGenericStack* CloneStack() const { return new MyProjStack(*this); }
190+
FairGenericStack* CloneStack() const override { return new MyProjStack(*this); }
191191

192192
private:
193193
/** STL stack (FILO) used to handle the TParticles for tracking **/
@@ -230,7 +230,7 @@ class MyProjStack : public FairGenericStack
230230
MyProjStack(const MyProjStack&);
231231
MyProjStack& operator=(const MyProjStack&);
232232

233-
ClassDef(MyProjStack, 1);
233+
ClassDefOverride(MyProjStack, 1);
234234
};
235235

236236
#endif

0 commit comments

Comments
 (0)