CMS 3D CMS Logo

List of all members | Public Member Functions | Private Types | Private Member Functions | Private Attributes
SiPixelCalibDigiProducer Class Reference

#include <CalibTracker/SiPixelGainCalibration/src/SiPixelCalibDigiProducer.cc>

Inheritance diagram for SiPixelCalibDigiProducer:
edm::EDProducer edm::ProducerBase edm::EDConsumerBase edm::ProductRegistryHelper

Public Member Functions

 SiPixelCalibDigiProducer (const edm::ParameterSet &iConfig)
 
 ~SiPixelCalibDigiProducer () override
 
- Public Member Functions inherited from edm::EDProducer
 EDProducer ()
 
SerialTaskQueueglobalLuminosityBlocksQueue ()
 
SerialTaskQueueglobalRunsQueue ()
 
ModuleDescription const & moduleDescription () const
 
 ~EDProducer () override
 
- Public Member Functions inherited from edm::ProducerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
std::vector< edm::ProductResolverIndex > const & indiciesForPutProducts (BranchType iBranchType) const
 
 ProducerBase ()
 
std::vector< edm::ProductResolverIndex > const & putTokenIndexToProductResolverIndex () const
 
std::vector< bool > const & recordProvenanceList () const
 
void registerProducts (ProducerBase *, ProductRegistry *, ModuleDescription const &)
 
std::function< void(BranchDescription const &)> registrationCallback () const
 used by the fwk to register list of products More...
 
void resolvePutIndicies (BranchType iBranchType, ModuleToResolverIndicies const &iIndicies, std::string const &moduleLabel)
 
TypeLabelList const & typeLabelList () const
 used by the fwk to register the list of products of this module More...
 
 ~ProducerBase () noexcept(false) override
 
- Public Member Functions inherited from edm::EDConsumerBase
std::vector< ConsumesInfoconsumesInfo () const
 
void convertCurrentProcessAlias (std::string const &processName)
 Convert "@currentProcess" in InputTag process names to the actual current process name. More...
 
 EDConsumerBase ()
 
 EDConsumerBase (EDConsumerBase &&)=default
 
 EDConsumerBase (EDConsumerBase const &)=delete
 
ESProxyIndex const * esGetTokenIndices (edm::Transition iTrans) const
 
std::vector< ESProxyIndex > const & esGetTokenIndicesVector (edm::Transition iTrans) const
 
std::vector< ESRecordIndex > const & esGetTokenRecordIndicesVector (edm::Transition iTrans) const
 
ProductResolverIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
std::vector< ProductResolverIndexAndSkipBit > const & itemsToGetFrom (BranchType iType) const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void modulesWhoseProductsAreConsumed (std::vector< ModuleDescription const * > &modules, ProductRegistry const &preg, std::map< std::string, ModuleDescription const * > const &labelsToDesc, std::string const &processName) const
 
EDConsumerBaseoperator= (EDConsumerBase &&)=default
 
EDConsumerBase const & operator= (EDConsumerBase const &)=delete
 
bool registeredToConsume (ProductResolverIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
ProductResolverIndexAndSkipBit uncheckedIndexFrom (EDGetToken) const
 
void updateLookup (BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet)
 
void updateLookup (eventsetup::ESRecordsToProxyIndices const &)
 
virtual ~EDConsumerBase () noexcept(false)
 

Private Types

typedef std::pair< uint32_t, std::pair< short, short > > pixelstruct
 

Private Member Functions

virtual bool checkFED (uint32_t detid)
 
virtual bool checkPixel (uint32_t detid, short row, short col)
 
virtual void clear ()
 
virtual void fill (edm::Event &iEvent, const edm::EventSetup &iSetup)
 
virtual void fillPixel (uint32_t detid, short row, short col, short ipoint, short adc)
 
void produce (edm::Event &iEvent, const edm::EventSetup &iSetup) override
 
virtual void setPattern ()
 
virtual bool store ()
 

Private Attributes

edm::ESHandle< SiPixelCalibConfigurationcalib_
 
edm::ParameterSet conf_
 
bool control_pattern_size_
 
std::pair< short, short > currentpair_
 
std::vector< std::pair< short, short > > currentpattern_
 
std::map< uint32_t, uint32_t > detid_to_fedid_
 
std::vector< pixelstructdetPixelMap_
 
std::map< pixelstruct, SiPixelCalibDigiErrorerror_data_
 
int errorType
 
uint32_t iEventCounter_
 
bool ignore_non_pattern_
 
bool includeErrors_
 
std::string instance_
 
std::map< pixelstruct, SiPixelCalibDigiintermediate_data_
 
std::string label_
 
uint32_t number_of_pixels_per_pattern_
 
uint32_t pattern_repeat_
 
edm::InputTag src_
 
edm::ESHandle< SiPixelFedCablingMaptheCablingMap_
 
edm::ESHandle< TrackerGeometrytheGeometry_
 
edm::EDGetTokenT< edm::DetSetVector< PixelDigi > > tPixelDigi
 
bool use_realeventnumber_
 

Additional Inherited Members

- Public Types inherited from edm::EDProducer
typedef EDProducer ModuleType
 
- Public Types inherited from edm::ProducerBase
using ModuleToResolverIndicies = std::unordered_multimap< std::string, std::tuple< edm::TypeID const *, const char *, edm::ProductResolverIndex > >
 
typedef ProductRegistryHelper::TypeLabelList TypeLabelList
 
- Public Types inherited from edm::EDConsumerBase
typedef ProductLabels Labels
 
- Static Public Member Functions inherited from edm::EDProducer
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 
static bool wantsGlobalLuminosityBlocks ()
 
static bool wantsGlobalRuns ()
 
static bool wantsInputProcessBlocks ()
 
static bool wantsProcessBlocks ()
 
static bool wantsStreamLuminosityBlocks ()
 
static bool wantsStreamRuns ()
 
- Protected Member Functions inherited from edm::ProducerBase
template<class ProductType >
BranchAliasSetterT< ProductType > produces ()
 declare what type of product will make and with which optional label More...
 
template<typename ProductType , BranchType B>
BranchAliasSetterT< ProductType > produces ()
 
template<typename ProductType , Transition B>
BranchAliasSetterT< ProductType > produces ()
 
BranchAliasSetter produces (const TypeID &id, std::string instanceName=std::string(), bool recordProvenance=true)
 
template<BranchType B>
BranchAliasSetter produces (const TypeID &id, std::string instanceName=std::string(), bool recordProvenance=true)
 
template<Transition B>
BranchAliasSetter produces (const TypeID &id, std::string instanceName=std::string(), bool recordProvenance=true)
 
template<typename ProductType , Transition B>
BranchAliasSetterT< ProductType > produces (std::string instanceName)
 
template<class ProductType >
BranchAliasSetterT< ProductType > produces (std::string instanceName)
 
template<typename ProductType , BranchType B>
BranchAliasSetterT< ProductType > produces (std::string instanceName)
 
ProducesCollector producesCollector ()
 
- Protected Member Functions inherited from edm::EDConsumerBase
EDGetToken consumes (const TypeToGet &id, edm::InputTag const &tag)
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (edm::InputTag const &tag)
 
template<BranchType B = InEvent>
EDConsumerBaseAdaptor< B > consumes (edm::InputTag tag) noexcept
 
template<BranchType B>
EDGetToken consumes (TypeToGet const &id, edm::InputTag const &tag)
 
ConsumesCollector consumesCollector ()
 Use a ConsumesCollector to gather consumes information from helper functions. More...
 
template<typename ProductType , BranchType B = InEvent>
void consumesMany ()
 
void consumesMany (const TypeToGet &id)
 
template<BranchType B>
void consumesMany (const TypeToGet &id)
 
template<typename ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes ()
 
template<Transition Tr = Transition::Event>
constexpr auto esConsumes () noexcept
 
template<typename ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes (ESInputTag const &tag)
 
template<Transition Tr = Transition::Event>
auto esConsumes (ESInputTag tag) noexcept
 
template<Transition Tr = Transition::Event>
ESGetTokenGeneric esConsumes (eventsetup::EventSetupRecordKey const &iRecord, eventsetup::DataKey const &iKey)
 Used with EventSetupRecord::doGet. More...
 
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > mayConsume (edm::InputTag const &tag)
 

Detailed Description

Description: <one line="" class="" summary>="">

Implementation: <Notes on="" implementation>="">

Definition at line 56 of file SiPixelCalibDigiProducer.h.

Member Typedef Documentation

◆ pixelstruct

typedef std::pair<uint32_t, std::pair<short, short> > SiPixelCalibDigiProducer::pixelstruct
private

Definition at line 70 of file SiPixelCalibDigiProducer.h.

Constructor & Destructor Documentation

◆ SiPixelCalibDigiProducer()

SiPixelCalibDigiProducer::SiPixelCalibDigiProducer ( const edm::ParameterSet iConfig)
explicit

Definition at line 47 of file SiPixelCalibDigiProducer.cc.

48  : src_(iConfig.getParameter<edm::InputTag>("src")),
49  iEventCounter_(0),
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)),
54  conf_(iConfig),
56  use_realeventnumber_(iConfig.getParameter<bool>("useRealEventNumber"))
57 
58 {
59  tPixelDigi = consumes<edm::DetSetVector<PixelDigi>>(src_);
60  //register your products
61  produces<edm::DetSetVector<SiPixelCalibDigi>>();
62  if (includeErrors_)
63  produces<edm::DetSetVector<SiPixelCalibDigiError>>();
64 }

References includeErrors_, src_, and tPixelDigi.

◆ ~SiPixelCalibDigiProducer()

SiPixelCalibDigiProducer::~SiPixelCalibDigiProducer ( )
override

Definition at line 66 of file SiPixelCalibDigiProducer.cc.

66  {
67  // do anything here that needs to be done at desctruction time
68  // (e.g. close files, deallocate resources etc.)
69 }

Member Function Documentation

◆ checkFED()

bool SiPixelCalibDigiProducer::checkFED ( uint32_t  detid)
privatevirtual

Definition at line 116 of file SiPixelCalibDigiProducer.cc.

116  {
117  // edm::LogInfo("SiPixelCalibProducer") << "in checkFED" << std::endl;
118 
119  if (detid_to_fedid_[detid])
120  return true;
121  for (int fedid = 0; fedid <= 40; ++fedid) {
122  // edm::LogInfo("SiPixelCalibProducer") << " looking at fedid " << fedid << std::endl;
124  if (converter.hasDetUnit(detid)) {
125  detid_to_fedid_[detid] = fedid;
126  edm::LogInfo("SiPixelCalibDigiProducer")
127  << "matched detid " << detid << " to fed " << detid_to_fedid_[detid] << std::endl;
128  return true;
129  }
130  }
131  return false;
132 }

References detid_to_fedid_, PixelSLinkDataInputSource_cfi::fedid, edm::ESHandle< T >::product(), and theCablingMap_.

Referenced by fillPixel().

◆ checkPixel()

bool SiPixelCalibDigiProducer::checkPixel ( uint32_t  detid,
short  row,
short  col 
)
privatevirtual

Definition at line 305 of file SiPixelCalibDigiProducer.cc.

305  {
306  if (!control_pattern_size_ && !store())
307  return true;
308 
309  if (!ignore_non_pattern_)
310  return true;
311 
312  edm::LogInfo("SiPixelCalibDigiProducer") << "Event" << iEventCounter_ << ",now in checkpixel() " << std::endl;
313  if (currentpattern_.empty())
314  setPattern();
315  // uint32_t iroc;
316  uint32_t fedid = detid_to_fedid_[detid];
317 
321 
322  formatter.toCabling(cabling, detector);
323  // cabling should now contain cabling.roc and cabling.dcol and cabling.pxid
324 
325  // however, the coordinates now need to be converted from dcl, pxid to the row,col coordinates used in the calibration info
327  loc.dcol = cabling.dcol;
328  loc.pxid = cabling.pxid;
329  sipixelobjects::LocalPixel locpixel(loc);
330  currentpair_.first = locpixel.rocRow();
331  currentpair_.second = locpixel.rocCol();
332 
333  for (uint32_t i = 0; i < currentpattern_.size(); ++i) {
334  // edm::LogInfo("SiPixelCalibDigiProducer") << "found pair " << currentpair_.first << "," << currentpair_.second << " calib " << currentpattern_[i].first << ","<< currentpattern_[i].second << " input " << row << "," << col << std::endl;
335  if (currentpair_ == currentpattern_[i]) {
336  return true;
337  }
338  }
339  std::ostringstream errorlog;
340  errorlog << "DETID " << detid << ", row, col (offline)=" << row << "," << col
341  << " row, col (ROC) =" << currentpair_.first << "," << currentpair_.second
342  << " found no match in list of patterns: ";
343  for (uint32_t i = 0; i < currentpattern_.size(); ++i) {
344  if (i != 0 && i != currentpattern_.size() - 1)
345  errorlog << " ";
346  errorlog << "(";
347  errorlog << currentpattern_[i].first;
348  errorlog << ",";
349  errorlog << currentpattern_[i].second;
350  errorlog << ")";
351  }
352  edm::LogError("ERROR") << errorlog.str() << std::endl;
353  if (includeErrors_) { // book the error
354 
355  pixelstruct temppixelworker;
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);
360  if (ierr == error_data_.end()) {
361  SiPixelCalibDigiError temperr(row, col, 1);
362  error_data_[temppixelworker] = temperr;
363  }
364  }
365 
366  return false;
367 }

References cuy::col, control_pattern_size_, currentpair_, currentpattern_, sipixelobjects::ElectronicIndex::dcol, sipixelobjects::LocalPixel::DcolPxid::dcol, hgcalTestNeighbor_cfi::detector, detid_to_fedid_, error_data_, PixelSLinkDataInputSource_cfi::fedid, mps_fire::i, iEventCounter_, ignore_non_pattern_, includeErrors_, edm::ESHandle< T >::product(), sipixelobjects::ElectronicIndex::pxid, sipixelobjects::LocalPixel::DcolPxid::pxid, sipixelobjects::LocalPixel::rocCol(), sipixelobjects::LocalPixel::rocRow(), setPattern(), store(), and theCablingMap_.

Referenced by fillPixel(), and produce().

◆ clear()

void SiPixelCalibDigiProducer::clear ( void  )
privatevirtual

Definition at line 168 of file SiPixelCalibDigiProducer.cc.

168  {
169  // edm::LogInfo("SiPixelCalibProducer") << "in clear() " << std::endl;
170  // this is where we empty the containers so they can be re-filled
171  // the idea: the detPixelMap_ container shrinks/expands as a function
172  // of the number of pixels looked at at one particular time...
173  // unlike the intermediate_data_ container which only expands when
174  // detPixelMap_ becomes bigger than intermedate_data_
175 
176  // shrink the detPixelMap_
177  uint32_t tempsize = intermediate_data_.size();
178  if (tempsize > number_of_pixels_per_pattern_) {
179  edm::LogError("SiPixelCalibDigiProducer") << "Number of pixels in pattern is now: " << tempsize << ", size is was "
180  << number_of_pixels_per_pattern_ << std::endl;
182  }
183 
185  intermediate_data_.clear();
186 
187  // and erase the error bits
188  error_data_.erase(error_data_.begin(), error_data_.end());
189  error_data_.clear();
190 }

References error_data_, intermediate_data_, and number_of_pixels_per_pattern_.

Referenced by produce(), and BeautifulSoup.Tag::setString().

◆ fill()

void SiPixelCalibDigiProducer::fill ( edm::Event iEvent,
const edm::EventSetup iSetup 
)
privatevirtual

Definition at line 92 of file SiPixelCalibDigiProducer.cc.

92  {
93  // figure out which calibration point we're on now..
94  short icalibpoint = calib_->vcalIndexForEvent(iEventCounter_);
96  iEvent.getByToken(tPixelDigi, pixelDigis);
97 
98  edm::LogInfo("SiPixelCalibProducer") << "in fill(), calibpoint " << icalibpoint << " ndigis " << pixelDigis->size()
99  << std::endl;
100  // loop over the data and store things
102  for (digiIter = pixelDigis->begin(); digiIter != pixelDigis->end(); ++digiIter) { // ITERATOR OVER DET IDs
103  uint32_t detid = digiIter->id;
104  edm::DetSet<PixelDigi>::const_iterator ipix; // ITERATOR OVER DIGI DATA
105 
106  for (ipix = digiIter->data.begin(); ipix != digiIter->end(); ++ipix) {
107  // fill in the appropriate location of the temporary data container
108  fillPixel(detid, ipix->row(), ipix->column(), icalibpoint, ipix->adc());
109  }
110  }
111 }

References edm::DetSetVector< T >::begin(), calib_, edm::DetSetVector< T >::end(), fillPixel(), iEvent, iEventCounter_, tPixelDigi, and SiPixelCalibConfiguration::vcalIndexForEvent().

Referenced by produce().

◆ fillPixel()

void SiPixelCalibDigiProducer::fillPixel ( uint32_t  detid,
short  row,
short  col,
short  ipoint,
short  adc 
)
privatevirtual

Definition at line 137 of file SiPixelCalibDigiProducer.cc.

137  {
138  // edm::LogInfo("SiPixelCalibProducer") << " in fillpixel()" << std::endl;
139 
140  // edm::LogInfo("SiPixelCalibProducer") << "in fillPixel " << detid << " " << row << " " << col << " " << ipoint << " " << adc << std::endl;
141  if (!checkFED(detid)) {
142  edm::LogError("SiPixelCalibDigiProducer") << " was unable to match detid " << detid << " to a FED!" << std::endl;
143  return;
144  }
145  if (!checkPixel(detid, row, col)) {
146  return;
147  }
148  // now the check if the pixel exists and fill
149  //
150  pixelstruct temppixelworker;
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);
155 
156  if (ipix == intermediate_data_.end()) {
157  SiPixelCalibDigi tempdigi(calib_->nVCal());
158  tempdigi.setrowcol(row, col);
159  intermediate_data_[temppixelworker] = tempdigi;
160  }
161 
162  intermediate_data_[temppixelworker].fill(ipoint, adc);
163  return;
164 }

References ecalLiteDTU::adc(), calib_, checkFED(), checkPixel(), cuy::col, intermediate_data_, plotBeamSpotDB::ipoint, SiPixelCalibConfiguration::nVCal(), and SiPixelCalibDigi::setrowcol().

Referenced by fill().

◆ produce()

void SiPixelCalibDigiProducer::produce ( edm::Event iEvent,
const edm::EventSetup iSetup 
)
overrideprivatevirtual

Implements edm::EDProducer.

Definition at line 249 of file SiPixelCalibDigiProducer.cc.

249  {
250  // edm::LogInfo("SiPixelCalibDigiProducer") <<"in produce() " << std::endl;
251  using namespace edm;
256  if (use_realeventnumber_) {
257  iEventCounter_ = iEvent.id().event() - 1;
258  } else
259  iEventCounter_++;
260  if (iEventCounter_ % pattern_repeat_ == 1)
261  setPattern();
262 
263  // edm::LogInfo("SiPixelCalibDigiProducer") << "now starting fill..." << std::endl;
264  fill(iEvent, iSetup); // fill method where the actual looping over the digis is done.
265  // edm::LogInfo("SiPixelCalibDigiProducer") << "done filling..." << std::endl;
266  auto pOut = std::make_unique<edm::DetSetVector<SiPixelCalibDigi>>();
267  auto pErr = std::make_unique<edm::DetSetVector<SiPixelCalibDigiError>>();
268 
269  // copy things over into pOut if necessary (this is only once per pattern)
270  if (store()) {
271  // edm::LogInfo("SiPixelCalibDigiProducer") << "in loop" << std::endl;
272  for (std::map<pixelstruct, SiPixelCalibDigi>::const_iterator idet = intermediate_data_.begin();
273  idet != intermediate_data_.end();
274  ++idet) {
275  uint32_t detid = idet->first.first;
276  if (!control_pattern_size_) {
277  if (!checkPixel(idet->first.first, idet->first.second.first, idet->first.second.second))
278  continue;
279  }
280 
281  SiPixelCalibDigi tempdigi = idet->second;
282  edm::DetSet<SiPixelCalibDigi>& detSet = pOut->find_or_insert(detid);
283  detSet.data.push_back(tempdigi);
284  }
285  if (includeErrors_) {
286  for (std::map<pixelstruct, SiPixelCalibDigiError>::const_iterator ierr = error_data_.begin();
287  ierr != error_data_.end();
288  ++ierr) {
289  uint32_t detid = ierr->first.first;
290  SiPixelCalibDigiError temperror = ierr->second;
291  edm::DetSet<SiPixelCalibDigiError>& errSet = pErr->find_or_insert(detid);
292  errSet.data.push_back(temperror);
293  }
294  }
295  edm::LogInfo("INFO") << "now filling event " << iEventCounter_ << " as pixel pattern changes every "
296  << pattern_repeat_ << " events..." << std::endl;
297  clear();
298  }
299  iEvent.put(std::move(pOut));
300  if (includeErrors_)
301  iEvent.put(std::move(pErr));
302 }

References calib_, checkPixel(), clear(), control_pattern_size_, edm::DetSet< T >::data, error_data_, fill(), edm::EventSetup::get(), get, SiPixelCalibConfiguration::getNTriggers(), iEvent, iEventCounter_, includeErrors_, intermediate_data_, eostools::move(), SiPixelCalibConfiguration::nVCal(), pattern_repeat_, setPattern(), store(), theCablingMap_, theGeometry_, and use_realeventnumber_.

◆ setPattern()

void SiPixelCalibDigiProducer::setPattern ( )
privatevirtual

Definition at line 195 of file SiPixelCalibDigiProducer.cc.

195  {
196  // edm::LogInfo("SiPixelCalibProducer") << "in setPattern()" << std::endl;
197  uint32_t patternnumber = (iEventCounter_ - 1) / pattern_repeat_;
198  uint32_t rowpatternnumber = patternnumber / calib_->nColumnPatterns();
199  uint32_t colpatternnumber = patternnumber % calib_->nColumnPatterns();
200  edm::LogInfo("SiPixelCalibDigiProducer")
201  << " rowpatternnumbers = " << rowpatternnumber << " " << colpatternnumber << " " << patternnumber << std::endl;
202  // update currentpattern_
203  std::vector<short> calibcols = calib_->getColumnPattern();
204  std::vector<short> calibrows = calib_->getRowPattern();
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) {
212  nminuscol++;
213  } else if (nminuscol == colpatternnumber) {
214  //edm::LogInfo("SiPixelCalibProducer") << "col " << calibcols[icol] << std::endl;
215  short val = calibcols[icol];
216  tempcolvals.push_back(val);
217  } else if (nminuscol > colpatternnumber)
218  break;
219  }
220  for (uint32_t irow = 0; irow < calibrows.size(); irow++) {
221  // edm::LogInfo("SiPixelCalibProducer") << "row " << irow <<" "<< nminusrow<<" " << calibrows[irow] << std::endl;
222  if (calibrows[irow] == -1)
223  nminusrow++;
224  else if (nminusrow == rowpatternnumber) {
225  short val = calibrows[irow];
226  temprowvals.push_back(val);
227  } else if (nminusrow > rowpatternnumber)
228  break;
229  }
230  //now clean up the currentpattern_;
231  while (currentpattern_.size() > temprowvals.size() * tempcolvals.size()) {
232  currentpattern_.erase(currentpattern_.end());
233  }
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]);
237  npatterns++;
238  if (npatterns > currentpattern_.size())
239  currentpattern_.push_back(pattern);
240  else
241  currentpattern_[npatterns - 1] = pattern;
242  }
243  }
244 }

References calib_, currentpattern_, SiPixelCalibConfiguration::getColumnPattern(), SiPixelCalibConfiguration::getRowPattern(), iEventCounter_, SiPixelCalibConfiguration::nColumnPatterns(), topSingleLeptonDQM_PU_cfi::pattern, pattern_repeat_, and heppy_batch::val.

Referenced by checkPixel(), and produce().

◆ store()

bool SiPixelCalibDigiProducer::store ( )
privatevirtual

Definition at line 78 of file SiPixelCalibDigiProducer.cc.

78  {
79  // std::cout << "in store() " << std::endl;
80  if (iEventCounter_ % pattern_repeat_ == 0) {
81  // std::cout << "now at event " << iEventCounter_ <<" where we save the calibration information into the CMSSW digi";
82  return true;
83  } else if (iEventCounter_ == calib_->expectedTotalEvents())
84  return true;
85  else
86  return false;
87  return true;
88 }

References calib_, SiPixelCalibConfiguration::expectedTotalEvents(), iEventCounter_, and pattern_repeat_.

Referenced by checkPixel(), and produce().

Member Data Documentation

◆ calib_

edm::ESHandle<SiPixelCalibConfiguration> SiPixelCalibDigiProducer::calib_
private

Definition at line 86 of file SiPixelCalibDigiProducer.h.

Referenced by fill(), fillPixel(), produce(), setPattern(), and store().

◆ conf_

edm::ParameterSet SiPixelCalibDigiProducer::conf_
private

Definition at line 80 of file SiPixelCalibDigiProducer.h.

◆ control_pattern_size_

bool SiPixelCalibDigiProducer::control_pattern_size_
private

Definition at line 77 of file SiPixelCalibDigiProducer.h.

Referenced by checkPixel(), and produce().

◆ currentpair_

std::pair<short, short> SiPixelCalibDigiProducer::currentpair_
private

Definition at line 100 of file SiPixelCalibDigiProducer.h.

Referenced by checkPixel().

◆ currentpattern_

std::vector<std::pair<short, short> > SiPixelCalibDigiProducer::currentpattern_
private

Definition at line 99 of file SiPixelCalibDigiProducer.h.

Referenced by checkPixel(), and setPattern().

◆ detid_to_fedid_

std::map<uint32_t, uint32_t> SiPixelCalibDigiProducer::detid_to_fedid_
private

Definition at line 97 of file SiPixelCalibDigiProducer.h.

Referenced by checkFED(), and checkPixel().

◆ detPixelMap_

std::vector<pixelstruct> SiPixelCalibDigiProducer::detPixelMap_
private

Definition at line 95 of file SiPixelCalibDigiProducer.h.

◆ error_data_

std::map<pixelstruct, SiPixelCalibDigiError> SiPixelCalibDigiProducer::error_data_
private

Definition at line 93 of file SiPixelCalibDigiProducer.h.

Referenced by checkPixel(), clear(), and produce().

◆ errorType

int SiPixelCalibDigiProducer::errorType
private

Definition at line 79 of file SiPixelCalibDigiProducer.h.

◆ iEventCounter_

uint32_t SiPixelCalibDigiProducer::iEventCounter_
private

Definition at line 74 of file SiPixelCalibDigiProducer.h.

Referenced by checkPixel(), fill(), produce(), setPattern(), and store().

◆ ignore_non_pattern_

bool SiPixelCalibDigiProducer::ignore_non_pattern_
private

Definition at line 76 of file SiPixelCalibDigiProducer.h.

Referenced by checkPixel().

◆ includeErrors_

bool SiPixelCalibDigiProducer::includeErrors_
private

Definition at line 78 of file SiPixelCalibDigiProducer.h.

Referenced by checkPixel(), produce(), and SiPixelCalibDigiProducer().

◆ instance_

std::string SiPixelCalibDigiProducer::instance_
private

Definition at line 82 of file SiPixelCalibDigiProducer.h.

◆ intermediate_data_

std::map<pixelstruct, SiPixelCalibDigi> SiPixelCalibDigiProducer::intermediate_data_
private

Definition at line 92 of file SiPixelCalibDigiProducer.h.

Referenced by clear(), fillPixel(), and produce().

◆ label_

std::string SiPixelCalibDigiProducer::label_
private

◆ number_of_pixels_per_pattern_

uint32_t SiPixelCalibDigiProducer::number_of_pixels_per_pattern_
private

Definition at line 83 of file SiPixelCalibDigiProducer.h.

Referenced by clear().

◆ pattern_repeat_

uint32_t SiPixelCalibDigiProducer::pattern_repeat_
private

Definition at line 96 of file SiPixelCalibDigiProducer.h.

Referenced by produce(), setPattern(), and store().

◆ src_

edm::InputTag SiPixelCalibDigiProducer::src_
private

Definition at line 72 of file SiPixelCalibDigiProducer.h.

Referenced by SiPixelCalibDigiProducer().

◆ theCablingMap_

edm::ESHandle<SiPixelFedCablingMap> SiPixelCalibDigiProducer::theCablingMap_
private

Definition at line 88 of file SiPixelCalibDigiProducer.h.

Referenced by checkFED(), checkPixel(), and produce().

◆ theGeometry_

edm::ESHandle<TrackerGeometry> SiPixelCalibDigiProducer::theGeometry_
private

Definition at line 87 of file SiPixelCalibDigiProducer.h.

Referenced by produce().

◆ tPixelDigi

edm::EDGetTokenT<edm::DetSetVector<PixelDigi> > SiPixelCalibDigiProducer::tPixelDigi
private

Definition at line 73 of file SiPixelCalibDigiProducer.h.

Referenced by fill(), and SiPixelCalibDigiProducer().

◆ use_realeventnumber_

bool SiPixelCalibDigiProducer::use_realeventnumber_
private

Definition at line 84 of file SiPixelCalibDigiProducer.h.

Referenced by produce().

edm::ESHandle::product
T const * product() const
Definition: ESHandle.h:86
SiPixelCalibDigiProducer::detid_to_fedid_
std::map< uint32_t, uint32_t > detid_to_fedid_
Definition: SiPixelCalibDigiProducer.h:97
SiPixelCalibDigiProducer::error_data_
std::map< pixelstruct, SiPixelCalibDigiError > error_data_
Definition: SiPixelCalibDigiProducer.h:93
mps_fire.i
i
Definition: mps_fire.py:428
edm::DetSetVector::end
iterator end()
Return the off-the-end iterator.
Definition: DetSetVector.h:325
edm::DetSet
Definition: DetSet.h:23
converter
Definition: CandidateProducer.h:25
edm
HLT enums.
Definition: AlignableModifier.h:19
SiPixelCalibConfiguration::getNTriggers
short getNTriggers() const
Definition: SiPixelCalibConfiguration.h:28
cuy.col
col
Definition: cuy.py:1010
SiPixelCalibDigiProducer::theGeometry_
edm::ESHandle< TrackerGeometry > theGeometry_
Definition: SiPixelCalibDigiProducer.h:87
SiPixelCalibDigiProducer::iEventCounter_
uint32_t iEventCounter_
Definition: SiPixelCalibDigiProducer.h:74
edm::DetSetVector::begin
iterator begin()
Return an iterator to the first DetSet.
Definition: DetSetVector.h:314
SiPixelCalibDigiProducer::includeErrors_
bool includeErrors_
Definition: SiPixelCalibDigiProducer.h:78
SiPixelCalibConfiguration::nColumnPatterns
uint32_t nColumnPatterns() const
Definition: SiPixelCalibConfiguration.cc:105
sipixelobjects::ElectronicIndex::dcol
int dcol
Definition: ElectronicIndex.h:8
edm::ParameterSet::getUntrackedParameter
T getUntrackedParameter(std::string const &, T const &) const
edm::LogInfo
Log< level::Info, false > LogInfo
Definition: MessageLogger.h:125
SiPixelCalibDigiProducer::fill
virtual void fill(edm::Event &iEvent, const edm::EventSetup &iSetup)
Definition: SiPixelCalibDigiProducer.cc:92
SiPixelCalibDigiProducer::checkFED
virtual bool checkFED(uint32_t detid)
Definition: SiPixelCalibDigiProducer.cc:116
edm::Handle
Definition: AssociativeIterator.h:50
sipixelobjects::LocalPixel
identify pixel inside single ROC
Definition: LocalPixel.h:7
SiPixelCalibDigiProducer::setPattern
virtual void setPattern()
Definition: SiPixelCalibDigiProducer.cc:195
ecalLiteDTU::adc
constexpr int adc(sample_type sample)
get the ADC sample (12 bits)
Definition: EcalLiteDTUSample.h:12
edm::EventSetup::get
T get() const
Definition: EventSetup.h:80
SiPixelCalibDigiProducer::checkPixel
virtual bool checkPixel(uint32_t detid, short row, short col)
Definition: SiPixelCalibDigiProducer.cc:305
TrackerDigiGeometryRecord
Definition: TrackerDigiGeometryRecord.h:15
SiPixelCalibConfiguration::expectedTotalEvents
uint32_t expectedTotalEvents() const
Definition: SiPixelCalibConfiguration.cc:56
plotBeamSpotDB.ipoint
ipoint
Definition: plotBeamSpotDB.py:340
sipixelobjects::ElectronicIndex::pxid
int pxid
Definition: ElectronicIndex.h:9
SiPixelCalibDigiProducer::intermediate_data_
std::map< pixelstruct, SiPixelCalibDigi > intermediate_data_
Definition: SiPixelCalibDigiProducer.h:92
sipixelobjects::ElectronicIndex
Definition: ElectronicIndex.h:5
SiPixelCalibConfiguration::vcalIndexForEvent
short vcalIndexForEvent(const uint32_t &eventnumber) const
Definition: SiPixelCalibConfiguration.cc:5
SiPixelCalibDigiProducer::src_
edm::InputTag src_
Definition: SiPixelCalibDigiProducer.h:72
SiPixelCalibDigiProducer::currentpattern_
std::vector< std::pair< short, short > > currentpattern_
Definition: SiPixelCalibDigiProducer.h:99
SiPixelCalibDigiError
Definition: SiPixelCalibDigiError.h:16
SiPixelCalibConfigurationRcd
Definition: SiPixelCalibConfigurationRcd.h:24
sipixelobjects::LocalPixel::DcolPxid::pxid
int pxid
Definition: LocalPixel.h:20
sipixelobjects::LocalPixel::DcolPxid
double collumn and pixel ID in double collumn representation
Definition: LocalPixel.h:19
edm::DetSetVector::const_iterator
collection_type::const_iterator const_iterator
Definition: DetSetVector.h:102
SiPixelCalibDigiProducer::ignore_non_pattern_
bool ignore_non_pattern_
Definition: SiPixelCalibDigiProducer.h:76
SiPixelCalibConfiguration::nVCal
uint32_t nVCal() const
Definition: SiPixelCalibConfiguration.h:54
SiPixelCalibDigiProducer::errorType
int errorType
Definition: SiPixelCalibDigiProducer.h:79
iEvent
int iEvent
Definition: GenABIO.cc:224
SiPixelCalibDigiProducer::store
virtual bool store()
Definition: SiPixelCalibDigiProducer.cc:78
topSingleLeptonDQM_PU_cfi.pattern
pattern
Definition: topSingleLeptonDQM_PU_cfi.py:39
SiPixelCalibDigiProducer::calib_
edm::ESHandle< SiPixelCalibConfiguration > calib_
Definition: SiPixelCalibDigiProducer.h:86
SiPixelCalibDigiProducer::currentpair_
std::pair< short, short > currentpair_
Definition: SiPixelCalibDigiProducer.h:100
SiPixelCalibDigiProducer::conf_
edm::ParameterSet conf_
Definition: SiPixelCalibDigiProducer.h:80
SiPixelCalibDigi::setrowcol
void setrowcol(uint16_t row, uint16_t col)
Definition: SiPixelCalibDigi.cc:32
SiPixelFrameConverter
Definition: SiPixelFrameConverter.h:15
SiPixelCalibDigiProducer::theCablingMap_
edm::ESHandle< SiPixelFedCablingMap > theCablingMap_
Definition: SiPixelCalibDigiProducer.h:88
SiPixelCalibDigiProducer::use_realeventnumber_
bool use_realeventnumber_
Definition: SiPixelCalibDigiProducer.h:84
edm::LogError
Log< level::Error, false > LogError
Definition: MessageLogger.h:123
PixelSLinkDataInputSource_cfi.fedid
fedid
Definition: PixelSLinkDataInputSource_cfi.py:6
get
#define get
heppy_batch.val
val
Definition: heppy_batch.py:351
eostools.move
def move(src, dest)
Definition: eostools.py:511
SiPixelCalibDigi
Definition: SiPixelCalibDigi.h:9
edm::DetSet::data
collection_type data
Definition: DetSet.h:80
SiPixelCalibConfiguration::getColumnPattern
std::vector< short > getColumnPattern() const
Definition: SiPixelCalibConfiguration.h:34
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
SiPixelCalibDigiProducer::clear
virtual void clear()
Definition: SiPixelCalibDigiProducer.cc:168
SiPixelCalibDigiProducer::pattern_repeat_
uint32_t pattern_repeat_
Definition: SiPixelCalibDigiProducer.h:96
hgcalTestNeighbor_cfi.detector
detector
Definition: hgcalTestNeighbor_cfi.py:6
SiPixelCalibDigiProducer::pixelstruct
std::pair< uint32_t, std::pair< short, short > > pixelstruct
Definition: SiPixelCalibDigiProducer.h:70
SiPixelCalibDigiProducer::number_of_pixels_per_pattern_
uint32_t number_of_pixels_per_pattern_
Definition: SiPixelCalibDigiProducer.h:83
SiPixelCalibDigiProducer::tPixelDigi
edm::EDGetTokenT< edm::DetSetVector< PixelDigi > > tPixelDigi
Definition: SiPixelCalibDigiProducer.h:73
SiPixelFedCablingMapRcd
Definition: SiPixelFedCablingMapRcd.h:5
SiPixelCalibDigiProducer::control_pattern_size_
bool control_pattern_size_
Definition: SiPixelCalibDigiProducer.h:77
SiPixelCalibConfiguration::getRowPattern
std::vector< short > getRowPattern() const
Definition: SiPixelCalibConfiguration.h:31
SiPixelCalibDigiProducer::fillPixel
virtual void fillPixel(uint32_t detid, short row, short col, short ipoint, short adc)
Definition: SiPixelCalibDigiProducer.cc:137
edm::InputTag
Definition: InputTag.h:15
sipixelobjects::LocalPixel::DcolPxid::dcol
int dcol
Definition: LocalPixel.h:20
sipixelobjects::DetectorIndex
Definition: DetectorIndex.h:6
edm::DetSet::const_iterator
collection_type::const_iterator const_iterator
Definition: DetSet.h:31