13 while (cellmap.begin() != cellmap.end())
15 delete cellmap.begin()->second;
16 cellmap.erase(cellmap.begin());
23 map<unsigned int, PHG4CylinderCell*>::const_iterator iter;
24 os <<
"Number of cells: " <<
size() << endl;
25 for (iter = cellmap.begin(); iter != cellmap.end(); ++iter)
27 os <<
"cell key 0x" << hex << iter->first << dec << endl;
30 set<int>::const_iterator siter;
31 os <<
"Number of layers: " << num_layers() << endl;
32 for (siter = layers.begin(); siter != layers.end(); ++siter)
34 os <<
"layer : " << *siter << endl;
44 cout <<
" detector id too large: " << detid << endl;
48 unsigned int cellid = cellmap.size();
51 if (cellmap.find(newkey) != cellmap.end())
53 cout <<
" duplicate key: " << newkey <<
" exiting now" << endl;
65 cellmap[key] = newcell;
66 return cellmap.find(key);
72 if (cellmap.find(key) != cellmap.end())
74 cout <<
"PHG4CylinderCellContainer::AddCylinderCellSpecifyKey: duplicate key: " << key <<
" exiting now" << endl;
79 cellmap[key] = newcell;
80 return cellmap.find(key);
88 cout <<
" detector id too large: " << detid << endl;
97 retpair.first = cellmap.lower_bound(keylow);
98 retpair.second = cellmap.upper_bound(keyup);
105 return std::make_pair(cellmap.begin(), cellmap.end());
112 if (it == cellmap.end())
115 it = cellmap.find(key);
128 if (it != cellmap.end())
140 double totalenergy = 0;
141 for (iter = cellmap.begin(); iter != cellmap.end(); ++iter)
143 totalenergy += iter->second->get_edep();