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>>();
65 calibToken_ = esConsumes<SiPixelCalibConfiguration, SiPixelCalibConfigurationRcd>();
67 cablingMapToken_ = esConsumes<SiPixelFedCablingMap, SiPixelFedCablingMapRcd>();
102 edm::LogInfo(
"SiPixelCalibProducer") <<
"in fill(), calibpoint " << icalibpoint <<
" ndigis " << pixelDigis->size()
106 for (digiIter = pixelDigis->begin(); digiIter != pixelDigis->end(); ++digiIter) {
107 uint32_t detid = digiIter->id;
110 for (ipix = digiIter->data.
begin(); ipix != digiIter->
end(); ++ipix) {
112 fillPixel(detid, ipix->row(), ipix->column(), icalibpoint, ipix->adc());
131 <<
"matched detid " << detid <<
" to fed " <<
detid_to_fedid_[detid] << std::endl;
146 edm::LogError(
"SiPixelCalibDigiProducer") <<
" was unable to match detid " << detid <<
" to a FED!" << std::endl;
155 temppixelworker.first = detid;
156 temppixelworker.second.first = row;
157 temppixelworker.second.second =
col;
158 std::map<pixelstruct, SiPixelCalibDigi>::const_iterator ipix =
intermediate_data_.find(temppixelworker);
183 edm::LogError(
"SiPixelCalibDigiProducer") <<
"Number of pixels in pattern is now: " << tempsize <<
", size is was " 205 <<
" rowpatternnumbers = " << rowpatternnumber <<
" " << colpatternnumber <<
" " << patternnumber << std::endl;
209 std::vector<short> temprowvals(0);
210 std::vector<short> tempcolvals(0);
211 uint32_t nminuscol = 0;
212 uint32_t nminusrow = 0;
213 uint32_t npatterns = 0;
214 for (uint32_t icol = 0; icol < calibcols.size(); icol++) {
215 if (calibcols[icol] == -1) {
217 }
else if (nminuscol == colpatternnumber) {
219 short val = calibcols[icol];
220 tempcolvals.push_back(
val);
221 }
else if (nminuscol > colpatternnumber)
224 for (uint32_t irow = 0; irow < calibrows.size(); irow++) {
226 if (calibrows[irow] == -1)
228 else if (nminusrow == rowpatternnumber) {
229 short val = calibrows[irow];
230 temprowvals.push_back(
val);
231 }
else if (nminusrow > rowpatternnumber)
235 while (
currentpattern_.size() > temprowvals.size() * tempcolvals.size()) {
238 for (uint32_t irow = 0; irow < temprowvals.size(); irow++) {
239 for (uint32_t icol = 0; icol < tempcolvals.size(); icol++) {
240 std::pair<short, short>
pattern(temprowvals[irow], tempcolvals[icol]);
270 auto pOut = std::make_unique<edm::DetSetVector<SiPixelCalibDigi>>();
271 auto pErr = std::make_unique<edm::DetSetVector<SiPixelCalibDigiError>>();
276 for (std::map<pixelstruct, SiPixelCalibDigi>::const_iterator idet =
intermediate_data_.begin();
279 uint32_t detid = idet->first.first;
281 if (!
checkPixel(idet->first.first, idet->first.second.first, idet->first.second.second))
287 detSet.
data.push_back(tempdigi);
290 for (std::map<pixelstruct, SiPixelCalibDigiError>::const_iterator ierr =
error_data_.begin();
293 uint32_t detid = ierr->first.first;
296 errSet.
data.push_back(temperror);
343 std::ostringstream errorlog;
344 errorlog <<
"DETID " << detid <<
", row, col (offline)=" << row <<
"," <<
col 346 <<
" found no match in list of patterns: ";
360 temppixelworker.first = detid;
361 temppixelworker.second.first = row;
362 temppixelworker.second.second =
col;
363 std::map<pixelstruct, SiPixelCalibDigiError>::const_iterator ierr =
error_data_.find(temppixelworker);
short vcalIndexForEvent(const uint32_t &eventnumber) const
virtual void fill(edm::Event &iEvent, const edm::EventSetup &iSetup)
virtual bool checkFED(uint32_t detid)
uint32_t number_of_pixels_per_pattern_
virtual void setPattern()
std::vector< short > getColumnPattern() const
std::vector< short > getRowPattern() const
std::map< pixelstruct, SiPixelCalibDigiError > error_data_
std::map< pixelstruct, SiPixelCalibDigi > intermediate_data_
Log< level::Error, false > LogError
identify pixel inside single ROC
std::vector< std::pair< short, short > > currentpattern_
T const * product() const
edm::ESHandle< SiPixelFedCablingMap > theCablingMap_
void produce(edm::Event &iEvent, const edm::EventSetup &iSetup) override
bool use_realeventnumber_
short getNTriggers() const
void setrowcol(uint16_t row, uint16_t col)
uint32_t nColumnPatterns() const
edm::ESGetToken< SiPixelFedCablingMap, SiPixelFedCablingMapRcd > cablingMapToken_
#define DEFINE_FWK_MODULE(type)
virtual bool checkPixel(uint32_t detid, short row, short col)
edm::ESGetToken< TrackerGeometry, TrackerDigiGeometryRecord > trackerGeomToken_
ESHandle< T > getHandle(const ESGetToken< T, R > &iToken) const
iterator end()
Return the off-the-end iterator.
double collumn and pixel ID in double collumn representation
Log< level::Info, false > LogInfo
std::pair< uint32_t, std::pair< short, short > > pixelstruct
~SiPixelCalibDigiProducer() override
virtual void fillPixel(uint32_t detid, short row, short col, short ipoint, short adc)
edm::EDGetTokenT< edm::DetSetVector< PixelDigi > > tPixelDigi
bool control_pattern_size_
edm::ESGetToken< SiPixelCalibConfiguration, SiPixelCalibConfigurationRcd > calibToken_
SiPixelCalibDigiProducer(const edm::ParameterSet &iConfig)
edm::ESHandle< SiPixelCalibConfiguration > calib_
std::pair< short, short > currentpair_
iterator begin()
Return an iterator to the first DetSet.
std::map< uint32_t, uint32_t > detid_to_fedid_
collection_type::const_iterator const_iterator
collection_type::const_iterator const_iterator
uint32_t expectedTotalEvents() const
edm::ESHandle< TrackerGeometry > theGeometry_
uint16_t *__restrict__ uint16_t const *__restrict__ adc