FairRoot
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
FairModule Class Reference

#include <FairModule.h>

Inheritance diagram for FairModule:
FairCave FairDetector FairMagnet FairPipe FairTarget MyCave MyCave MyMagnet MyMagnet MyPipe MyPipe

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 see Tutorial4 for
examples 
LOG (warn)<< "This function is deprecated. Use FairAlignmentHandler instead
 
virtual void RegisterAlignmentMatrices ()
 
virtual void ConstructGDMLGeometry (__attribute__((unused)) TGeoMatrix *posrot)
 
virtual void SetSpecialPhysicsCuts ()
 
virtual FairModuleCloneModule () const
 
virtual void BeginWorkerRun () const
 
virtual void FinishWorkerRun () const
 
template<class T , class U >
void ConstructASCIIGeometry (T *dataType1, TString containerName="", U *datatype2=nullptr)
 
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)
 
void ProcessNodes (TList *aList)
 
virtual void SetParContainers ()
 
virtual void InitParContainers ()
 
TList * GetListOfGeoPar ()
 
FairVolumegetFairVolume (FairGeoNode *fNode)
 
void AddSensitiveVolume (TGeoVolume *v)
 

Public Attributes

virtual void see Tutorial4 for
examples 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 &)
 
FairModuleoperator= (const FairModule &)
 
 ClassDef (FairModule, 4)
 cahed pointer to MC (available only after initialization) More...
 

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 More...
 
TVirtualMC * fMC
 flag for initialisation More...
 

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

default ctor

Definition at line 135 of file FairModule.cxx.

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

Standard ctor

Definition at line 74 of file FairModule.cxx.

FairModule::~FairModule ( )
virtual

default dtor

Definition at line 72 of file FairModule.cxx.

FairModule::FairModule ( const FairModule rhs)
protected

Definition at line 95 of file FairModule.cxx.

Member Function Documentation

void FairModule::AddSensitiveVolume ( TGeoVolume *  v)

Definition at line 294 of file FairModule.cxx.

virtual void FairModule::BeginWorkerRun ( ) const
inlinevirtual

Init worker run (used in MT mode only)

Definition at line 87 of file FairModule.h.

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

FairModule::ClassDef ( FairModule  ,
 
)
protected

cahed pointer to MC (available only after initialization)

FairModule * FairModule::CloneModule ( ) const
virtual
void FairModule::ConstructASCIIGeometry ( )
virtual

construct geometry from standard ASSCII files (Hades Format)

Reimplemented in FairMagnet.

Definition at line 552 of file FairModule.cxx.

template<class T , class U >
void FairModule::ConstructASCIIGeometry ( T *  dataType1,
TString  containerName = "",
U *  datatype2 = nullptr 
)

template function to construct geometry. to be used in derived classes.

Definition at line 170 of file FairModule.h.

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

construct geometry from GDML files

Definition at line 508 of file FairModule.cxx.

void FairModule::ConstructGeometry ( )
virtual

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

Reimplemented in FairTutorialDet4, FairTutorialDet1, FairTutorialDet2, FairRutherford, FairTestDetector, Pixel, NewDetector, NewDetector, FairTutPropDet, NewDetector, NewDetector, FairFastSimExample, FairFastSimExample2, FairFastSimDetector, MyMagnet, MyMagnet, MyCave, MyCave, MyPipe, MyPipe, FairMagnet, FairPipe, FairCave, and FairTarget.

Definition at line 60 of file FairModule.cxx.

void FairModule::ConstructOpGeometry ( )
virtual

method called from the MC application to set optical geometry properties

Definition at line 66 of file FairModule.cxx.

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 327 of file FairModule.cxx.

void FairModule::ExpandNode ( TGeoNode *  Node)
virtual

called from ConstructRootGeometry()

Definition at line 569 of file FairModule.cxx.

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

called from ConstructGDMLGeometry()

Definition at line 516 of file FairModule.cxx.

virtual void FairModule::FinishWorkerRun ( ) const
inlinevirtual

Finish worker run (used in MT mode only)

Definition at line 89 of file FairModule.h.

FairVolume * FairModule::getFairVolume ( FairGeoNode fNode)

Definition at line 312 of file FairModule.cxx.

virtual TString FairModule::GetGeometryFileName ( )
inlinevirtual

Get the Geometry file name

Definition at line 60 of file FairModule.h.

virtual TString FairModule::GetGeometryFileVer ( )
inlinevirtual

Get the geometry file version if used

Definition at line 62 of file FairModule.h.

TList* FairModule::GetListOfGeoPar ( )
inline

return the geo parameter of this detector/module

Definition at line 130 of file FairModule.h.

Int_t FairModule::GetModId ( )
inline

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

Definition at line 111 of file FairModule.h.

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

return the MC id of a volume named vname

Definition at line 109 of file FairModule.h.

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.

Reimplemented in FairTutorialDet4.

Definition at line 128 of file FairModule.h.

Bool_t FairModule::IsActive ( )
inline

return the detector status

Definition at line 115 of file FairModule.h.

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

Reimplemented in FairTutorialDet4, FairTutorialDet1, Pixel, NewDetector, NewDetector, NewDetector, NewDetector, FairFastSimExample, FairFastSimExample2, and FairMagnet.

Definition at line 559 of file FairModule.cxx.

virtual void see Tutorial4 for examples FairModule::LOG ( warn  )
virtual void FairModule::ModifyGeometry ( )
virtual

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

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

Definition at line 149 of file FairModule.cxx.

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.

void FairModule::ProcessNodes ( TList *  aList)

called from ConstuctASCIIGeometry

Definition at line 244 of file FairModule.cxx.

virtual void FairModule::RegisterAlignmentMatrices ( )
inlinevirtual

Reimplemented in FairTutorialDet4.

Definition at line 77 of file FairModule.h.

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

Set the geometry file name o be used

Definition at line 199 of file FairModule.cxx.

void FairModule::SetModId ( Int_t  id)
inline

set the detector/module id

Definition at line 117 of file FairModule.h.

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

virtual void FairModule::SetParContainers ( )
inlinevirtual

Set the parameter containers

Reimplemented in FairTutorialDet4.

Definition at line 125 of file FairModule.h.

virtual void FairModule::SetSpecialPhysicsCuts ( )
inlinevirtual

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

Reimplemented in FairTutorialDet4, FairTestDetector, FairTutorialDet1, FairTutorialDet2, FairRutherford, Pixel, FairTutPropDet, NewDetector, NewDetector, NewDetector, and NewDetector.

Definition at line 83 of file FairModule.h.

void FairModule::SetVerboseLevel ( Int_t  level)
inline

Set the verbose level in this detector

Definition at line 113 of file FairModule.h.

Member Data Documentation

virtual void see Tutorial4 for examples see Tutorial4 for FairModule::examples

Definition at line 75 of file FairModule.h.

Bool_t FairModule::fActive
protected

Definition at line 159 of file FairModule.h.

TString FairModule::fgeoName
protected

Definition at line 157 of file FairModule.h.

Bool_t FairModule::fGeoSaved
protected

list of Detector Geometry parameters

Definition at line 163 of file FairModule.h.

TString FairModule::fgeoVer
protected

Definition at line 156 of file FairModule.h.

TList* FairModule::flGeoPar
protected

Definition at line 162 of file FairModule.h.

TVirtualMC* FairModule::fMC
protected

flag for initialisation

Definition at line 164 of file FairModule.h.

Int_t FairModule::fModId
protected

Definition at line 158 of file FairModule.h.

TString FairModule::fMotherVolumeName

Definition at line 140 of file FairModule.h.

Int_t FairModule::fNbOfSensitiveVol
protected

Definition at line 160 of file FairModule.h.

thread_local Int_t FairModule::fNbOfVolumes = 0
static

total number of volumes in a simulaion session

Definition at line 135 of file FairModule.h.

Int_t FairModule::fVerboseLevel
protected

Definition at line 161 of file FairModule.h.

thread_local TRefArray * FairModule::svList = 0
static

list of all sensitive volumes in a simulaion session

Definition at line 137 of file FairModule.h.

thread_local FairVolumeList * FairModule::vList = 0
static

list of volumes in a simulation session

Definition at line 133 of file FairModule.h.

thread_local TArrayI * FairModule::volNumber = 0
static

Definition at line 139 of file FairModule.h.


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