CMS 3D CMS Logo

List of all members | Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes
SiPixelStatusProducer Class Reference

#include <SiPixelStatusProducer.h>

Inheritance diagram for SiPixelStatusProducer:
edm::one::EDProducer< edm::EndLuminosityBlockProducer, edm::one::WatchLuminosityBlocks, edm::Accumulator > edm::one::EDProducerBase edm::ProducerBase edm::EDConsumerBase edm::ProductRegistryHelper

Public Member Functions

 SiPixelStatusProducer (const edm::ParameterSet &)
 
 ~SiPixelStatusProducer () override
 
- Public Member Functions inherited from edm::one::EDProducer< edm::EndLuminosityBlockProducer, edm::one::WatchLuminosityBlocks, edm::Accumulator >
 EDProducer ()=default
 
SerialTaskQueueglobalLuminosityBlocksQueue () final
 
SerialTaskQueueglobalRunsQueue () final
 
bool hasAbilityToProduceInBeginLumis () const final
 
bool hasAbilityToProduceInBeginRuns () const final
 
bool hasAbilityToProduceInEndLumis () const final
 
bool hasAbilityToProduceInEndRuns () const final
 
bool wantsGlobalLuminosityBlocks () const final
 
bool wantsGlobalRuns () const final
 
- Public Member Functions inherited from edm::one::EDProducerBase
 EDProducerBase ()
 
ModuleDescription const & moduleDescription () const
 
bool wantsStreamLuminosityBlocks () const
 
bool wantsStreamRuns () const
 
 ~EDProducerBase () 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
 
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)
 

Static Public Member Functions

static void fillDescriptions (edm::ConfigurationDescriptions &descriptions)
 
- Static Public Member Functions inherited from edm::one::EDProducerBase
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 

Private Member Functions

void accumulate (edm::Event const &, const edm::EventSetup &) final
 
void beginLuminosityBlock (edm::LuminosityBlock const &lumiSeg, const edm::EventSetup &) final
 
void endLuminosityBlock (edm::LuminosityBlock const &lumiSeg, const edm::EventSetup &) final
 
void endLuminosityBlockProduce (edm::LuminosityBlock &lumiSeg, const edm::EventSetup &) final
 
virtual int indexROC (int irow, int icol, int nROCcolumns) final
 
virtual void onlineRocColRow (const DetId &detId, int offlineRow, int offlineCol, int &roc, int &row, int &col) final
 

Private Attributes

int beginLumi_
 
int beginRun_
 
SiPixelCoordinates coord_
 
int countLumi_
 
int endLumi_
 
int endRun_
 
const SiPixelFedCablingMapfCablingMap_ = nullptr
 
SiPixelDetectorStatus fDet
 
std::map< int, std::vector< PixelFEDChannel > > FEDerror25_
 
std::unordered_map< uint32_t, unsigned int > fFedIds
 
edm::InputTag fPixelClusterLabel_
 
std::map< int, std::map< int, int > > fRocIds
 
std::map< int, std::pair< int, int > > fSensorLayout
 
std::map< int, std::pair< int, int > > fSensors
 
edm::EDGetTokenT< edmNew::DetSetVector< SiPixelCluster > > fSiPixelClusterToken_
 
unsigned long int ftotalevents
 
int resetNLumi_
 
edm::ESGetToken< SiPixelFedCablingMap, SiPixelFedCablingMapRcdsiPixelFedCablingMapToken_
 
edm::ESWatcher< SiPixelFedCablingMapRcdsiPixelFedCablingMapWatcher_
 
std::vector< edm::EDGetTokenT< PixelFEDChannelCollection > > theBadPixelFEDChannelsTokens_
 
edm::ESWatcher< TrackerDigiGeometryRecordtrackerDIGIGeoWatcher_
 
const TrackerGeometrytrackerGeometry_ = nullptr
 
edm::ESGetToken< TrackerGeometry, TrackerDigiGeometryRecordtrackerGeometryToken_
 
edm::ESGetToken< TrackerTopology, TrackerTopologyRcdtrackerTopologyToken_
 
edm::ESWatcher< TrackerTopologyRcdtrackerTopoWatcher_
 

Additional Inherited Members

- Public Types inherited from edm::one::EDProducerBase
typedef EDProducerBase 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
 
- 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>
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<typename ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes (ESInputTag const &tag)
 
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


class: SiPixelStatusProducer.h package: CalibTracker/SiPixelQuality


Definition at line 34 of file SiPixelStatusProducer.h.

Constructor & Destructor Documentation

◆ SiPixelStatusProducer()

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

Definition at line 46 of file SiPixelStatusProducer.cc.

48  esConsumes<TrackerGeometry, TrackerDigiGeometryRecord, edm::Transition::BeginLuminosityBlock>()),
49  trackerTopologyToken_(esConsumes<TrackerTopology, TrackerTopologyRcd, edm::Transition::BeginLuminosityBlock>()),
51  esConsumes<SiPixelFedCablingMap, SiPixelFedCablingMapRcd, edm::Transition::BeginLuminosityBlock>()) {
52  // get parameter
53 
54  // badPixelFEDChannelCollections
55  std::vector<edm::InputTag> badPixelFEDChannelCollectionLabels_ =
56  iConfig.getParameter<edm::ParameterSet>("SiPixelStatusProducerParameters")
57  .getParameter<std::vector<edm::InputTag>>("badPixelFEDChannelCollections");
58  for (auto& t : badPixelFEDChannelCollectionLabels_)
59  theBadPixelFEDChannelsTokens_.push_back(consumes<PixelFEDChannelCollection>(t));
60  // badPixelFEDChannelCollections = cms.VInputTag(cms.InputTag('siPixelDigis'))
61 
62  fPixelClusterLabel_ = iConfig.getParameter<edm::ParameterSet>("SiPixelStatusProducerParameters")
63  .getUntrackedParameter<edm::InputTag>("pixelClusterLabel");
64  fSiPixelClusterToken_ = consumes<edmNew::DetSetVector<SiPixelCluster>>(fPixelClusterLabel_);
65  resetNLumi_ = iConfig.getParameter<edm::ParameterSet>("SiPixelStatusProducerParameters")
66  .getUntrackedParameter<int>("resetEveryNLumi", 1);
67 
68  ftotalevents = 0;
69  countLumi_ = 0;
70 
71  beginLumi_ = endLumi_ = -1;
72  endLumi_ = endRun_ = -1;
73 
74  produces<SiPixelDetectorStatus, edm::Transition::EndLuminosityBlock>("siPixelStatus");
75 }

References beginLumi_, countLumi_, endLumi_, endRun_, fPixelClusterLabel_, fSiPixelClusterToken_, ftotalevents, edm::ParameterSet::getParameter(), resetNLumi_, OrderedSet::t, and theBadPixelFEDChannelsTokens_.

◆ ~SiPixelStatusProducer()

SiPixelStatusProducer::~SiPixelStatusProducer ( )
override

Definition at line 78 of file SiPixelStatusProducer.cc.

78 {}

Member Function Documentation

◆ accumulate()

void SiPixelStatusProducer::accumulate ( edm::Event const &  iEvent,
const edm::EventSetup  
)
finalprivate

Definition at line 154 of file SiPixelStatusProducer.cc.

154  {
155  ftotalevents++;
156 
157  edm::LogInfo("SiPixelStatusProducer") << "start cluster analyzer " << endl;
158 
159  // ----------------------------------------------------------------------
160  // -- Pixel cluster analysis
161  // ----------------------------------------------------------------------
162 
164  if (!iEvent.getByToken(fSiPixelClusterToken_, hClusterColl)) {
165  edm::LogWarning("SiPixelStatusProducer")
166  << " edmNew::DetSetVector<SiPixelCluster> " << fPixelClusterLabel_ << " does not exist!" << endl;
167  return;
168  }
169 
170  iEvent.getByToken(fSiPixelClusterToken_, hClusterColl);
171 
172  if (hClusterColl.isValid()) {
173  for (const auto& clusters : *hClusterColl) { //loop over different clusters in a clusters vector (module)
174  for (const auto& clu : clusters) { // loop over cluster in a given detId (module)
175  int detid = clusters.detId();
176  int rowsperroc = fSensors[detid].first;
177  int colsperroc = fSensors[detid].second;
178 
179  int nROCcolumns = fSensorLayout[detid].second;
180 
181  int roc(-1);
182  std::map<int, int> fRocIds_detid;
183  if (fRocIds.find(detid) != fRocIds.end()) {
184  fRocIds_detid = fRocIds[detid];
185  }
186 
187  const vector<SiPixelCluster::Pixel>& pixvector = clu.pixels();
188  for (unsigned int i = 0; i < pixvector.size(); ++i) {
189  int mr0 = pixvector[i].x; // constant column direction is along x-axis,
190  int mc0 = pixvector[i].y; // constant row direction is along y-axis
191 
192  int irow = mr0 / rowsperroc;
193  int icol = mc0 / colsperroc;
194 
195  int key = indexROC(irow, icol, nROCcolumns);
196  if (fRocIds_detid.find(key) != fRocIds_detid.end()) {
197  roc = fRocIds_detid[key];
198  }
199 
200  fDet.fillDIGI(detid, roc);
201 
202  } // loop over pixels in a given cluster
203 
204  } // loop over cluster in a given detId (module)
205 
206  } // loop over detId-grouped clusters in cluster detId-grouped clusters-vector
207 
208  } // hClusterColl.isValid()
209  else {
210  edm::LogWarning("SiPixelStatusProducer")
211  << " edmNew::DetSetVector<SiPixelCluster> " << fPixelClusterLabel_ << " is NOT Valid!" << endl;
212  }
214 
215  // FEDerror25 per-ROC per-event
216  edm::Handle<PixelFEDChannelCollection> pixelFEDChannelCollectionHandle;
217 
218  // look over different resouces of takens
220  // collection has to exist
221  if (!iEvent.getByToken(tk, pixelFEDChannelCollectionHandle)) {
222  edm::LogWarning("SiPixelStatusProducer")
223  << " PixelFEDChannelCollection with index " << tk.index() << " does NOT exist!" << std::endl;
224  continue;
225  }
226  iEvent.getByToken(tk, pixelFEDChannelCollectionHandle);
227  // collection has to be valid
228  if (!pixelFEDChannelCollectionHandle.isValid()) {
229  edm::LogWarning("SiPixelStatusProducer")
230  << " PixelFEDChannelCollection with index " << tk.index() << " is NOT valid!" << endl;
231  continue;
232  }
233  // FEDerror channels for the current events
234  std::map<int, std::vector<PixelFEDChannel>> tmpFEDerror25;
235  for (const auto& disabledChannels : *pixelFEDChannelCollectionHandle) {
236  //loop over different PixelFED in a PixelFED vector (module)
237  for (const auto& ch : disabledChannels) {
238  DetId detId = disabledChannels.detId();
239  int detid = detId.rawId();
240 
241  if (ftotalevents == 1) {
242  // FEDerror25 channels for the first event in the lumi section
243  FEDerror25_[detid].push_back(ch);
244  } else
245  tmpFEDerror25[detid].push_back(ch);
246 
247  } // loop over different PixelFED in a PixelFED vector (different channel for a given module)
248 
249  } // loop over different (different DetId) PixelFED vectors in PixelFEDChannelCollection
250 
251  // Compare the current FEDerror list with the first event's FEDerror list
252  // and save the common channels
253  if (!tmpFEDerror25.empty() && !FEDerror25_.empty()) { // non-empty FEDerror lists
254 
255  std::map<int, std::vector<PixelFEDChannel>>::iterator itFEDerror25;
256  for (itFEDerror25 = FEDerror25_.begin(); itFEDerror25 != FEDerror25_.end(); 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];
261 
262  std::vector<PixelFEDChannel> chs_common;
263  for (unsigned int ich = 0; ich < chs.size(); ich++) {
264  PixelFEDChannel ch = chs[ich];
265  // look over the current FEDerror25 channels, save the common FED channels
266  for (unsigned int ich_tmp = 0; ich_tmp < chs_tmp.size(); ich_tmp++) {
267  PixelFEDChannel ch_tmp = chs_tmp[ich_tmp];
268  if ((ch.fed == ch_tmp.fed) && (ch.link == ch_tmp.link)) { // the same FED channel
269  chs_common.push_back(ch);
270  break;
271  }
272  }
273  }
274  // remove the full module from FEDerror25 list if no common channels are left
275  if (chs_common.empty())
276  FEDerror25_.erase(itFEDerror25);
277  // otherwise replace with the common channels
278  else {
279  FEDerror25_[detid].clear();
280  FEDerror25_[detid] = chs_common;
281  }
282  } else { // remove the full module from FEDerror25 list if the module doesn't appear in the current event's FEDerror25 list
283  FEDerror25_.erase(itFEDerror25);
284  }
285 
286  } // loop over modules that have FEDerror25 in the first event in the lumi section
287 
288  } // non-empty FEDerror lists
289 
290  } // look over different resouces of takens
291 
292  // no per-event collection put into iEvent
293  // If use produce() function and no collection is put into iEvent, produce() will not run in unScheduled mode
294  // Now since CMSSW_10_1_X, the accumulate() function will run whatsoever in the unScheduled mode
295  // But accumulate() is NOT available and will NOT be available for releases before CMSSW_10_1_X
296 }

References bsc_activity_cfg::clusters, fDet, PixelFEDChannel::fed, FEDerror25_, SiPixelDetectorStatus::fillDIGI(), fPixelClusterLabel_, fRocIds, fSensorLayout, fSensors, fSiPixelClusterToken_, ftotalevents, mps_fire::i, iEvent, indexROC(), edm::HandleBase::isValid(), crabWrapper::key, PixelFEDChannel::link, DetId::rawId(), PixelMapPlotter::roc, and theBadPixelFEDChannelsTokens_.

◆ beginLuminosityBlock()

void SiPixelStatusProducer::beginLuminosityBlock ( edm::LuminosityBlock const &  lumiSeg,
const edm::EventSetup iSetup 
)
finalprivate

Definition at line 81 of file SiPixelStatusProducer.cc.

81  {
82  edm::LogInfo("SiPixelStatusProducer") << "beginlumi setup " << endl;
83 
84  if (countLumi_ == 0 && resetNLumi_ > 0) {
85  beginLumi_ = lumiSeg.luminosityBlock();
86  beginRun_ = lumiSeg.run();
87  ftotalevents = 0;
88  }
89 
90  // The es watcher is acutally not needed if run parallel jobs for each lumi section
92  trackerTopoWatcher_.check(iSetup)) {
94  const TrackerTopology* trackerTopology = &iSetup.getData(trackerTopologyToken_);
96 
97  coord_.init(trackerTopology, trackerGeometry_, fCablingMap_);
98 
100 
101  } // if conditionWatcher_.check(iSetup)
102 
103  // init the SiPixelDetectorStatus fDet and sensor size fSensors in the begining (when countLumi is zero)
104  if (countLumi_ == 0) {
105  for (TrackerGeometry::DetContainer::const_iterator it = trackerGeometry_->dets().begin();
106  it != trackerGeometry_->dets().end();
107  it++) {
108  const PixelGeomDetUnit* pgdu = dynamic_cast<const PixelGeomDetUnit*>((*it));
109  if (pgdu == nullptr)
110  continue;
111  DetId detId = (*it)->geographicalId();
112  int detid = detId.rawId();
113 
114  // don't want to use magic number row 80 column 52
115  const PixelTopology* topo = static_cast<const PixelTopology*>(&pgdu->specificTopology());
116  int rowsperroc = topo->rowsperroc();
117  int colsperroc = topo->colsperroc();
118 
119  int nROCrows = pgdu->specificTopology().nrows() / rowsperroc;
120  int nROCcolumns = pgdu->specificTopology().ncolumns() / colsperroc;
121  int nrocs = nROCrows * nROCcolumns;
122 
123  fDet.addModule(detid, nrocs);
124 
125  fSensors[detid] = std::make_pair(rowsperroc, colsperroc);
126  fSensorLayout[detid] = std::make_pair(nROCrows, nROCcolumns);
127 
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;
133  // encode irow, icol
134  int key = indexROC(irow, icol, nROCcolumns);
135 
136  int roc(-1), rocR(-1), rocC(-1);
137  onlineRocColRow(detId, dummyOfflineRow, dummeOfflineColumn, roc, rocR, rocC);
138 
139  int value = roc;
140  rocIdMap[key] = value;
141  }
142  }
143 
144  fRocIds[detid] = rocIdMap;
145  }
146 
147  } // init when countLumi = 0
148 
149  FEDerror25_.clear();
150  countLumi_++;
151 }

References SiPixelDetectorStatus::addModule(), beginLumi_, beginRun_, edm::ESWatcher< T >::check(), PixelTopology::colsperroc(), coord_, countLumi_, SiPixelFedCablingMap::det2fedMap(), TrackerGeometry::dets(), fCablingMap_, fDet, FEDerror25_, fFedIds, fRocIds, fSensorLayout, fSensors, ftotalevents, edm::EventSetup::getData(), indexROC(), SiPixelCoordinates::init(), crabWrapper::key, edm::LuminosityBlockBase::luminosityBlock(), PixelTopology::ncolumns(), DeadROCCounter::nrocs, PixelTopology::nrows(), onlineRocColRow(), DetId::rawId(), resetNLumi_, PixelMapPlotter::roc, PixelTopology::rowsperroc(), edm::LuminosityBlockBase::run(), siPixelFedCablingMapToken_, siPixelFedCablingMapWatcher_, PixelGeomDetUnit::specificTopology(), trackerDIGIGeoWatcher_, trackerGeometry_, trackerGeometryToken_, trackerTopologyToken_, trackerTopoWatcher_, and relativeConstraints::value.

◆ endLuminosityBlock()

void SiPixelStatusProducer::endLuminosityBlock ( edm::LuminosityBlock const &  lumiSeg,
const edm::EventSetup  
)
finalprivate

Definition at line 299 of file SiPixelStatusProducer.cc.

299 {}

◆ endLuminosityBlockProduce()

void SiPixelStatusProducer::endLuminosityBlockProduce ( edm::LuminosityBlock lumiSeg,
const edm::EventSetup  
)
finalprivate

Definition at line 302 of file SiPixelStatusProducer.cc.

302  {
303  edm::LogInfo("SiPixelStatusProducer") << "endlumi producer " << endl;
304 
305  endLumi_ = lumiSeg.luminosityBlock();
306  endRun_ = lumiSeg.run();
307 
308  // check if countLumi_ is large enough to read out/save data and reset for the next round
309  if (resetNLumi_ == -1)
310  return;
311  if (countLumi_ < resetNLumi_)
312  return;
313 
314  // set the FEDerror25 flag to be true for ROCs send out FEDerror25 for all events in the lumi section
315  if (!FEDerror25_.empty()) {
316  std::map<int, std::vector<PixelFEDChannel>>::iterator itFEDerror25;
317  for (itFEDerror25 = FEDerror25_.begin(); itFEDerror25 != FEDerror25_.end(); itFEDerror25++) {
318  int detid = itFEDerror25->first;
319  std::vector<PixelFEDChannel> chs = itFEDerror25->second;
320  for (unsigned int ich = 0; ich < chs.size(); ich++) {
321  fDet.fillFEDerror25(detid, chs[ich]);
322  }
323  }
324  }
325 
329 
330  // save result
331  auto result = std::make_unique<SiPixelDetectorStatus>();
332  *result = fDet;
333 
334  // only save for the lumi sections with NON-ZERO events
335  lumiSeg.put(std::move(result), std::string("siPixelStatus"));
336  edm::LogInfo("SiPixelStatusProducer") << "new lumi-based data stored for run " << beginRun_ << " lumi from "
337  << beginLumi_ << " to " << endLumi_ << std::endl;
338 
339  // reset detector status and lumi-counter
341  countLumi_ = 0;
342  ftotalevents = 0;
343  FEDerror25_.clear();
344 }

References beginLumi_, beginRun_, countLumi_, endLumi_, endRun_, fDet, FEDerror25_, SiPixelDetectorStatus::fillFEDerror25(), ftotalevents, edm::LuminosityBlockBase::luminosityBlock(), eostools::move(), edm::LuminosityBlock::put(), SiPixelDetectorStatus::resetDetectorStatus(), resetNLumi_, mps_fire::result, edm::LuminosityBlockBase::run(), SiPixelDetectorStatus::setLSRange(), SiPixelDetectorStatus::setNevents(), SiPixelDetectorStatus::setRunRange(), and AlCaHLTBitMon_QueryRunRegistry::string.

◆ fillDescriptions()

void SiPixelStatusProducer::fillDescriptions ( edm::ConfigurationDescriptions descriptions)
static

Definition at line 392 of file SiPixelStatusProducer.cc.

392  {
393  // siPixelStatusProducer
395  {
397  psd0.addUntracked<int>("resetEveryNLumi", 1);
398  psd0.addUntracked<edm::InputTag>("pixelClusterLabel", edm::InputTag("siPixelClusters", "", "RECO"));
399  psd0.add<std::vector<edm::InputTag>>("badPixelFEDChannelCollections",
400  {
401  edm::InputTag("siPixelDigis"),
402  });
403  desc.add<edm::ParameterSetDescription>("SiPixelStatusProducerParameters", psd0);
404  }
405  descriptions.add("siPixelStatusProducer", desc);
406 }

References edm::ConfigurationDescriptions::add(), edm::ParameterSetDescription::add(), edm::ParameterSetDescription::addUntracked(), and HLT_2018_cff::InputTag.

◆ indexROC()

int SiPixelStatusProducer::indexROC ( int  irow,
int  icol,
int  nROCcolumns 
)
finalprivatevirtual

Definition at line 382 of file SiPixelStatusProducer.cc.

382  {
383  return int(icol + irow * nROCcolumns);
384 
385  // generate the folling roc index that is going to map with ROC id as
386  // 8 9 10 11 12 13 14 15
387  // 0 1 2 3 4 5 6 7
388 }

References createfilelist::int.

Referenced by accumulate(), and beginLuminosityBlock().

◆ onlineRocColRow()

void SiPixelStatusProducer::onlineRocColRow ( const DetId detId,
int  offlineRow,
int  offlineCol,
int &  roc,
int &  row,
int &  col 
)
finalprivatevirtual

Definition at line 347 of file SiPixelStatusProducer.cc.

348  {
349  int fedId = fFedIds[detId.rawId()];
350 
351  // from detector to cabling
353  sipixelobjects::DetectorIndex detector; //{detId.rawId(), offlineRow, offlineCol};
354  detector.rawId = detId.rawId();
355  detector.row = offlineRow;
356  detector.col = offlineCol;
357 
359  converter.toCabling(cabling, detector);
360 
361  // then one can construct local pixel
363  loc.dcol = cabling.dcol;
364  loc.pxid = cabling.pxid;
365  // and get local(online) row/column
366  sipixelobjects::LocalPixel locpixel(loc);
367  col = locpixel.rocCol();
368  row = locpixel.rocRow();
369  //sipixelobjects::CablingPathToDetUnit path = {(unsigned int) fedId, (unsigned int)cabling.link, (unsigned int)cabling.roc};
370  //const sipixelobjects::PixelROC *theRoc = fCablingMap_->findItem(path);
371  const sipixelobjects::PixelROC* theRoc = converter.toRoc(cabling.link, cabling.roc);
372  roc = theRoc->idInDetUnit();
373 
374  // has to be BPIX; has to be minus side; has to be half module
375  // for phase-I, there is no half module
376  if (detId.subdetId() == PixelSubdetector::PixelBarrel && coord_.side(detId) == 1 && coord_.half(detId)) {
377  roc += 8;
378  }
379 }

References cuy::col, coord_, sipixelobjects::ElectronicIndex::dcol, sipixelobjects::LocalPixel::DcolPxid::dcol, hgcalTestNeighbor_cfi::detector, fCablingMap_, l1tstage2_dqm_sourceclient-live_cfg::fedId, fFedIds, SiPixelCoordinates::half(), sipixelobjects::PixelROC::idInDetUnit(), sipixelobjects::ElectronicIndex::link, PixelSubdetector::PixelBarrel, sipixelobjects::ElectronicIndex::pxid, sipixelobjects::LocalPixel::DcolPxid::pxid, DetId::rawId(), sipixelobjects::ElectronicIndex::roc, PixelMapPlotter::roc, sipixelobjects::LocalPixel::rocCol(), sipixelobjects::LocalPixel::rocRow(), SiPixelCoordinates::side(), and DetId::subdetId().

Referenced by beginLuminosityBlock().

Member Data Documentation

◆ beginLumi_

int SiPixelStatusProducer::beginLumi_
private

◆ beginRun_

int SiPixelStatusProducer::beginRun_
private

Definition at line 59 of file SiPixelStatusProducer.h.

Referenced by beginLuminosityBlock(), and endLuminosityBlockProduce().

◆ coord_

SiPixelCoordinates SiPixelStatusProducer::coord_
private

Definition at line 80 of file SiPixelStatusProducer.h.

Referenced by beginLuminosityBlock(), and onlineRocColRow().

◆ countLumi_

int SiPixelStatusProducer::countLumi_
private

◆ endLumi_

int SiPixelStatusProducer::endLumi_
private

Definition at line 58 of file SiPixelStatusProducer.h.

Referenced by endLuminosityBlockProduce(), and SiPixelStatusProducer().

◆ endRun_

int SiPixelStatusProducer::endRun_
private

Definition at line 60 of file SiPixelStatusProducer.h.

Referenced by endLuminosityBlockProduce(), and SiPixelStatusProducer().

◆ fCablingMap_

const SiPixelFedCablingMap* SiPixelStatusProducer::fCablingMap_ = nullptr
private

Definition at line 65 of file SiPixelStatusProducer.h.

Referenced by beginLuminosityBlock(), and onlineRocColRow().

◆ fDet

SiPixelDetectorStatus SiPixelStatusProducer::fDet
private

◆ FEDerror25_

std::map<int, std::vector<PixelFEDChannel> > SiPixelStatusProducer::FEDerror25_
private

◆ fFedIds

std::unordered_map<uint32_t, unsigned int> SiPixelStatusProducer::fFedIds
private

Definition at line 87 of file SiPixelStatusProducer.h.

Referenced by beginLuminosityBlock(), and onlineRocColRow().

◆ fPixelClusterLabel_

edm::InputTag SiPixelStatusProducer::fPixelClusterLabel_
private

Definition at line 92 of file SiPixelStatusProducer.h.

Referenced by accumulate(), and SiPixelStatusProducer().

◆ fRocIds

std::map<int, std::map<int, int> > SiPixelStatusProducer::fRocIds
private

Definition at line 89 of file SiPixelStatusProducer.h.

Referenced by accumulate(), and beginLuminosityBlock().

◆ fSensorLayout

std::map<int, std::pair<int, int> > SiPixelStatusProducer::fSensorLayout
private

Definition at line 85 of file SiPixelStatusProducer.h.

Referenced by accumulate(), and beginLuminosityBlock().

◆ fSensors

std::map<int, std::pair<int, int> > SiPixelStatusProducer::fSensors
private

Definition at line 83 of file SiPixelStatusProducer.h.

Referenced by accumulate(), and beginLuminosityBlock().

◆ fSiPixelClusterToken_

edm::EDGetTokenT<edmNew::DetSetVector<SiPixelCluster> > SiPixelStatusProducer::fSiPixelClusterToken_
private

Definition at line 93 of file SiPixelStatusProducer.h.

Referenced by accumulate(), and SiPixelStatusProducer().

◆ ftotalevents

unsigned long int SiPixelStatusProducer::ftotalevents
private

◆ resetNLumi_

int SiPixelStatusProducer::resetNLumi_
private

◆ siPixelFedCablingMapToken_

edm::ESGetToken<SiPixelFedCablingMap, SiPixelFedCablingMapRcd> SiPixelStatusProducer::siPixelFedCablingMapToken_
private

Definition at line 76 of file SiPixelStatusProducer.h.

Referenced by beginLuminosityBlock().

◆ siPixelFedCablingMapWatcher_

edm::ESWatcher<SiPixelFedCablingMapRcd> SiPixelStatusProducer::siPixelFedCablingMapWatcher_
private

Definition at line 64 of file SiPixelStatusProducer.h.

Referenced by beginLuminosityBlock().

◆ theBadPixelFEDChannelsTokens_

std::vector<edm::EDGetTokenT<PixelFEDChannelCollection> > SiPixelStatusProducer::theBadPixelFEDChannelsTokens_
private

Definition at line 94 of file SiPixelStatusProducer.h.

Referenced by accumulate(), and SiPixelStatusProducer().

◆ trackerDIGIGeoWatcher_

edm::ESWatcher<TrackerDigiGeometryRecord> SiPixelStatusProducer::trackerDIGIGeoWatcher_
private

Definition at line 68 of file SiPixelStatusProducer.h.

Referenced by beginLuminosityBlock().

◆ trackerGeometry_

const TrackerGeometry* SiPixelStatusProducer::trackerGeometry_ = nullptr
private

Definition at line 69 of file SiPixelStatusProducer.h.

Referenced by beginLuminosityBlock().

◆ trackerGeometryToken_

edm::ESGetToken<TrackerGeometry, TrackerDigiGeometryRecord> SiPixelStatusProducer::trackerGeometryToken_
private

Definition at line 74 of file SiPixelStatusProducer.h.

Referenced by beginLuminosityBlock().

◆ trackerTopologyToken_

edm::ESGetToken<TrackerTopology, TrackerTopologyRcd> SiPixelStatusProducer::trackerTopologyToken_
private

Definition at line 75 of file SiPixelStatusProducer.h.

Referenced by beginLuminosityBlock().

◆ trackerTopoWatcher_

edm::ESWatcher<TrackerTopologyRcd> SiPixelStatusProducer::trackerTopoWatcher_
private

Definition at line 72 of file SiPixelStatusProducer.h.

Referenced by beginLuminosityBlock().

edm::ESWatcher::check
bool check(const edm::EventSetup &iSetup)
Definition: ESWatcher.h:52
SiPixelCoordinates::side
int side(const DetId &)
Definition: SiPixelCoordinates.cc:70
mps_fire.i
i
Definition: mps_fire.py:355
edm::ParameterSetDescription::add
ParameterDescriptionBase * add(U const &iLabel, T const &value)
Definition: ParameterSetDescription.h:95
SiPixelDetectorStatus::resetDetectorStatus
void resetDetectorStatus()
Definition: SiPixelDetectorStatus.h:66
SiPixelStatusProducer::fDet
SiPixelDetectorStatus fDet
Definition: SiPixelStatusProducer.h:100
PixelFEDChannel
Definition: PixelFEDChannel.h:6
PixelSubdetector::PixelBarrel
Definition: PixelSubdetector.h:11
SiPixelStatusProducer::siPixelFedCablingMapWatcher_
edm::ESWatcher< SiPixelFedCablingMapRcd > siPixelFedCablingMapWatcher_
Definition: SiPixelStatusProducer.h:64
SiPixelStatusProducer::theBadPixelFEDChannelsTokens_
std::vector< edm::EDGetTokenT< PixelFEDChannelCollection > > theBadPixelFEDChannelsTokens_
Definition: SiPixelStatusProducer.h:94
converter
Definition: CandidateProducer.h:25
edm::EDGetTokenT
Definition: EDGetToken.h:33
PixelTopology::colsperroc
virtual int colsperroc() const =0
SiPixelStatusProducer::ftotalevents
unsigned long int ftotalevents
Definition: SiPixelStatusProducer.h:53
TrackerTopology
Definition: TrackerTopology.h:16
SiPixelStatusProducer::resetNLumi_
int resetNLumi_
Definition: SiPixelStatusProducer.h:54
cuy.col
col
Definition: cuy.py:1010
edm::LogInfo
Definition: MessageLogger.h:254
edm::ParameterSetDescription
Definition: ParameterSetDescription.h:52
SiPixelStatusProducer::fSiPixelClusterToken_
edm::EDGetTokenT< edmNew::DetSetVector< SiPixelCluster > > fSiPixelClusterToken_
Definition: SiPixelStatusProducer.h:93
SiPixelCoordinates::half
int half(const DetId &)
Definition: SiPixelCoordinates.cc:147
SiPixelStatusProducer::endLumi_
int endLumi_
Definition: SiPixelStatusProducer.h:58
SiPixelStatusProducer::trackerGeometryToken_
edm::ESGetToken< TrackerGeometry, TrackerDigiGeometryRecord > trackerGeometryToken_
Definition: SiPixelStatusProducer.h:74
sipixelobjects::ElectronicIndex::dcol
int dcol
Definition: ElectronicIndex.h:8
SiPixelDetectorStatus::setLSRange
void setLSRange(int ls0, int ls1)
Definition: SiPixelDetectorStatus.h:56
edm::LuminosityBlockBase::run
RunNumber_t run() const
Definition: LuminosityBlockBase.h:42
SiPixelStatusProducer::fSensorLayout
std::map< int, std::pair< int, int > > fSensorLayout
Definition: SiPixelStatusProducer.h:85
edm::Handle
Definition: AssociativeIterator.h:50
SiPixelStatusProducer::fSensors
std::map< int, std::pair< int, int > > fSensors
Definition: SiPixelStatusProducer.h:83
sipixelobjects::LocalPixel
identify pixel inside single ROC
Definition: LocalPixel.h:7
SiPixelStatusProducer::trackerTopoWatcher_
edm::ESWatcher< TrackerTopologyRcd > trackerTopoWatcher_
Definition: SiPixelStatusProducer.h:72
SiPixelStatusProducer::fCablingMap_
const SiPixelFedCablingMap * fCablingMap_
Definition: SiPixelStatusProducer.h:65
SiPixelStatusProducer::trackerTopologyToken_
edm::ESGetToken< TrackerTopology, TrackerTopologyRcd > trackerTopologyToken_
Definition: SiPixelStatusProducer.h:75
SiPixelDetectorStatus::addModule
void addModule(int detid, int nrocs)
Definition: SiPixelDetectorStatus.cc:105
DetId
Definition: DetId.h:17
SiPixelCoordinates::init
void init(const TrackerTopology *, const TrackerGeometry *, const SiPixelFedCablingMap *)
Definition: SiPixelCoordinates.cc:30
edm::ConfigurationDescriptions::add
void add(std::string const &label, ParameterSetDescription const &psetDescription)
Definition: ConfigurationDescriptions.cc:57
edm::LuminosityBlockBase::luminosityBlock
LuminosityBlockNumber_t luminosityBlock() const
Definition: LuminosityBlockBase.h:40
PixelGeomDetUnit
Definition: PixelGeomDetUnit.h:15
SiPixelDetectorStatus::fillDIGI
void fillDIGI(int detid, int roc)
Definition: SiPixelDetectorStatus.cc:114
SiPixelStatusProducer::siPixelFedCablingMapToken_
edm::ESGetToken< SiPixelFedCablingMap, SiPixelFedCablingMapRcd > siPixelFedCablingMapToken_
Definition: SiPixelStatusProducer.h:76
SiPixelStatusProducer::trackerGeometry_
const TrackerGeometry * trackerGeometry_
Definition: SiPixelStatusProducer.h:69
PixelTopology::ncolumns
virtual int ncolumns() const =0
sipixelobjects::ElectronicIndex::pxid
int pxid
Definition: ElectronicIndex.h:9
PixelFEDChannel::link
unsigned int link
Definition: PixelFEDChannel.h:7
SiPixelStatusProducer::beginRun_
int beginRun_
Definition: SiPixelStatusProducer.h:59
OrderedSet.t
t
Definition: OrderedSet.py:90
PixelTopology
Definition: PixelTopology.h:10
sipixelobjects::ElectronicIndex
Definition: ElectronicIndex.h:5
DetId::subdetId
constexpr int subdetId() const
get the contents of the subdetector field (not cast into any detector's numbering enum)
Definition: DetId.h:48
sipixelobjects::ElectronicIndex::link
int link
Definition: ElectronicIndex.h:6
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
PixelFEDChannel::fed
unsigned int fed
Definition: PixelFEDChannel.h:7
edm::LogWarning
Definition: MessageLogger.h:141
bsc_activity_cfg.clusters
clusters
Definition: bsc_activity_cfg.py:36
SiPixelDetectorStatus::fillFEDerror25
void fillFEDerror25(int detid, PixelFEDChannel ch)
Definition: SiPixelDetectorStatus.cc:120
edm::ParameterSetDescription::addUntracked
ParameterDescriptionBase * addUntracked(U const &iLabel, T const &value)
Definition: ParameterSetDescription.h:100
HLT_2018_cff.InputTag
InputTag
Definition: HLT_2018_cff.py:79016
edm::ParameterSet
Definition: ParameterSet.h:36
SiPixelStatusProducer::onlineRocColRow
virtual void onlineRocColRow(const DetId &detId, int offlineRow, int offlineCol, int &roc, int &row, int &col) final
Definition: SiPixelStatusProducer.cc:347
SiPixelFedCablingMap::det2fedMap
std::unordered_map< uint32_t, unsigned int > det2fedMap() const final
Definition: SiPixelFedCablingMap.cc:133
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
SiPixelDetectorStatus::setNevents
void setNevents(unsigned long int N)
Definition: SiPixelDetectorStatus.h:63
PixelGeomDetUnit::specificTopology
virtual const PixelTopology & specificTopology() const
Returns a reference to the pixel proxy topology.
Definition: PixelGeomDetUnit.cc:17
createfilelist.int
int
Definition: createfilelist.py:10
iEvent
int iEvent
Definition: GenABIO.cc:224
value
Definition: value.py:1
SiPixelStatusProducer::fFedIds
std::unordered_map< uint32_t, unsigned int > fFedIds
Definition: SiPixelStatusProducer.h:87
SiPixelFrameConverter
Definition: SiPixelFrameConverter.h:15
TrackerGeometry::dets
const DetContainer & dets() const override
Returm a vector of all GeomDet (including all GeomDetUnits)
Definition: TrackerGeometry.h:62
l1tstage2_dqm_sourceclient-live_cfg.fedId
fedId
Definition: l1tstage2_dqm_sourceclient-live_cfg.py:82
SiPixelStatusProducer::endRun_
int endRun_
Definition: SiPixelStatusProducer.h:60
PixelTopology::rowsperroc
virtual int rowsperroc() const =0
edm::LuminosityBlock::put
void put(std::unique_ptr< PROD > product)
Put a new product.
Definition: LuminosityBlock.h:115
edm::EventSetup::getData
bool getData(T &iHolder) const
Definition: EventSetup.h:113
SiPixelStatusProducer::coord_
SiPixelCoordinates coord_
Definition: SiPixelStatusProducer.h:80
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
sipixelobjects::PixelROC
Definition: PixelROC.h:23
eostools.move
def move(src, dest)
Definition: eostools.py:511
DetId::rawId
constexpr uint32_t rawId() const
get the raw id
Definition: DetId.h:57
SiPixelStatusProducer::fPixelClusterLabel_
edm::InputTag fPixelClusterLabel_
Definition: SiPixelStatusProducer.h:92
SiPixelStatusProducer::beginLumi_
int beginLumi_
Definition: SiPixelStatusProducer.h:57
relativeConstraints.value
value
Definition: relativeConstraints.py:53
DeadROCCounter.nrocs
nrocs
Definition: DeadROCCounter.py:57
SiPixelStatusProducer::indexROC
virtual int indexROC(int irow, int icol, int nROCcolumns) final
Definition: SiPixelStatusProducer.cc:382
PixelMapPlotter.roc
roc
Definition: PixelMapPlotter.py:498
SiPixelStatusProducer::FEDerror25_
std::map< int, std::vector< PixelFEDChannel > > FEDerror25_
Definition: SiPixelStatusProducer.h:97
hgcalTestNeighbor_cfi.detector
detector
Definition: hgcalTestNeighbor_cfi.py:6
SiPixelStatusProducer::trackerDIGIGeoWatcher_
edm::ESWatcher< TrackerDigiGeometryRecord > trackerDIGIGeoWatcher_
Definition: SiPixelStatusProducer.h:68
SiPixelStatusProducer::countLumi_
int countLumi_
Definition: SiPixelStatusProducer.h:55
SiPixelDetectorStatus::setRunRange
void setRunRange(int run0, int run1)
Definition: SiPixelDetectorStatus.h:51
mps_fire.result
result
Definition: mps_fire.py:303
edm::HandleBase::isValid
bool isValid() const
Definition: HandleBase.h:70
PixelTopology::nrows
virtual int nrows() const =0
crabWrapper.key
key
Definition: crabWrapper.py:19
edm::InputTag
Definition: InputTag.h:15
SiPixelStatusProducer::fRocIds
std::map< int, std::map< int, int > > fRocIds
Definition: SiPixelStatusProducer.h:89
sipixelobjects::PixelROC::idInDetUnit
unsigned int idInDetUnit() const
id of this ROC in DetUnit etermined by token path
Definition: PixelROC.h:37
sipixelobjects::LocalPixel::DcolPxid::dcol
int dcol
Definition: LocalPixel.h:20
sipixelobjects::DetectorIndex
Definition: DetectorIndex.h:6
sipixelobjects::ElectronicIndex::roc
int roc
Definition: ElectronicIndex.h:7