50 ignore_non_pattern_(iConfig.getParameter<
bool>(
"ignoreNonPattern")),
51 control_pattern_size_(iConfig.getParameter<
bool>(
"checkPatternEachEvent")),
52 includeErrors_(iConfig.getUntrackedParameter<
bool>(
"includeErrors",
false)),
53 errorType(iConfig.getUntrackedParameter<
int>(
"errorTypeNumber", 1)),
55 number_of_pixels_per_pattern_(0),
56 use_realeventnumber_(iConfig.getParameter<
bool>(
"useRealEventNumber"))
61 produces<edm::DetSetVector<SiPixelCalibDigi>>();
63 produces<edm::DetSetVector<SiPixelCalibDigiError>>();
98 edm::LogInfo(
"SiPixelCalibProducer") <<
"in fill(), calibpoint " << icalibpoint <<
" ndigis " << pixelDigis->size()
102 for (digiIter = pixelDigis->begin(); digiIter != pixelDigis->end(); ++digiIter) {
103 uint32_t detid = digiIter->id;
106 for (ipix = digiIter->data.
begin(); ipix != digiIter->
end(); ++ipix) {
108 fillPixel(detid, ipix->row(), ipix->column(), icalibpoint, ipix->adc());
127 <<
"matched detid " << detid <<
" to fed " <<
detid_to_fedid_[detid] << std::endl;
142 edm::LogError(
"SiPixelCalibDigiProducer") <<
" was unable to match detid " << detid <<
" to a FED!" << std::endl;
151 temppixelworker.first = detid;
152 temppixelworker.second.first = row;
153 temppixelworker.second.second =
col;
154 std::map<pixelstruct, SiPixelCalibDigi>::const_iterator ipix =
intermediate_data_.find(temppixelworker);
179 edm::LogError(
"SiPixelCalibDigiProducer") <<
"Number of pixels in pattern is now: " << tempsize <<
", size is was "
201 <<
" rowpatternnumbers = " << rowpatternnumber <<
" " << colpatternnumber <<
" " << patternnumber << std::endl;
205 std::vector<short> temprowvals(0);
206 std::vector<short> tempcolvals(0);
207 uint32_t nminuscol = 0;
208 uint32_t nminusrow = 0;
209 uint32_t npatterns = 0;
210 for (uint32_t icol = 0; icol < calibcols.size(); icol++) {
211 if (calibcols[icol] == -1) {
213 }
else if (nminuscol == colpatternnumber) {
215 short val = calibcols[icol];
216 tempcolvals.push_back(
val);
217 }
else if (nminuscol > colpatternnumber)
220 for (uint32_t irow = 0; irow < calibrows.size(); irow++) {
222 if (calibrows[irow] == -1)
224 else if (nminusrow == rowpatternnumber) {
225 short val = calibrows[irow];
226 temprowvals.push_back(
val);
227 }
else if (nminusrow > rowpatternnumber)
231 while (
currentpattern_.size() > temprowvals.size() * tempcolvals.size()) {
234 for (uint32_t irow = 0; irow < temprowvals.size(); irow++) {
235 for (uint32_t icol = 0; icol < tempcolvals.size(); icol++) {
236 std::pair<short, short>
pattern(temprowvals[irow], tempcolvals[icol]);
266 auto pOut = std::make_unique<edm::DetSetVector<SiPixelCalibDigi>>();
267 auto pErr = std::make_unique<edm::DetSetVector<SiPixelCalibDigiError>>();
272 for (std::map<pixelstruct, SiPixelCalibDigi>::const_iterator idet =
intermediate_data_.begin();
275 uint32_t detid = idet->first.first;
277 if (!
checkPixel(idet->first.first, idet->first.second.first, idet->first.second.second))
283 detSet.
data.push_back(tempdigi);
286 for (std::map<pixelstruct, SiPixelCalibDigiError>::const_iterator ierr =
error_data_.begin();
289 uint32_t detid = ierr->first.first;
292 errSet.
data.push_back(temperror);
322 formatter.toCabling(cabling,
detector);
339 std::ostringstream errorlog;
340 errorlog <<
"DETID " << detid <<
", row, col (offline)=" << row <<
"," <<
col
342 <<
" found no match in list of patterns: ";
356 temppixelworker.first = detid;
357 temppixelworker.second.first = row;
358 temppixelworker.second.second =
col;
359 std::map<pixelstruct, SiPixelCalibDigiError>::const_iterator ierr =
error_data_.find(temppixelworker);