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));
127template <
typename T>
inline T*
129 std::map<G4int,T*> * theHitsMap = GetMap();
130 if(theHitsMap->find(key) != theHitsMap->end()) {
131 return theHitsMap->find(key)->second;
137template <
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();
149template <
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();
164template <
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();
175template <
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;
203 sum += *(itr->second);
205 G4cout << " Total : " << sum << G4endl;
206----------------------------------------------------------------------*/
211 std::map<G4int,T*> * theHitsMap = GetMap();
212 typename std::map<G4int, T*>::iterator itr = theHitsMap->begin();
213 for(; itr != theHitsMap->end(); itr++) {
G4DLLIMPORT std::ostream G4cout
virtual size_t GetSize() const
G4int add(const G4int &key, T &aHit) const
G4THitsMap< T > & operator+=(const G4THitsMap< T > &right) const
G4int add(const G4int &key, T *&aHit) const
T * operator[](G4int key) const
std::map< G4int, T * > * GetMap() const
G4int set(const G4int &key, T *&aHit) const
G4int operator==(const G4THitsMap< T > &right) const
G4int set(const G4int &key, T &aHit) const
virtual void PrintAllHits()
virtual G4VHit * GetHit(size_t) const
virtual void DrawAllHits()
G4THitsMap(G4String detName, G4String colNam)