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

#include <G4DigiManager.hh>

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 ()
 

Detailed Description

Definition at line 54 of file G4DigiManager.hh.

Constructor & Destructor Documentation

G4DigiManager::G4DigiManager ( )
protected

Definition at line 55 of file G4DigiManager.cc.

55  :verboseLevel(0)
56 {
57  theMessenger = new G4DMmessenger(this);
58  runManager = G4RunManager::GetRunManager();
59  SDManager = G4SDManager::GetSDMpointer();
60  DCtable = new G4DCtable;
61 }
static G4RunManager * GetRunManager()
Definition: G4RunManager.cc:79
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 ( )

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 }
int G4int
Definition: G4Types.hh:78
typedef int(XMLCALL *XML_NotStandaloneHandler)(void *userData)

Here is the call graph for this function:

Member Function Documentation

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 
108  runManager->SetDCtable(DCtable);
109 }
int G4int
Definition: G4Types.hh:78
G4int GetNumberOfCollections() const
G4String GetName() const
G4GLOB_DLL std::ostream G4cout
typedef int(XMLCALL *XML_NotStandaloneHandler)(void *userData)
G4int Registor(G4String SDname, G4String DCname)
Definition: G4DCtable.cc:37
void SetDCtable(G4DCtable *DCtbl)
G4String GetCollectionName(G4int i) const
#define G4endl
Definition: G4ios.hh:61

Here is the call graph for this function:

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:

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 }
int G4int
Definition: G4Types.hh:78
typedef int(XMLCALL *XML_NotStandaloneHandler)(void *userData)

Here is the call graph for this function:

Here is the caller graph for this function:

G4int G4DigiManager::GetCollectionCapacity ( ) const
inline

Definition at line 116 of file G4DigiManager.hh.

117  { return DCtable->entries(); }
G4int entries() const
Definition: G4DCtable.hh:66

Here is the call graph for this function:

G4DCtable* G4DigiManager::GetDCtable ( ) const
inline

Definition at line 120 of file G4DigiManager.hh.

121  { return DCtable; }
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 }
const G4Event * GetPreviousEvent(G4int i) const
G4VDigiCollection * GetDC(G4int i) const
G4DCofThisEvent * GetDCofThisEvent() const
Definition: G4Event.hh:187
const G4Event * GetCurrentEvent() const

Here is the call graph for this function:

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 }
int G4int
Definition: G4Types.hh:78
G4GLOB_DLL std::ostream G4cout
#define G4endl
Definition: G4ios.hh:61
G4int GetCollectionID(G4String DCname) const
Definition: G4DCtable.cc:46

Here is the call graph for this function:

Here is the caller graph for this function:

G4DigiManager * G4DigiManager::GetDMpointer ( )
static

Definition at line 43 of file G4DigiManager.cc.

44 {
45  if(!fDManager)
46  {
47  fDManager = new G4DigiManager;
48  }
49  return fDManager;
50 }

Here is the call graph for this function:

Here is the caller graph for this function:

G4DigiManager * G4DigiManager::GetDMpointerIfExist ( )
static

Definition at line 52 of file G4DigiManager.cc.

53 { return fDManager; }
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 }
G4VHitsCollection * GetHC(G4int i)
const G4Event * GetPreviousEvent(G4int i) const
G4HCofThisEvent * GetHCofThisEvent() const
Definition: G4Event.hh:185
const G4Event * GetCurrentEvent() const

Here is the call graph for this function:

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

Here is the call graph for this function:

G4int G4DigiManager::GetModuleCapacity ( ) const
inline

Definition at line 118 of file G4DigiManager.hh.

119  { return DMtable.size(); }
G4int G4DigiManager::GetVerboseLevel ( ) const
inline

Definition at line 114 of file G4DigiManager.hh.

115  { return verboseLevel; }
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 }
int G4int
Definition: G4Types.hh:78
G4GLOB_DLL std::ostream G4cout
typedef int(XMLCALL *XML_NotStandaloneHandler)(void *userData)
#define G4endl
Definition: G4ios.hh:61

Here is the call graph for this function:

Here is the caller graph for this function:

void G4DigiManager::RestoreDCtable ( G4DCtable dc)
inline

Definition at line 122 of file G4DigiManager.hh.

123  {
124  if(DCtable) delete DCtable;
125  DCtable = dc;
126  }
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 }
G4int entries() const
Definition: G4DCtable.hh:66
G4GLOB_DLL std::ostream G4cout
void SetDCofThisEvent(G4DCofThisEvent *value)
Definition: G4Event.hh:119
void AddDigiCollection(G4int DCID, G4VDigiCollection *aDC)
#define G4endl
Definition: G4ios.hh:61
G4DCofThisEvent * GetDCofThisEvent() const
Definition: G4Event.hh:187
const G4Event * GetCurrentEvent() const

Here is the call graph for this function:

Here is the caller graph for this function:

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 }
int G4int
Definition: G4Types.hh:78
typedef int(XMLCALL *XML_NotStandaloneHandler)(void *userData)

Here is the call graph for this function:

Here is the caller graph for this function:


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