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, *
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-
3131R3BCave::R3BCave ()
3232 : FairModule()
3333{
@@ -36,47 +36,40 @@ R3BCave::R3BCave()
3636R3BCave::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
4441R3BCave::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-
5447void 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
9790FairModule* R3BCave::CloneModule () const { return new R3BCave (*this ); }
9891
99- ClassImp (R3BCave);
92+ ClassImp (R3BCave)
0 commit comments