30 #define G4THitsMap_h 1
68 inline std::map<G4int,T*>*
GetMap()
const
93 theCollection = (
void*)
new std::map<G4int,T*>;
104 typename std::map<G4int,T*> * theHitsMap = GetMap();
105 typename std::map<G4int,T*>::iterator itr = theHitsMap->begin();
106 for(; itr != theHitsMap->end(); itr++) {
119 std::map<G4int,T*> * aHitsMap = right.
GetMap();
120 typename std::map<G4int,T*>::iterator itr = aHitsMap->begin();
121 for(; itr != aHitsMap->end(); itr++) {
122 add(itr->first, *(itr->second));
127 template <
typename T>
inline T*
129 std::map<G4int,T*> * theHitsMap = GetMap();
130 if(theHitsMap->find(key) != theHitsMap->end()) {
131 return theHitsMap->find(key)->second;
137 template <
typename T>
inline G4int
140 typename std::map<G4int,T*> * theHitsMap = GetMap();
141 if(theHitsMap->find(key) != theHitsMap->end()) {
142 *(*theHitsMap)[key] += *aHit;
144 (*theHitsMap)[key] = aHit;
146 return theHitsMap->size();
149 template <
typename T>
inline G4int
152 typename std::map<G4int,T*> * theHitsMap = GetMap();
153 if(theHitsMap->find(key) != theHitsMap->end()) {
154 *(*theHitsMap)[key] += aHit;
158 (*theHitsMap)[key] = hit;
161 return theHitsMap->size();
164 template <
typename T>
inline G4int
167 typename std::map<G4int,T*> * theHitsMap = GetMap();
168 if(theHitsMap->find(key) != theHitsMap->end()) {
169 delete (*theHitsMap)[key]->second;
171 (*theHitsMap)[key] = aHit;
172 return theHitsMap->size();
175 template <
typename T>
inline G4int
178 typename std::map<G4int,T*> * theHitsMap = GetMap();
179 if(theHitsMap->find(key) != theHitsMap->end()) {
180 *(*theHitsMap)[key] = aHit;
184 (*theHitsMap)[key] = hit;
187 return theHitsMap->size();
195 G4cout <<
"G4THitsMap " << SDname <<
" / " << collectionName <<
" --- " << entries() <<
" entries" <<
G4endl;
211 std::map<G4int,T*> * theHitsMap = GetMap();
212 typename std::map<G4int, T*>::iterator itr = theHitsMap->begin();
213 for(; itr != theHitsMap->end(); itr++) {
G4int operator==(const G4THitsMap< T > &right) const
virtual void DrawAllHits()
T * operator[](G4int key) const
G4THitsMap< T > & operator+=(const G4THitsMap< T > &right) const
G4GLOB_DLL std::ostream G4cout
G4int add(const G4int &key, T *&aHit) const
virtual size_t GetSize() const
virtual void PrintAllHits()
std::map< G4int, T * > * GetMap() const
virtual G4VHit * GetHit(size_t) const
G4int set(const G4int &key, T *&aHit) const