Project
Loading...
Searching...
No Matches
FairModule Class Reference

#include <FairModule.h>

Inherits TNamed.

Inherited by FairDetector, o2::passive::Alice3PassiveBase, o2::passive::PassiveBase, and o2::trk::TRKServices.

Public Member Functions

 FairModule ()
 
 FairModule (const char *Name, const char *title, Bool_t Active=kFALSE)
 
virtual ~FairModule ()
 
virtual void Print (Option_t *) const
 
virtual void SetGeometryFileName (TString fname, TString geoVer="0")
 
virtual TString GetGeometryFileName ()
 
virtual TString GetGeometryFileVer ()
 
virtual void ConstructGeometry ()
 
virtual void ConstructOpGeometry ()
 
virtual void ConstructRootGeometry (TGeoMatrix *shiftM=nullptr)
 
virtual void ConstructASCIIGeometry ()
 
virtual void ModifyGeometry () __attribute__((deprecated("Use FairAlignmentHandler instead
 
virtual void RegisterAlignmentMatrices ()
 
virtual void ConstructGDMLGeometry (__attribute__((unused)) TGeoMatrix *posrot)
 
virtual void SetSpecialPhysicsCuts ()
 
virtual FairModule * CloneModule () const
 
virtual void BeginWorkerRun () const
 
virtual void FinishWorkerRun () const
 
virtual Bool_t IsSensitive (const std::string &name)
 
virtual Bool_t CheckIfSensitive (__attribute__((unused)) std::string name) __attribute__((deprecated("The method CheckIfSensitive is deprecated. Implement IsSensitive in the detector classes.")))
 
virtual void ExpandNode (TGeoNode *Node)
 
virtual void ExpandNodeForGDML (__attribute__((unused)) TGeoNode *curNode)
 
virtual Int_t getVolId (const TString &) const
 
Int_t GetModId ()
 
void SetVerboseLevel (Int_t level)
 
Bool_t IsActive ()
 
void SetModId (Int_t id)
 
void SetMotherVolume (TString volName)
 
virtual void SetParContainers ()
 
virtual void InitParContainers ()
 
TList * GetListOfGeoPar ()
 
FairVolume * getFairVolume (FairGeoNode *fNode)
 
void AddSensitiveVolume (TGeoVolume *v)
 
void SetMC (TVirtualMC *mc)
 cahed pointer to MC (available only after initialization)
 
 ClassDef (FairModule, 4)
 

Public Attributes

virtual void see Tutorial4 for examples
 
TString fMotherVolumeName
 

Static Public Attributes

static thread_local FairVolumeList * vList = 0
 
static thread_local Int_t fNbOfVolumes = 0
 
static thread_local TRefArray * svList = 0
 
static thread_local TArrayI * volNumber = 0
 

Protected Member Functions

 FairModule (const FairModule &)
 
FairModule & operator= (const FairModule &)
 

Protected Attributes

TString fgeoVer
 
TString fgeoName
 
Int_t fModId
 
Bool_t fActive
 
Int_t fNbOfSensitiveVol
 
Int_t fVerboseLevel
 
TList * flGeoPar
 
Bool_t fGeoSaved
 list of Detector Geometry parameters
 
TVirtualMC * fMC
 flag for initialisation
 

Detailed Description

Base class for constructing all detecors and passive volumes

Author
M. Al-Turany, Denis Bertini
Version
1.0
Since
01.04.08 M.Al-Turany Add methods to construct geometry via ROOT files Add some documentation

Changelog: 29.02.2012 [O.Merle] Fixed missing material assignment for top volume. ... and please - add some documentation to your code.

Definition at line 46 of file FairModule.h.

Constructor & Destructor Documentation

◆ FairModule() [1/3]

FairModule::FairModule ( )

default ctor

Definition at line 134 of file FairModule.cxx.

◆ FairModule() [2/3]

FairModule::FairModule ( const char *  Name,
const char *  title,
Bool_t  Active = kFALSE 
)

Standard ctor

Definition at line 73 of file FairModule.cxx.

◆ ~FairModule()

FairModule::~FairModule ( )
virtual

default dtor

Definition at line 71 of file FairModule.cxx.

◆ FairModule() [3/3]

FairModule::FairModule ( const FairModule &  rhs)
protected

Definition at line 94 of file FairModule.cxx.

Member Function Documentation

◆ AddSensitiveVolume()

void FairModule::AddSensitiveVolume ( TGeoVolume *  v)

Definition at line 246 of file FairModule.cxx.

◆ BeginWorkerRun()

virtual void FairModule::BeginWorkerRun ( ) const
inlinevirtual

Init worker run (used in MT mode only)

Definition at line 87 of file FairModule.h.

◆ CheckIfSensitive()

virtual Bool_t FairModule::CheckIfSensitive ( __attribute__((unused)) std::string  name)
inlinevirtual

The function below is depracated, please change to the new method above

Definition at line 96 of file FairModule.h.

◆ ClassDef()

FairModule::ClassDef ( FairModule  ,
4   
)

◆ CloneModule()

◆ ConstructASCIIGeometry()

void FairModule::ConstructASCIIGeometry ( )
virtual

construct geometry from standard ASSCII files (Hades Format)

Definition at line 507 of file FairModule.cxx.

◆ ConstructGDMLGeometry()

void FairModule::ConstructGDMLGeometry ( __attribute__((unused)) TGeoMatrix *  posrot)
virtual

construct geometry from GDML files

Definition at line 460 of file FairModule.cxx.

◆ ConstructGeometry()

◆ ConstructOpGeometry()

void FairModule::ConstructOpGeometry ( )
virtual

method called from the MC application to set optical geometry properties

Reimplemented in o2::ft0::Detector, and o2::hmpid::Detector.

Definition at line 65 of file FairModule.cxx.

◆ ConstructRootGeometry()

void FairModule::ConstructRootGeometry ( TGeoMatrix *  shiftM = nullptr)
virtual

construct geometry from root files (TGeo)

Construct the detector geometry from ROOT files, possible inputs are:

  1. A TGeoVolume as a mother (master) volume containing the detector geometry
  2. A TGeoManager with the detector geometry
  3. A TGeoVolume as a mother or Master volume which is the output of the CAD2ROOT geometry, in this case the materials are not proprely defined and had to be reset In all cases we have to check that the material properties are the same or is the materials defined in the current simulation session

loop inside the delivered root file and try to fine a TGeoManager object the first TGeoManager found will be read

in case a TGeoManager was found get the top most volume and the node

The file does not contain any TGeoManager, so we assume to have a file with a TGeoVolume try to look for a TGeoVolume inside the file

Everything is OK, we have a TGeoVolume and now we add it to the simulation TGeoManager

Force rebuilding of voxels

To avoid having different names of the default matrices because we could have get the volume from another TGeoManager, we reset the default matrix name

Now we can remove the matrix so that the new geomanager will rebuild it properly

Now we can add the node to the existing cave

correction from O. Merle: in case of a TGeoVolume (v1) set the material properly

now go through the herachy and set the materials properly, this is important becase the CAD converter produce TGeoVolumes with materials that have only names and no properties

Definition at line 279 of file FairModule.cxx.

◆ ExpandNode()

void FairModule::ExpandNode ( TGeoNode *  Node)
virtual

called from ConstructRootGeometry()

Definition at line 524 of file FairModule.cxx.

◆ ExpandNodeForGDML()

void FairModule::ExpandNodeForGDML ( __attribute__((unused)) TGeoNode *  curNode)
virtual

called from ConstructGDMLGeometry()

Definition at line 468 of file FairModule.cxx.

◆ FinishWorkerRun()

virtual void FairModule::FinishWorkerRun ( ) const
inlinevirtual

Finish worker run (used in MT mode only)

Definition at line 89 of file FairModule.h.

◆ getFairVolume()

FairVolume * FairModule::getFairVolume ( FairGeoNode *  fNode)

Definition at line 264 of file FairModule.cxx.

◆ GetGeometryFileName()

virtual TString FairModule::GetGeometryFileName ( )
inlinevirtual

Get the Geometry file name

Definition at line 60 of file FairModule.h.

◆ GetGeometryFileVer()

virtual TString FairModule::GetGeometryFileVer ( )
inlinevirtual

Get the geometry file version if used

Definition at line 62 of file FairModule.h.

◆ GetListOfGeoPar()

TList * FairModule::GetListOfGeoPar ( )
inline

return the geo parameter of this detector/module

Definition at line 126 of file FairModule.h.

◆ GetModId()

Int_t FairModule::GetModId ( )
inline

return the detector/Module id (which was set in the sim macro for the detector)

Definition at line 108 of file FairModule.h.

◆ getVolId()

virtual Int_t FairModule::getVolId ( const TString &  ) const
inlinevirtual

return the MC id of a volume named vname

Definition at line 106 of file FairModule.h.

◆ InitParContainers()

virtual void FairModule::InitParContainers ( )
inlinevirtual

Initialize everything which has to be done before the construction and modification of the geometry. Mostly this is needed to read data from the parameter containers.

Definition at line 124 of file FairModule.h.

◆ IsActive()

Bool_t FairModule::IsActive ( )
inline

return the detector status

Definition at line 112 of file FairModule.h.

◆ IsSensitive()

Bool_t FairModule::IsSensitive ( const std::string &  name)
virtual

Set the sensitivity flag for volumes, called from ConstructASCIIRootGeometry(), and has to be implimented for detectors which use ConstructASCIIRootGeometry() to build the geometry

Definition at line 514 of file FairModule.cxx.

◆ ModifyGeometry()

virtual void FairModule::ModifyGeometry ( )
virtual

Modify the geometry for the simulation run using methods of the Root geometry package

◆ operator=()

FairModule & FairModule::operator= ( const FairModule &  rhs)
protected

Definition at line 148 of file FairModule.cxx.

◆ Print()

virtual void FairModule::Print ( Option_t *  ) const
inlinevirtual

Print method should be implemented in detector or module

Definition at line 56 of file FairModule.h.

◆ RegisterAlignmentMatrices()

virtual void FairModule::RegisterAlignmentMatrices ( )
inlinevirtual

Definition at line 77 of file FairModule.h.

◆ SetGeometryFileName()

void FairModule::SetGeometryFileName ( TString  fname,
TString  geoVer = "0" 
)
virtual

Set the geometry file name o be used

Definition at line 198 of file FairModule.cxx.

◆ SetMC()

void FairModule::SetMC ( TVirtualMC *  mc)
inline

cahed pointer to MC (available only after initialization)

Sets the cached MC, for a module cloned for a worker thread before its MC existed

Definition at line 164 of file FairModule.h.

◆ SetModId()

void FairModule::SetModId ( Int_t  id)
inline

set the detector/module id

Definition at line 114 of file FairModule.h.

◆ SetMotherVolume()

void FairModule::SetMotherVolume ( TString  volName)
inline

Set the name of the mother volume to which a new geometry is added. This function is needed for geometries which are defined as ROOT geometry manager.

Definition at line 118 of file FairModule.h.

◆ SetParContainers()

virtual void FairModule::SetParContainers ( )
inlinevirtual

called from ConstuctASCIIGeometry Set the parameter containers

Definition at line 121 of file FairModule.h.

◆ SetSpecialPhysicsCuts()

virtual void FairModule::SetSpecialPhysicsCuts ( )
inlinevirtual

custom settings of processes and cuts for media to be forwarded to the detector simulation

Reimplemented in o2::base::Detector, o2::passive::PassiveBase, o2::tpc::Detector, and o2::passive::Alice3PassiveBase.

Definition at line 83 of file FairModule.h.

◆ SetVerboseLevel()

void FairModule::SetVerboseLevel ( Int_t  level)
inline

Set the verbose level in this detector

Definition at line 110 of file FairModule.h.

Member Data Documentation

◆ examples

virtual void see Tutorial4 for FairModule::examples
Initial value:
{
LOG(warn) << "This function is deprecated. Use FairAlignmentHandler instead, see Tutorial4 for examples."
LOG(info)<< "Compressed in "<< sw.CpuTime()<< " s"

Definition at line 73 of file FairModule.h.

◆ fActive

Bool_t FairModule::fActive
protected

Definition at line 155 of file FairModule.h.

◆ fgeoName

TString FairModule::fgeoName
protected

Definition at line 153 of file FairModule.h.

◆ fGeoSaved

Bool_t FairModule::fGeoSaved
protected

list of Detector Geometry parameters

Definition at line 159 of file FairModule.h.

◆ fgeoVer

TString FairModule::fgeoVer
protected

Definition at line 152 of file FairModule.h.

◆ flGeoPar

TList* FairModule::flGeoPar
protected

Definition at line 158 of file FairModule.h.

◆ fMC

TVirtualMC* FairModule::fMC
protected

flag for initialisation

Definition at line 160 of file FairModule.h.

◆ fModId

Int_t FairModule::fModId
protected

Definition at line 154 of file FairModule.h.

◆ fMotherVolumeName

TString FairModule::fMotherVolumeName

Definition at line 136 of file FairModule.h.

◆ fNbOfSensitiveVol

Int_t FairModule::fNbOfSensitiveVol
protected

Definition at line 156 of file FairModule.h.

◆ fNbOfVolumes

thread_local Int_t FairModule::fNbOfVolumes = 0
static

total number of volumes in a simulaion session

Definition at line 131 of file FairModule.h.

◆ fVerboseLevel

Int_t FairModule::fVerboseLevel
protected

Definition at line 157 of file FairModule.h.

◆ svList

thread_local TRefArray * FairModule::svList = 0
static

list of all sensitive volumes in a simulaion session

Definition at line 133 of file FairModule.h.

◆ vList

thread_local FairVolumeList * FairModule::vList = 0
static

list of volumes in a simulation session

Definition at line 129 of file FairModule.h.

◆ volNumber

thread_local TArrayI * FairModule::volNumber = 0
static

Definition at line 135 of file FairModule.h.


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