14 #include <boost/foreach.hpp>
39 cout <<
"PHG4CylinderCellGeom_Spacalv1::identify - Tower mapping:" << endl;
40 BOOST_FOREACH(
const tower_z_ID_eta_bin_map_t::value_type& tower_z_ID_eta_bin,
41 get_tower_z_ID_eta_bin_map())
43 cout <<
"\t" <<
"Tower Z ID[" << tower_z_ID_eta_bin.first
44 <<
"] \t-> Eta Bin " << tower_z_ID_eta_bin.second << endl;
47 cout <<
"PHG4CylinderCellGeom_Spacalv1::identify - Bin -> z range:" << endl;
48 BOOST_FOREACH(
const bound_map_t::value_type&
b, z_bound_map)
50 cout <<
"\t" <<
"bin[" << b.first <<
"] \t-> z = " << b.second.first
51 <<
" - " << b.second.second << endl;
54 cout <<
"PHG4CylinderCellGeom_Spacalv1::identify - Bin -> eta range:" << endl;
55 BOOST_FOREACH(
const bound_map_t::value_type& b, eta_bound_map)
57 cout <<
"\t" <<
"bin[" << b.first <<
"] \t-> eta = " << b.second.first
58 <<
" - " << b.second.second << endl;
66 if ((
size_t) nzbins != z_bound_map.size())
68 cout <<
"PHG4CylinderCellGeom_Spacalv1::map_consistency_check - "
69 <<
"z_bound_map.size() of " << z_bound_map.size()
70 <<
" in inconsistent with nzbins of " << nzbins << endl;
73 if ((
size_t) nzbins != eta_bound_map.size())
75 cout <<
"PHG4CylinderCellGeom_Spacalv1::map_consistency_check - "
76 <<
"eta_bound_map.size() of " << eta_bound_map.size()
77 <<
" in inconsistent with nzbins of " << nzbins << endl;
80 if ((
size_t) nzbins < tower_z_ID_eta_bin_map.size())
82 cout <<
"PHG4CylinderCellGeom_Spacalv1::map_consistency_check - "
83 <<
"tower_z_ID_eta_bin_map.size() of " << tower_z_ID_eta_bin_map.size()
84 <<
" in inconsistent with nzbins of " << nzbins << endl;
91 const std::pair<double, double> & bounds)
94 z_bound_map[ibin] = bounds;
99 const std::pair<double, double> & bounds)
102 eta_bound_map[ibin] = bounds;
108 map_consistency_check();
110 bound_map_t ::const_iterator iter =
111 z_bound_map.find(ibin);
113 if (iter == z_bound_map.end())
116 <<
"PHG4CylinderCellGeom_Spacalv1::get_zbounds - Fatal Error - Asking for invalid bin in z: "
117 << ibin<<
". Print of content:" << endl;
127 map_consistency_check();
130 bound_map_t ::const_iterator iter =
131 eta_bound_map.find(ibin);
133 if (iter == eta_bound_map.end())
136 <<
"PHG4CylinderCellGeom_Spacalv1::get_etabounds - Fatal Error - Asking for invalid bin in z: "
137 << ibin<<
". Print of content:" << endl;
147 cout <<
"PHG4CylinderCellGeom_Spacalv1::get_zbin is invalid" << endl;
155 cout <<
"PHG4CylinderCellGeom_Spacalv1::get_etabin is invalid" << endl;
163 pair<double, double> bound = get_zbounds(ibin);
164 return 0.5 * (bound.first + bound.second);
170 pair<double, double> bound = get_etabounds(ibin);
171 return 0.5 * (bound.first + bound.second);
176 map_consistency_check();
178 tower_z_ID_eta_bin_map_t::const_iterator iter = tower_z_ID_eta_bin_map.find(tower_z_ID);
180 if (iter == tower_z_ID_eta_bin_map.end())
184 o <<
"PHG4CylinderCellGeom_Spacalv1::get_etabin - Fatal Error - can not find tower_z_ID of "<<tower_z_ID<<
".";
186 throw range_error(o.str());