Geant4 VMC Version 6.6
Loading...
Searching...
No Matches
TG4SDConstruction Class Reference

Sensitive detector construction. More...

#include <TG4SDConstruction.h>

Inheritance diagram for TG4SDConstruction:

Public Member Functions

 TG4SDConstruction ()
 
virtual ~TG4SDConstruction ()
 
virtual void Construct ()
 
void AddSelection (const G4String &selection)
 
void SetExclusiveSDScoring (G4bool value)
 
void SetSelectionFromTGeo (G4bool value)
 
void SetSensitiveVolumeLabel (const G4String &label)
 
void SetIsGflash (G4bool isGflash)
 
- Public Member Functions inherited from TG4Verbose
 TG4Verbose (const G4String &cmdName)
 
 TG4Verbose (const G4String &cmdName, G4int verboseLevel)
 
virtual ~TG4Verbose ()
 
virtual void VerboseLevel (G4int level)
 
virtual G4int VerboseLevel () const
 

Static Public Member Functions

static const G4String & GetDefaultSVLabel ()
 

Private Member Functions

void CreateSD (G4LogicalVolume *lv, TVirtualMCSensitiveDetector *userSD) const
 
void FillSDSelectionFromTGeo ()
 
void MapVolumesToInstanceIds ()
 
void MapVolumesToSDIds ()
 

Private Attributes

TG4SDMessenger fMessenger
 messenger
 
G4bool fExclusiveSDScoring
 the flag to activate new scoring via user defined sensitive detectors
 
G4bool fSelectionFromTGeo
 the flag to activate retrieving sensitive volumes from TGeo
 
G4String fSVLabel
 the label used to flag sensitive volumes in TGeo
 
std::set< G4String > fSelection
 the set of volumes names which are selected as sensitive
 
G4bool fIsGflash
 the flag to acivate creating Gflash sensitive detectors
 

Static Private Attributes

static const G4String fgkDefaultSVLabel = "SV"
 default value of the sensitive volumes label
 

Detailed Description

Sensitive detector construction.

Class for construction of user sensitive detectors. Constructed sensitive detectors inherit from TG4VSensitiveDetector (see TG4VSensitiveDetector.h description); all cloned logical volumes (which a single G3 volume correspond to) share the same sensitive detector instance.

Author
I. Hrivnacova; IPN, Orsay

Definition at line 39 of file TG4SDConstruction.h.

Constructor & Destructor Documentation

◆ TG4SDConstruction()

TG4SDConstruction::TG4SDConstruction ( )

Default constructor

Definition at line 37 of file TG4SDConstruction.cxx.

◆ ~TG4SDConstruction()

TG4SDConstruction::~TG4SDConstruction ( )
virtual

Destructor

Definition at line 50 of file TG4SDConstruction.cxx.

Member Function Documentation

◆ GetDefaultSVLabel()

const G4String & TG4SDConstruction::GetDefaultSVLabel ( )
inlinestatic

Get the default value of the sensitive volumes label (the string which is used to select sensitive volumes in TGeoGeometry)

Definition at line 89 of file TG4SDConstruction.h.

Referenced by TG4SDMessenger::TG4SDMessenger().

◆ Construct()

void TG4SDConstruction::Construct ( )
virtual

Create sensitive detectors and initialize the VMC application. Sensitive detectors are set to all logical volumes

Definition at line 228 of file TG4SDConstruction.cxx.

Referenced by TG4SDManager::Initialize().

◆ AddSelection()

void TG4SDConstruction::AddSelection ( const G4String & selection)

Add the selection in the set of volume names which will be made sensitive.

Definition at line 315 of file TG4SDConstruction.cxx.

Referenced by TG4SDMessenger::SetNewValue().

◆ SetExclusiveSDScoring()

void TG4SDConstruction::SetExclusiveSDScoring ( G4bool value)
inline

Set option to activate new scoring via user defined sensitive detectors

Definition at line 96 of file TG4SDConstruction.h.

Referenced by TG4SDManager::SetExclusiveSDScoring(), and TG4SDMessenger::SetNewValue().

◆ SetSelectionFromTGeo()

void TG4SDConstruction::SetSelectionFromTGeo ( G4bool value)
inline

Set option to get the SD selection from TGeo

Definition at line 102 of file TG4SDConstruction.h.

Referenced by TG4SDMessenger::SetNewValue().

◆ SetSensitiveVolumeLabel()

void TG4SDConstruction::SetSensitiveVolumeLabel ( const G4String & label)
inline

Set the sensitive volumes label (the string which is used to select sensitive volumes in TGeoGeometry)

Definition at line 108 of file TG4SDConstruction.h.

Referenced by TG4SDMessenger::SetNewValue().

◆ SetIsGflash()

void TG4SDConstruction::SetIsGflash ( G4bool isGflash)
inline

Set the flag to acivate creating Gflash sensitive detectors

Definition at line 115 of file TG4SDConstruction.h.

Referenced by TG4SDMessenger::SetNewValue().

◆ CreateSD()

void TG4SDConstruction::CreateSD ( G4LogicalVolume * lv,
TVirtualMCSensitiveDetector * userSD ) const
private

Create/retrieve a sensitive detector for the given logical volume.

Definition at line 60 of file TG4SDConstruction.cxx.

Referenced by Construct().

◆ FillSDSelectionFromTGeo()

void TG4SDConstruction::FillSDSelectionFromTGeo ( )
private

Retrieve the selection of sensitive volumes from TGeo. The volumes are marked as sensitive when there is set the TGeoVolume option to a given value (TG4SDConstruction::fgkDefaultSVLabel by default)

Definition at line 132 of file TG4SDConstruction.cxx.

Referenced by Construct().

◆ MapVolumesToInstanceIds()

void TG4SDConstruction::MapVolumesToInstanceIds ( )
private

Define VMC volume Ids when new sensitive detectors framework is used. The volume Ids correspond to the Geant4 logical volume instance number.

A special care is needed whin combining the old way of geometry definition with the new sensitive detectors framework. Note that in this case, if geometry is defined via the VMC functions like gsposp, then the "same" volume in the context of Geant3, which is represented by more than one logical volumes in Geant4, will have several volume ids.

Definition at line 164 of file TG4SDConstruction.cxx.

Referenced by Construct().

◆ MapVolumesToSDIds()

void TG4SDConstruction::MapVolumesToSDIds ( )
private

Define VMC volume Ids if new sensitive detectors framework is not used, The volume ID is defined via sensitive detector Id. The sensitive detector is associated with maximum one logical volume, that's why it can hold volume and medium Id.

Definition at line 191 of file TG4SDConstruction.cxx.

Referenced by Construct().

Member Data Documentation

◆ fMessenger

TG4SDMessenger TG4SDConstruction::fMessenger
private

messenger

Definition at line 66 of file TG4SDConstruction.h.

◆ fgkDefaultSVLabel

const G4String TG4SDConstruction::fgkDefaultSVLabel = "SV"
staticprivate

default value of the sensitive volumes label

Definition at line 69 of file TG4SDConstruction.h.

Referenced by GetDefaultSVLabel().

◆ fExclusiveSDScoring

G4bool TG4SDConstruction::fExclusiveSDScoring
private

the flag to activate new scoring via user defined sensitive detectors

Definition at line 72 of file TG4SDConstruction.h.

Referenced by Construct(), CreateSD(), and SetExclusiveSDScoring().

◆ fSelectionFromTGeo

G4bool TG4SDConstruction::fSelectionFromTGeo
private

the flag to activate retrieving sensitive volumes from TGeo

Definition at line 75 of file TG4SDConstruction.h.

Referenced by Construct(), and SetSelectionFromTGeo().

◆ fSVLabel

G4String TG4SDConstruction::fSVLabel
private

the label used to flag sensitive volumes in TGeo

Definition at line 78 of file TG4SDConstruction.h.

Referenced by FillSDSelectionFromTGeo(), and SetSensitiveVolumeLabel().

◆ fSelection

std::set<G4String> TG4SDConstruction::fSelection
private

the set of volumes names which are selected as sensitive

Definition at line 81 of file TG4SDConstruction.h.

Referenced by AddSelection(), Construct(), and FillSDSelectionFromTGeo().

◆ fIsGflash

G4bool TG4SDConstruction::fIsGflash
private

the flag to acivate creating Gflash sensitive detectors

Definition at line 84 of file TG4SDConstruction.h.

Referenced by CreateSD(), and SetIsGflash().


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