15 while (cellmap.begin() != cellmap.end())
17 delete cellmap.begin()->second;
18 cellmap.erase(cellmap.begin());
26 os <<
"Number of cells: " <<
size() << endl;
27 for (iter = cellmap.begin(); iter != cellmap.end(); ++iter)
29 os <<
"cell key 0x" << hex << iter->first << dec << endl;
39 if (cellmap.find(key) != cellmap.end())
41 cout <<
"overwriting cell 0x" << hex << key << dec << endl;
44 cellmap[key] = newcell;
45 return cellmap.find(key);
51 if (cellmap.find(key) != cellmap.end())
53 cout <<
"PHG4CellContainer::AddCellSpecifyKey: duplicate key: " << key <<
" exiting now" << endl;
57 cellmap[key] = newcell;
58 return cellmap.find(key);
70 retpair.first = cellmap.lower_bound(keylow);
71 retpair.second = cellmap.upper_bound(keyup);
78 return std::make_pair(cellmap.begin(), cellmap.end());
85 if (it == cellmap.end())
88 it = cellmap.find(key);
100 if (it != cellmap.end())
112 double totalenergy = 0;
113 for (iter = cellmap.begin(); iter != cellmap.end(); ++iter)
115 totalenergy += iter->second->get_edep();