SToGS
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros
SToGS::ScintillatorDF Class Reference

Base classe to build scintillators. More...

#include <SToGS_ScintillatorDF.hh>

Inheritance diagram for SToGS::ScintillatorDF:

Public Member Functions

void AssemblyRename (G4AssemblyVolume *assembly, const G4String &volume_to_find) const
 rename physical volume produced by the assembly More...
 
void Clean ()
 clear factory i.e. in memory collections of physicals and assemblies More...
 
G4int DoMap (G4AssemblyVolume *assembly, G4VPhysicalVolume *volume_used_to_built_assembly, G4int copy_number_offset=0) const
 remap all the physical volumes produced by the Imprint method. More...
 
virtual G4VPhysicalVolume * Get (G4String basename)
 search for a detector in DetectorFactory More...
 
G4AssemblyVolume * GetAssembly (G4String basename)
 
virtual void GetAttributes (G4String basename, G4bool do_amap=true, G4bool do_dmap=false)
 Read the amap file and apply atributes to the detector. if not found, it creates a deefault one from the sensitive detector founds. More...
 
G4String GetDetName (const G4String &path) const
 Get detector name from full path to the gdml file. More...
 
G4String GetDetName (G4String name, G4String version) const
 
G4String GetFactoryName () const
 
G4String GetFileName (G4String detname, G4String extention)
 compute name of the file to store/read information More...
 
virtual G4VPhysicalVolume * Make (G4String, G4String)
 Should be implemented in any sub factory. It built (C++) a detector and return it. More...
 
virtual G4VPhysicalVolume * MakeAnArrayFromFactory (G4String input_file)
 built an array from the factory using the given input file More...
 
G4VPhysicalVolume * MakeCdC (G4String detname, G4String opt="bare")
 
G4VPhysicalVolume * MakeCPPW (G4String detname, G4String opt="bare")
 
G4VPhysicalVolume * MakeEDEN (G4String detname, G4double caps_width=0.0, G4double extra_back=0.0, G4String opt="v0")
 
G4VPhysicalVolume * MakeFATIMAM (G4String detname, G4String opt="bare")
 
G4VPhysicalVolume * MakeFATIMAQ (G4String detname, G4String opt="bare")
 
G4VPhysicalVolume * MakePPW (G4String detname, G4double caps_width=0.0, G4double housing_width=0.0, G4String opt="bare")
 
virtual void MakeStore ()
 build the default store i.e. all the scintillators detectors. More...
 
virtual G4int ReMap (G4VPhysicalVolume *adetector, G4int offset)
 for the given volume, it changes all copy number of active volumes by starting with offset More...
 
 ScintillatorDF (G4String path)
 
G4int Set (G4String basename, G4VPhysicalVolume *world, G4int copy_number_offset, const G4ThreeVector *T=0x0, const G4RotationMatrix *R=0x0, G4int main_copy_number=0)
 to be used once a detector is fully contructed to simply place it in the world More...
 
G4int Set (G4String basename, G4VPhysicalVolume *world, G4int copy_number_offset, const G4Transform3D *Tr, G4int main_copy_number=0)
 
virtual void Store (G4VPhysicalVolume *)
 Store in the sub-factory the given physical volume. More...
 
virtual ~ScintillatorDF ()
 

Static Public Member Functions

static G4int AddGCopyNb ()
 global copy number, used to set copy number once building detector. Not protected for MT since in principle init of geom done without MT More...
 
static void ChangeCopyNb (G4VPhysicalVolume *top, G4String which_det, G4int which_nb)
 change copy number of the physical volume contained in the top volume More...
 
static void ChangeSD (G4String opt, G4VPhysicalVolume *top=0x0)
 Change some SD detector into an other type of SD. Opt is used eventually to filter on the name of the volume and its material name. More...
 
static void CollectVolumes (G4VPhysicalVolume *theDetector, std::vector< G4LogicalVolume * > &logical_stored, std::vector< G4VPhysicalVolume * > &physical_stored, std::vector< G4VPhysicalVolume * > &physical_active)
 From the given physical volume, it collects into collection all logical (sensitive) and physical volumes (including itself in first slot) More...
 
static DetectorFactoryGetFactory (G4String fullname)
 get the specific factory for a full name to a file More...
 
static G4int GetGCopyNb ()
 
static G4VSensitiveDetector * GetSD (G4String opt, const char sd_type= 'S')
 Get a particular SD. S means a SD while s is for Scorers. More...
 
static G4VPhysicalVolume * MakeVCR (G4String name, G4double HalfX=5.0 *CLHEP::m, G4double HalfY=5.0 *CLHEP::m, G4double HalfZ=5.0 *CLHEP::m, G4int copy=-1)
 make a cubic world More...
 
static void SetActive (G4LogicalVolume *pv, const G4String &option="*|*|*|0.5;0.5;0.5;0.5")
 Set to the given logical volume some attributs (sensitive, color) depending of the given option. used @ the import level. More...
 
static G4int SetGCopyNb (G4int val)
 
static DetectorFactorytheMainFactory ()
 to get the main factory More...
 

Protected Member Functions

G4VPhysicalVolume * Import (G4String gdmlfile, G4String detname, const G4String &opt_amap, const G4String &opt_dmap)
 import a gdml file (extention to ascii ?) into factory. See Active for opt_amap option More...
 
void MakeInStore (G4String name, G4String version_string)
 build in store a particular detector from its names and version. i.e. call th Make method of the sub factory and then Store More...
 
void StoreMap (std::ofstream &amap, std::ofstream &dmap, std::vector< G4LogicalVolume * > &logical_stored, std::vector< G4VPhysicalVolume * > &physical_stored, std::vector< G4VPhysicalVolume * > &physical_active, G4VPhysicalVolume *theDetector)
 recursively called in the tree struture More...
 
void StreamTouchable (std::ofstream &dmap, G4String)
 extrac from the name of the detector the touchable part More...
 

Protected Attributes

std::vector< std::pair
< G4String, G4AssemblyVolume * > > 
fLoadedAssembly
 in case a gdml file has already by loaded, it allows to get the assembly quickly More...
 
std::vector< std::pair
< G4String, G4VPhysicalVolume * > > 
fLoadedPhysical
 in case it has been loaded, keep a trace More...
 
G4String fPath
 Name of the factory, also used for the name of the directory containing the detectors handled by the factory. More...
 

Detailed Description

Base classe to build scintillators.

Definition at line 37 of file SToGS_ScintillatorDF.hh.

Constructor & Destructor Documentation

SToGS::ScintillatorDF::ScintillatorDF ( G4String  path)
inline

Definition at line 65 of file SToGS_ScintillatorDF.hh.

virtual SToGS::ScintillatorDF::~ScintillatorDF ( )
inlinevirtual

Definition at line 67 of file SToGS_ScintillatorDF.hh.

Member Function Documentation

static G4int SToGS::DetectorFactory::AddGCopyNb ( )
inlinestaticinherited

global copy number, used to set copy number once building detector. Not protected for MT since in principle init of geom done without MT

Definition at line 122 of file SToGS_DetectorFactory.hh.

void SToGS::DetectorFactory::AssemblyRename ( G4AssemblyVolume *  assembly,
const G4String &  volume_to_find 
) const
inherited

rename physical volume produced by the assembly

Definition at line 428 of file SToGS_DetectorFactory.cc.

static void SToGS::DetectorFactory::ChangeCopyNb ( G4VPhysicalVolume *  top,
G4String  which_det,
G4int  which_nb 
)
staticinherited

change copy number of the physical volume contained in the top volume

void SToGS::DetectorFactory::ChangeSD ( G4String  opt,
G4VPhysicalVolume *  top = 0x0 
)
staticinherited

Change some SD detector into an other type of SD. Opt is used eventually to filter on the name of the volume and its material name.

if top is 0x0, tries with world

Definition at line 95 of file SToGS_DetectorFactory.cc.

void SToGS::DetectorFactory::Clean ( )
inherited

clear factory i.e. in memory collections of physicals and assemblies

Definition at line 1136 of file SToGS_DetectorFactory.cc.

void SToGS::DetectorFactory::CollectVolumes ( G4VPhysicalVolume *  theDetector,
std::vector< G4LogicalVolume * > &  logical_stored,
std::vector< G4VPhysicalVolume * > &  physical_stored,
std::vector< G4VPhysicalVolume * > &  physical_active 
)
staticinherited

From the given physical volume, it collects into collection all logical (sensitive) and physical volumes (including itself in first slot)

recursive call.

Definition at line 334 of file SToGS_DetectorFactory.cc.

G4int SToGS::DetectorFactory::DoMap ( G4AssemblyVolume *  assembly,
G4VPhysicalVolume *  volume_used_to_built_assembly,
G4int  copy_number_offset = 0 
) const
inherited

remap all the physical volumes produced by the Imprint method.

Definition at line 455 of file SToGS_DetectorFactory.cc.

G4VPhysicalVolume * SToGS::DetectorFactory::Get ( G4String  basename)
virtualinherited

search for a detector in DetectorFactory

Get calls GetGeometry + GetAttributes. Separated since geant4.10 requires separation of geometrical part and attributes for Multi-Threading

it has to start with the subfactory name and then the name of the file. It adds autmoatically .gdml Ex:

Scintillators/ParisPW_2 –> DetectorFactory/Scintillators/ParisPW_2.gdml

Reimplemented in SToGS::GenericsDF.

Definition at line 693 of file SToGS_DetectorFactory.cc.

G4AssemblyVolume * SToGS::DetectorFactory::GetAssembly ( G4String  basename)
inherited

Definition at line 1099 of file SToGS_DetectorFactory.cc.

void SToGS::DetectorFactory::GetAttributes ( G4String  basename,
G4bool  do_amap = true,
G4bool  do_dmap = false 
)
virtualinherited

Read the amap file and apply atributes to the detector. if not found, it creates a deefault one from the sensitive detector founds.

Reimplemented in SToGS::GenericsDF.

Definition at line 748 of file SToGS_DetectorFactory.cc.

G4String SToGS::DetectorFactory::GetDetName ( const G4String &  path) const
inherited

Get detector name from full path to the gdml file.

It removes the path and the gdml extention. This name is supposed to be equal to the one of the detector inside the gdml file

Definition at line 403 of file SToGS_DetectorFactory.cc.

G4String SToGS::DetectorFactory::GetDetName ( G4String  name,
G4String  version 
) const
inherited

Definition at line 416 of file SToGS_DetectorFactory.cc.

SToGS::DetectorFactory * SToGS::DetectorFactory::GetFactory ( G4String  fullname)
staticinherited

get the specific factory for a full name to a file

Definition at line 80 of file SToGS_DetectorFactory.cc.

G4String SToGS::DetectorFactory::GetFactoryName ( ) const
inlineinherited

Definition at line 203 of file SToGS_DetectorFactory.hh.

G4String SToGS::DetectorFactory::GetFileName ( G4String  detname,
G4String  extention 
)
inherited

compute name of the file to store/read information

Definition at line 161 of file SToGS_DetectorFactory.cc.

static G4int SToGS::DetectorFactory::GetGCopyNb ( )
inlinestaticinherited

Definition at line 133 of file SToGS_DetectorFactory.hh.

G4VSensitiveDetector * SToGS::DetectorFactory::GetSD ( G4String  opt,
const char  sd_type = 'S' 
)
staticinherited

Get a particular SD. S means a SD while s is for Scorers.

Definition at line 615 of file SToGS_DetectorFactory.cc.

G4VPhysicalVolume * SToGS::DetectorFactory::Import ( G4String  gdmlfile,
G4String  detname,
const G4String &  opt_amap,
const G4String &  opt_dmap 
)
protectedinherited

import a gdml file (extention to ascii ?) into factory. See Active for opt_amap option

if opt_dmap == "T" touchable is done i.e. the physical name is changed to include the copy numnber PNAME:COPY#

Definition at line 638 of file SToGS_DetectorFactory.cc.

G4VPhysicalVolume * SToGS::ScintillatorDF::Make ( G4String  name,
G4String  version_string 
)
virtual

Should be implemented in any sub factory. It built (C++) a detector and return it.

Reimplemented from SToGS::DetectorFactory.

Definition at line 116 of file SToGS_ScintillatorDF.cc.

G4VPhysicalVolume * SToGS::DetectorFactory::MakeAnArrayFromFactory ( G4String  input_file)
virtualinherited

built an array from the factory using the given input file

Definition at line 1184 of file SToGS_DetectorFactory.cc.

G4VPhysicalVolume * SToGS::ScintillatorDF::MakeCdC ( G4String  detname,
G4String  opt = "bare" 
)

Definition at line 174 of file SToGS_ScintillatorDF.cc.

G4VPhysicalVolume * SToGS::ScintillatorDF::MakeCPPW ( G4String  detname,
G4String  opt = "bare" 
)

Definition at line 696 of file SToGS_ScintillatorDF.cc.

G4VPhysicalVolume * SToGS::ScintillatorDF::MakeEDEN ( G4String  detname,
G4double  caps_width = 0.0,
G4double  extra_back = 0.0,
G4String  opt = "v0" 
)

Definition at line 956 of file SToGS_ScintillatorDF.cc.

G4VPhysicalVolume * SToGS::ScintillatorDF::MakeFATIMAM ( G4String  detname,
G4String  opt = "bare" 
)

Definition at line 771 of file SToGS_ScintillatorDF.cc.

G4VPhysicalVolume * SToGS::ScintillatorDF::MakeFATIMAQ ( G4String  detname,
G4String  opt = "bare" 
)

Definition at line 899 of file SToGS_ScintillatorDF.cc.

void SToGS::DetectorFactory::MakeInStore ( G4String  name,
G4String  version_string 
)
protectedinherited

build in store a particular detector from its names and version. i.e. call th Make method of the sub factory and then Store

The most important method is Make which, depending of the name and version calls the correct C++ methods with the right parameters. This methods just check is has not yet been made in store and if not call Make then Store

Definition at line 144 of file SToGS_DetectorFactory.cc.

G4VPhysicalVolume * SToGS::ScintillatorDF::MakePPW ( G4String  detname,
G4double  caps_width = 0.0,
G4double  housing_width = 0.0,
G4String  opt = "bare" 
)

Options
bare : take into account caps and housing but they are not included in the PW. It allows studies of the impact of encapsulation

Definition at line 555 of file SToGS_ScintillatorDF.cc.

void SToGS::ScintillatorDF::MakeStore ( )
virtual

build the default store i.e. all the scintillators detectors.

Reimplemented from SToGS::DetectorFactory.

Definition at line 65 of file SToGS_ScintillatorDF.cc.

G4VPhysicalVolume * SToGS::DetectorFactory::MakeVCR ( G4String  name,
G4double  HalfX = 5.0*CLHEP::m,
G4double  HalfY = 5.0*CLHEP::m,
G4double  HalfZ = 5.0*CLHEP::m,
G4int  copy = -1 
)
staticinherited

make a cubic world

Definition at line 1158 of file SToGS_DetectorFactory.cc.

G4int SToGS::DetectorFactory::ReMap ( G4VPhysicalVolume *  adetector,
G4int  offset 
)
virtualinherited

for the given volume, it changes all copy number of active volumes by starting with offset

It returns the number of actives volumes found in this detector

Definition at line 955 of file SToGS_DetectorFactory.cc.

G4int SToGS::DetectorFactory::Set ( G4String  basename,
G4VPhysicalVolume *  world,
G4int  copy_number_offset,
const G4ThreeVector *  T = 0x0,
const G4RotationMatrix *  R = 0x0,
G4int  main_copy_number = 0 
)
inherited

to be used once a detector is fully contructed to simply place it in the world

Definition at line 968 of file SToGS_DetectorFactory.cc.

G4int SToGS::DetectorFactory::Set ( G4String  basename,
G4VPhysicalVolume *  world,
G4int  copy_number_offset,
const G4Transform3D *  Tr,
G4int  main_copy_number = 0 
)
inherited

Definition at line 1089 of file SToGS_DetectorFactory.cc.

void SToGS::DetectorFactory::SetActive ( G4LogicalVolume *  pv,
const G4String &  option = "*|*|*|0.5;0.5;0.5;0.5" 
)
staticinherited

Set to the given logical volume some attributs (sensitive, color) depending of the given option. used @ the import level.

option has the following format : Volumename|material|sensitivedetectorname|color
with color red;green;blue;alpha

Definition at line 525 of file SToGS_DetectorFactory.cc.

static G4int SToGS::DetectorFactory::SetGCopyNb ( G4int  val)
inlinestaticinherited

Definition at line 127 of file SToGS_DetectorFactory.hh.

void SToGS::DetectorFactory::Store ( G4VPhysicalVolume *  theDetector)
virtualinherited

Store in the sub-factory the given physical volume.

Definition at line 373 of file SToGS_DetectorFactory.cc.

void SToGS::DetectorFactory::StoreMap ( std::ofstream &  amap,
std::ofstream &  dmap,
std::vector< G4LogicalVolume * > &  logical_stored,
std::vector< G4VPhysicalVolume * > &  physical_stored,
std::vector< G4VPhysicalVolume * > &  physical_active,
G4VPhysicalVolume *  theDetector 
)
protectedinherited

recursively called in the tree struture

Definition at line 180 of file SToGS_DetectorFactory.cc.

void SToGS::DetectorFactory::StreamTouchable ( std::ofstream &  dmap,
G4String  dname 
)
protectedinherited

extrac from the name of the detector the touchable part

Definition at line 171 of file SToGS_DetectorFactory.cc.

SToGS::DetectorFactory * SToGS::DetectorFactory::theMainFactory ( )
staticinherited

to get the main factory

Definition at line 69 of file SToGS_DetectorFactory.cc.

Member Data Documentation

std::vector< std::pair < G4String, G4AssemblyVolume *> > SToGS::DetectorFactory::fLoadedAssembly
protectedinherited

in case a gdml file has already by loaded, it allows to get the assembly quickly

Definition at line 84 of file SToGS_DetectorFactory.hh.

std::vector< std::pair < G4String, G4VPhysicalVolume *> > SToGS::DetectorFactory::fLoadedPhysical
protectedinherited

in case it has been loaded, keep a trace

Definition at line 86 of file SToGS_DetectorFactory.hh.

G4String SToGS::DetectorFactory::fPath
protectedinherited

Name of the factory, also used for the name of the directory containing the detectors handled by the factory.

Definition at line 81 of file SToGS_DetectorFactory.hh.


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