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
 
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)
 
 ~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 const &)=delete
 
 EDConsumerBase (EDConsumerBase &&)=default
 
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
 
EDConsumerBase const & operator= (EDConsumerBase const &)=delete
 
EDConsumerBaseoperator= (EDConsumerBase &&)=default
 
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 &iSetup) final
 
void beginLuminosityBlock (edm::LuminosityBlock const &lumiSeg, const edm::EventSetup &iSetup) final
 
void endLuminosityBlock (edm::LuminosityBlock const &lumiSeg, const edm::EventSetup &iSetup) final
 
void endLuminosityBlockProduce (edm::LuminosityBlock &lumiSeg, const edm::EventSetup &iSetup) 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_
 
edm::ESHandle< SiPixelFedCablingMapfCablingMap
 
const SiPixelFedCablingMapfCablingMap_
 
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_
 
edm::ESHandle< TrackerGeometryfTG
 
unsigned long int ftotalevents
 
int resetNLumi_
 
edm::ESWatcher< SiPixelFedCablingMapRcdsiPixelFedCablingMapWatcher_
 
std::vector< edm::EDGetTokenT< PixelFEDChannelCollection > > theBadPixelFEDChannelsTokens_
 
edm::ESWatcher< TrackerDigiGeometryRecordtrackerDIGIGeoWatcher_
 
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
ProducesCollector producesCollector ()
 
- 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 ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes ()
 
template<typename ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes (ESInputTag const &tag)
 
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


class: SiPixelStatusProducer.h package: CalibTracker/SiPixelQuality


Definition at line 31 of file SiPixelStatusProducer.h.

Constructor & Destructor Documentation

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

Definition at line 48 of file SiPixelStatusProducer.cc.

References edm::ParameterSet::getParameter(), and OrderedSet::t.

48  {
49  // get parameter
50 
51  // badPixelFEDChannelCollections
52  std::vector<edm::InputTag> badPixelFEDChannelCollectionLabels_ =
53  iConfig.getParameter<edm::ParameterSet>("SiPixelStatusProducerParameters")
54  .getParameter<std::vector<edm::InputTag>>("badPixelFEDChannelCollections");
55  for (auto& t : badPixelFEDChannelCollectionLabels_)
56  theBadPixelFEDChannelsTokens_.push_back(consumes<PixelFEDChannelCollection>(t));
57  // badPixelFEDChannelCollections = cms.VInputTag(cms.InputTag('siPixelDigis'))
58 
59  fPixelClusterLabel_ = iConfig.getParameter<edm::ParameterSet>("SiPixelStatusProducerParameters")
60  .getUntrackedParameter<edm::InputTag>("pixelClusterLabel");
61  fSiPixelClusterToken_ = consumes<edmNew::DetSetVector<SiPixelCluster>>(fPixelClusterLabel_);
62  resetNLumi_ = iConfig.getParameter<edm::ParameterSet>("SiPixelStatusProducerParameters")
63  .getUntrackedParameter<int>("resetEveryNLumi", 1);
64 
65  ftotalevents = 0;
66  countLumi_ = 0;
67 
68  beginLumi_ = endLumi_ = -1;
69  endLumi_ = endRun_ = -1;
70 
71  produces<SiPixelDetectorStatus, edm::Transition::EndLuminosityBlock>("siPixelStatus");
72 }
T getParameter(std::string const &) const
std::vector< edm::EDGetTokenT< PixelFEDChannelCollection > > theBadPixelFEDChannelsTokens_
edm::EDGetTokenT< edmNew::DetSetVector< SiPixelCluster > > fSiPixelClusterToken_
unsigned long int ftotalevents
SiPixelStatusProducer::~SiPixelStatusProducer ( )
override

Definition at line 75 of file SiPixelStatusProducer.cc.

75 {}

Member Function Documentation

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

Definition at line 148 of file SiPixelStatusProducer.cc.

References bsc_activity_cfg::clusters, PixelFEDChannel::fed, edm::Event::getByToken(), mps_fire::i, edm::HandleBase::isValid(), crabWrapper::key, PixelFEDChannel::link, DetId::rawId(), and PixelMapPlotter::roc.

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

Definition at line 78 of file SiPixelStatusProducer.cc.

References PixelTopology::colsperroc(), edm::EventSetup::get(), crabWrapper::key, edm::LuminosityBlockBase::luminosityBlock(), PixelTopology::ncolumns(), DeadROCCounter::nrocs, PixelTopology::nrows(), DetId::rawId(), PixelMapPlotter::roc, PixelTopology::rowsperroc(), edm::LuminosityBlockBase::run(), PixelGeomDetUnit::specificTopology(), and relativeConstraints::value.

78  {
79  edm::LogInfo("SiPixelStatusProducer") << "beginlumi setup " << endl;
80 
81  if (countLumi_ == 0 && resetNLumi_ > 0) {
82  beginLumi_ = lumiSeg.luminosityBlock();
83  beginRun_ = lumiSeg.run();
84  ftotalevents = 0;
85  }
86 
87  // The es watcher is acutally not needed if run parallel jobs for each lumi section
89  trackerTopoWatcher_.check(iSetup)) {
90  coord_.init(iSetup);
93  iSetup.get<TrackerDigiGeometryRecord>().get(fTG);
94 
96 
97  } // if conditionWatcher_.check(iSetup)
98 
99  // init the SiPixelDetectorStatus fDet and sensor size fSensors in the begining (when countLumi is zero)
100  if (countLumi_ == 0) {
101  for (TrackerGeometry::DetContainer::const_iterator it = fTG->dets().begin(); it != fTG->dets().end(); it++) {
102  const PixelGeomDetUnit* pgdu = dynamic_cast<const PixelGeomDetUnit*>((*it));
103  if (pgdu == nullptr)
104  continue;
105  DetId detId = (*it)->geographicalId();
106  int detid = detId.rawId();
107 
108  // don't want to use magic number row 80 column 52
109  const PixelTopology* topo = static_cast<const PixelTopology*>(&pgdu->specificTopology());
110  int rowsperroc = topo->rowsperroc();
111  int colsperroc = topo->colsperroc();
112 
113  int nROCrows = pgdu->specificTopology().nrows() / rowsperroc;
114  int nROCcolumns = pgdu->specificTopology().ncolumns() / colsperroc;
115  int nrocs = nROCrows * nROCcolumns;
116 
117  fDet.addModule(detid, nrocs);
118 
119  fSensors[detid] = std::make_pair(rowsperroc, colsperroc);
120  fSensorLayout[detid] = std::make_pair(nROCrows, nROCcolumns);
121 
122  std::map<int, int> rocIdMap;
123  for (int irow = 0; irow < nROCrows; irow++) {
124  for (int icol = 0; icol < nROCcolumns; icol++) {
125  int dummyOfflineRow = (rowsperroc / 2 - 1) + irow * rowsperroc;
126  int dummeOfflineColumn = (colsperroc / 2 - 1) + icol * colsperroc;
127  // encode irow, icol
128  int key = indexROC(irow, icol, nROCcolumns);
129 
130  int roc(-1), rocR(-1), rocC(-1);
131  onlineRocColRow(detId, dummyOfflineRow, dummeOfflineColumn, roc, rocR, rocC);
132 
133  int value = roc;
134  rocIdMap[key] = value;
135  }
136  }
137 
138  fRocIds[detid] = rocIdMap;
139  }
140 
141  } // init when countLumi = 0
142 
143  FEDerror25_.clear();
144  countLumi_++;
145 }
void addModule(int detid, int nrocs)
virtual int nrows() const =0
virtual int rowsperroc() const =0
void init(edm::EventSetup const &)
edm::ESHandle< TrackerGeometry > fTG
constexpr uint32_t rawId() const
get the raw id
Definition: DetId.h:57
edm::ESWatcher< TrackerDigiGeometryRecord > trackerDIGIGeoWatcher_
edm::ESWatcher< TrackerTopologyRcd > trackerTopoWatcher_
std::map< int, std::pair< int, int > > fSensorLayout
const DetContainer & dets() const override
Returm a vector of all GeomDet (including all GeomDetUnits)
edm::ESHandle< SiPixelFedCablingMap > fCablingMap
virtual int colsperroc() const =0
virtual void onlineRocColRow(const DetId &detId, int offlineRow, int offlineCol, int &roc, int &row, int &col) final
Definition: value.py:1
std::unordered_map< uint32_t, unsigned int > fFedIds
std::unordered_map< uint32_t, unsigned int > det2fedMap() const final
std::map< int, std::pair< int, int > > fSensors
SiPixelDetectorStatus fDet
Definition: DetId.h:17
unsigned long int ftotalevents
virtual const PixelTopology & specificTopology() const
Returns a reference to the pixel proxy topology.
edm::ESWatcher< SiPixelFedCablingMapRcd > siPixelFedCablingMapWatcher_
bool check(const edm::EventSetup &iSetup)
Definition: ESWatcher.h:52
std::map< int, std::vector< PixelFEDChannel > > FEDerror25_
virtual int ncolumns() const =0
T get() const
Definition: EventSetup.h:73
const SiPixelFedCablingMap * fCablingMap_
virtual int indexROC(int irow, int icol, int nROCcolumns) final
std::map< int, std::map< int, int > > fRocIds
T const * product() const
Definition: ESHandle.h:86
SiPixelCoordinates coord_
void SiPixelStatusProducer::endLuminosityBlock ( edm::LuminosityBlock const &  lumiSeg,
const edm::EventSetup iSetup 
)
finalprivate

Definition at line 293 of file SiPixelStatusProducer.cc.

293 {}
void SiPixelStatusProducer::endLuminosityBlockProduce ( edm::LuminosityBlock lumiSeg,
const edm::EventSetup iSetup 
)
finalprivate

Definition at line 296 of file SiPixelStatusProducer.cc.

References edm::LuminosityBlockBase::luminosityBlock(), eostools::move(), edm::LuminosityBlock::put(), mps_fire::result, edm::LuminosityBlockBase::run(), and AlCaHLTBitMon_QueryRunRegistry::string.

296  {
297  edm::LogInfo("SiPixelStatusProducer") << "endlumi producer " << endl;
298 
299  endLumi_ = lumiSeg.luminosityBlock();
300  endRun_ = lumiSeg.run();
301 
302  // check if countLumi_ is large enough to read out/save data and reset for the next round
303  if (resetNLumi_ == -1)
304  return;
305  if (countLumi_ < resetNLumi_)
306  return;
307 
308  // set the FEDerror25 flag to be true for ROCs send out FEDerror25 for all events in the lumi section
309  if (!FEDerror25_.empty()) {
310  std::map<int, std::vector<PixelFEDChannel>>::iterator itFEDerror25;
311  for (itFEDerror25 = FEDerror25_.begin(); itFEDerror25 != FEDerror25_.end(); itFEDerror25++) {
312  int detid = itFEDerror25->first;
313  std::vector<PixelFEDChannel> chs = itFEDerror25->second;
314  for (unsigned int ich = 0; ich < chs.size(); ich++) {
315  fDet.fillFEDerror25(detid, chs[ich]);
316  }
317  }
318  }
319 
323 
324  // save result
325  auto result = std::make_unique<SiPixelDetectorStatus>();
326  *result = fDet;
327 
328  // only save for the lumi sections with NON-ZERO events
329  lumiSeg.put(std::move(result), std::string("siPixelStatus"));
330  edm::LogInfo("SiPixelStatusProducer") << "new lumi-based data stored for run " << beginRun_ << " lumi from "
331  << beginLumi_ << " to " << endLumi_ << std::endl;
332 
333  // reset detector status and lumi-counter
335  countLumi_ = 0;
336  ftotalevents = 0;
337  FEDerror25_.clear();
338 }
void fillFEDerror25(int detid, PixelFEDChannel ch)
LuminosityBlockNumber_t luminosityBlock() const
void setNevents(unsigned long int N)
void put(std::unique_ptr< PROD > product)
Put a new product.
RunNumber_t run() const
void setLSRange(int ls0, int ls1)
SiPixelDetectorStatus fDet
unsigned long int ftotalevents
void setRunRange(int run0, int run1)
std::map< int, std::vector< PixelFEDChannel > > FEDerror25_
def move(src, dest)
Definition: eostools.py:511
void SiPixelStatusProducer::fillDescriptions ( edm::ConfigurationDescriptions descriptions)
static

Definition at line 386 of file SiPixelStatusProducer.cc.

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

386  {
387  // siPixelStatusProducer
389  {
391  psd0.addUntracked<int>("resetEveryNLumi", 1);
392  psd0.addUntracked<edm::InputTag>("pixelClusterLabel", edm::InputTag("siPixelClusters", "", "RECO"));
393  psd0.add<std::vector<edm::InputTag>>("badPixelFEDChannelCollections",
394  {
395  edm::InputTag("siPixelDigis"),
396  });
397  desc.add<edm::ParameterSetDescription>("SiPixelStatusProducerParameters", psd0);
398  }
399  descriptions.add("siPixelStatusProducer", desc);
400 }
ParameterDescriptionBase * addUntracked(U const &iLabel, T const &value)
ParameterDescriptionBase * add(U const &iLabel, T const &value)
void add(std::string const &label, ParameterSetDescription const &psetDescription)
int SiPixelStatusProducer::indexROC ( int  irow,
int  icol,
int  nROCcolumns 
)
finalprivatevirtual

Definition at line 376 of file SiPixelStatusProducer.cc.

References createfilelist::int.

376  {
377  return int(icol + irow * nROCcolumns);
378 
379  // generate the folling roc index that is going to map with ROC id as
380  // 8 9 10 11 12 13 14 15
381  // 0 1 2 3 4 5 6 7
382 }
void SiPixelStatusProducer::onlineRocColRow ( const DetId detId,
int  offlineRow,
int  offlineCol,
int &  roc,
int &  row,
int &  col 
)
finalprivatevirtual

Definition at line 341 of file SiPixelStatusProducer.cc.

References sipixelobjects::DetectorIndex::col, sipixelobjects::ElectronicIndex::dcol, sipixelobjects::LocalPixel::DcolPxid::dcol, hgcalTestNeighbor_cfi::detector, l1tstage2_dqm_sourceclient-live_cfg::fedId, sipixelobjects::PixelROC::idInDetUnit(), sipixelobjects::ElectronicIndex::link, PixelSubdetector::PixelBarrel, sipixelobjects::ElectronicIndex::pxid, sipixelobjects::LocalPixel::DcolPxid::pxid, sipixelobjects::DetectorIndex::rawId, DetId::rawId(), sipixelobjects::ElectronicIndex::roc, sipixelobjects::LocalPixel::rocCol(), sipixelobjects::LocalPixel::rocRow(), sipixelobjects::DetectorIndex::row, DetId::subdetId(), SiPixelFrameConverter::toCabling(), and SiPixelFrameConverter::toRoc().

342  {
343  int fedId = fFedIds[detId.rawId()];
344 
345  // from detector to cabling
347  sipixelobjects::DetectorIndex detector; //{detId.rawId(), offlineRow, offlineCol};
348  detector.rawId = detId.rawId();
349  detector.row = offlineRow;
350  detector.col = offlineCol;
351 
353  converter.toCabling(cabling, detector);
354 
355  // then one can construct local pixel
357  loc.dcol = cabling.dcol;
358  loc.pxid = cabling.pxid;
359  // and get local(online) row/column
360  sipixelobjects::LocalPixel locpixel(loc);
361  col = locpixel.rocCol();
362  row = locpixel.rocRow();
363  //sipixelobjects::CablingPathToDetUnit path = {(unsigned int) fedId, (unsigned int)cabling.link, (unsigned int)cabling.roc};
364  //const sipixelobjects::PixelROC *theRoc = fCablingMap->findItem(path);
365  const sipixelobjects::PixelROC* theRoc = converter.toRoc(cabling.link, cabling.roc);
366  roc = theRoc->idInDetUnit();
367 
368  // has to be BPIX; has to be minus side; has to be half module
369  // for phase-I, there is no half module
370  if (detId.subdetId() == PixelSubdetector::PixelBarrel && coord_.side(detId) == 1 && coord_.half(detId)) {
371  roc += 8;
372  }
373 }
int side(const DetId &)
constexpr uint32_t rawId() const
get the raw id
Definition: DetId.h:57
identify pixel inside single ROC
Definition: LocalPixel.h:7
int half(const DetId &)
unsigned int idInDetUnit() const
id of this ROC in DetUnit etermined by token path
Definition: PixelROC.h:37
constexpr int subdetId() const
get the contents of the subdetector field (not cast into any detector&#39;s numbering enum) ...
Definition: DetId.h:48
std::unordered_map< uint32_t, unsigned int > fFedIds
double collumn and pixel ID in double collumn representation
Definition: LocalPixel.h:19
const SiPixelFedCablingMap * fCablingMap_
col
Definition: cuy.py:1010
SiPixelCoordinates coord_

Member Data Documentation

int SiPixelStatusProducer::beginLumi_
private

Definition at line 54 of file SiPixelStatusProducer.h.

int SiPixelStatusProducer::beginRun_
private

Definition at line 56 of file SiPixelStatusProducer.h.

SiPixelCoordinates SiPixelStatusProducer::coord_
private

Definition at line 73 of file SiPixelStatusProducer.h.

int SiPixelStatusProducer::countLumi_
private

Definition at line 52 of file SiPixelStatusProducer.h.

int SiPixelStatusProducer::endLumi_
private

Definition at line 55 of file SiPixelStatusProducer.h.

int SiPixelStatusProducer::endRun_
private

Definition at line 57 of file SiPixelStatusProducer.h.

edm::ESHandle<SiPixelFedCablingMap> SiPixelStatusProducer::fCablingMap
private

Definition at line 62 of file SiPixelStatusProducer.h.

const SiPixelFedCablingMap* SiPixelStatusProducer::fCablingMap_
private

Definition at line 63 of file SiPixelStatusProducer.h.

SiPixelDetectorStatus SiPixelStatusProducer::fDet
private

Definition at line 93 of file SiPixelStatusProducer.h.

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

Definition at line 90 of file SiPixelStatusProducer.h.

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

Definition at line 80 of file SiPixelStatusProducer.h.

edm::InputTag SiPixelStatusProducer::fPixelClusterLabel_
private

Definition at line 85 of file SiPixelStatusProducer.h.

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

Definition at line 82 of file SiPixelStatusProducer.h.

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

Definition at line 78 of file SiPixelStatusProducer.h.

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

Definition at line 76 of file SiPixelStatusProducer.h.

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

Definition at line 86 of file SiPixelStatusProducer.h.

edm::ESHandle<TrackerGeometry> SiPixelStatusProducer::fTG
private

Definition at line 67 of file SiPixelStatusProducer.h.

unsigned long int SiPixelStatusProducer::ftotalevents
private

Definition at line 50 of file SiPixelStatusProducer.h.

int SiPixelStatusProducer::resetNLumi_
private

Definition at line 51 of file SiPixelStatusProducer.h.

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

Definition at line 61 of file SiPixelStatusProducer.h.

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

Definition at line 87 of file SiPixelStatusProducer.h.

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

Definition at line 66 of file SiPixelStatusProducer.h.

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

Definition at line 69 of file SiPixelStatusProducer.h.