CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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 ()
 
- Public Member Functions inherited from edm::EDProducer
 EDProducer ()
 
ModuleDescription const & moduleDescription () const
 
virtual ~EDProducer ()
 
- Public Member Functions inherited from edm::ProducerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
 ProducerBase ()
 
void registerProducts (ProducerBase *, ProductRegistry *, ModuleDescription const &)
 
std::function< void(BranchDescription
const &)> 
registrationCallback () const
 used by the fwk to register list of products More...
 
virtual ~ProducerBase ()
 
- Public Member Functions inherited from edm::EDConsumerBase
std::vector< ConsumesInfoconsumesInfo () const
 
 EDConsumerBase ()
 
ProductHolderIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductHolderIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductHolderIndexAndSkipBit > &) const
 
std::vector
< ProductHolderIndexAndSkipBit >
const & 
itemsToGetFromEvent () const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void modulesDependentUpon (const std::string &iProcessName, std::vector< const char * > &oModuleLabels) const
 
void modulesWhoseProductsAreConsumed (std::vector< ModuleDescription const * > &modules, ProductRegistry const &preg, std::map< std::string, ModuleDescription const * > const &labelsToDesc, std::string const &processName) const
 
bool registeredToConsume (ProductHolderIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
void updateLookup (BranchType iBranchType, ProductHolderIndexHelper const &)
 
virtual ~EDConsumerBase ()
 

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)
 
virtual void produce (edm::Event &iEvent, const edm::EventSetup &iSetup) override
 
virtual void setPattern ()
 
virtual bool store ()
 

Private Attributes

edm::ESHandle
< SiPixelCalibConfiguration
calib_
 
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,
SiPixelCalibDigiError
error_data_
 
int errorType
 
uint32_t iEventCounter_
 
bool ignore_non_pattern_
 
bool includeErrors_
 
std::string instance_
 
std::map< pixelstruct,
SiPixelCalibDigi
intermediate_data_
 
std::string label_
 
uint32_t number_of_pixels_per_pattern_
 
uint32_t pattern_repeat_
 
edm::InputTag src_
 
edm::ESHandle
< SiPixelFedCablingMap
theCablingMap_
 
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
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)
 
- Protected Member Functions inherited from edm::EDConsumerBase
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (edm::InputTag const &tag)
 
EDGetToken consumes (const TypeToGet &id, edm::InputTag const &tag)
 
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 ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > mayConsume (edm::InputTag const &tag)
 
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 

Detailed Description

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

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

Definition at line 55 of file SiPixelCalibDigiProducer.h.

Member Typedef Documentation

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 ( const edm::ParameterSet iConfig)
explicit

Definition at line 54 of file SiPixelCalibDigiProducer.cc.

References includeErrors_, src_, and tPixelDigi.

54  :
55  src_(iConfig.getParameter<edm::InputTag>("src")),
56  iEventCounter_(0),
57  ignore_non_pattern_(iConfig.getParameter<bool>("ignoreNonPattern")),
58  control_pattern_size_(iConfig.getParameter<bool>("checkPatternEachEvent")),
59  includeErrors_(iConfig.getUntrackedParameter<bool>("includeErrors",false)),
60  errorType(iConfig.getUntrackedParameter<int>("errorTypeNumber",1)),
61  conf_(iConfig),
63  use_realeventnumber_(iConfig.getParameter<bool>("useRealEventNumber"))
64 
65 {
66  tPixelDigi = consumes<edm::DetSetVector<PixelDigi>> (src_);
67  //register your products
68  produces< edm::DetSetVector<SiPixelCalibDigi> >();
69  if(includeErrors_)
70  produces< edm::DetSetVector<SiPixelCalibDigiError> > ();
71 
72 }
T getParameter(std::string const &) const
T getUntrackedParameter(std::string const &, T const &) const
edm::EDGetTokenT< edm::DetSetVector< PixelDigi > > tPixelDigi
SiPixelCalibDigiProducer::~SiPixelCalibDigiProducer ( )

Definition at line 75 of file SiPixelCalibDigiProducer.cc.

76 {
77 
78  // do anything here that needs to be done at desctruction time
79  // (e.g. close files, deallocate resources etc.)
80 
81 }

Member Function Documentation

bool SiPixelCalibDigiProducer::checkFED ( uint32_t  detid)
privatevirtual

Definition at line 134 of file SiPixelCalibDigiProducer.cc.

References cond::rpcobgas::detid, detid_to_fedid_, edm::ESHandle< class >::product(), and theCablingMap_.

Referenced by fillPixel().

134  {
135  // edm::LogInfo("SiPixelCalibProducer") << "in checkFED" << std::endl;
136 
138  return true;
139  for(int fedid=0; fedid<=40; ++fedid){
140  // edm::LogInfo("SiPixelCalibProducer") << " looking at fedid " << fedid << std::endl;
141  SiPixelFrameConverter converter(theCablingMap_.product(),fedid);
142  if(converter.hasDetUnit(detid)){
143  detid_to_fedid_[detid]=fedid;
144  edm::LogInfo("SiPixelCalibDigiProducer") << "matched detid " << detid << " to fed " << detid_to_fedid_[detid] << std::endl;
145  return true;
146  }
147  }
148  return false;
149 }
std::map< uint32_t, uint32_t > detid_to_fedid_
edm::ESHandle< SiPixelFedCablingMap > theCablingMap_
T const * product() const
Definition: ESHandle.h:86
bool SiPixelCalibDigiProducer::checkPixel ( uint32_t  detid,
short  row,
short  col 
)
privatevirtual

Definition at line 325 of file SiPixelCalibDigiProducer.cc.

References cuy::col, control_pattern_size_, currentpair_, currentpattern_, sipixelobjects::ElectronicIndex::dcol, sipixelobjects::LocalPixel::DcolPxid::dcol, cond::rpcobgas::detid, detid_to_fedid_, error_data_, i, iEventCounter_, ignore_non_pattern_, includeErrors_, edm::ESHandle< class >::product(), sipixelobjects::ElectronicIndex::pxid, sipixelobjects::LocalPixel::DcolPxid::pxid, sipixelobjects::LocalPixel::rocCol(), sipixelobjects::LocalPixel::rocRow(), setPattern(), store(), and theCablingMap_.

Referenced by fillPixel(), and produce().

325  {
326 
327  if(!control_pattern_size_ && !store())
328  return true;
329 
330  if( !ignore_non_pattern_ )
331  return true;
332 
333 
334  edm::LogInfo("SiPixelCalibDigiProducer") << "Event" << iEventCounter_ << ",now in checkpixel() " << std::endl;
335  if(currentpattern_.size()==0)
336  setPattern();
337  // uint32_t iroc;
338  uint32_t fedid = detid_to_fedid_[detid];
339 
340  SiPixelFrameConverter formatter(theCablingMap_.product(),fedid);
341  sipixelobjects::DetectorIndex detector ={detid, row, col};
343 
344  formatter.toCabling(cabling,detector);
345  // cabling should now contain cabling.roc and cabling.dcol and cabling.pxid
346 
347  // however, the coordinates now need to be converted from dcl, pxid to the row,col coordinates used in the calibration info
349  loc.dcol = cabling.dcol;
350  loc.pxid = cabling.pxid;
351  sipixelobjects::LocalPixel locpixel(loc);
352  currentpair_.first = locpixel.rocRow();
353  currentpair_.second = locpixel.rocCol();
354 
355  for(uint32_t i=0; i<currentpattern_.size(); ++i){
356  // edm::LogInfo("SiPixelCalibDigiProducer") << "found pair " << currentpair_.first << "," << currentpair_.second << " calib " << currentpattern_[i].first << ","<< currentpattern_[i].second << " input " << row << "," << col << std::endl;
358  return true;
359  }
360  }
361  std::ostringstream errorlog;
362  errorlog << "DETID "<<detid<<", row, col (offline)="<<row<<","<<col<<" row, col (ROC) ="<<currentpair_.first<<","<< currentpair_.second<< " found no match in list of patterns: " ;
363  for(uint32_t i=0; i<currentpattern_.size(); ++i){
364  if(i!=0 && i!=currentpattern_.size()-1)
365  errorlog<<" ";
366  errorlog<<"(";
367  errorlog<<currentpattern_[i].first;
368  errorlog<<",";
369  errorlog<<currentpattern_[i].second;
370  errorlog<<")";
371  }
372  edm::LogError("ERROR") << errorlog.str() << std::endl;
373  if(includeErrors_){// book the error
374 
375  pixelstruct temppixelworker;
376  temppixelworker.first=detid;
377  temppixelworker.second.first=row;
378  temppixelworker.second.second=col;
379  std::map<pixelstruct,SiPixelCalibDigiError>::const_iterator ierr = error_data_.find(temppixelworker);
380  if(ierr== error_data_.end()){
381  SiPixelCalibDigiError temperr(row,col,1);
382  error_data_[temppixelworker]=temperr;
383  }
384  }
385 
386  return false;
387 }
int i
Definition: DBlmapReader.cc:9
std::pair< uint32_t, std::pair< short, short > > pixelstruct
std::map< uint32_t, uint32_t > detid_to_fedid_
identify pixel inside single ROC
Definition: LocalPixel.h:7
edm::ESHandle< SiPixelFedCablingMap > theCablingMap_
std::map< pixelstruct, SiPixelCalibDigiError > error_data_
double collumn and pixel ID in double collumn representation
Definition: LocalPixel.h:22
std::vector< std::pair< short, short > > currentpattern_
T const * product() const
Definition: ESHandle.h:86
std::pair< short, short > currentpair_
int col
Definition: cuy.py:1008
void SiPixelCalibDigiProducer::clear ( void  )
privatevirtual

Definition at line 187 of file SiPixelCalibDigiProducer.cc.

References error_data_, intermediate_data_, and number_of_pixels_per_pattern_.

Referenced by Vispa.Views.WidgetView.WidgetView::closeEvent(), Vispa.Views.BoxDecayView.BoxDecayView::closeEvent(), Vispa.Share.FindAlgorithm.FindAlgorithm::findUsingFindDialog(), produce(), Vispa.Views.LineDecayView.LineDecayView::setDataObjects(), Vispa.Views.WidgetView.WidgetView::setDataObjects(), BeautifulSoup.Tag::setString(), Vispa.Views.TreeView.TreeView::updateContent(), Vispa.Views.TableView.TableView::updateContent(), Vispa.Views.BoxDecayView.BoxDecayView::updateContent(), and Vispa.Views.PropertyView.PropertyView::updateContent().

187  {
188  // edm::LogInfo("SiPixelCalibProducer") << "in clear() " << std::endl;
189  // this is where we empty the containers so they can be re-filled
190  // the idea: the detPixelMap_ container shrinks/expands as a function
191  // of the number of pixels looked at at one particular time...
192  // unlike the intermediate_data_ container which only expands when
193  // detPixelMap_ becomes bigger than intermedate_data_
194 
195  // shrink the detPixelMap_
196  uint32_t tempsize = intermediate_data_.size();
197  if(tempsize>number_of_pixels_per_pattern_){
198  edm::LogError("SiPixelCalibDigiProducer") << "Number of pixels in pattern is now: " << tempsize<< ", size is was " << number_of_pixels_per_pattern_ << std::endl;
200  }
201 
203  intermediate_data_.clear();
204 
205  // and erase the error bits
206  error_data_.erase(error_data_.begin(), error_data_.end());
207  error_data_.clear();
208 }
std::map< pixelstruct, SiPixelCalibDigi > intermediate_data_
std::map< pixelstruct, SiPixelCalibDigiError > error_data_
void SiPixelCalibDigiProducer::fill ( edm::Event iEvent,
const edm::EventSetup iSetup 
)
privatevirtual

Definition at line 109 of file SiPixelCalibDigiProducer.cc.

References edm::DetSetVector< T >::begin(), calib_, cond::rpcobgas::detid, edm::DetSetVector< T >::end(), fillPixel(), edm::Event::getByToken(), iEventCounter_, and tPixelDigi.

Referenced by produce().

110 {
111 
112  // figure out which calibration point we're on now..
113  short icalibpoint = calib_->vcalIndexForEvent(iEventCounter_);
115  iEvent.getByToken( tPixelDigi, pixelDigis );
116 
117  edm::LogInfo("SiPixelCalibProducer") << "in fill(), calibpoint " << icalibpoint <<" ndigis " << pixelDigis->size() << std::endl;
118  // loop over the data and store things
120  for(digiIter=pixelDigis->begin(); digiIter!=pixelDigis->end(); ++digiIter){// ITERATOR OVER DET IDs
121  uint32_t detid = digiIter->id;
122  edm::DetSet<PixelDigi>::const_iterator ipix; // ITERATOR OVER DIGI DATA
123 
124  for(ipix = digiIter->data.begin(); ipix!=digiIter->end(); ++ipix){
125  // fill in the appropriate location of the temporary data container
126  fillPixel(detid,ipix->row(),ipix->column(),icalibpoint,ipix->adc());
127  }
128  }
129 }
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:457
iterator end()
Return the off-the-end iterator.
Definition: DetSetVector.h:365
virtual void fillPixel(uint32_t detid, short row, short col, short ipoint, short adc)
edm::EDGetTokenT< edm::DetSetVector< PixelDigi > > tPixelDigi
edm::ESHandle< SiPixelCalibConfiguration > calib_
iterator begin()
Return an iterator to the first DetSet.
Definition: DetSetVector.h:350
collection_type::const_iterator const_iterator
Definition: DetSet.h:33
collection_type::const_iterator const_iterator
Definition: DetSetVector.h:108
void SiPixelCalibDigiProducer::fillPixel ( uint32_t  detid,
short  row,
short  col,
short  ipoint,
short  adc 
)
privatevirtual

Definition at line 154 of file SiPixelCalibDigiProducer.cc.

References calib_, checkFED(), checkPixel(), cuy::col, cond::rpcobgas::detid, intermediate_data_, and SiPixelCalibDigi::setrowcol().

Referenced by fill().

154  {
155  // edm::LogInfo("SiPixelCalibProducer") << " in fillpixel()" << std::endl;
156 
157  // edm::LogInfo("SiPixelCalibProducer") << "in fillPixel " << detid << " " << row << " " << col << " " << ipoint << " " << adc << std::endl;
158  if(!checkFED(detid)){
159  edm::LogError("SiPixelCalibDigiProducer") << " was unable to match detid " << detid << " to a FED!" << std::endl;
160  return;
161  }
162  if(!checkPixel(detid,row,col)){
163  return;
164  }
165  // now the check if the pixel exists and fill
166  //
167  pixelstruct temppixelworker;
168  temppixelworker.first=detid;
169  temppixelworker.second.first=row;
170  temppixelworker.second.second=col;
171  std::map<pixelstruct,SiPixelCalibDigi>::const_iterator ipix = intermediate_data_.find(temppixelworker);
172 
173  if(ipix == intermediate_data_.end()){
174  SiPixelCalibDigi tempdigi(calib_->nVCal());
175  tempdigi.setrowcol(row,col);
176  intermediate_data_[temppixelworker]=tempdigi;
177  }
178 
179  intermediate_data_[temppixelworker].fill(ipoint,adc);
180  return;
181 
182 }
int adc(sample_type sample)
get the ADC sample (12 bits)
std::pair< uint32_t, std::pair< short, short > > pixelstruct
virtual bool checkFED(uint32_t detid)
std::map< pixelstruct, SiPixelCalibDigi > intermediate_data_
void setrowcol(uint16_t row, uint16_t col)
virtual bool checkPixel(uint32_t detid, short row, short col)
edm::ESHandle< SiPixelCalibConfiguration > calib_
int col
Definition: cuy.py:1008
void SiPixelCalibDigiProducer::produce ( edm::Event iEvent,
const edm::EventSetup iSetup 
)
overrideprivatevirtual

Implements edm::EDProducer.

Definition at line 271 of file SiPixelCalibDigiProducer.cc.

References calib_, checkPixel(), clear(), control_pattern_size_, edm::DetSet< T >::data, cond::rpcobgas::detid, error_data_, edm::EventID::event(), fill(), edm::EventSetup::get(), edm::EventBase::id(), iEventCounter_, includeErrors_, intermediate_data_, pattern_repeat_, edm::Event::put(), setPattern(), store(), theCablingMap_, theGeometry_, and use_realeventnumber_.

Referenced by JSONExport.JsonExport::export(), HTMLExport.HTMLExport::export(), and HTMLExport.HTMLExportStatic::export().

272 {
273  // edm::LogInfo("SiPixelCalibDigiProducer") <<"in produce() " << std::endl;
274  using namespace edm;
275  iSetup.get<SiPixelCalibConfigurationRcd>().get(calib_);
276  iSetup.get<TrackerDigiGeometryRecord>().get( theGeometry_ );
278  pattern_repeat_=calib_->getNTriggers()*calib_->nVCal();
280  iEventCounter_= iEvent.id().event()-1;
281  }
282  else
283  iEventCounter_++;
285  setPattern();
286 
287  // edm::LogInfo("SiPixelCalibDigiProducer") << "now starting fill..." << std::endl;
288  fill(iEvent,iSetup); // fill method where the actual looping over the digis is done.
289  // edm::LogInfo("SiPixelCalibDigiProducer") << "done filling..." << std::endl;
290  std::auto_ptr<edm::DetSetVector<SiPixelCalibDigi> > pOut(new edm::DetSetVector<SiPixelCalibDigi>);
291  std::auto_ptr<edm::DetSetVector<SiPixelCalibDigiError> > pErr (new edm::DetSetVector<SiPixelCalibDigiError> );
292 
293  // copy things over into pOut if necessary (this is only once per pattern)
294  if(store()){
295  // edm::LogInfo("SiPixelCalibDigiProducer") << "in loop" << std::endl;
296  for(std::map<pixelstruct,SiPixelCalibDigi>::const_iterator idet=intermediate_data_.begin(); idet!=intermediate_data_.end();++idet){
297  uint32_t detid=idet->first.first;
299  if(! checkPixel(idet->first.first,idet->first.second.first,idet->first.second.second))
300  continue;
301  }
302 
303 
304  SiPixelCalibDigi tempdigi=idet->second;
305  edm::DetSet<SiPixelCalibDigi> & detSet = pOut->find_or_insert(detid);
306  detSet.data.push_back(tempdigi);
307  }
308  if(includeErrors_){
309  for(std::map<pixelstruct,SiPixelCalibDigiError>::const_iterator ierr=error_data_.begin(); ierr!=error_data_.end();++ierr){
310  uint32_t detid=ierr->first.first;
311  SiPixelCalibDigiError temperror = ierr->second;
312  edm::DetSet<SiPixelCalibDigiError> & errSet = pErr->find_or_insert(detid);
313  errSet.data.push_back(temperror);
314  }
315  }
316  edm::LogInfo("INFO") << "now filling event " << iEventCounter_ << " as pixel pattern changes every " << pattern_repeat_ << " events..." << std::endl;
317  clear();
318  }
319  iEvent.put(pOut);
320  if(includeErrors_)
321  iEvent.put(pErr);
322 }
EventNumber_t event() const
Definition: EventID.h:41
virtual void fill(edm::Event &iEvent, const edm::EventSetup &iSetup)
std::map< pixelstruct, SiPixelCalibDigi > intermediate_data_
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
Definition: Event.h:115
edm::ESHandle< SiPixelFedCablingMap > theCablingMap_
virtual bool checkPixel(uint32_t detid, short row, short col)
std::map< pixelstruct, SiPixelCalibDigiError > error_data_
const T & get() const
Definition: EventSetup.h:55
edm::EventID id() const
Definition: EventBase.h:60
collection_type data
Definition: DetSet.h:78
edm::ESHandle< SiPixelCalibConfiguration > calib_
edm::ESHandle< TrackerGeometry > theGeometry_
void SiPixelCalibDigiProducer::setPattern ( )
privatevirtual

Definition at line 214 of file SiPixelCalibDigiProducer.cc.

References funct::abs(), calib_, currentpattern_, iEventCounter_, chain::pattern, and pattern_repeat_.

Referenced by checkPixel(), and produce().

214  {
215  // edm::LogInfo("SiPixelCalibProducer") << "in setPattern()" << std::endl;
216  uint32_t patternnumber = abs(iEventCounter_-1)/pattern_repeat_;
217  uint32_t rowpatternnumber = patternnumber/calib_->nColumnPatterns();
218  uint32_t colpatternnumber = patternnumber%calib_->nColumnPatterns();
219  edm::LogInfo("SiPixelCalibDigiProducer") << " rowpatternnumbers = " << rowpatternnumber << " " << colpatternnumber << " " << patternnumber << std::endl;
220  // update currentpattern_
221  std::vector<short> calibcols = calib_->getColumnPattern();
222  std::vector<short> calibrows = calib_->getRowPattern();
223  std::vector<short> temprowvals(0);
224  std::vector<short> tempcolvals(0);
225  uint32_t nminuscol=0;
226  uint32_t nminusrow=0;
227  uint32_t npatterns=0;
228  for(uint32_t icol=0; icol<calibcols.size(); icol++){
229  if(calibcols[icol]==-1){
230  nminuscol++;
231  }
232  else if(nminuscol==colpatternnumber){
233  //edm::LogInfo("SiPixelCalibProducer") << "col " << calibcols[icol] << std::endl;
234  short val=calibcols[icol];
235  tempcolvals.push_back(val);
236  }
237  else if (nminuscol> colpatternnumber)
238  break;
239  }
240  for(uint32_t irow=0; irow<calibrows.size(); irow++){
241  // edm::LogInfo("SiPixelCalibProducer") << "row " << irow <<" "<< nminusrow<<" " << calibrows[irow] << std::endl;
242  if(calibrows[irow]==-1)
243  nminusrow++;
244  else if(nminusrow==rowpatternnumber){
245  short val=calibrows[irow];
246  temprowvals.push_back(val);
247  }
248  else if(nminusrow>rowpatternnumber)
249  break;
250  }
251  //now clean up the currentpattern_;
252  while(currentpattern_.size()>temprowvals.size()*tempcolvals.size()){
253  currentpattern_.erase(currentpattern_.end());
254  }
255  for(uint32_t irow=0; irow<temprowvals.size(); irow++){
256  for(uint32_t icol=0; icol<tempcolvals.size(); icol++){
257  std::pair<short,short> pattern(temprowvals[irow],tempcolvals[icol]);
258  npatterns++;
259  if(npatterns>currentpattern_.size())
260  currentpattern_.push_back(pattern);
261  else
262  currentpattern_[npatterns-1]=pattern;
263  }
264  }
265 }
list pattern
Definition: chain.py:104
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
std::vector< std::pair< short, short > > currentpattern_
edm::ESHandle< SiPixelCalibConfiguration > calib_
bool SiPixelCalibDigiProducer::store ( )
privatevirtual

Definition at line 92 of file SiPixelCalibDigiProducer.cc.

References calib_, iEventCounter_, and pattern_repeat_.

Referenced by checkPixel(), and produce().

93 {
94  // std::cout << "in store() " << std::endl;
96  // std::cout << "now at event " << iEventCounter_ <<" where we save the calibration information into the CMSSW digi";
97  return 1;
98  }
99  else if(iEventCounter_==calib_->expectedTotalEvents())
100  return 1;
101  else
102  return 0;
103  return 1;
104 }
edm::ESHandle< SiPixelCalibConfiguration > calib_

Member Data Documentation

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

Definition at line 86 of file SiPixelCalibDigiProducer.h.

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

edm::ParameterSet SiPixelCalibDigiProducer::conf_
private

Definition at line 80 of file SiPixelCalibDigiProducer.h.

bool SiPixelCalibDigiProducer::control_pattern_size_
private

Definition at line 77 of file SiPixelCalibDigiProducer.h.

Referenced by checkPixel(), and produce().

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

Definition at line 99 of file SiPixelCalibDigiProducer.h.

Referenced by checkPixel().

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

Definition at line 98 of file SiPixelCalibDigiProducer.h.

Referenced by checkPixel(), and setPattern().

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

Definition at line 96 of file SiPixelCalibDigiProducer.h.

Referenced by checkFED(), and checkPixel().

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

Definition at line 94 of file SiPixelCalibDigiProducer.h.

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

Definition at line 92 of file SiPixelCalibDigiProducer.h.

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

int SiPixelCalibDigiProducer::errorType
private

Definition at line 79 of file SiPixelCalibDigiProducer.h.

uint32_t SiPixelCalibDigiProducer::iEventCounter_
private

Definition at line 74 of file SiPixelCalibDigiProducer.h.

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

bool SiPixelCalibDigiProducer::ignore_non_pattern_
private

Definition at line 76 of file SiPixelCalibDigiProducer.h.

Referenced by checkPixel().

bool SiPixelCalibDigiProducer::includeErrors_
private

Definition at line 78 of file SiPixelCalibDigiProducer.h.

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

std::string SiPixelCalibDigiProducer::instance_
private

Definition at line 82 of file SiPixelCalibDigiProducer.h.

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

Definition at line 91 of file SiPixelCalibDigiProducer.h.

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

std::string SiPixelCalibDigiProducer::label_
private
uint32_t SiPixelCalibDigiProducer::number_of_pixels_per_pattern_
private

Definition at line 83 of file SiPixelCalibDigiProducer.h.

Referenced by clear().

uint32_t SiPixelCalibDigiProducer::pattern_repeat_
private

Definition at line 95 of file SiPixelCalibDigiProducer.h.

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

edm::InputTag SiPixelCalibDigiProducer::src_
private

Definition at line 72 of file SiPixelCalibDigiProducer.h.

Referenced by SiPixelCalibDigiProducer().

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

Definition at line 88 of file SiPixelCalibDigiProducer.h.

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

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

Definition at line 87 of file SiPixelCalibDigiProducer.h.

Referenced by produce().

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

Definition at line 73 of file SiPixelCalibDigiProducer.h.

Referenced by fill(), and SiPixelCalibDigiProducer().

bool SiPixelCalibDigiProducer::use_realeventnumber_
private

Definition at line 84 of file SiPixelCalibDigiProducer.h.

Referenced by produce().