Geant4  10.02.p03
G4DigiManager Class Reference

#include <G4DigiManager.hh>

Collaboration diagram for G4DigiManager:

Public Member Functions

 ~G4DigiManager ()
 
void AddNewModule (G4VDigitizerModule *DM)
 
void Digitize (G4String mName)
 
G4VDigitizerModuleFindDigitizerModule (G4String mName)
 
const G4VHitsCollectionGetHitsCollection (G4int HCID, G4int eventID=0)
 
const G4VDigiCollectionGetDigiCollection (G4int DCID, G4int eventID=0)
 
G4int GetHitsCollectionID (G4String HCname)
 
G4int GetDigiCollectionID (G4String DCname)
 
void SetDigiCollection (G4int DCID, G4VDigiCollection *aDC)
 
void SetVerboseLevel (G4int vl)
 
void List () const
 
G4int GetVerboseLevel () const
 
G4int GetCollectionCapacity () const
 
G4int GetModuleCapacity () const
 
G4DCtableGetDCtable () const
 
void RestoreDCtable (G4DCtable *dc)
 

Static Public Member Functions

static G4DigiManagerGetDMpointer ()
 
static G4DigiManagerGetDMpointerIfExist ()
 

Protected Member Functions

 G4DigiManager ()
 

Private Member Functions

 G4DigiManager (const G4DigiManager &)
 
G4DigiManageroperator= (const G4DigiManager &)
 

Private Attributes

G4int verboseLevel
 
std::vector< G4VDigitizerModule * > DMtable
 
G4DCtableDCtable
 
G4DMmessengertheMessenger
 
G4RunManagerrunManager
 
G4SDManagerSDManager
 

Static Private Attributes

static G4ThreadLocal G4DigiManagerfDManager = 0
 

Detailed Description

Definition at line 54 of file G4DigiManager.hh.

Constructor & Destructor Documentation

◆ G4DigiManager() [1/2]

G4DigiManager::G4DigiManager ( )
protected

Definition at line 55 of file G4DigiManager.cc.

55  :verboseLevel(0)
56 {
57  theMessenger = new G4DMmessenger(this);
60  DCtable = new G4DCtable;
61 }
G4SDManager * SDManager
G4DCtable * DCtable
static G4RunManager * GetRunManager()
Definition: G4RunManager.cc:79
G4RunManager * runManager
G4DMmessenger * theMessenger
static G4SDManager * GetSDMpointer()
Definition: G4SDManager.cc:40
Here is the call graph for this function:
Here is the caller graph for this function:

◆ ~G4DigiManager()

G4DigiManager::~G4DigiManager ( )

Definition at line 63 of file G4DigiManager.cc.

64 {
65  //DMtable.clearAndDestroy();
66  for(G4int i=0;i<int(DMtable.size());i++)
67  { delete DMtable[i]; }
68  DMtable.clear();
69  delete DCtable;
70  delete theMessenger;
71 }
std::vector< G4VDigitizerModule * > DMtable
int G4int
Definition: G4Types.hh:78
G4DCtable * DCtable
G4DMmessenger * theMessenger

◆ G4DigiManager() [2/2]

G4DigiManager::G4DigiManager ( const G4DigiManager )
private

Member Function Documentation

◆ AddNewModule()

void G4DigiManager::AddNewModule ( G4VDigitizerModule DM)

Definition at line 73 of file G4DigiManager.cc.

74 {
75  G4String DMname = DM->GetName();
76  for(int j=0;j<int(DMtable.size());j++)
77  {
78  if(DMtable[j]==DM)
79  {
80  G4cout << "<" << DMname << "> has already been registored." << G4endl;
81  return;
82  }
83  }
84  if( verboseLevel > 0 )
85  {
86  G4cout << "New DigitizerModule <" << DMname
87  << "> is registored." << G4endl;
88  }
89  DMtable.push_back(DM);
90 
91  G4int numberOfCollections = DM->GetNumberOfCollections();
92  for(int i=0;i<numberOfCollections;i++)
93  {
94  G4String DCname = DM->GetCollectionName(i);
95  if( DCtable->Registor(DMname,DCname) < 0 )
96  {
97  G4cout << "DigiCollection <" << DCname
98  << "> has already been registored with "
99  << DMname << " DigitizerModule." << G4endl;
100  }
101  else if( verboseLevel > 0 )
102  {
103  G4cout << "DigiCollection " << DCname
104  << " is registored. " << G4endl;
105  }
106  }
107 
109 }
std::vector< G4VDigitizerModule * > DMtable
int G4int
Definition: G4Types.hh:78
G4GLOB_DLL std::ostream G4cout
G4String GetCollectionName(G4int i) const
G4int Registor(G4String SDname, G4String DCname)
Definition: G4DCtable.cc:37
G4int GetNumberOfCollections() const
G4DCtable * DCtable
void SetDCtable(G4DCtable *DCtbl)
G4RunManager * runManager
#define G4endl
Definition: G4ios.hh:61
G4String GetName() const
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Digitize()

void G4DigiManager::Digitize ( G4String  mName)

Definition at line 111 of file G4DigiManager.cc.

112 {
114  if(aDM)
115  { aDM->Digitize(); }
116  else
117  { G4cout << "Unknown digitizer module <" << mName << ">. Digitize() ignored." << G4endl; }
118 }
virtual void Digitize()=0
G4GLOB_DLL std::ostream G4cout
#define G4endl
Definition: G4ios.hh:61
G4VDigitizerModule * FindDigitizerModule(G4String mName)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ FindDigitizerModule()

G4VDigitizerModule * G4DigiManager::FindDigitizerModule ( G4String  mName)

Definition at line 120 of file G4DigiManager.cc.

121 {
122  for(G4int i=0;i<int(DMtable.size());i++)
123  {
124  if(DMtable[i]->GetName() == mName) return DMtable[i];
125  }
126  return NULL;
127 }
std::vector< G4VDigitizerModule * > DMtable
int G4int
Definition: G4Types.hh:78
Here is the caller graph for this function:

◆ GetCollectionCapacity()

G4int G4DigiManager::GetCollectionCapacity ( ) const
inline

Definition at line 116 of file G4DigiManager.hh.

117  { return DCtable->entries(); }
G4DCtable * DCtable
G4int entries() const
Definition: G4DCtable.hh:66
Here is the call graph for this function:

◆ GetDCtable()

G4DCtable* G4DigiManager::GetDCtable ( ) const
inline

Definition at line 120 of file G4DigiManager.hh.

121  { return DCtable; }
G4DCtable * DCtable

◆ GetDigiCollection()

const G4VDigiCollection * G4DigiManager::GetDigiCollection ( G4int  DCID,
G4int  eventID = 0 
)

Definition at line 144 of file G4DigiManager.cc.

145 {
146  const G4Event* evt = NULL;
147  if(eventID==0)
148  { evt = runManager->GetCurrentEvent(); }
149  else
150  { evt = runManager->GetPreviousEvent(eventID); }
151  if(evt==NULL) return NULL;
152 
153  G4DCofThisEvent* DCE = evt->GetDCofThisEvent();
154  if(DCE==NULL) return NULL;
155 
156  return DCE->GetDC(DCID);
157 }
G4VDigiCollection * GetDC(G4int i) const
G4DCofThisEvent * GetDCofThisEvent() const
Definition: G4Event.hh:187
const G4Event * GetCurrentEvent() const
G4RunManager * runManager
const G4Event * GetPreviousEvent(G4int i) const
Here is the call graph for this function:
Here is the caller graph for this function:

◆ GetDigiCollectionID()

G4int G4DigiManager::GetDigiCollectionID ( G4String  DCname)

Definition at line 164 of file G4DigiManager.cc.

165 {
166  G4int i = DCtable->GetCollectionID(DCname);
167  if(i==-2)
168  { G4cout << "< " << DCname << "> is ambegious." << G4endl; }
169  return i;
170 }
G4int GetCollectionID(G4String DCname) const
Definition: G4DCtable.cc:46
int G4int
Definition: G4Types.hh:78
G4GLOB_DLL std::ostream G4cout
G4DCtable * DCtable
#define G4endl
Definition: G4ios.hh:61
Here is the call graph for this function:
Here is the caller graph for this function:

◆ GetDMpointer()

G4DigiManager * G4DigiManager::GetDMpointer ( )
static

Definition at line 43 of file G4DigiManager.cc.

44 {
45  if(!fDManager)
46  {
48  }
49  return fDManager;
50 }
static G4ThreadLocal G4DigiManager * fDManager
Here is the call graph for this function:
Here is the caller graph for this function:

◆ GetDMpointerIfExist()

G4DigiManager * G4DigiManager::GetDMpointerIfExist ( )
static

Definition at line 52 of file G4DigiManager.cc.

53 { return fDManager; }
static G4ThreadLocal G4DigiManager * fDManager

◆ GetHitsCollection()

const G4VHitsCollection * G4DigiManager::GetHitsCollection ( G4int  HCID,
G4int  eventID = 0 
)

Definition at line 129 of file G4DigiManager.cc.

130 {
131  const G4Event* evt = NULL;
132  if(eventID==0)
133  { evt = runManager->GetCurrentEvent(); }
134  else
135  { evt = runManager->GetPreviousEvent(eventID); }
136  if(evt==NULL) return NULL;
137 
138  G4HCofThisEvent* HCE = evt->GetHCofThisEvent();
139  if(HCE==NULL) return NULL;
140 
141  return HCE->GetHC(HCID);
142 }
const G4Event * GetCurrentEvent() const
G4RunManager * runManager
G4HCofThisEvent * GetHCofThisEvent() const
Definition: G4Event.hh:185
const G4Event * GetPreviousEvent(G4int i) const
Here is the call graph for this function:
Here is the caller graph for this function:

◆ GetHitsCollectionID()

G4int G4DigiManager::GetHitsCollectionID ( G4String  HCname)

Definition at line 159 of file G4DigiManager.cc.

160 {
161  return SDManager->GetCollectionID(HCname);
162 }
G4int GetCollectionID(G4String colName)
Definition: G4SDManager.cc:135
G4SDManager * SDManager
Here is the call graph for this function:
Here is the caller graph for this function:

◆ GetModuleCapacity()

G4int G4DigiManager::GetModuleCapacity ( ) const
inline

Definition at line 118 of file G4DigiManager.hh.

119  { return DMtable.size(); }
std::vector< G4VDigitizerModule * > DMtable

◆ GetVerboseLevel()

G4int G4DigiManager::GetVerboseLevel ( ) const
inline

Definition at line 114 of file G4DigiManager.hh.

115  { return verboseLevel; }

◆ List()

void G4DigiManager::List ( ) const

Definition at line 208 of file G4DigiManager.cc.

209 {
210  for(G4int i=0;i<int(DMtable.size());i++)
211  { G4cout << " " << i << " : " << DMtable[i]->GetName() << G4endl; }
212 }
std::vector< G4VDigitizerModule * > DMtable
int G4int
Definition: G4Types.hh:78
G4GLOB_DLL std::ostream G4cout
#define G4endl
Definition: G4ios.hh:61
Here is the caller graph for this function:

◆ operator=()

G4DigiManager& G4DigiManager::operator= ( const G4DigiManager )
private
Here is the caller graph for this function:

◆ RestoreDCtable()

void G4DigiManager::RestoreDCtable ( G4DCtable dc)
inline

Definition at line 122 of file G4DigiManager.hh.

123  {
124  if(DCtable) delete DCtable;
125  DCtable = dc;
126  }
G4DCtable * DCtable
Here is the call graph for this function:

◆ SetDigiCollection()

void G4DigiManager::SetDigiCollection ( G4int  DCID,
G4VDigiCollection aDC 
)

Definition at line 172 of file G4DigiManager.cc.

173 {
174  const G4Event* consEvt = runManager->GetCurrentEvent();
175  if(consEvt==NULL)
176  {
177  G4cout << "G4DigiManager::SetDigiCollection --- "
178  << "Event object is not available." << G4endl;
179  return;
180  }
181 
182  G4Event* evt = (G4Event*)consEvt;
183  G4DCofThisEvent* DCE = evt->GetDCofThisEvent();
184  if(DCE==NULL)
185  {
186  DCE = new G4DCofThisEvent(DCtable->entries());
187  evt->SetDCofThisEvent(DCE);
188  if(verboseLevel>0)
189  { G4cout << "DCofThisEvent object is added to current G4Event." << G4endl; }
190  }
191 
192  DCE->AddDigiCollection(DCID,aDC);
193 
194  if(verboseLevel>0)
195  {
196  G4cout << aDC->GetName() << " is stored at " << DCID
197  << "-th slot of G4DCofThisEvent." << G4endl;
198  }
199 }
G4DCofThisEvent * GetDCofThisEvent() const
Definition: G4Event.hh:187
G4GLOB_DLL std::ostream G4cout
G4DCtable * DCtable
const G4Event * GetCurrentEvent() const
void SetDCofThisEvent(G4DCofThisEvent *value)
Definition: G4Event.hh:119
G4RunManager * runManager
void AddDigiCollection(G4int DCID, G4VDigiCollection *aDC)
G4int entries() const
Definition: G4DCtable.hh:66
#define G4endl
Definition: G4ios.hh:61
Here is the call graph for this function:
Here is the caller graph for this function:

◆ SetVerboseLevel()

void G4DigiManager::SetVerboseLevel ( G4int  vl)

Definition at line 201 of file G4DigiManager.cc.

202 {
203  verboseLevel = val;
204  for(G4int i=0;i<int(DMtable.size());i++)
205  { DMtable[i]->SetVerboseLevel(val); }
206 }
std::vector< G4VDigitizerModule * > DMtable
int G4int
Definition: G4Types.hh:78
Here is the caller graph for this function:

Member Data Documentation

◆ DCtable

G4DCtable* G4DigiManager::DCtable
private

Definition at line 108 of file G4DigiManager.hh.

◆ DMtable

std::vector<G4VDigitizerModule*> G4DigiManager::DMtable
private

Definition at line 107 of file G4DigiManager.hh.

◆ fDManager

G4ThreadLocal G4DigiManager * G4DigiManager::fDManager = 0
staticprivate

Definition at line 105 of file G4DigiManager.hh.

◆ runManager

G4RunManager* G4DigiManager::runManager
private

Definition at line 110 of file G4DigiManager.hh.

◆ SDManager

G4SDManager* G4DigiManager::SDManager
private

Definition at line 111 of file G4DigiManager.hh.

◆ theMessenger

G4DMmessenger* G4DigiManager::theMessenger
private

Definition at line 109 of file G4DigiManager.hh.

◆ verboseLevel

G4int G4DigiManager::verboseLevel
private

Definition at line 106 of file G4DigiManager.hh.


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