Project
Loading...
Searching...
No Matches
o2::base::MaterialManager Class Reference

#include <MaterialManager.h>

Public Types

enum class  ESpecial : bool { kTRUE = true , kFALSE = false }
 scoped enum to decide whether settings are done globally or for a certain medium More...
 

Public Member Functions

void Material (const char *modname, Int_t imat, const char *name, Float_t a, Float_t z, Float_t dens, Float_t radl, Float_t absl, Float_t *buf=nullptr, Int_t nwbuf=0)
 
void Mixture (const char *modname, Int_t imat, const char *name, Float_t *a, Float_t *z, Float_t dens, Int_t nlmat, Float_t *wmat)
 
void Medium (const char *modname, 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=nullptr, Int_t nbuf=0)
 
void DefaultProcesses (const std::initializer_list< std::pair< EProc, int > > &parIDValMap)
 
void SpecialProcesses (const char *modname, int localindex, const std::initializer_list< std::pair< EProc, int > > &parIDValMap)
 
void DefaultProcess (EProc parID, int val)
 set default process
 
void SpecialProcess (const char *modname, int localindex, EProc parID, int val)
 Custom setting of process or cut given parameter name and value.
 
void DefaultCuts (const std::initializer_list< std::pair< ECut, Float_t > > &parIDValMap)
 
void SpecialCuts (const char *modname, int localindex, const std::initializer_list< std::pair< ECut, Float_t > > &parIDValMap)
 
void DefaultCut (ECut parID, Float_t val)
 set default cut
 
void SpecialCut (const char *modname, int localindex, ECut parID, Float_t val)
 Custom setting of process or cut given parameter name and value.
 
void SetLowEnergyNeutronTransport (bool flag)
 Set flag fro low energy neutron transport.
 
void loadCutsAndProcessesFromFile (const char *modname, const char *filename)
 load cuts and process flags from a data file (like AliRoot did)
 
void loadCutsAndProcessesFromJSON (ESpecial special=ESpecial::kFALSE, std::string const &filename="")
 
void writeCutsAndProcessesToJSON (std::string const &filename="")
 
void enableSpecialProcesses (bool val=true)
 Set flags whether to use special cuts and process settings.
 
bool specialProcessesEnabled () const
 
void enableSpecialCuts (bool val=true)
 
bool specialCutsEnabled () const
 
int getMaterialID (const char *modname, int imat) const
 
int getMediumID (const char *modname, int imed) const
 
TGeoMedium * getTGeoMedium (const std::string &modname, int localid)
 
TGeoMedium * getTGeoMedium (const char *mediumname)
 
void getMediumIDMappingAsVector (const char *modname, std::vector< int > &mapping) const
 
const chargetProcessName (EProc process) const
 Get the names of processes and cuts providing an respective enum member.
 
const chargetCutName (ECut cut) const
 
const chargetModuleFromMediumID (int globalindex) const
 Get module name which has medium of a certain global medium ID.
 
const chargetMediumNameFromMediumID (int globalindex) const
 Get medium name from global medium ID.
 
void getMediaWithSpecialProcess (EProc process, std::vector< int > &mediumProcessVector) const
 get global medium IDs where special process is set along with process value
 
void getMediaWithSpecialCut (ECut cut, std::vector< Float_t > &mediumCutVector) const
 get global medium IDs where special cut is set along with cut value
 
void getDefaultProcesses (std::vector< std::pair< EProc, int > > &processVector)
 Fill vector with default processes.
 
void getDefaultCuts (std::vector< std::pair< ECut, Float_t > > &cutVector)
 Fill vector with default cuts.
 
void getSpecialProcesses (int globalindex, std::vector< std::pair< EProc, int > > &processVector)
 Get special processes for global medium ID.
 
void getSpecialProcesses (const char *modname, int localindex, std::vector< std::pair< EProc, int > > &processVector)
 Interface for module name and local medium ID.
 
void getSpecialCuts (int globalindex, std::vector< std::pair< ECut, Float_t > > &cutVector)
 Get special cuts for global medium ID.
 
void getSpecialCuts (const char *modname, int localindex, std::vector< std::pair< ECut, Float_t > > &cutVector)
 Interface for module name and local medium ID.
 
void printProcesses (std::ostream &stream) const
 Print all processes for all media as well as defaults.
 
void printCuts (std::ostream &stream) const
 Print all cuts for all media as well as defaults.
 
void printMaterials () const
 
void printMedia () const
 
 ClassDefNV (MaterialManager, 0)
 

Static Public Member Functions

static MaterialManagerInstance ()
 
static void printContainingMedia (std::string const &volumename)
 

Detailed Description

Definition at line 65 of file MaterialManager.h.

Member Enumeration Documentation

◆ ESpecial

enum class o2::base::MaterialManager::ESpecial : bool
strong

scoped enum to decide whether settings are done globally or for a certain medium

In Geant3/4 there is the possibility to set custom production cuts and to enable/disable certain processes. This can be done globally as well as for each medium separately. Hence, for both cases there is one method to set default processes and cuts and another 2 methods to set cuts and processes per medium. In any case, the respective cut/process setting method is a wrapper around a private, more general, method. Global settings of processes.

Enumerator
kTRUE 
kFALSE 

Definition at line 92 of file MaterialManager.h.

Member Function Documentation

◆ ClassDefNV()

o2::base::MaterialManager::ClassDefNV ( MaterialManager  ,
 
)

◆ DefaultCut()

void o2::base::MaterialManager::DefaultCut ( ECut  parID,
Float_t  val 
)
inline

set default cut

Definition at line 129 of file MaterialManager.h.

◆ DefaultCuts()

void o2::base::MaterialManager::DefaultCuts ( const std::initializer_list< std::pair< ECut, Float_t > > &  parIDValMap)
inline

Global settings of cuts. To ignore a certain cut to be set, just set it to o2::base::MaterialManager::NOPROCESS

Definition at line 117 of file MaterialManager.h.

◆ DefaultProcess()

void o2::base::MaterialManager::DefaultProcess ( EProc  parID,
int  val 
)
inline

set default process

Definition at line 110 of file MaterialManager.h.

◆ DefaultProcesses()

void o2::base::MaterialManager::DefaultProcesses ( const std::initializer_list< std::pair< EProc, int > > &  parIDValMap)
inline

Definition at line 94 of file MaterialManager.h.

◆ enableSpecialCuts()

void o2::base::MaterialManager::enableSpecialCuts ( bool  val = true)
inline

Definition at line 145 of file MaterialManager.h.

◆ enableSpecialProcesses()

void o2::base::MaterialManager::enableSpecialProcesses ( bool  val = true)
inline

Set flags whether to use special cuts and process settings.

Definition at line 143 of file MaterialManager.h.

◆ getCutName()

const char * o2::base::MaterialManager::getCutName ( ECut  cut) const
inline

Definition at line 286 of file MaterialManager.h.

◆ getDefaultCuts()

void MaterialManager::getDefaultCuts ( std::vector< std::pair< ECut, Float_t > > &  cutVector)

Fill vector with default cuts.

Definition at line 813 of file MaterialManager.cxx.

◆ getDefaultProcesses()

void MaterialManager::getDefaultProcesses ( std::vector< std::pair< EProc, int > > &  processVector)

Fill vector with default processes.

Definition at line 805 of file MaterialManager.cxx.

◆ getMaterialID()

int MaterialManager::getMaterialID ( const char modname,
int  imat 
) const

Definition at line 712 of file MaterialManager.cxx.

◆ getMediaWithSpecialCut()

void MaterialManager::getMediaWithSpecialCut ( ECut  cut,
std::vector< Float_t > &  mediumCutVector 
) const

get global medium IDs where special cut is set along with cut value

Definition at line 784 of file MaterialManager.cxx.

◆ getMediaWithSpecialProcess()

void MaterialManager::getMediaWithSpecialProcess ( EProc  process,
std::vector< int > &  mediumProcessVector 
) const

get global medium IDs where special process is set along with process value

Definition at line 764 of file MaterialManager.cxx.

◆ getMediumID()

int MaterialManager::getMediumID ( const char modname,
int  imed 
) const

Definition at line 727 of file MaterialManager.cxx.

◆ getMediumIDMappingAsVector()

void MaterialManager::getMediumIDMappingAsVector ( const char modname,
std::vector< int > &  mapping 
) const

fill the medium index mapping into a standard vector the vector gets sized properly and will be overridden

Definition at line 744 of file MaterialManager.cxx.

◆ getMediumNameFromMediumID()

const char * MaterialManager::getMediumNameFromMediumID ( int  globalindex) const

Get medium name from global medium ID.

Definition at line 875 of file MaterialManager.cxx.

◆ getModuleFromMediumID()

const char * MaterialManager::getModuleFromMediumID ( int  globalindex) const

Get module name which has medium of a certain global medium ID.

Definition at line 857 of file MaterialManager.cxx.

◆ getProcessName()

const char * o2::base::MaterialManager::getProcessName ( EProc  process) const
inline

Get the names of processes and cuts providing an respective enum member.

Definition at line 277 of file MaterialManager.h.

◆ getSpecialCuts() [1/2]

void MaterialManager::getSpecialCuts ( const char modname,
int  localindex,
std::vector< std::pair< ECut, Float_t > > &  cutVector 
)

Interface for module name and local medium ID.

Definition at line 849 of file MaterialManager.cxx.

◆ getSpecialCuts() [2/2]

void MaterialManager::getSpecialCuts ( int  globalindex,
std::vector< std::pair< ECut, Float_t > > &  cutVector 
)

Get special cuts for global medium ID.

Definition at line 839 of file MaterialManager.cxx.

◆ getSpecialProcesses() [1/2]

void MaterialManager::getSpecialProcesses ( const char modname,
int  localindex,
std::vector< std::pair< EProc, int > > &  processVector 
)

Interface for module name and local medium ID.

Definition at line 831 of file MaterialManager.cxx.

◆ getSpecialProcesses() [2/2]

void MaterialManager::getSpecialProcesses ( int  globalindex,
std::vector< std::pair< EProc, int > > &  processVector 
)

Get special processes for global medium ID.

Definition at line 821 of file MaterialManager.cxx.

◆ getTGeoMedium() [1/2]

TGeoMedium * MaterialManager::getTGeoMedium ( const char mediumname)

Definition at line 417 of file MaterialManager.cxx.

◆ getTGeoMedium() [2/2]

TGeoMedium * MaterialManager::getTGeoMedium ( const std::string &  modname,
int  localid 
)

Definition at line 404 of file MaterialManager.cxx.

◆ Instance()

static MaterialManager & o2::base::MaterialManager::Instance ( )
inlinestatic

Definition at line 68 of file MaterialManager.h.

◆ loadCutsAndProcessesFromFile()

void MaterialManager::loadCutsAndProcessesFromFile ( const char modname,
const char filename 
)

load cuts and process flags from a data file (like AliRoot did)

list of cut enumerated in ascending column mode as written in file

list of process flags enumerated in ascending column mode as written in file

Definition at line 587 of file MaterialManager.cxx.

◆ loadCutsAndProcessesFromJSON()

void MaterialManager::loadCutsAndProcessesFromJSON ( ESpecial  special = ESpecial::kFALSE,
std::string const &  filename = "" 
)

Definition at line 424 of file MaterialManager.cxx.

◆ Material()

void MaterialManager::Material ( const char modname,
Int_t  imat,
const char name,
Float_t  a,
Float_t  z,
Float_t  dens,
Float_t  radl,
Float_t  absl,
Float_t buf = nullptr,
Int_t  nwbuf = 0 
)

Definition at line 137 of file MaterialManager.cxx.

◆ Medium()

void MaterialManager::Medium ( const char modname,
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 = nullptr,
Int_t  nbuf = 0 
)

Definition at line 208 of file MaterialManager.cxx.

◆ Mixture()

void MaterialManager::Mixture ( const char modname,
Int_t  imat,
const char name,
Float_t a,
Float_t z,
Float_t  dens,
Int_t  nlmat,
Float_t wmat 
)

Define a mixture or a compound

Parameters
imatlocal (to detector/module) mixture identifier
a,z,wmatarrays of size abs(nlmat) defining the materials
nlmatindicates what wmat array represents

If nlmat > 0 then wmat contains the proportion by weights of each basic material in the mixture.

If nlmat < 0 then wmat contains the number of atoms of a given kind into the molecule of the compound. In this case, wmat in output is changed to relative weights.

Definition at line 172 of file MaterialManager.cxx.

◆ printContainingMedia()

void MaterialManager::printContainingMedia ( std::string const &  volumename)
static

print all tracking media inside a logical volume (specified by name) and all of its daughters

Definition at line 891 of file MaterialManager.cxx.

◆ printCuts()

void MaterialManager::printCuts ( std::ostream &  stream) const

Print all cuts for all media as well as defaults.

Definition at line 354 of file MaterialManager.cxx.

◆ printMaterials()

void MaterialManager::printMaterials ( ) const

Definition at line 305 of file MaterialManager.cxx.

◆ printMedia()

void MaterialManager::printMedia ( ) const

Definition at line 316 of file MaterialManager.cxx.

◆ printProcesses()

void MaterialManager::printProcesses ( std::ostream &  stream) const

Print all processes for all media as well as defaults.

Definition at line 329 of file MaterialManager.cxx.

◆ SetLowEnergyNeutronTransport()

void o2::base::MaterialManager::SetLowEnergyNeutronTransport ( bool  flag)
inline

Set flag fro low energy neutron transport.

Definition at line 135 of file MaterialManager.h.

◆ SpecialCut()

void MaterialManager::SpecialCut ( const char modname,
int  localindex,
ECut  parID,
Float_t  val 
)

Custom setting of process or cut given parameter name and value.

Definition at line 691 of file MaterialManager.cxx.

◆ SpecialCuts()

void MaterialManager::SpecialCuts ( const char modname,
int  localindex,
const std::initializer_list< std::pair< ECut, Float_t > > &  parIDValMap 
)

Set cuts per medium providing the module name and the local ID of the medium. To ignore a certain cut to be set explicitly (default or Geant settings will be used in that case) use o2::base::MaterialManager::NOPROCESS

Definition at line 682 of file MaterialManager.cxx.

◆ specialCutsEnabled()

bool o2::base::MaterialManager::specialCutsEnabled ( ) const
inline

Definition at line 146 of file MaterialManager.h.

◆ SpecialProcess()

void MaterialManager::SpecialProcess ( const char modname,
int  localindex,
EProc  parID,
int  val 
)

Custom setting of process or cut given parameter name and value.

Definition at line 702 of file MaterialManager.cxx.

◆ SpecialProcesses()

void o2::base::MaterialManager::SpecialProcesses ( const char modname,
int  localindex,
const std::initializer_list< std::pair< EProc, int > > &  parIDValMap 
)
inline

Set processes per medium providing the module name and the local ID of the medium. To ignore a certain process to be set explicitly (default or Geant settings will be used in that case) use o2::base::MaterialManager::NOPROCESS

Definition at line 101 of file MaterialManager.h.

◆ specialProcessesEnabled()

bool o2::base::MaterialManager::specialProcessesEnabled ( ) const
inline

Definition at line 144 of file MaterialManager.h.

◆ writeCutsAndProcessesToJSON()

void MaterialManager::writeCutsAndProcessesToJSON ( std::string const &  filename = "")

Definition at line 511 of file MaterialManager.cxx.


The documentation for this class was generated from the following files: