Skip to content

Commit d97b53b

Browse files
ChristianTackeGSIkarabowi
authored andcommitted
refactor: Drop empty overriden methods in FairDetector classes
Most classes that derive from FairDetector override a bunch of member functions with an empty function. But the original one is already empty. So there is no need to override them. Just remove all of this. If someone wants to customize / use those hooks, they can override the hook that they need.
1 parent 23a39ba commit d97b53b

12 files changed

Lines changed: 12 additions & 109 deletions

File tree

examples/MQ/pixelDetector/src/Pixel.h

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/********************************************************************************
2-
* Copyright (C) 2014-2022 GSI Helmholtzzentrum fuer Schwerionenforschung GmbH *
2+
* Copyright (C) 2014-2024 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, *
@@ -60,16 +60,7 @@ class Pixel : public FairDetector
6060
* any optional action in your detector during the transport.
6161
*/
6262

63-
// virtual void CopyClones( TClonesArray* cl1, TClonesArray* cl2 ,
64-
// Int_t offset) {;}
65-
void SetSpecialPhysicsCuts() override { ; }
6663
void EndOfEvent() override;
67-
void FinishPrimary() override { ; }
68-
void FinishRun() override { ; }
69-
void BeginPrimary() override { ; }
70-
void PostTrack() override { ; }
71-
void PreTrack() override { ; }
72-
void BeginEvent() override { ; }
7364

7465
Bool_t IsSensitive(const std::string& name) override;
7566
FairModule* CloneModule() const override;

examples/advanced/Tutorial3/simulation/FairTestDetector.h

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/********************************************************************************
2-
* Copyright (C) 2014-2022 GSI Helmholtzzentrum fuer Schwerionenforschung GmbH *
2+
* Copyright (C) 2014-2024 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, *
@@ -70,20 +70,7 @@ class FairTestDetector : public FairDetector
7070
* any optional action in your detector during the transport.
7171
*/
7272

73-
/*
74-
virtual void CopyClones(TClonesArray* cl1, TClonesArray* cl2, Int_t offset)
75-
{
76-
;
77-
}
78-
*/
79-
void SetSpecialPhysicsCuts() override { ; }
8073
void EndOfEvent() override;
81-
void FinishPrimary() override { ; }
82-
void FinishRun() override { ; }
83-
void BeginPrimary() override { ; }
84-
void PostTrack() override { ; }
85-
void PreTrack() override { ; }
86-
void BeginEvent() override { ; }
8774

8875
private:
8976
/** Track information to be stored until the track leaves the

examples/advanced/propagator/src/FairTutPropDet.h

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/********************************************************************************
2-
* Copyright (C) 2019-2022 GSI Helmholtzzentrum fuer Schwerionenforschung GmbH *
2+
* Copyright (C) 2019-2024 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, *
@@ -18,7 +18,6 @@ class TClonesArray;
1818

1919
class FairTutPropDet : public FairDetector
2020
{
21-
2221
public:
2322
/** Name : Detector Name
2423
* Active: kTRUE for active detectors (ProcessHits() will be called)
@@ -59,16 +58,7 @@ class FairTutPropDet : public FairDetector
5958
* any optional action in your detector during the transport.
6059
*/
6160

62-
// virtual void CopyClones( TClonesArray* cl1, TClonesArray* cl2 ,
63-
// Int_t offset) {;}
64-
void SetSpecialPhysicsCuts() override { ; }
6561
void EndOfEvent() override;
66-
void FinishPrimary() override { ; }
67-
void FinishRun() override { ; }
68-
void BeginPrimary() override { ; }
69-
void PostTrack() override { ; }
70-
void PreTrack() override { ; }
71-
void BeginEvent() override { ; }
7262

7363
void SetPointsArrayName(const std::string& tempName) { fPointsArrayName = tempName; };
7464

examples/simulation/Tutorial1/src/FairTutorialDet1.h

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/********************************************************************************
2-
* Copyright (C) 2014-2022 GSI Helmholtzzentrum fuer Schwerionenforschung GmbH *
2+
* Copyright (C) 2014-2024 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, *
@@ -66,16 +66,7 @@ class FairTutorialDet1 : public FairDetector
6666
* any optional action in your detector during the transport.
6767
*/
6868

69-
// virtual void CopyClones( TClonesArray* cl1, TClonesArray* cl2 ,
70-
// Int_t offset) {;}
71-
void SetSpecialPhysicsCuts() override { ; }
7269
void EndOfEvent() override;
73-
void FinishPrimary() override { ; }
74-
void FinishRun() override { ; }
75-
void BeginPrimary() override { ; }
76-
void PostTrack() override { ; }
77-
void PreTrack() override { ; }
78-
void BeginEvent() override { ; }
7970

8071
FairModule* CloneModule() const override;
8172

examples/simulation/Tutorial2/src/FairTutorialDet2.h

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/********************************************************************************
2-
* Copyright (C) 2014-2022 GSI Helmholtzzentrum fuer Schwerionenforschung GmbH *
2+
* Copyright (C) 2014-2024 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, *
@@ -63,16 +63,7 @@ class FairTutorialDet2 : public FairDetector
6363
* any optional action in your detector during the transport.
6464
*/
6565

66-
// virtual void CopyClones( TClonesArray* cl1, TClonesArray* cl2 ,
67-
// Int_t offset) {;}
68-
virtual void SetSpecialPhysicsCuts() { ; }
6966
virtual void EndOfEvent();
70-
virtual void FinishPrimary() { ; }
71-
virtual void FinishRun() { ; }
72-
virtual void BeginPrimary() { ; }
73-
virtual void PostTrack() { ; }
74-
virtual void PreTrack() { ; }
75-
virtual void BeginEvent() { ; }
7667

7768
virtual FairModule* CloneModule() const;
7869

examples/simulation/Tutorial4/src/mc/FairTutorialDet4.h

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/********************************************************************************
2-
* Copyright (C) 2014-2022 GSI Helmholtzzentrum fuer Schwerionenforschung GmbH *
2+
* Copyright (C) 2014-2024 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, *
@@ -76,15 +76,7 @@ class FairTutorialDet4 : public FairDetector
7676
* any optional action in your detector during the transport.
7777
*/
7878

79-
// virtual void CopyClones(TClonesArray* cl1, TClonesArray* cl2 , Int_t offset) {}
80-
virtual void SetSpecialPhysicsCuts() {}
8179
virtual void EndOfEvent();
82-
virtual void FinishPrimary() {}
83-
virtual void FinishRun() {}
84-
virtual void BeginPrimary() {}
85-
virtual void PostTrack() {}
86-
virtual void PreTrack() {}
87-
virtual void BeginEvent() {}
8880

8981
void SetModifyGeometry(Bool_t val) { fModifyGeometry = val; }
9082
void SetGlobalCoordinates(Bool_t val) { fGlobalCoordinates = val; }

examples/simulation/rutherford/src/FairRutherford.h

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/********************************************************************************
2-
* Copyright (C) 2014-2022 GSI Helmholtzzentrum fuer Schwerionenforschung GmbH *
2+
* Copyright (C) 2014-2024 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, *
@@ -62,16 +62,7 @@ class FairRutherford : public FairDetector
6262
* any optional action in your detector during the transport.
6363
*/
6464

65-
// virtual void CopyClones( TClonesArray* cl1, TClonesArray* cl2 ,
66-
// Int_t offset) {;}
67-
void SetSpecialPhysicsCuts() override {}
6865
void EndOfEvent() override;
69-
void FinishPrimary() override {}
70-
void FinishRun() override {}
71-
void BeginPrimary() override {}
72-
void PostTrack() override {}
73-
void PreTrack() override {}
74-
void BeginEvent() override {}
7566

7667
FairModule* CloneModule() const override;
7768

fairroot/base/sim/FairModule.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ class FairModule : public TNamed
8686
virtual void ConstructGDMLGeometry(__attribute__((unused)) TGeoMatrix* posrot);
8787
/** custom settings of processes and cuts for media to be forwarded to the
8888
** detector simulation */
89-
virtual void SetSpecialPhysicsCuts() { ; }
89+
virtual void SetSpecialPhysicsCuts() {}
9090
/** Clone this object (used in MT mode only)*/
9191
virtual FairModule* CloneModule() const;
9292
/** Init worker run (used in MT mode only) */

templates/NewDetector_root_containers/NewDetector.h

Lines changed: 1 addition & 9 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-2024 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, *
@@ -19,7 +19,6 @@ class TClonesArray;
1919

2020
class NewDetector : public FairDetector
2121
{
22-
2322
public:
2423
/** Name : Detector Name
2524
* Active: kTRUE for active detectors (ProcessHits() will be called)
@@ -63,14 +62,7 @@ class NewDetector : public FairDetector
6362
* any optional action in your detector during the transport.
6463
*/
6564

66-
virtual void SetSpecialPhysicsCuts() { ; }
6765
virtual void EndOfEvent();
68-
virtual void FinishPrimary() { ; }
69-
virtual void FinishRun() { ; }
70-
virtual void BeginPrimary() { ; }
71-
virtual void PostTrack() { ; }
72-
virtual void PreTrack() { ; }
73-
virtual void BeginEvent() { ; }
7466

7567
virtual FairModule* CloneModule() const;
7668

templates/NewDetector_stl_containers/NewDetector.h

Lines changed: 1 addition & 8 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-2024 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, *
@@ -60,14 +60,7 @@ class NewDetector : public FairDetector
6060
* any optional action in your detector during the transport.
6161
*/
6262

63-
virtual void SetSpecialPhysicsCuts() { ; }
6463
virtual void EndOfEvent();
65-
virtual void FinishPrimary() { ; }
66-
virtual void FinishRun() { ; }
67-
virtual void BeginPrimary() { ; }
68-
virtual void PostTrack() { ; }
69-
virtual void PreTrack() { ; }
70-
virtual void BeginEvent() { ; }
7164

7265
virtual FairModule* CloneModule() const;
7366

0 commit comments

Comments
 (0)