Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 34 additions & 0 deletions AliBase/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# Create a library called "O2MCStack" which includes the source files given in
# the array .
# The extension is already found. Any number of sources could be listed here.

set(INCLUDE_DIRECTORIES
${ROOT_INCLUDE_DIR}
${BASE_INCLUDE_DIRECTORIES}
${CMAKE_SOURCE_DIR}/AliBase
)

include_directories( ${INCLUDE_DIRECTORIES})

set(LINK_DIRECTORIES
${ROOT_LIBRARY_DIR}
${FAIRROOT_LIBRARY_DIR}
${CMAKE_SOURCE_DIR}/AliBase

)

link_directories( ${LINK_DIRECTORIES})

set(SRCS
O2Module.cxx
O2Detector.cxx
O2TrackReference.cxx
)

Set(HEADERS)
Set(LINKDEF O2BaseLinkDef.h)
Set(LIBRARY_NAME O2Base)
Set(DEPENDENCIES Base EG Physics Cint Core)

GENERATE_LIBRARY()

13 changes: 13 additions & 0 deletions AliBase/O2BaseLinkDef.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@

#ifdef __CINT__

#pragma link off all globals;
#pragma link off all classes;
#pragma link off all functions;

#pragma link C++ class O2Module+;
#pragma link C++ class O2Detector+;
#pragma link C++ class O2TrackReference+;

#endif

121 changes: 121 additions & 0 deletions AliBase/O2Detector.cxx
Original file line number Diff line number Diff line change
@@ -0,0 +1,121 @@
#include "O2Detector.h"

#include <Riostream.h>
#include <TVirtualMC.h>


using std::endl;
using std::cout;
using std::fstream;
using std::ios;
using std::ostream;

ClassImp(O2Detector)

Float_t O2Detector::fgDensityFactor = 1.0;

//_______________________________________________________________________
O2Detector::O2Detector():
FairDetector()
{
//
// Default constructor for the O2Detector class
//
}

//_______________________________________________________________________
O2Detector::O2Detector(const char* name,Bool_t Active, Int_t DetId):
FairDetector(name,Active,DetId)
{
}

//_______________________________________________________________________
O2Detector::~O2Detector()
{

}

//_______________________________________________________________________
void O2Detector::AliMaterial(Int_t imat, const char* name, Float_t a,
Float_t z, Float_t dens, Float_t radl,
Float_t absl, Float_t *buf, Int_t nwbuf) const
{
TString uniquename = GetName();
uniquename.Append("_");
uniquename.Append(name);

//Check this!!!
gMC->Material(imat, uniquename.Data(), a, z, dens * fgDensityFactor, radl, absl, buf, nwbuf);
}


//_______________________________________________________________________
void O2Detector::AliMixture(Int_t imat, const char *name, Float_t *a,
Float_t *z, Float_t dens, Int_t nlmat,
Float_t *wmat) const
{
TString uniquename = GetName();
uniquename.Append("_");
uniquename.Append(name);

//Check this!!!
gMC->Mixture(imat, uniquename.Data(), a, z, dens * fgDensityFactor, nlmat, wmat);
}

//_______________________________________________________________________
void O2Detector::AliMedium(Int_t numed, const char *name, Int_t nmat,
Int_t isvol, Int_t ifield, Float_t fieldm,
Float_t tmaxfd, Float_t stemax, Float_t deemax,
Float_t epsil, Float_t stmin, Float_t *ubuf,
Int_t nbuf) const
{
TString uniquename = GetName();
uniquename.Append("_");
uniquename.Append(name);

//Check this!!!
gMC->Medium(numed, uniquename.Data(), nmat, isvol, ifield,
fieldm, tmaxfd, stemax, deemax, epsil, stmin, ubuf, nbuf);
}

//_______________________________________________________________________
void O2Detector::AliMatrix(Int_t &nmat, Float_t theta1, Float_t phi1,
Float_t theta2, Float_t phi2, Float_t theta3,
Float_t phi3) const
{
//
// Define a rotation matrix. Angles are in degrees.
//
// nmat on output contains the number assigned to the rotation matrix
// theta1 polar angle for axis I
// phi1 azimuthal angle for axis I
// theta2 polar angle for axis II
// phi2 azimuthal angle for axis II
// theta3 polar angle for axis III
// phi3 azimuthal angle for axis III
//
gMC->Matrix(nmat, theta1, phi1, theta2, phi2, theta3, phi3);
}

void O2Detector::DefineWrapVolume(Int_t id, Double_t rmin,Double_t rmax, Double_t zspan)
{
}

void O2Detector::SetNWrapVolumes(Int_t n)
{
}

void O2Detector::DefineLayer(const Int_t nlay, const double phi0, const Double_t r,
const Double_t zlen, const Int_t nladd,
const Int_t nmod, const Double_t lthick,
const Double_t dthick, const UInt_t dettypeID,
const Int_t buildLevel)
{
}

void O2Detector::DefineLayerTurbo(Int_t nlay, Double_t phi0, Double_t r, Double_t zlen, Int_t nladd,
Int_t nmod, Double_t width, Double_t tilt,
Double_t lthick,Double_t dthick,
UInt_t dettypeID, Int_t buildLevel)
{
}
62 changes: 62 additions & 0 deletions AliBase/O2Detector.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
#ifndef O2DETECTOR_H
#define O2DETECTOR_H

//
// This is the basic class for any
// ALICE detector module, whether it is
// sensitive or not. Detector classes depend
// on this.
//

#include "FairDetector.h"

class O2Detector : public FairDetector {
public:

// Creators - distructors
O2Detector(const char* name, Bool_t Active, Int_t DetId=0);
O2Detector();
virtual ~O2Detector();

// Module composition
virtual void AliMaterial(Int_t imat, const char* name, Float_t a,
Float_t z, Float_t dens, Float_t radl,
Float_t absl, Float_t *buf=0, Int_t nwbuf=0) const;
virtual void AliMixture(Int_t imat, const char *name, Float_t *a,
Float_t *z, Float_t dens, Int_t nlmat,
Float_t *wmat) const;
virtual void AliMedium(Int_t numed, const char *name, Int_t nmat,
Int_t isvol, Int_t ifield, Float_t fieldm,
Float_t tmaxfd, Float_t stemax, Float_t deemax,
Float_t epsil, Float_t stmin, Float_t *ubuf=0,
Int_t nbuf=0) const;
virtual void AliMatrix(Int_t &nmat, Float_t theta1, Float_t phi1,
Float_t theta2, Float_t phi2, Float_t theta3,
Float_t phi3) const;

static void SetDensityFactor(Float_t density) { fgDensityFactor = density; }
static Float_t GetDensityFactor() { return fgDensityFactor; }

/** Set per wrapper volume parameters */
virtual void DefineWrapVolume(Int_t id, Double_t rmin,Double_t rmax, Double_t zspan);

/** Book arrays for wrapper volumes */
virtual void SetNWrapVolumes(Int_t n);

virtual void DefineLayer(Int_t nlay,Double_t phi0,Double_t r,Double_t zlen,Int_t nladd,
Int_t nmod, Double_t lthick=0.,Double_t dthick=0.,UInt_t detType=0, Int_t buildFlag=0);

virtual void DefineLayerTurbo(Int_t nlay,Double_t phi0,Double_t r,Double_t zlen,Int_t nladd,
Int_t nmod,Double_t width,Double_t tilt,
Double_t lthick = 0.,Double_t dthick = 0.,UInt_t detType=0, Int_t buildFlag=0);

protected:

static Float_t fgDensityFactor; //! factor that is multiplied to all material densities (ONLY for systematic studies)
private:
O2Detector(const O2Detector&);
O2Detector& operator=(const O2Detector&);

ClassDef(O2Detector, 1) //Base class for ALICE Modules
};
#endif
91 changes: 91 additions & 0 deletions AliBase/O2Module.cxx
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
#include "O2Module.h"
#include <Riostream.h>
#include <TVirtualMC.h>

using std::endl;
using std::cout;
using std::fstream;
using std::ios;
using std::ostream;

ClassImp(O2Module)

Float_t O2Module::fgDensityFactor = 1.0;

//_______________________________________________________________________
O2Module::O2Module():
FairModule()
{
//
// Default constructor for the O2Module class
//
}

//_______________________________________________________________________
O2Module::O2Module(const char* name,const char *title, Bool_t Active):
FairModule(name,title, Active)
{
}

//_______________________________________________________________________
O2Module::~O2Module()
{

}

void O2Module::AliMaterial(Int_t imat, const char* name, Float_t a,
Float_t z, Float_t dens, Float_t radl,
Float_t absl, Float_t *buf, Int_t nwbuf) const
{
TString uniquename = GetName();
uniquename.Append("_");
uniquename.Append(name);

//Check this!!!
gMC->Material(imat, uniquename.Data(), a, z, dens * fgDensityFactor, radl, absl, buf, nwbuf);
}

void O2Module::AliMixture(Int_t imat, const char *name, Float_t *a,
Float_t *z, Float_t dens, Int_t nlmat,
Float_t *wmat) const
{
TString uniquename = GetName();
uniquename.Append("_");
uniquename.Append(name);

//Check this!!!
gMC->Mixture(imat, uniquename.Data(), a, z, dens * fgDensityFactor, nlmat, wmat);
}

void O2Module::AliMedium(Int_t numed, const char *name, Int_t nmat,
Int_t isvol, Int_t ifield, Float_t fieldm,
Float_t tmaxfd, Float_t stemax, Float_t deemax,
Float_t epsil, Float_t stmin, Float_t *ubuf,
Int_t nbuf) const
{
TString uniquename = GetName();
uniquename.Append("_");
uniquename.Append(name);

//Check this!!!
gMC->Medium(numed, uniquename.Data(), nmat, isvol, ifield,
fieldm, tmaxfd, stemax, deemax, epsil, stmin, ubuf, nbuf);
}

void O2Module::AliMatrix(Int_t &nmat, Float_t theta1, Float_t phi1,
Float_t theta2, Float_t phi2, Float_t theta3,
Float_t phi3) const
{
//
// Define a rotation matrix. Angles are in degrees.
//
// nmat on output contains the number assigned to the rotation matrix
// theta1 polar angle for axis I
// phi1 azimuthal angle for axis I
// theta2 polar angle for axis II
// phi2 azimuthal angle for axis II
// theta3 polar angle for axis III
// phi3 azimuthal angle for axis III
//
gMC->Matrix(nmat, theta1, phi1, theta2, phi2, theta3, phi3);
}
53 changes: 53 additions & 0 deletions AliBase/O2Module.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
#ifndef O2MODULE_H
#define O2MODULE_H

//
// This is the basic class for any
// ALICE detector module, whether it is
// sensitive or not. Detector classes depend
// on this.
//

#include "FairModule.h"


class O2Module : public FairModule {

public:

// Creators - distructors
O2Module(const char* name, const char *title, Bool_t Active=kFALSE);
O2Module();
virtual ~O2Module();

// Module composition
virtual void AliMaterial(Int_t imat, const char* name, Float_t a,
Float_t z, Float_t dens, Float_t radl,
Float_t absl, Float_t *buf=0, Int_t nwbuf=0) const;
virtual void AliMixture(Int_t imat, const char *name, Float_t *a,
Float_t *z, Float_t dens, Int_t nlmat,
Float_t *wmat) const;
virtual void AliMedium(Int_t numed, const char *name, Int_t nmat,
Int_t isvol, Int_t ifield, Float_t fieldm,
Float_t tmaxfd, Float_t stemax, Float_t deemax,
Float_t epsil, Float_t stmin, Float_t *ubuf=0,
Int_t nbuf=0) const;
virtual void AliMatrix(Int_t &nmat, Float_t theta1, Float_t phi1,
Float_t theta2, Float_t phi2, Float_t theta3,
Float_t phi3) const;

static void SetDensityFactor(Float_t density) { fgDensityFactor = density; }
static Float_t GetDensityFactor() { return fgDensityFactor; }

protected:

static Float_t fgDensityFactor; //! factor that is multiplied to all material densities (ONLY for systematic studies)

private:

O2Module(const O2Module&);
O2Module& operator=(const O2Module&);

ClassDef(O2Module, 1) //Base class for ALICE Modules
};
#endif
Loading