Geant4  10.03.p01
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
G4SDManager Class Reference

#include <G4SDManager.hh>

Public Member Functions

 ~G4SDManager ()
 
void AddNewDetector (G4VSensitiveDetector *aSD)
 
void Activate (G4String dName, G4bool activeFlag)
 
G4int GetCollectionID (G4String colName)
 
G4int GetCollectionID (G4VHitsCollection *aHC)
 
G4VSensitiveDetectorFindSensitiveDetector (G4String dName, G4bool warning=true)
 
G4HCofThisEventPrepareNewEvent ()
 
void TerminateCurrentEvent (G4HCofThisEvent *HCE)
 
void AddNewCollection (G4String SDname, G4String DCname)
 
void SetVerboseLevel (G4int vl)
 
G4SDStructureGetTreeTop () const
 
void ListTree () const
 
G4int GetCollectionCapacity () const
 
G4HCtableGetHCtable () const
 

Static Public Member Functions

static G4SDManagerGetSDMpointer ()
 
static G4SDManagerGetSDMpointerIfExist ()
 

Protected Member Functions

 G4SDManager ()
 

Detailed Description

Definition at line 50 of file G4SDManager.hh.

Constructor & Destructor Documentation

G4SDManager::G4SDManager ( )
protected

Definition at line 52 of file G4SDManager.cc.

52  :verboseLevel(0)
53 {
54  G4String topName = "/";
55  treeTop = new G4SDStructure(topName);
56  theMessenger = new G4SDmessenger(this);
57  HCtable = new G4HCtable;
58 }

Here is the caller graph for this function:

G4SDManager::~G4SDManager ( )

Definition at line 60 of file G4SDManager.cc.

61 {
62  delete theMessenger;
63  delete HCtable;
64  delete treeTop;
65  theMessenger = nullptr;
66  HCtable = nullptr;
67  treeTop = nullptr;
68  fSDManager = nullptr;
69 }

Member Function Documentation

void G4SDManager::Activate ( G4String  dName,
G4bool  activeFlag 
)

Definition at line 121 of file G4SDManager.cc.

122 {
123  G4String pathName = dName;
124  if( pathName(0) != '/' ) pathName.prepend("/");
125  treeTop->Activate(pathName,activeFlag);
126 }
void Activate(G4String aName, G4bool sensitiveFlag)
G4String & prepend(const char *)

Here is the call graph for this function:

Here is the caller graph for this function:

void G4SDManager::AddNewCollection ( G4String  SDname,
G4String  DCname 
)

Definition at line 92 of file G4SDManager.cc.

93 {
94  G4int i = HCtable->Registor(SDname,DCname);
95  if(verboseLevel>0)
96  {
97  if(i<0) {
98  if(verboseLevel>1) G4cout << "G4SDManager::AddNewCollection : the collection <"
99  << SDname << "/" << DCname << "> has already been reginstered." << G4endl;
100  }
101  else
102  {
103  G4cout << "G4SDManager::AddNewCollection : the collection <"
104  << SDname << "/" << DCname << "> is registered at " << i << G4endl;
105  }
106  }
107 }
int G4int
Definition: G4Types.hh:78
G4int Registor(G4String SDname, G4String HCname)
Definition: G4HCtable.cc:37
G4GLOB_DLL std::ostream G4cout
#define G4endl
Definition: G4ios.hh:61

Here is the call graph for this function:

Here is the caller graph for this function:

void G4SDManager::AddNewDetector ( G4VSensitiveDetector aSD)

Definition at line 71 of file G4SDManager.cc.

72 {
73  G4int numberOfCollections = aSD->GetNumberOfCollections();
74  G4String pathName = aSD->GetPathName();
75  if( pathName(0) != '/' ) pathName.prepend("/");
76  if( pathName(pathName.length()-1) != '/' ) pathName += "/";
77  treeTop->AddNewDetector(aSD,pathName);
78  if(numberOfCollections<1) return;
79  for(G4int i=0;i<numberOfCollections;i++)
80  {
81  G4String SDname = aSD->GetName();
82  G4String DCname = aSD->GetCollectionName(i);
83  AddNewCollection(SDname,DCname);
84  }
85  if( verboseLevel > 0 )
86  {
87  G4cout << "New sensitive detector <" << aSD->GetName()
88  << "> is registered at " << pathName << G4endl;
89  }
90 }
void AddNewDetector(G4VSensitiveDetector *aSD, G4String treeStructure)
void AddNewCollection(G4String SDname, G4String DCname)
Definition: G4SDManager.cc:92
int G4int
Definition: G4Types.hh:78
G4String & prepend(const char *)
G4GLOB_DLL std::ostream G4cout
G4int GetNumberOfCollections() const
#define G4endl
Definition: G4ios.hh:61
G4String GetCollectionName(G4int id) const
G4String GetPathName() const

Here is the call graph for this function:

Here is the caller graph for this function:

G4VSensitiveDetector * G4SDManager::FindSensitiveDetector ( G4String  dName,
G4bool  warning = true 
)

Definition at line 128 of file G4SDManager.cc.

129 {
130  G4String pathName = dName;
131  if( pathName(0) != '/' ) pathName.prepend("/");
132  return treeTop->FindSensitiveDetector(pathName, warning);
133 }
G4String & prepend(const char *)
G4VSensitiveDetector * FindSensitiveDetector(G4String aName, G4bool warning=true)

Here is the call graph for this function:

Here is the caller graph for this function:

G4int G4SDManager::GetCollectionCapacity ( ) const
inline

Definition at line 99 of file G4SDManager.hh.

100  { return HCtable->entries(); }
G4int entries() const
Definition: G4HCtable.hh:66

Here is the call graph for this function:

G4int G4SDManager::GetCollectionID ( G4String  colName)

Definition at line 135 of file G4SDManager.cc.

136 {
137  G4int id = HCtable->GetCollectionID(colName);
138  if(id==-1)
139  { G4cout << "<" << colName << "> is not found." << G4endl; }
140  else if(id==-2)
141  { G4cout << "<" << colName << "> is ambiguous." << G4endl; }
142  return id;
143 }
G4int GetCollectionID(G4String HCname) const
Definition: G4HCtable.cc:46
int G4int
Definition: G4Types.hh:78
G4GLOB_DLL std::ostream G4cout
#define G4endl
Definition: G4ios.hh:61

Here is the call graph for this function:

Here is the caller graph for this function:

G4int G4SDManager::GetCollectionID ( G4VHitsCollection aHC)

Definition at line 145 of file G4SDManager.cc.

146 {
147  G4String HCname = aHC->GetSDname();
148  HCname += "/";
149  HCname += aHC->GetName();
150  return GetCollectionID(HCname);
151 }
G4int GetCollectionID(G4String colName)
Definition: G4SDManager.cc:135
G4String & GetSDname()

Here is the call graph for this function:

G4HCtable* G4SDManager::GetHCtable ( ) const
inline

Definition at line 101 of file G4SDManager.hh.

102  { return HCtable; }

Here is the caller graph for this function:

G4SDManager * G4SDManager::GetSDMpointer ( )
static

Definition at line 40 of file G4SDManager.cc.

41 {
42  if(!fSDManager)
43  {
44  fSDManager = new G4SDManager;
45  }
46  return fSDManager;
47 }

Here is the call graph for this function:

Here is the caller graph for this function:

G4SDManager * G4SDManager::GetSDMpointerIfExist ( )
static

Definition at line 49 of file G4SDManager.cc.

50 { return fSDManager; }

Here is the caller graph for this function:

G4SDStructure* G4SDManager::GetTreeTop ( ) const
inline

Definition at line 95 of file G4SDManager.hh.

96  { return treeTop; }
void G4SDManager::ListTree ( ) const
inline

Definition at line 97 of file G4SDManager.hh.

98  { treeTop->ListTree(); }

Here is the call graph for this function:

Here is the caller graph for this function:

G4HCofThisEvent * G4SDManager::PrepareNewEvent ( )

Definition at line 109 of file G4SDManager.cc.

110 {
111  G4HCofThisEvent* HCE = new G4HCofThisEvent(HCtable->entries());
112  treeTop->Initialize(HCE);
113  return HCE;
114 }
void Initialize(G4HCofThisEvent *HCE)
G4int entries() const
Definition: G4HCtable.hh:66

Here is the call graph for this function:

void G4SDManager::SetVerboseLevel ( G4int  vl)
inline

Definition at line 90 of file G4SDManager.hh.

91  {
92  verboseLevel = vl;
93  treeTop->SetVerboseLevel(vl);
94  }
void SetVerboseLevel(G4int vl)

Here is the call graph for this function:

Here is the caller graph for this function:

void G4SDManager::TerminateCurrentEvent ( G4HCofThisEvent HCE)

Definition at line 116 of file G4SDManager.cc.

117 {
118  treeTop->Terminate(HCE);
119 }
void Terminate(G4HCofThisEvent *HCE)

Here is the call graph for this function:


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