Skip to content

Commit 76109ec

Browse files
committed
refactor(passive):Update classes
1 parent 3f697ad commit 76109ec

24 files changed

Lines changed: 145 additions & 259 deletions

passive/CMakeLists.txt

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
##############################################################################
2-
# Copyright (C) 2019 GSI Helmholtzzentrum für Schwerionenforschung GmbH #
3-
# Copyright (C) 2019-2025 Members of R3B Collaboration #
2+
# Copyright (C) 2009 GSI Helmholtzzentrum für Schwerionenforschung GmbH #
3+
# Copyright (C) 2009-2026 Members of R3B Collaboration #
44
# #
55
# This software is distributed under the terms of the #
66
# GNU General Public Licence (GPL) version 3, #
@@ -24,7 +24,6 @@ set(SRCS
2424
R3BNeutronWindowAndSomeAir.cxx
2525
R3BPassiveContFact.cxx
2626
R3BPipe.cxx
27-
R3BVacVesselCool.cxx
2827
R3BTarget.cxx
2928
R3BCollimator.cxx)
3029

@@ -37,7 +36,6 @@ set(HEADERS
3736
R3BNeutronWindowAndSomeAir.h
3837
R3BPassiveContFact.h
3938
R3BPipe.h
40-
R3BVacVesselCool.h
4139
R3BTarget.h
4240
R3BCollimator.h)
4341

passive/PassiveLinkDef.h

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
// clang-format off
22

33
/******************************************************************************
4-
* Copyright (C) 2019 GSI Helmholtzzentrum für Schwerionenforschung GmbH *
5-
* Copyright (C) 2019-2025 Members of R3B Collaboration *
4+
* Copyright (C) 2009 GSI Helmholtzzentrum für Schwerionenforschung GmbH *
5+
* Copyright (C) 2009-2026 Members of R3B Collaboration *
66
* *
77
* This software is distributed under the terms of the *
88
* GNU General Public Licence (GPL) version 3, *
@@ -23,7 +23,6 @@
2323
#pragma link C++ class R3BTarget+;
2424
#pragma link C++ class R3BCollimator+;
2525
#pragma link C++ class R3BPipe+;
26-
#pragma link C++ class R3BVacVesselCool+;
2726
#pragma link C++ class R3BCave+;
2827
#pragma link C++ class R3BNeutronWindowAndSomeAir+;
2928
#pragma link C++ class R3BGeoCave;

passive/R3BAladinMagnet.cxx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/******************************************************************************
2-
* Copyright (C) 2019 GSI Helmholtzzentrum für Schwerionenforschung GmbH *
3-
* Copyright (C) 2019-2025 Members of R3B Collaboration *
2+
* Copyright (C) 2009 GSI Helmholtzzentrum für Schwerionenforschung GmbH *
3+
* Copyright (C) 2009-2026 Members of R3B Collaboration *
44
* *
55
* This software is distributed under the terms of the *
66
* GNU General Public Licence (GPL) version 3, *
@@ -12,7 +12,7 @@
1212
******************************************************************************/
1313

1414
#include "R3BAladinMagnet.h"
15-
#include "FairLogger.h"
15+
#include <FairLogger.h>
1616

1717
const Double_t __ALADIN_POS_DX = 0.;
1818
const Double_t __ALADIN_POS_DY = 0.;

passive/R3BAladinMagnet.h

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/******************************************************************************
2-
* Copyright (C) 2019 GSI Helmholtzzentrum für Schwerionenforschung GmbH *
3-
* Copyright (C) 2019-2025 Members of R3B Collaboration *
2+
* Copyright (C) 2009 GSI Helmholtzzentrum für Schwerionenforschung GmbH *
3+
* Copyright (C) 2009-2026 Members of R3B Collaboration *
44
* *
55
* This software is distributed under the terms of the *
66
* GNU General Public Licence (GPL) version 3, *
@@ -11,8 +11,7 @@
1111
* or submit itself to any jurisdiction. *
1212
******************************************************************************/
1313

14-
#ifndef R3BALADINMAGNET_H
15-
#define R3BALADINMAGNET_H
14+
#pragma once
1615

1716
#include "R3BModule.h"
1817

@@ -32,8 +31,6 @@ class R3BAladinMagnet : public R3BModule
3231
void SetRotation(const TGeoRotation&); // override;
3332

3433
private:
35-
ClassDef(R3BAladinMagnet, 3)
34+
ClassDef(R3BAladinMagnet, 3);
3635
// ClassDefOverride(R3BAladinMagnet, 3)
3736
};
38-
39-
#endif // R3BALADINMAGNET_H

passive/R3BCave.cxx

Lines changed: 27 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/******************************************************************************
2-
* Copyright (C) 2019 GSI Helmholtzzentrum für Schwerionenforschung GmbH *
3-
* Copyright (C) 2019-2025 Members of R3B Collaboration *
2+
* Copyright (C) 2009 GSI Helmholtzzentrum für Schwerionenforschung GmbH *
3+
* Copyright (C) 2009-2026 Members of R3B Collaboration *
44
* *
55
* This software is distributed under the terms of the *
66
* GNU General Public Licence (GPL) version 3, *
@@ -12,22 +12,22 @@
1212
******************************************************************************/
1313

1414
#include "R3BCave.h"
15+
#include "R3BGeoCave.h"
16+
#include "R3BGeoPassivePar.h"
1517

16-
#include "FairGeoInterface.h"
17-
#include "FairGeoLoader.h"
18-
#include "FairGeoNode.h"
19-
#include "FairGeoRootBuilder.h"
20-
#include "FairGeoVolume.h"
21-
#include "FairRun.h"
22-
#include "FairRuntimeDb.h"
18+
#include <FairGeoInterface.h>
19+
#include <FairGeoLoader.h>
20+
#include <FairGeoNode.h>
21+
#include <FairGeoRootBuilder.h>
22+
#include <FairGeoVolume.h>
23+
#include <FairRun.h>
24+
#include <FairRuntimeDb.h>
2325

24-
#include "TObjArray.h"
2526
#include <TList.h>
27+
#include <TObjArray.h>
28+
#include <algorithm>
2629
#include <stddef.h>
2730

28-
#include "R3BGeoCave.h"
29-
#include "R3BGeoPassivePar.h"
30-
3131
R3BCave::R3BCave()
3232
: FairModule()
3333
{
@@ -36,47 +36,40 @@ R3BCave::R3BCave()
3636
R3BCave::R3BCave(const char* name, const char* Title)
3737
: FairModule(name, Title)
3838
{
39-
world[0] = 0;
40-
world[1] = 0;
41-
world[2] = 0;
4239
}
4340

4441
R3BCave::R3BCave(const R3BCave& right)
4542
: FairModule(right)
4643
{
47-
world[0] = right.world[0];
48-
world[1] = right.world[1];
49-
world[2] = right.world[2];
44+
std::copy(std::begin(right.world), std::end(right.world), world);
5045
}
5146

52-
R3BCave::~R3BCave() {}
53-
5447
void R3BCave::ConstructGeometry()
5548
{
56-
FairGeoLoader* loader = FairGeoLoader::Instance();
57-
FairGeoInterface* GeoInterface = loader->getGeoInterface();
58-
R3BGeoCave* MGeo = new R3BGeoCave();
49+
auto* loader = FairGeoLoader::Instance();
50+
auto* GeoInterface = loader->getGeoInterface();
51+
auto* MGeo = new R3BGeoCave();
5952
MGeo->setGeomFile(GetGeometryFileName());
6053
GeoInterface->addGeoModule(MGeo);
61-
Bool_t rc = GeoInterface->readSet(MGeo);
54+
auto rc = GeoInterface->readSet(MGeo);
6255
if (rc)
6356
{
6457
MGeo->create(loader->getGeoBuilder());
6558
}
6659

67-
TList* volList = MGeo->getListOfVolumes();
60+
auto* volList = MGeo->getListOfVolumes();
6861
// store geo parameter
6962

70-
FairRun* fRun = FairRun::Instance();
71-
FairRuntimeDb* rtdb = FairRun::Instance()->GetRuntimeDb();
63+
auto* fRun = FairRun::Instance();
64+
auto* rtdb = FairRun::Instance()->GetRuntimeDb();
7265

73-
R3BGeoPassivePar* par = dynamic_cast<R3BGeoPassivePar*>(rtdb->getContainer("R3BGeoPassivePar"));
74-
TObjArray* fSensNodes = par->GetGeoSensitiveNodes();
75-
TObjArray* fPassNodes = par->GetGeoPassiveNodes();
66+
auto* par = dynamic_cast<R3BGeoPassivePar*>(rtdb->getContainer("R3BGeoPassivePar"));
67+
auto* fSensNodes = par->GetGeoSensitiveNodes();
68+
auto* fPassNodes = par->GetGeoPassiveNodes();
7669

7770
TListIter iter(volList);
78-
FairGeoNode* node = NULL;
79-
FairGeoVolume* aVol = NULL;
71+
FairGeoNode* node = nullptr;
72+
FairGeoVolume* aVol = nullptr;
8073

8174
while ((node = dynamic_cast<FairGeoNode*>(iter.Next())))
8275
{
@@ -96,4 +89,4 @@ void R3BCave::ConstructGeometry()
9689

9790
FairModule* R3BCave::CloneModule() const { return new R3BCave(*this); }
9891

99-
ClassImp(R3BCave);
92+
ClassImp(R3BCave)

passive/R3BCave.h

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/******************************************************************************
2-
* Copyright (C) 2019 GSI Helmholtzzentrum für Schwerionenforschung GmbH *
3-
* Copyright (C) 2019-2025 Members of R3B Collaboration *
2+
* Copyright (C) 2009 GSI Helmholtzzentrum für Schwerionenforschung GmbH *
3+
* Copyright (C) 2009-2026 Members of R3B Collaboration *
44
* *
55
* This software is distributed under the terms of the *
66
* GNU General Public Licence (GPL) version 3, *
@@ -11,31 +11,31 @@
1111
* or submit itself to any jurisdiction. *
1212
******************************************************************************/
1313

14-
#ifndef R3BCAVE_H
15-
#define R3BCAVE_H 1
14+
#pragma once
1615

17-
#include "FairDetector.h"
18-
#include "FairModule.h"
16+
#include <FairDetector.h>
17+
#include <FairModule.h>
1918

20-
#include "Rtypes.h"
19+
#include <Rtypes.h>
2120

2221
class R3BCave : public FairModule
2322
{
2423
public:
25-
R3BCave(const char* name, const char* Title = "Exp Cave");
2624
R3BCave();
27-
virtual ~R3BCave();
25+
explicit R3BCave(const char* name, const char* Title = "Exp Cave");
26+
27+
virtual ~R3BCave() = default;
28+
2829
virtual void ConstructGeometry();
2930

3031
virtual FairModule* CloneModule() const;
3132

3233
private:
33-
Double_t world[3];
34+
double world[3]{};
3435

3536
R3BCave(const R3BCave&);
3637
R3BCave& operator=(const R3BCave&);
3738

38-
ClassDef(R3BCave, 2);
39+
public:
40+
ClassDef(R3BCave, 2); // NOLINT
3941
};
40-
41-
#endif // R3BCave_H

passive/R3BCollimator.cxx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/******************************************************************************
2-
* Copyright (C) 2019 GSI Helmholtzzentrum für Schwerionenforschung GmbH *
3-
* Copyright (C) 2019-2025 Members of R3B Collaboration *
2+
* Copyright (C) 2018 GSI Helmholtzzentrum für Schwerionenforschung GmbH *
3+
* Copyright (C) 2018-2026 Members of R3B Collaboration *
44
* *
55
* This software is distributed under the terms of the *
66
* GNU General Public Licence (GPL) version 3, *
@@ -13,8 +13,8 @@
1313

1414
#include "R3BCollimator.h"
1515

16-
#include "TGeoManager.h"
17-
#include "TGeoTube.h"
16+
#include <TGeoManager.h>
17+
#include <TGeoTube.h>
1818

1919
R3BCollimator::R3BCollimator()
2020
: R3BModule()

passive/R3BCollimator.h

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/******************************************************************************
2-
* Copyright (C) 2019 GSI Helmholtzzentrum für Schwerionenforschung GmbH *
3-
* Copyright (C) 2019-2025 Members of R3B Collaboration *
2+
* Copyright (C) 2018 GSI Helmholtzzentrum für Schwerionenforschung GmbH *
3+
* Copyright (C) 2018-2026 Members of R3B Collaboration *
44
* *
55
* This software is distributed under the terms of the *
66
* GNU General Public Licence (GPL) version 3, *
@@ -11,8 +11,7 @@
1111
* or submit itself to any jurisdiction. *
1212
******************************************************************************/
1313

14-
#ifndef R3BCOLLIMATOR_H
15-
#define R3BCOLLIMATOR_H
14+
#pragma once
1615

1716
#include "R3BModule.h"
1817

@@ -34,10 +33,10 @@ class R3BCollimator : public R3BModule
3433

3534
virtual void ConstructGeometry();
3635

37-
ClassDef(R3BCollimator, 1) void SetParContainers();
36+
void SetParContainers();
37+
38+
ClassDef(R3BCollimator, 1);
3839

3940
protected:
4041
R3BTGeoPar* fTGeoPar; //!
4142
};
42-
43-
#endif // R3BCOLLIMATOR_H

passive/R3BGeoCave.cxx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/******************************************************************************
2-
* Copyright (C) 2019 GSI Helmholtzzentrum für Schwerionenforschung GmbH *
3-
* Copyright (C) 2019-2025 Members of R3B Collaboration *
2+
* Copyright (C) 2009 GSI Helmholtzzentrum für Schwerionenforschung GmbH *
3+
* Copyright (C) 2009-2026 Members of R3B Collaboration *
44
* *
55
* This software is distributed under the terms of the *
66
* GNU General Public Licence (GPL) version 3, *

passive/R3BGeoCave.h

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/******************************************************************************
2-
* Copyright (C) 2019 GSI Helmholtzzentrum für Schwerionenforschung GmbH *
3-
* Copyright (C) 2019-2025 Members of R3B Collaboration *
2+
* Copyright (C) 2009 GSI Helmholtzzentrum für Schwerionenforschung GmbH *
3+
* Copyright (C) 2009-2026 Members of R3B Collaboration *
44
* *
55
* This software is distributed under the terms of the *
66
* GNU General Public Licence (GPL) version 3, *
@@ -11,8 +11,7 @@
1111
* or submit itself to any jurisdiction. *
1212
******************************************************************************/
1313

14-
#ifndef R3BGEOCAVE_H
15-
#define R3BGEOCAVE_H 1
14+
#pragma once
1615

1716
#include "FairGeoSet.h"
1817

@@ -36,7 +35,5 @@ class R3BGeoCave : public FairGeoSet
3635
void addRefNodes();
3736
void write(std::fstream&);
3837
void print();
39-
ClassDef(R3BGeoCave, 0) // Class for the geometry of CAVE
38+
ClassDef(R3BGeoCave, 0); // Class for the geometry of CAVE
4039
};
41-
42-
#endif /* !R3BGEOCAVE_H */

0 commit comments

Comments
 (0)