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

Factory which is an interface to G4VUserDetectorConstruction. More...

#include <SToGS_GenericsDF.hh>

Inheritance diagram for SToGS::GenericsDF:

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...
 
 GenericsDF (G4String path)
 
virtual G4VPhysicalVolume * Get (G4String basename)
 overwrite the Get method to retrieve the detector from the standard G4 way i.e. by calling Construct More...
 
G4AssemblyVolume * GetAssembly (G4String basename)
 
virtual void GetAttributes (G4String basename, G4bool do_amap=true, G4bool do_dmap=false)
 Read attrbiutes by calling COnstructSDandFileds. 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 * MakeAnArrayFromFactory (G4String input_file)
 built an array from the factory using the given input file More...
 
virtual void MakeStore ()
 build the default store i.e. nothing here 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...
 
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 ~GenericsDF ()
 

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

G4String GetConf (G4String path_in_factory) const
 return from the full path in the factory the configuration file which is following $ More...
 
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...
 
virtual G4VPhysicalVolume * Make (G4String, G4String)
 Should be implemented in any sub factory. It built (C++) a detector and return it. 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...
 
std::vector< std::pair
< G4String,
G4VUserDetectorConstruction * > > 
fLoadedUserDetectorConstruction
 
G4String fPath
 Name of the factory, also used for the name of the directory containing the detectors handled by the factory. More...
 

Detailed Description

Factory which is an interface to G4VUserDetectorConstruction.

Definition at line 39 of file SToGS_GenericsDF.hh.

Constructor & Destructor Documentation

SToGS::GenericsDF::GenericsDF ( G4String  path)
inline

Definition at line 52 of file SToGS_GenericsDF.hh.

virtual SToGS::GenericsDF::~GenericsDF ( )
inlinevirtual

Definition at line 54 of file SToGS_GenericsDF.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::GenericsDF::Get ( G4String  basename)
virtual

overwrite the Get method to retrieve the detector from the standard G4 way i.e. by calling Construct

Reimplemented from SToGS::DetectorFactory.

Definition at line 61 of file SToGS_GenericsDF.cc.

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

Definition at line 1099 of file SToGS_DetectorFactory.cc.

void SToGS::GenericsDF::GetAttributes ( G4String  basename,
G4bool  do_amap = true,
G4bool  do_dmap = false 
)
virtual

Read attrbiutes by calling COnstructSDandFileds.

Reimplemented from SToGS::DetectorFactory.

Definition at line 112 of file SToGS_GenericsDF.cc.

G4String SToGS::GenericsDF::GetConf ( G4String  path_in_factory) const
protected

return from the full path in the factory the configuration file which is following $

ex: DetectorFactory/Generics/TwoShell$toto.geo

Definition at line 47 of file SToGS_GenericsDF.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.

virtual G4VPhysicalVolume* SToGS::DetectorFactory::Make ( G4String  ,
G4String   
)
inlineprotectedvirtualinherited

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

Reimplemented in SToGS::ScintillatorDF, SToGS::PlainDF, SToGS::SemiConductorGeDF, and SToGS::ArraysDF.

Definition at line 178 of file SToGS_DetectorFactory.hh.

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.

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.

virtual void SToGS::GenericsDF::MakeStore ( )
inlinevirtual

build the default store i.e. nothing here

Reimplemented from SToGS::DetectorFactory.

Definition at line 63 of file SToGS_GenericsDF.hh.

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.

std::vector< std::pair < G4String, G4VUserDetectorConstruction *> > SToGS::GenericsDF::fLoadedUserDetectorConstruction
protected

Definition at line 42 of file SToGS_GenericsDF.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: