47 : trackerGeometryToken_(
50 siPixelFedCablingMapToken_(
55 std::vector<edm::InputTag> badPixelFEDChannelCollectionLabels_ =
57 .getParameter<std::vector<edm::InputTag>>(
"badPixelFEDChannelCollections");
58 for (
auto&
t : badPixelFEDChannelCollectionLabels_)
63 .getUntrackedParameter<edm::InputTag>(
"pixelClusterLabel");
66 .getUntrackedParameter<int>(
"resetEveryNLumi", 1);
74 produces<SiPixelDetectorStatus, edm::Transition::EndLuminosityBlock>(
"siPixelStatus");
82 edm::LogInfo(
"SiPixelStatusProducer") <<
"beginlumi setup " << endl;
108 const PixelGeomDetUnit* pgdu = dynamic_cast<const PixelGeomDetUnit*>((*it));
111 DetId detId = (*it)->geographicalId();
112 int detid = detId.
rawId();
121 int nrocs = nROCrows * nROCcolumns;
125 fSensors[detid] = std::make_pair(rowsperroc, colsperroc);
126 fSensorLayout[detid] = std::make_pair(nROCrows, nROCcolumns);
128 std::map<int, int> rocIdMap;
129 for (
int irow = 0; irow < nROCrows; irow++) {
130 for (
int icol = 0; icol < nROCcolumns; icol++) {
131 int dummyOfflineRow = (rowsperroc / 2 - 1) + irow * rowsperroc;
132 int dummeOfflineColumn = (colsperroc / 2 - 1) + icol * colsperroc;
136 int roc(-1), rocR(-1), rocC(-1);
157 edm::LogInfo(
"SiPixelStatusProducer") <<
"start cluster analyzer " << endl;
166 <<
" edmNew::DetSetVector<SiPixelCluster> " <<
fPixelClusterLabel_ <<
" does not exist!" << endl;
173 for (
const auto&
clusters : *hClusterColl) {
176 int rowsperroc =
fSensors[detid].first;
177 int colsperroc =
fSensors[detid].second;
182 std::map<int, int> fRocIds_detid;
184 fRocIds_detid =
fRocIds[detid];
187 const vector<SiPixelCluster::Pixel>& pixvector = clu.pixels();
188 for (
unsigned int i = 0;
i < pixvector.size(); ++
i) {
189 int mr0 = pixvector[
i].x;
190 int mc0 = pixvector[
i].y;
192 int irow = mr0 / rowsperroc;
193 int icol = mc0 / colsperroc;
196 if (fRocIds_detid.find(
key) != fRocIds_detid.end()) {
211 <<
" edmNew::DetSetVector<SiPixelCluster> " <<
fPixelClusterLabel_ <<
" is NOT Valid!" << endl;
221 if (!
iEvent.getByToken(tk, pixelFEDChannelCollectionHandle)) {
223 <<
" PixelFEDChannelCollection with index " << tk.index() <<
" does NOT exist!" << std::endl;
226 iEvent.getByToken(tk, pixelFEDChannelCollectionHandle);
228 if (!pixelFEDChannelCollectionHandle.
isValid()) {
230 <<
" PixelFEDChannelCollection with index " << tk.index() <<
" is NOT valid!" << endl;
234 std::map<int, std::vector<PixelFEDChannel>> tmpFEDerror25;
235 for (
const auto& disabledChannels : *pixelFEDChannelCollectionHandle) {
237 for (
const auto& ch : disabledChannels) {
238 DetId detId = disabledChannels.detId();
239 int detid = detId.
rawId();
245 tmpFEDerror25[detid].push_back(ch);
253 if (!tmpFEDerror25.empty() && !
FEDerror25_.empty()) {
255 std::map<int, std::vector<PixelFEDChannel>>::iterator itFEDerror25;
257 int detid = itFEDerror25->first;
258 if (tmpFEDerror25.find(detid) != tmpFEDerror25.end()) {
259 std::vector<PixelFEDChannel> chs = itFEDerror25->second;
260 std::vector<PixelFEDChannel> chs_tmp = tmpFEDerror25[detid];
262 std::vector<PixelFEDChannel> chs_common;
263 for (
unsigned int ich = 0; ich < chs.size(); ich++) {
266 for (
unsigned int ich_tmp = 0; ich_tmp < chs_tmp.size(); ich_tmp++) {
269 chs_common.push_back(ch);
275 if (chs_common.empty())
303 edm::LogInfo(
"SiPixelStatusProducer") <<
"endlumi producer " << endl;
316 std::map<int, std::vector<PixelFEDChannel>>::iterator itFEDerror25;
318 int detid = itFEDerror25->first;
319 std::vector<PixelFEDChannel> chs = itFEDerror25->second;
320 for (
unsigned int ich = 0; ich < chs.size(); ich++) {
331 auto result = std::make_unique<SiPixelDetectorStatus>();
336 edm::LogInfo(
"SiPixelStatusProducer") <<
"new lumi-based data stored for run " <<
beginRun_ <<
" lumi from "
348 const DetId& detId,
int offlineRow,
int offlineCol,
int&
roc,
int& row,
int&
col) {
383 return int(icol + irow * nROCcolumns);
399 psd0.
add<std::vector<edm::InputTag>>(
"badPixelFEDChannelCollections",
405 descriptions.
add(
"siPixelStatusProducer", desc);