EIC Software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
FairModule Class Reference

#include <EicRoot/blob/master/base/FairModule.h>

+ Inheritance diagram for FairModule:
+ Collaboration diagram for FairModule:

Public Member Functions

 FairModule ()
 
 FairModule (const char *Name, const char *title, Bool_t Active=kFALSE)
 
virtual ~FairModule ()
 
virtual void Print (Option_t *option="") const
 
virtual void SetGeometryFileName (TString fname, TString geoVer="0")
 
virtual TString GetGeometryFileName ()
 
virtual TString GetGeometryFileVer ()
 
virtual void ConstructGeometry ()
 
virtual void ConstructOpGeometry ()
 
virtual void ConstructRootGeometry ()
 
virtual void ConstructASCIIGeometry ()
 
virtual Bool_t CheckIfSensitive (std::string name)
 
virtual void ExpandNode (TGeoNode *Node)
 
virtual Int_t getVolId (const TString &vname) const
 
Int_t GetModId ()
 
void SetVerboseLevel (Int_t level)
 
Bool_t IsActive ()
 
void SetModId (Int_t id)
 
void SetMotherVolume (TString volName)
 
void ProcessNodes (TList *aList)
 
virtual void SetParContainers ()
 
TList * GetListOfGeoPar ()
 
FairVolumegetFairVolume (FairGeoNode *fNode)
 
void AddSensitiveVolume (TGeoVolume *v)
 
void ImportRootMaterials ()
 

Public Attributes

TString fMotherVolumeName
 

Static Public Attributes

static FairVolumeListvList =0
 
static Int_t fNbOfVolumes =0
 
static TRefArray * svList =0
 
static TArrayI * volNumber =0
 

Protected Attributes

TString fgeoVer
 
TString fgeoName
 
Int_t fModId
 
Bool_t fActive
 
Int_t fNbOfSensitiveVol
 
Int_t fVerboseLevel
 
TList * flGeoPar
 
Bool_t kGeoSaved
 list of Detector Geometry parameters
 
FairLoggerfLogger
 flag for initialisation
 
Bool_t fRootMaterialImportFlag
 

Private Member Functions

 FairModule (const FairModule &)
 
FairModuleoperator= (const FairModule &)
 
void SetDefaultMatrixName (TGeoMatrix *matrix)
 
void AssignMediumAtImport (TGeoVolume *v)
 

Private Attributes

std::set< TGeoVolume * > fGeoVolumeLut
 

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 32 of file FairModule.h.

View newest version in sPHENIX GitHub at line 32 of file FairModule.h

Constructor & Destructor Documentation

FairModule::FairModule ( )

default ctor

Definition at line 87 of file FairModule.cxx.

View newest version in sPHENIX GitHub at line 87 of file FairModule.cxx

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

Standard ctor

Definition at line 66 of file FairModule.cxx.

View newest version in sPHENIX GitHub at line 66 of file FairModule.cxx

References svList, and vList.

FairModule::~FairModule ( )
virtual

default dtor

Definition at line 61 of file FairModule.cxx.

View newest version in sPHENIX GitHub at line 61 of file FairModule.cxx

FairModule::FairModule ( const FairModule )
private

Member Function Documentation

void FairModule::AddSensitiveVolume ( TGeoVolume *  v)

Definition at line 192 of file FairModule.cxx.

View newest version in sPHENIX GitHub at line 192 of file FairModule.cxx

References FairVolumeList::addVolume(), FairLogger::Debug2(), FairVolumeList::findObject(), fLogger, fModId, fNbOfSensitiveVol, fNbOfVolumes, MESSAGE_ORIGIN, FairVolume::setModId(), FairVolume::SetModule(), svList, vList, and Acts::Test::volume.

Referenced by ExpandNode(), and CbmRich::ExpandNodeForGdml().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void FairModule::AssignMediumAtImport ( TGeoVolume *  v)
private

Assign medium to the the volume v, this has to be done in all cases: case 1: For CAD converted volumes they have no mediums (only names) case 2: TGeoVolumes, we need to be sure that the material is defined in this session

The Material is not defined in the TGeoManager, we try to create one if we have enough information about it

Material is already available in the TGeoManager and we can set it

Definition at line 433 of file FairModule.cxx.

View newest version in sPHENIX GitHub at line 433 of file FairModule.cxx

References FairGeoMedium::calcRadiationLength(), FairGeoBuilder::createMedium(), FairGeoMedium::epsil, FairLogger::Fatal(), FairGeoMedium::fld, FairGeoMedium::fldFlag, fLogger, fRootMaterialImportFlag, FairGeoLoader::getGeoBuilder(), FairGeoLoader::getGeoInterface(), FairGeoInterface::getMedia(), FairGeoMedia::getMedium(), FairGeoLoader::Instance(), FairGeoMedium::madfld, FairGeoMedium::maxde, FairGeoMedium::maxstep, MESSAGE_ORIGIN, FairGeoMedium::minstep, FairGeoMedium::sensFlag, FairGeoMedium::setComponent(), FairGeoMedium::setDensity(), FairGeoMedium::setNComponents(), and z.

Referenced by ConstructRootGeometry(), and ExpandNode().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

Bool_t FairModule::CheckIfSensitive ( std::string  name)
virtual

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

Reimplemented in CbmRich, EicDetector, PndMagnet, and PndPipe.

Definition at line 358 of file FairModule.cxx.

View newest version in sPHENIX GitHub at line 358 of file FairModule.cxx

References fLogger, MESSAGE_ORIGIN, and FairLogger::Warning().

Referenced by ExpandNode().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void FairModule::ConstructASCIIGeometry ( )
virtual

construct geometry from standard ASSCII files (Hades Format)

Reimplemented in PndMagnet.

Definition at line 352 of file FairModule.cxx.

View newest version in sPHENIX GitHub at line 352 of file FairModule.cxx

References fLogger, MESSAGE_ORIGIN, and FairLogger::Warning().

Referenced by PndPipe::ConstructGeometry().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void FairModule::ConstructGeometry ( )
virtual

method called from the MC application to construct the geometry, has to be implimented by user

Reimplemented in CbmRich, EicDetector, EicCadFile, CbmModule, EicFieldGradDetector, EicFieldMapDetector, PndPipe, PndMagnet, PndCave, and PndTarget.

Definition at line 49 of file FairModule.cxx.

View newest version in sPHENIX GitHub at line 49 of file FairModule.cxx

References fLogger, MESSAGE_ORIGIN, and FairLogger::Warning().

Referenced by FairMCApplication::ConstructGeometry().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void FairModule::ConstructOpGeometry ( )
virtual

method called from the MC application to set optical geometry properties

Reimplemented in CbmRich.

Definition at line 55 of file FairModule.cxx.

View newest version in sPHENIX GitHub at line 55 of file FairModule.cxx

References FairLogger::Debug2(), fLogger, and MESSAGE_ORIGIN.

Referenced by FairMCApplication::ConstructOpGeometry().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void FairModule::ConstructRootGeometry ( )
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

Every thing 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 226 of file FairModule.cxx.

View newest version in sPHENIX GitHub at line 226 of file FairModule.cxx

References AssignMediumAtImport(), ExpandNode(), FairLogger::Fatal(), fLogger, fMotherVolumeName, GetGeometryFileName(), M, MESSAGE_ORIGIN, n, SetDefaultMatrixName(), v1, and Acts::Test::volume.

Referenced by PndMagnet::ConstructGeometry(), PndPipe::ConstructGeometry(), EicDetector::ConstructGeometry(), and CbmRich::ConstructGeometry().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void FairModule::ExpandNode ( TGeoNode *  Node)
virtual

called from ConstructRootGeometry()

Definition at line 365 of file FairModule.cxx.

View newest version in sPHENIX GitHub at line 365 of file FairModule.cxx

References AddSensitiveVolume(), AssignMediumAtImport(), CheckIfSensitive(), FairLogger::Debug2(), fGeoVolumeLut, fLogger, M, MESSAGE_ORIGIN, SetDefaultMatrixName(), v, and v1.

Referenced by ConstructRootGeometry().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

FairVolume * FairModule::getFairVolume ( FairGeoNode fNode)

Definition at line 211 of file FairModule.cxx.

View newest version in sPHENIX GitHub at line 211 of file FairModule.cxx

References FairVolumeList::At(), fv(), FairVolumeList::getEntries(), FairVolume::getGeoNode(), and vList.

+ Here is the call graph for this function:

virtual TString FairModule::GetGeometryFileName ( )
inlinevirtual

Get the Geometry file name

Definition at line 46 of file FairModule.h.

View newest version in sPHENIX GitHub at line 46 of file FairModule.h

References fgeoName.

Referenced by PndMagnet::ConstructASCIIGeometry(), CbmRich::ConstructAsciiGeometry(), CbmRich::ConstructGdmlGeometry(), PndTarget::ConstructGeometry(), PndMagnet::ConstructGeometry(), PndPipe::ConstructGeometry(), EicCadFile::ConstructGeometry(), EicDetector::ConstructGeometry(), CbmRich::ConstructGeometry(), and ConstructRootGeometry().

+ Here is the caller graph for this function:

virtual TString FairModule::GetGeometryFileVer ( )
inlinevirtual

Get the geometry file version if used

Definition at line 48 of file FairModule.h.

View newest version in sPHENIX GitHub at line 48 of file FairModule.h

References fgeoVer.

TList* FairModule::GetListOfGeoPar ( )
inline

return the geo parameter of this detector/module

Definition at line 81 of file FairModule.h.

View newest version in sPHENIX GitHub at line 81 of file FairModule.h

References flGeoPar.

Int_t FairModule::GetModId ( )
inline

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

Definition at line 65 of file FairModule.h.

View newest version in sPHENIX GitHub at line 65 of file FairModule.h

References fModId.

Referenced by FairMCApplication::ConstructGeometry(), and FairDetector::Initialize().

+ Here is the caller graph for this function:

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

return the MC id of a volume named vname

Definition at line 63 of file FairModule.h.

View newest version in sPHENIX GitHub at line 63 of file FairModule.h

void FairModule::ImportRootMaterials ( )
inline

Definition at line 94 of file FairModule.h.

View newest version in sPHENIX GitHub at line 94 of file FairModule.h

References fRootMaterialImportFlag.

Bool_t FairModule::IsActive ( )
inline

return the detector status

Definition at line 69 of file FairModule.h.

View newest version in sPHENIX GitHub at line 69 of file FairModule.h

References fActive.

Referenced by EicFieldGradDetector::ConstructGeometry(), EicFieldMapDetector::ConstructGeometry(), and FairMCApplication::FairMCApplication().

+ Here is the caller graph for this function:

FairModule& FairModule::operator= ( const FairModule )
private
virtual void FairModule::Print ( Option_t *  option = "") const
inlinevirtual

Print method sould be implimented in detector or module

Definition at line 42 of file FairModule.h.

View newest version in sPHENIX GitHub at line 42 of file FairModule.h

void FairModule::ProcessNodes ( TList *  aList)

called from ConstuctASCIIGeometry

Definition at line 154 of file FairModule.cxx.

View newest version in sPHENIX GitHub at line 154 of file FairModule.cxx

References FairVolumeList::addVolume(), FairGeoNode::calcLabTransform(), fActive, fModId, fNbOfSensitiveVol, fNbOfVolumes, FairRuntimeDb::getContainer(), FairGeoNode::getCopyNo(), FairBaseParSet::GetGeoNodes(), FairGeoVolume::getMCid(), FairGeoNode::getMotherNode(), FairRun::GetRuntimeDb(), FairGeoNode::getTruncName(), FairRun::Instance(), FairGeoNode::isSensitive(), FairVolume::setCopyNo(), FairVolume::setGeoNode(), FairVolume::setModId(), FairVolume::SetModule(), FairVolume::setMotherCopyNo(), FairVolume::setMotherId(), FairVolume::setRealName(), svList, vList, and Acts::Test::volume.

Referenced by PndMagnet::ConstructASCIIGeometry(), CbmRich::ConstructAsciiGeometry(), PndTarget::ConstructGeometry(), and EicDetector::ConstructGeometry().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void FairModule::SetDefaultMatrixName ( TGeoMatrix *  matrix)
private

Re-implimented from ROOT: TGeoMatrix::SetDefaultName()

Definition at line 405 of file FairModule.cxx.

View newest version in sPHENIX GitHub at line 405 of file FairModule.cxx

Referenced by ConstructRootGeometry(), and ExpandNode().

+ Here is the caller graph for this function:

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

Set the geometry file name o be used

Reimplemented in EicDetector.

Definition at line 124 of file FairModule.cxx.

View newest version in sPHENIX GitHub at line 124 of file FairModule.cxx

References FairLogger::Fatal(), fgeoName, fgeoVer, fLogger, FairLogger::Info(), MESSAGE_ORIGIN, and FairLogger::Warning().

Referenced by EicRunSim::AddModule(), EicDetector::SetGeometryFileName(), and simulation().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void FairModule::SetModId ( Int_t  id)
inline

set the detector/module id

Definition at line 71 of file FairModule.h.

View newest version in sPHENIX GitHub at line 71 of file FairModule.h

References fModId.

Referenced by FairRunSim::AddModule().

+ Here is the caller graph for this function:

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 75 of file FairModule.h.

View newest version in sPHENIX GitHub at line 75 of file FairModule.h

References fMotherVolumeName.

virtual void FairModule::SetParContainers ( )
inlinevirtual

Set the parameter containers

Definition at line 79 of file FairModule.h.

View newest version in sPHENIX GitHub at line 79 of file FairModule.h

Referenced by FairMCApplication::SetParTask().

+ Here is the caller graph for this function:

void FairModule::SetVerboseLevel ( Int_t  level)
inline

Set the verbose level in this detector

Definition at line 67 of file FairModule.h.

View newest version in sPHENIX GitHub at line 67 of file FairModule.h

References fVerboseLevel.

Member Data Documentation

Bool_t FairModule::fActive
protected

Definition at line 111 of file FairModule.h.

View newest version in sPHENIX GitHub at line 111 of file FairModule.h

Referenced by IsActive(), and ProcessNodes().

TString FairModule::fgeoName
protected

Definition at line 109 of file FairModule.h.

View newest version in sPHENIX GitHub at line 109 of file FairModule.h

Referenced by GetGeometryFileName(), SetGeometryFileName(), and EicDetector::SetGeometryFileName().

TString FairModule::fgeoVer
protected

Definition at line 108 of file FairModule.h.

View newest version in sPHENIX GitHub at line 108 of file FairModule.h

Referenced by GetGeometryFileVer(), and SetGeometryFileName().

std::set<TGeoVolume*> FairModule::fGeoVolumeLut
private

Definition at line 105 of file FairModule.h.

View newest version in sPHENIX GitHub at line 105 of file FairModule.h

Referenced by ExpandNode().

TList* FairModule::flGeoPar
protected

Definition at line 114 of file FairModule.h.

View newest version in sPHENIX GitHub at line 114 of file FairModule.h

Referenced by FairDetector::FairDetector(), GetListOfGeoPar(), FairDetector::SaveGeoParams(), and FairDetector::~FairDetector().

FairLogger* FairModule::fLogger
protected

flag for initialisation

Fair Logger

Definition at line 117 of file FairModule.h.

View newest version in sPHENIX GitHub at line 117 of file FairModule.h

Referenced by AddSensitiveVolume(), AssignMediumAtImport(), CheckIfSensitive(), ConstructASCIIGeometry(), ConstructGeometry(), ConstructOpGeometry(), ConstructRootGeometry(), ExpandNode(), and SetGeometryFileName().

Int_t FairModule::fModId
protected

Definition at line 110 of file FairModule.h.

View newest version in sPHENIX GitHub at line 110 of file FairModule.h

Referenced by AddSensitiveVolume(), GetModId(), ProcessNodes(), and SetModId().

TString FairModule::fMotherVolumeName

Definition at line 90 of file FairModule.h.

View newest version in sPHENIX GitHub at line 90 of file FairModule.h

Referenced by ConstructRootGeometry(), and SetMotherVolume().

Int_t FairModule::fNbOfSensitiveVol
protected

Definition at line 112 of file FairModule.h.

View newest version in sPHENIX GitHub at line 112 of file FairModule.h

Referenced by AddSensitiveVolume(), and ProcessNodes().

Int_t FairModule::fNbOfVolumes =0
static

total number of volumes in a simulaion session

Definition at line 85 of file FairModule.h.

View newest version in sPHENIX GitHub at line 85 of file FairModule.h

Referenced by AddSensitiveVolume(), and ProcessNodes().

Bool_t FairModule::fRootMaterialImportFlag
protected

Definition at line 124 of file FairModule.h.

View newest version in sPHENIX GitHub at line 124 of file FairModule.h

Referenced by AssignMediumAtImport(), and ImportRootMaterials().

Int_t FairModule::fVerboseLevel
protected

Definition at line 113 of file FairModule.h.

View newest version in sPHENIX GitHub at line 113 of file FairModule.h

Referenced by CbmRich::CbmRich(), EicDetector::EicDetector(), CbmRich::EndOfEvent(), EicDetector::EndOfEvent(), CbmRich::Print(), EicDetector::Print(), and SetVerboseLevel().

Bool_t FairModule::kGeoSaved
protected

list of Detector Geometry parameters

Definition at line 115 of file FairModule.h.

View newest version in sPHENIX GitHub at line 115 of file FairModule.h

Referenced by FairDetector::FairDetector(), and FairDetector::SaveGeoParams().

TRefArray * FairModule::svList =0
static

list of all sensitive volumes in a simulaion session

Definition at line 87 of file FairModule.h.

View newest version in sPHENIX GitHub at line 87 of file FairModule.h

Referenced by AddSensitiveVolume(), FairMCApplication::ConstructGeometry(), FairModule(), FairDetector::Initialize(), and ProcessNodes().

FairVolumeList * FairModule::vList =0
static

list of volumes in a simulation session

Definition at line 83 of file FairModule.h.

View newest version in sPHENIX GitHub at line 83 of file FairModule.h

Referenced by AddSensitiveVolume(), FairModule(), getFairVolume(), and ProcessNodes().

TArrayI * FairModule::volNumber =0
static

Definition at line 89 of file FairModule.h.

View newest version in sPHENIX GitHub at line 89 of file FairModule.h


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