Skip to content

Commit aafdfba

Browse files
committed
Initial commit of the ITS simulation code
1 parent 8bbe81e commit aafdfba

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

49 files changed

+10233
-860
lines changed

AliBase/CMakeLists.txt

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
# Create a library called "O2MCStack" which includes the source files given in
2+
# the array .
3+
# The extension is already found. Any number of sources could be listed here.
4+
5+
set(INCLUDE_DIRECTORIES
6+
${ROOT_INCLUDE_DIR}
7+
${BASE_INCLUDE_DIRECTORIES}
8+
${CMAKE_SOURCE_DIR}/AliBase
9+
)
10+
11+
include_directories( ${INCLUDE_DIRECTORIES})
12+
13+
set(LINK_DIRECTORIES
14+
${ROOT_LIBRARY_DIR}
15+
${FAIRROOT_LIBRARY_DIR}
16+
${CMAKE_SOURCE_DIR}/AliBase
17+
18+
)
19+
20+
link_directories( ${LINK_DIRECTORIES})
21+
22+
set(SRCS
23+
O2Module.cxx
24+
O2Detector.cxx
25+
O2TrackReference.cxx
26+
)
27+
28+
Set(HEADERS)
29+
Set(LINKDEF O2BaseLinkDef.h)
30+
Set(LIBRARY_NAME O2Base)
31+
Set(DEPENDENCIES Base EG Physics Cint Core)
32+
33+
GENERATE_LIBRARY()
34+

AliBase/O2BaseLinkDef.h

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
2+
#ifdef __CINT__
3+
4+
#pragma link off all globals;
5+
#pragma link off all classes;
6+
#pragma link off all functions;
7+
8+
#pragma link C++ class O2Module+;
9+
#pragma link C++ class O2Detector+;
10+
#pragma link C++ class O2TrackReference+;
11+
12+
#endif
13+

AliBase/O2Detector.cxx

Lines changed: 121 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,121 @@
1+
#include "O2Detector.h"
2+
3+
#include <Riostream.h>
4+
#include <TVirtualMC.h>
5+
6+
7+
using std::endl;
8+
using std::cout;
9+
using std::fstream;
10+
using std::ios;
11+
using std::ostream;
12+
13+
ClassImp(O2Detector)
14+
15+
Float_t O2Detector::fgDensityFactor = 1.0;
16+
17+
//_______________________________________________________________________
18+
O2Detector::O2Detector():
19+
FairDetector()
20+
{
21+
//
22+
// Default constructor for the O2Detector class
23+
//
24+
}
25+
26+
//_______________________________________________________________________
27+
O2Detector::O2Detector(const char* name,Bool_t Active, Int_t DetId):
28+
FairDetector(name,Active,DetId)
29+
{
30+
}
31+
32+
//_______________________________________________________________________
33+
O2Detector::~O2Detector()
34+
{
35+
36+
}
37+
38+
//_______________________________________________________________________
39+
void O2Detector::AliMaterial(Int_t imat, const char* name, Float_t a,
40+
Float_t z, Float_t dens, Float_t radl,
41+
Float_t absl, Float_t *buf, Int_t nwbuf) const
42+
{
43+
TString uniquename = GetName();
44+
uniquename.Append("_");
45+
uniquename.Append(name);
46+
47+
//Check this!!!
48+
gMC->Material(imat, uniquename.Data(), a, z, dens * fgDensityFactor, radl, absl, buf, nwbuf);
49+
}
50+
51+
52+
//_______________________________________________________________________
53+
void O2Detector::AliMixture(Int_t imat, const char *name, Float_t *a,
54+
Float_t *z, Float_t dens, Int_t nlmat,
55+
Float_t *wmat) const
56+
{
57+
TString uniquename = GetName();
58+
uniquename.Append("_");
59+
uniquename.Append(name);
60+
61+
//Check this!!!
62+
gMC->Mixture(imat, uniquename.Data(), a, z, dens * fgDensityFactor, nlmat, wmat);
63+
}
64+
65+
//_______________________________________________________________________
66+
void O2Detector::AliMedium(Int_t numed, const char *name, Int_t nmat,
67+
Int_t isvol, Int_t ifield, Float_t fieldm,
68+
Float_t tmaxfd, Float_t stemax, Float_t deemax,
69+
Float_t epsil, Float_t stmin, Float_t *ubuf,
70+
Int_t nbuf) const
71+
{
72+
TString uniquename = GetName();
73+
uniquename.Append("_");
74+
uniquename.Append(name);
75+
76+
//Check this!!!
77+
gMC->Medium(numed, uniquename.Data(), nmat, isvol, ifield,
78+
fieldm, tmaxfd, stemax, deemax, epsil, stmin, ubuf, nbuf);
79+
}
80+
81+
//_______________________________________________________________________
82+
void O2Detector::AliMatrix(Int_t &nmat, Float_t theta1, Float_t phi1,
83+
Float_t theta2, Float_t phi2, Float_t theta3,
84+
Float_t phi3) const
85+
{
86+
//
87+
// Define a rotation matrix. Angles are in degrees.
88+
//
89+
// nmat on output contains the number assigned to the rotation matrix
90+
// theta1 polar angle for axis I
91+
// phi1 azimuthal angle for axis I
92+
// theta2 polar angle for axis II
93+
// phi2 azimuthal angle for axis II
94+
// theta3 polar angle for axis III
95+
// phi3 azimuthal angle for axis III
96+
//
97+
gMC->Matrix(nmat, theta1, phi1, theta2, phi2, theta3, phi3);
98+
}
99+
100+
void O2Detector::DefineWrapVolume(Int_t id, Double_t rmin,Double_t rmax, Double_t zspan)
101+
{
102+
}
103+
104+
void O2Detector::SetNWrapVolumes(Int_t n)
105+
{
106+
}
107+
108+
void O2Detector::DefineLayer(const Int_t nlay, const double phi0, const Double_t r,
109+
const Double_t zlen, const Int_t nladd,
110+
const Int_t nmod, const Double_t lthick,
111+
const Double_t dthick, const UInt_t dettypeID,
112+
const Int_t buildLevel)
113+
{
114+
}
115+
116+
void O2Detector::DefineLayerTurbo(Int_t nlay, Double_t phi0, Double_t r, Double_t zlen, Int_t nladd,
117+
Int_t nmod, Double_t width, Double_t tilt,
118+
Double_t lthick,Double_t dthick,
119+
UInt_t dettypeID, Int_t buildLevel)
120+
{
121+
}

AliBase/O2Detector.h

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
#ifndef O2DETECTOR_H
2+
#define O2DETECTOR_H
3+
4+
//
5+
// This is the basic class for any
6+
// ALICE detector module, whether it is
7+
// sensitive or not. Detector classes depend
8+
// on this.
9+
//
10+
11+
#include "FairDetector.h"
12+
13+
class O2Detector : public FairDetector {
14+
public:
15+
16+
// Creators - distructors
17+
O2Detector(const char* name, Bool_t Active, Int_t DetId=0);
18+
O2Detector();
19+
virtual ~O2Detector();
20+
21+
// Module composition
22+
virtual void AliMaterial(Int_t imat, const char* name, Float_t a,
23+
Float_t z, Float_t dens, Float_t radl,
24+
Float_t absl, Float_t *buf=0, Int_t nwbuf=0) const;
25+
virtual void AliMixture(Int_t imat, const char *name, Float_t *a,
26+
Float_t *z, Float_t dens, Int_t nlmat,
27+
Float_t *wmat) const;
28+
virtual void AliMedium(Int_t numed, const char *name, Int_t nmat,
29+
Int_t isvol, Int_t ifield, Float_t fieldm,
30+
Float_t tmaxfd, Float_t stemax, Float_t deemax,
31+
Float_t epsil, Float_t stmin, Float_t *ubuf=0,
32+
Int_t nbuf=0) const;
33+
virtual void AliMatrix(Int_t &nmat, Float_t theta1, Float_t phi1,
34+
Float_t theta2, Float_t phi2, Float_t theta3,
35+
Float_t phi3) const;
36+
37+
static void SetDensityFactor(Float_t density) { fgDensityFactor = density; }
38+
static Float_t GetDensityFactor() { return fgDensityFactor; }
39+
40+
/** Set per wrapper volume parameters */
41+
virtual void DefineWrapVolume(Int_t id, Double_t rmin,Double_t rmax, Double_t zspan);
42+
43+
/** Book arrays for wrapper volumes */
44+
virtual void SetNWrapVolumes(Int_t n);
45+
46+
virtual void DefineLayer(Int_t nlay,Double_t phi0,Double_t r,Double_t zlen,Int_t nladd,
47+
Int_t nmod, Double_t lthick=0.,Double_t dthick=0.,UInt_t detType=0, Int_t buildFlag=0);
48+
49+
virtual void DefineLayerTurbo(Int_t nlay,Double_t phi0,Double_t r,Double_t zlen,Int_t nladd,
50+
Int_t nmod,Double_t width,Double_t tilt,
51+
Double_t lthick = 0.,Double_t dthick = 0.,UInt_t detType=0, Int_t buildFlag=0);
52+
53+
protected:
54+
55+
static Float_t fgDensityFactor; //! factor that is multiplied to all material densities (ONLY for systematic studies)
56+
private:
57+
O2Detector(const O2Detector&);
58+
O2Detector& operator=(const O2Detector&);
59+
60+
ClassDef(O2Detector, 1) //Base class for ALICE Modules
61+
};
62+
#endif

AliBase/O2Module.cxx

Lines changed: 91 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,91 @@
1+
#include "O2Module.h"
2+
#include <Riostream.h>
3+
#include <TVirtualMC.h>
4+
5+
using std::endl;
6+
using std::cout;
7+
using std::fstream;
8+
using std::ios;
9+
using std::ostream;
10+
11+
ClassImp(O2Module)
12+
13+
Float_t O2Module::fgDensityFactor = 1.0;
14+
15+
//_______________________________________________________________________
16+
O2Module::O2Module():
17+
FairModule()
18+
{
19+
//
20+
// Default constructor for the O2Module class
21+
//
22+
}
23+
24+
//_______________________________________________________________________
25+
O2Module::O2Module(const char* name,const char *title, Bool_t Active):
26+
FairModule(name,title, Active)
27+
{
28+
}
29+
30+
//_______________________________________________________________________
31+
O2Module::~O2Module()
32+
{
33+
34+
}
35+
36+
void O2Module::AliMaterial(Int_t imat, const char* name, Float_t a,
37+
Float_t z, Float_t dens, Float_t radl,
38+
Float_t absl, Float_t *buf, Int_t nwbuf) const
39+
{
40+
TString uniquename = GetName();
41+
uniquename.Append("_");
42+
uniquename.Append(name);
43+
44+
//Check this!!!
45+
gMC->Material(imat, uniquename.Data(), a, z, dens * fgDensityFactor, radl, absl, buf, nwbuf);
46+
}
47+
48+
void O2Module::AliMixture(Int_t imat, const char *name, Float_t *a,
49+
Float_t *z, Float_t dens, Int_t nlmat,
50+
Float_t *wmat) const
51+
{
52+
TString uniquename = GetName();
53+
uniquename.Append("_");
54+
uniquename.Append(name);
55+
56+
//Check this!!!
57+
gMC->Mixture(imat, uniquename.Data(), a, z, dens * fgDensityFactor, nlmat, wmat);
58+
}
59+
60+
void O2Module::AliMedium(Int_t numed, const char *name, Int_t nmat,
61+
Int_t isvol, Int_t ifield, Float_t fieldm,
62+
Float_t tmaxfd, Float_t stemax, Float_t deemax,
63+
Float_t epsil, Float_t stmin, Float_t *ubuf,
64+
Int_t nbuf) const
65+
{
66+
TString uniquename = GetName();
67+
uniquename.Append("_");
68+
uniquename.Append(name);
69+
70+
//Check this!!!
71+
gMC->Medium(numed, uniquename.Data(), nmat, isvol, ifield,
72+
fieldm, tmaxfd, stemax, deemax, epsil, stmin, ubuf, nbuf);
73+
}
74+
75+
void O2Module::AliMatrix(Int_t &nmat, Float_t theta1, Float_t phi1,
76+
Float_t theta2, Float_t phi2, Float_t theta3,
77+
Float_t phi3) const
78+
{
79+
//
80+
// Define a rotation matrix. Angles are in degrees.
81+
//
82+
// nmat on output contains the number assigned to the rotation matrix
83+
// theta1 polar angle for axis I
84+
// phi1 azimuthal angle for axis I
85+
// theta2 polar angle for axis II
86+
// phi2 azimuthal angle for axis II
87+
// theta3 polar angle for axis III
88+
// phi3 azimuthal angle for axis III
89+
//
90+
gMC->Matrix(nmat, theta1, phi1, theta2, phi2, theta3, phi3);
91+
}

AliBase/O2Module.h

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
#ifndef O2MODULE_H
2+
#define O2MODULE_H
3+
4+
//
5+
// This is the basic class for any
6+
// ALICE detector module, whether it is
7+
// sensitive or not. Detector classes depend
8+
// on this.
9+
//
10+
11+
#include "FairModule.h"
12+
13+
14+
class O2Module : public FairModule {
15+
16+
public:
17+
18+
// Creators - distructors
19+
O2Module(const char* name, const char *title, Bool_t Active=kFALSE);
20+
O2Module();
21+
virtual ~O2Module();
22+
23+
// Module composition
24+
virtual void AliMaterial(Int_t imat, const char* name, Float_t a,
25+
Float_t z, Float_t dens, Float_t radl,
26+
Float_t absl, Float_t *buf=0, Int_t nwbuf=0) const;
27+
virtual void AliMixture(Int_t imat, const char *name, Float_t *a,
28+
Float_t *z, Float_t dens, Int_t nlmat,
29+
Float_t *wmat) const;
30+
virtual void AliMedium(Int_t numed, const char *name, Int_t nmat,
31+
Int_t isvol, Int_t ifield, Float_t fieldm,
32+
Float_t tmaxfd, Float_t stemax, Float_t deemax,
33+
Float_t epsil, Float_t stmin, Float_t *ubuf=0,
34+
Int_t nbuf=0) const;
35+
virtual void AliMatrix(Int_t &nmat, Float_t theta1, Float_t phi1,
36+
Float_t theta2, Float_t phi2, Float_t theta3,
37+
Float_t phi3) const;
38+
39+
static void SetDensityFactor(Float_t density) { fgDensityFactor = density; }
40+
static Float_t GetDensityFactor() { return fgDensityFactor; }
41+
42+
protected:
43+
44+
static Float_t fgDensityFactor; //! factor that is multiplied to all material densities (ONLY for systematic studies)
45+
46+
private:
47+
48+
O2Module(const O2Module&);
49+
O2Module& operator=(const O2Module&);
50+
51+
ClassDef(O2Module, 1) //Base class for ALICE Modules
52+
};
53+
#endif

0 commit comments

Comments
 (0)