Skip to content

Commit 737b961

Browse files
Apply the coding convention to the passive modules
1 parent 86be3de commit 737b961

14 files changed

Lines changed: 126 additions & 105 deletions

its/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ Point.cxx
3030
)
3131

3232
Set(LINKDEF itsLinkDef.h)
33-
Set(LIBRARY_NAME AliceO2its)
33+
Set(LIBRARY_NAME O2its)
3434
Set(DEPENDENCIES
3535
Base
3636
)

macro/run_sim.C

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,8 @@ void run_sim(Int_t nEvents = 10, TString mcEngine = "TGeant3")
2525
TStopwatch timer;
2626
timer.Start();
2727

28-
gSystem->Load("libAliceO2Base");
29-
gSystem->Load("libAliceO2its");
28+
// gSystem->Load("libAliceO2Base");
29+
// gSystem->Load("libAliceO2its");
3030

3131
// Create simulation run
3232
FairRunSim* run = new FairRunSim();
@@ -38,7 +38,7 @@ void run_sim(Int_t nEvents = 10, TString mcEngine = "TGeant3")
3838
run->SetMaterials("media.geo"); // Materials
3939

4040
// Create geometry
41-
FairModule* cave = new AliCave("CAVE");
41+
AliceO2::Passive::Cave* cave = new AliceO2::Passive::Cave("CAVE");
4242
cave->SetGeometryFileName("cave.geo");
4343
run->AddModule(cave);
4444

passive/CMakeLists.txt

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,11 @@ ${FAIRROOT_LIBRARY_DIR}
2020
link_directories( ${LINK_DIRECTORIES})
2121

2222
set(SRCS
23-
AliCave.cxx
24-
AliPipe.cxx
25-
AliGeoCave.cxx
26-
AliMagnet.cxx
27-
AliPassiveContFact.cxx
23+
Cave.cxx
24+
GeoCave.cxx
25+
Pipe.cxx
26+
Magnet.cxx
27+
PassiveContFact.cxx
2828
)
2929

3030
Set(HEADERS )
Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,11 @@
88
********************************************************************************/
99

1010
// -------------------------------------------------------------------------
11-
// ----- AliCave file -----
11+
// ----- Cave file -----
1212
// ----- Created 26/03/14 by M. Al-Turany -----
1313
// -------------------------------------------------------------------------
14-
#include "AliCave.h"
15-
#include "AliGeoCave.h" // for AliGeoCave
14+
#include "Cave.h"
15+
#include "GeoCave.h" // for AliGeoCave
1616
#include "FairGeoInterface.h" // for FairGeoInterface
1717
#include "FairGeoLoader.h" // for FairGeoLoader
1818
#include "FairGeoNode.h" // for FairGeoNode
@@ -27,29 +27,33 @@
2727

2828
#include <stddef.h> // for NULL
2929

30-
ClassImp(AliCave)
30+
using namespace AliceO2::Passive;
3131

32-
void AliCave::ConstructGeometry()
32+
ClassImp(AliceO2::Passive::Cave)
33+
34+
35+
36+
void Cave::ConstructGeometry()
3337
{
3438
FairGeoLoader* loader=FairGeoLoader::Instance();
3539
FairGeoInterface* GeoInterface =loader->getGeoInterface();
36-
AliGeoCave* MGeo=new AliGeoCave();
40+
GeoCave* MGeo=new GeoCave();
3741
MGeo->setGeomFile(GetGeometryFileName());
3842
GeoInterface->addGeoModule(MGeo);
3943
Bool_t rc = GeoInterface->readSet(MGeo);
4044
if ( rc ) { MGeo->create(loader->getGeoBuilder()); }
4145

4246
}
43-
AliCave::AliCave()
47+
Cave::Cave()
4448
:FairModule()
4549
{
4650
}
4751

48-
AliCave::~AliCave()
52+
Cave::~Cave()
4953
{
5054

5155
}
52-
AliCave::AliCave(const char* name, const char* Title)
56+
Cave::Cave(const char* name, const char* Title)
5357
: FairModule(name ,Title)
5458
{
5559
world[0] = 0;

passive/AliCave.h renamed to passive/Cave.h

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -7,31 +7,33 @@
77
********************************************************************************/
88

99
// -------------------------------------------------------------------------
10-
// ----- AliCave file -----
10+
// ----- Cave file -----
1111
// ----- Created 26/03/14 by M. Al-Turany -----
1212
// -------------------------------------------------------------------------
1313

1414

15-
#ifndef Cave_H
16-
#define Cave_H
15+
#ifndef ALICEO2_PASSIVE_Cave_H
16+
#define ALICEO2_PASSIVE_Cave_H
1717

1818
#include "FairModule.h" // for FairModule
19+
#include "Rtypes.h" // for ClassDef, etc
20+
namespace AliceO2 {
21+
namespace Passive {
1922

20-
#include "Rtypes.h" // for AliCave::Class, ClassDef, etc
21-
22-
class AliCave : public FairModule
23+
class Cave : public FairModule
2324
{
2425
public:
25-
AliCave(const char* name, const char* Title="Exp Cave");
26-
AliCave();
27-
virtual ~AliCave();
26+
Cave(const char* name, const char* Title="Exp Cave");
27+
Cave();
28+
virtual ~Cave();
2829
virtual void ConstructGeometry();
2930

3031

3132
private:
3233
Double_t world[3];
33-
ClassDef(AliCave,1) //PNDCaveSD
34+
ClassDef(AliceO2::Passive::Cave,1) //
3435
};
35-
36+
}
37+
}
3638
#endif //Cave_H
3739

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -7,18 +7,18 @@
77
********************************************************************************/
88

99
// -------------------------------------------------------------------------
10-
// ----- AliGeoCave file -----
10+
// ----- GeoCave file -----
1111
// ----- Created 26/03/14 by M. Al-Turany -----
1212
// -------------------------------------------------------------------------
1313

1414
/////////////////////////////////////////////////////////////
15-
// AliGeoCave
15+
// GeoCave
1616
//
1717
// Class for the geometry of the detector part CAVE
1818
//
1919
/////////////////////////////////////////////////////////////
2020

21-
#include "AliGeoCave.h"
21+
#include "GeoCave.h"
2222

2323
#include "FairGeoBasicShape.h" // for FairGeoBasicShape
2424
#include "FairGeoMedia.h" // for FairGeoMedia
@@ -32,9 +32,10 @@
3232
#include <iostream> // for cout
3333

3434
using namespace std;
35-
ClassImp(AliGeoCave)
35+
using namespace AliceO2::Passive;
36+
ClassImp(AliceO2::Passive::GeoCave)
3637

37-
AliGeoCave::AliGeoCave()
38+
GeoCave::GeoCave()
3839
: FairGeoSet(),
3940
name("cave")
4041
{
@@ -44,7 +45,7 @@ AliGeoCave::AliGeoCave()
4445
maxModules=1;
4546
}
4647

47-
Bool_t AliGeoCave::read(fstream& fin,FairGeoMedia* media)
48+
Bool_t GeoCave::read(fstream& fin,FairGeoMedia* media)
4849
{
4950
// Reads the geometry from file
5051
if (!media) { return kFALSE; }
@@ -90,14 +91,14 @@ Bool_t AliGeoCave::read(fstream& fin,FairGeoMedia* media)
9091
return rc;
9192
}
9293

93-
void AliGeoCave::addRefNodes()
94+
void GeoCave::addRefNodes()
9495
{
9596
// Adds the reference node
9697
FairGeoNode* volu=getVolume(name);
9798
if (volu) { masterNodes->Add(new FairGeoNode(*volu)); }
9899
}
99100

100-
void AliGeoCave::write(fstream& fout)
101+
void GeoCave::write(fstream& fout)
101102
{
102103
// Writes the geometry to file
103104
fout.setf(ios::fixed,ios::floatfield);
@@ -112,7 +113,7 @@ void AliGeoCave::write(fstream& fout)
112113
}
113114
}
114115

115-
void AliGeoCave::print()
116+
void GeoCave::print()
116117
{
117118
// Prints the geometry
118119
FairGeoNode* volu=getVolume(name);
Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@
1313
// -------------------------------------------------------------------------
1414

1515

16-
#ifndef MYGEOCAVE_H
17-
#define MYGEOCAVE_H
16+
#ifndef ALICEO2_PASSIVE_GEOCAVE_H
17+
#define ALICEO2_PASSIVE_GEOCAVE_H
1818

1919
#include "FairGeoSet.h" // for FairGeoSet
2020
#include "Riosfwd.h" // for fstream
@@ -24,20 +24,23 @@
2424
#include <fstream> // for fstream
2525

2626
class FairGeoMedia;
27+
namespace AliceO2 {
28+
namespace Passive {
2729

28-
class AliGeoCave : public FairGeoSet
30+
class GeoCave : public FairGeoSet
2931
{
3032
protected:
3133
TString name;
3234
public:
33-
AliGeoCave();
34-
~AliGeoCave() {}
35+
GeoCave();
36+
~GeoCave() {}
3537
const char* getModuleName(Int_t) {return name.Data();}
3638
Bool_t read(fstream&,FairGeoMedia*);
3739
void addRefNodes();
3840
void write(fstream&);
3941
void print();
40-
ClassDef(AliGeoCave,0) // Class for the geometry of CAVE
42+
ClassDef(AliceO2::Passive::GeoCave,0) // Class for the geometry of CAVE
4143
};
42-
44+
}
45+
}
4346
#endif /* !PNDGEOCAVE_H */
Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,11 @@
77
********************************************************************************/
88

99
// -------------------------------------------------------------------------
10-
// ----- AliMagnet file -----
10+
// ----- Magnet file -----
1111
// ----- Created 26/03/14 by M. Al-Turany -----
1212
// -------------------------------------------------------------------------
1313

14-
#include "AliMagnet.h"
14+
#include "Magnet.h"
1515

1616
#include "TGeoManager.h"
1717
#include "FairRun.h" // for FairRun
@@ -29,22 +29,23 @@
2929
#include <stddef.h> // for NULL
3030
#include <iostream> // for operator<<, basic_ostream, etc
3131

32+
using namespace AliceO2::Passive;
3233

3334

34-
AliMagnet::~AliMagnet()
35+
Magnet::~Magnet()
3536
{
3637
}
37-
AliMagnet::AliMagnet()
38-
: FairModule("AliMagnet", "")
38+
Magnet::Magnet()
39+
: FairModule("Magnet", "")
3940
{
4041
}
4142

42-
AliMagnet::AliMagnet(const char* name, const char* Title)
43+
Magnet::Magnet(const char* name, const char* Title)
4344
: FairModule(name ,Title)
4445
{
4546
}
4647

47-
void AliMagnet::ConstructGeometry()
48+
void Magnet::ConstructGeometry()
4849
{
4950

5051
TGeoVolume *top=gGeoManager->GetTopVolume();
@@ -96,8 +97,7 @@ void AliMagnet::ConstructGeometry()
9697
}
9798

9899

99-
100-
ClassImp(AliMagnet)
100+
ClassImp(AliceO2::Passive::Magnet)
101101

102102

103103

Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -7,28 +7,33 @@
77
********************************************************************************/
88

99
// -------------------------------------------------------------------------
10-
// ----- AliMagnet file -----
10+
// ----- Magnet file -----
1111
// ----- Created 26/03/14 by M. Al-Turany -----
1212
// -------------------------------------------------------------------------
1313

1414

15-
#ifndef MAGNET_H
16-
#define MAGNET_H
15+
#ifndef ALICEO2_PASSIVE_MAGNET_H
16+
#define ALICEO2_PASSIVE_MAGNET_H
1717

1818
#include "FairModule.h" // for FairModule
19-
#include "Rtypes.h" // for AliMagnet::Class, Bool_t, etc
19+
#include "Rtypes.h" // for Magnet::Class, Bool_t, etc
2020
#include <string> // for string
21+
namespace AliceO2 {
22+
namespace Passive {
2123

22-
class AliMagnet : public FairModule
24+
class Magnet : public FairModule
2325
{
2426
public:
25-
AliMagnet(const char* name, const char* Title="MY Magnet");
26-
AliMagnet();
27-
virtual ~AliMagnet();
27+
Magnet(const char* name, const char* Title="MY Magnet");
28+
Magnet();
29+
virtual ~Magnet();
2830
void ConstructGeometry();
29-
ClassDef(AliMagnet,1)
31+
ClassDef(AliceO2::Passive::Magnet,1)
3032

3133
};
3234

35+
}
36+
}
37+
3338
#endif //MAGNET_H
3439

0 commit comments

Comments
 (0)