42 throw std::logic_error(
"EcalRingCalibrationTools::initializeFromGeometry Ecal Endcap geometry is not initialized");
47 return endcapRingIndex;
80 std::vector<DetId> ringIds;
96 ringIds.push_back(
EBDetId(k,iphi));
103 throw std::logic_error(
"EcalRingCalibrationTools::initializeFromGeometry Ecal Endcap geometry is not initialized");
111 ringIds.push_back(
EEDetId(ix+1,iy+1,zside));
120 std::vector<DetId> ringIds;
125 ringIds.push_back(
EBDetId(ieta,iphi));
129 throw std::logic_error(
"EcalRingCalibrationTools::initializeFromGeometry Ecal Endcap geometry is not initialized");
146 std::vector<DetId> ringIds;
150 short moduleBound[5] = {1, 26, 46, 66, 86};
154 short sm, moduleInSm, zsm;
156 short minModuleiphi, maxModuleiphi, minModuleieta=360,maxModuleieta=0;
159 sm = moduleIndex / 4 + 1;
164 moduleInSm = moduleIndex%4;
173 minModuleiphi = ( (sm - 1) %18 + 1 ) *20 - 19;
174 maxModuleiphi = ( (sm - 1) %18 + 1 ) * 20;
178 minModuleieta = moduleBound[ moduleInSm ];
179 maxModuleieta = moduleBound[ moduleInSm + 1 ] - 1;
182 minModuleieta = - moduleBound[ moduleInSm + 1 ] + 1;
183 maxModuleieta = - moduleBound[ moduleInSm ];
188 std::cout<<
"Called moduleIndex "<<moduleIndex<<std::endl;
189 std::cout<<
"minModuleieta "<<minModuleieta<<
" maxModuleieta "<<maxModuleieta<<
" minModuleiphi "<<minModuleiphi<<
" maxModuleiphi "<<maxModuleiphi<<std::endl;
191 for(
int ieta = minModuleieta; ieta <= maxModuleieta; ++ieta){
192 for(
int iphi = minModuleiphi; iphi<= maxModuleiphi; ++iphi){
195 ringIds.push_back(
EBDetId(ieta,iphi));
215 throw std::invalid_argument(
"EcalRingCalibrationTools::initializeFromGeometry called with a nullptr argument");
221 cellPosEta[ix][iy] = -1.;
226 if (not endcapGeometry)
227 throw std::logic_error(
"EcalRingCalibrationTools::initializeFromGeometry Ecal Endcap geometry not found");
231 for (std::vector<DetId>::const_iterator endcapIt = endcapCells.begin();
232 endcapIt!=endcapCells.end();
236 if (ee.
zside() == -1)
continue;
237 const CaloCellGeometry *cellGeometry = endcapGeometry->getGeometry(*endcapIt) ;
238 int ics=ee.
ix() - 1 ;
239 int ips=ee.
iy() - 1 ;
246 eta_ring[
ring]=cellPosEta[
ring][50];
259 if (cellPosEta[ix][iy]>etaBoundary[
ring] && cellPosEta[ix][iy]<etaBoundary[
ring+1])
268 for (std::vector<DetId>::const_iterator barrelIt = barrelCells.begin();
269 barrelIt!=barrelCells.end();
static const int MIN_IPHI
virtual const GlobalPoint & getPosition() const
Returns the position of reference for this cell.
int ism() const
get the ECAL/SM id
static bool validDetId(int i, int j)
check if a valid index combination
int im() const
get the number of module inside the SM (1-4)
int ieta() const
get the crystal ieta
static const int MAX_IPHI
static bool validDetId(int crystal_ix, int crystal_iy, int iz)
static const int MAX_IETA