37 throw std::logic_error(
38 "EcalRingCalibrationTools::initializeFromGeometry Ecal Endcap geometry is not initialized");
44 return endcapRingIndex;
67 std::vector<DetId> ringIds;
87 throw std::logic_error(
88 "EcalRingCalibrationTools::initializeFromGeometry Ecal Endcap geometry is not initialized");
103 std::vector<DetId> ringIds;
112 throw std::logic_error(
"EcalRingCalibrationTools::initializeFromGeometry Ecal Endcap geometry is not initialized");
126 std::vector<DetId> ringIds;
130 short moduleBound[5] = {1, 26, 46, 66, 86};
133 short sm, moduleInSm, zsm;
135 short minModuleiphi, maxModuleiphi, minModuleieta = 360, maxModuleieta = 0;
138 sm = moduleIndex / 4 + 1;
143 moduleInSm = moduleIndex % 4;
147 if (moduleIndex > 71)
152 minModuleiphi = ((sm - 1) % 18 + 1) * 20 - 19;
153 maxModuleiphi = ((sm - 1) % 18 + 1) * 20;
156 minModuleieta = moduleBound[moduleInSm];
157 maxModuleieta = moduleBound[moduleInSm + 1] - 1;
158 }
else if (zsm == -1) {
159 minModuleieta = -moduleBound[moduleInSm + 1] + 1;
160 maxModuleieta = -moduleBound[moduleInSm];
164 std::cout <<
"Called moduleIndex " << moduleIndex << std::endl;
165 std::cout <<
"minModuleieta " << minModuleieta <<
" maxModuleieta " << maxModuleieta <<
" minModuleiphi "
166 << minModuleiphi <<
" maxModuleiphi " << maxModuleiphi << std::endl;
168 for (
int ieta = minModuleieta;
ieta <= maxModuleieta; ++
ieta) {
169 for (
int iphi = minModuleiphi;
iphi <= maxModuleiphi; ++
iphi) {
187 throw std::invalid_argument(
"EcalRingCalibrationTools::initializeFromGeometry called with a nullptr argument");
192 cellPosEta[ix][iy] = -1.;
197 if (not endcapGeometry)
198 throw std::logic_error(
"EcalRingCalibrationTools::initializeFromGeometry Ecal Endcap geometry not found");
202 for (std::vector<DetId>::const_iterator endcapIt = endcapCells.begin(); endcapIt != endcapCells.end(); ++endcapIt) {
204 if (ee.
zside() == -1)
206 auto cellGeometry = endcapGeometry->getGeometry(*endcapIt);
207 int ics = ee.
ix() - 1;
208 int ips = ee.
iy() - 1;
209 cellPosEta[
ics][ips] = fabs(cellGeometry->getPosition().eta());
215 eta_ring[
ring] = cellPosEta[
ring][50];
218 etaBoundary[0] = 1.47;
222 etaBoundary[
ring] = (eta_ring[
ring] + eta_ring[
ring - 1]) / 2.;
228 if (cellPosEta[ix][iy] > etaBoundary[
ring] && cellPosEta[ix][iy] < etaBoundary[
ring + 1]) {
236 for (std::vector<DetId>::const_iterator barrelIt = barrelCells.begin(); barrelIt != barrelCells.end(); ++barrelIt) {