CMS 3D CMS Logo

List of all members | 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 hasAbilityToProduceInLumis () const final
 
bool hasAbilityToProduceInRuns () 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
 
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)
 
virtual ~EDConsumerBase () noexcept(false)
 

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
 
- Static Public Member Functions inherited from edm::one::EDProducerBase
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


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 54 of file SiPixelStatusProducer.cc.

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

54  {
55  // get parameter
56 
57  // badPixelFEDChannelCollections
58  std::vector<edm::InputTag> badPixelFEDChannelCollectionLabels_ = iConfig.getParameter<edm::ParameterSet>("SiPixelStatusProducerParameters").getParameter<std::vector<edm::InputTag> >("badPixelFEDChannelCollections");
59  for (auto &t : badPixelFEDChannelCollectionLabels_)
60  theBadPixelFEDChannelsTokens_.push_back(consumes<PixelFEDChannelCollection>(t));
61  // badPixelFEDChannelCollections = cms.VInputTag(cms.InputTag('siPixelDigis'))
62 
63  fPixelClusterLabel_ = iConfig.getParameter<edm::ParameterSet>("SiPixelStatusProducerParameters").getUntrackedParameter<edm::InputTag>("pixelClusterLabel");
64  fSiPixelClusterToken_ = consumes<edmNew::DetSetVector<SiPixelCluster>>(fPixelClusterLabel_);
65  resetNLumi_ = iConfig.getParameter<edm::ParameterSet>("SiPixelStatusProducerParameters").getUntrackedParameter<int>("resetEveryNLumi",1);
66 
67  ftotalevents = 0;
68  countLumi_ = 0;
69 
70  beginLumi_ = endLumi_ = -1;
71  endLumi_ = endRun_ = -1;
72 
73  produces<SiPixelDetectorStatus, edm::Transition::EndLuminosityBlock>("siPixelStatus");
74 }
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 77 of file SiPixelStatusProducer.cc.

77  {
78 
79 }

Member Function Documentation

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

Definition at line 161 of file SiPixelStatusProducer.cc.

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

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

Definition at line 82 of file SiPixelStatusProducer.cc.

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

82  {
83 
84  edm::LogInfo("SiPixelStatusProducer")
85  << "beginlumi setup "<<endl;
86 
87  if ( countLumi_ == 0 && resetNLumi_ > 0 ) {
88 
89  beginLumi_ = lumiSeg.luminosityBlock();
90  beginRun_ = lumiSeg.run();
91  ftotalevents = 0;
92 
93  }
94 
95  // The es watcher is acutally not needed if run parallel jobs for each lumi section
97 
98  coord_.init(iSetup);
101  iSetup.get<TrackerDigiGeometryRecord>().get(fTG);
102 
104 
105  } // if conditionWatcher_.check(iSetup)
106 
107  // init the SiPixelDetectorStatus fDet and sensor size fSensors in the begining (when countLumi is zero)
108  if(countLumi_ == 0){
109 
110  for (TrackerGeometry::DetContainer::const_iterator it = fTG->dets().begin(); it != fTG->dets().end(); it++){
111 
112  const PixelGeomDetUnit *pgdu = dynamic_cast<const PixelGeomDetUnit*>((*it));
113  if (pgdu == nullptr) continue;
114  DetId detId = (*it)->geographicalId();
115  int detid = detId.rawId();
116 
117  // don't want to use magic number row 80 column 52
118  const PixelTopology* topo = static_cast<const PixelTopology*>(&pgdu->specificTopology());
119  int rowsperroc = topo->rowsperroc();
120  int colsperroc = topo->colsperroc();
121 
122  int nROCrows = pgdu->specificTopology().nrows()/rowsperroc;
123  int nROCcolumns = pgdu->specificTopology().ncolumns()/colsperroc;
124  int nrocs = nROCrows*nROCcolumns;
125 
126  fDet.addModule(detid, nrocs);
127 
128  fSensors[detid] = std::make_pair(rowsperroc,colsperroc);
129  fSensorLayout[detid] = std::make_pair(nROCrows,nROCcolumns);
130 
131  std::map<int, int> rocIdMap;
132  for(int irow = 0; irow<nROCrows; irow++){
133 
134  for(int icol = 0; icol<nROCcolumns; icol++){
135 
136  int dummyOfflineRow = (rowsperroc/2-1) + irow*rowsperroc;
137  int dummeOfflineColumn = (colsperroc/2-1) + icol*colsperroc;
138  // encode irow, icol
139  int key = indexROC(irow,icol,nROCcolumns);
140 
141  int roc(-1), rocR(-1), rocC(-1);
142  onlineRocColRow(detId, dummyOfflineRow, dummeOfflineColumn, roc, rocR, rocC);
143 
144  int value = roc;
145  rocIdMap[key] = value;
146  }
147 
148  }
149 
150  fRocIds[detid] = rocIdMap;
151  }
152 
153  } // init when countLumi = 0
154 
155  FEDerror25_.clear();
156  countLumi_++;
157 
158 }
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
std::map< int, std::map< int, int > > fRocIds
constexpr uint32_t rawId() const
get the raw id
Definition: DetId.h:47
std::map< int, std::pair< int, int > > fSensors
std::map< int, std::pair< int, int > > fSensorLayout
edm::ESWatcher< TrackerDigiGeometryRecord > trackerDIGIGeoWatcher_
edm::ESWatcher< TrackerTopologyRcd > trackerTopoWatcher_
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
SiPixelDetectorStatus fDet
Definition: DetId.h:18
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:57
std::map< int, std::vector< PixelFEDChannel > > FEDerror25_
virtual int ncolumns() const =0
T get() const
Definition: EventSetup.h:63
const SiPixelFedCablingMap * fCablingMap_
virtual int indexROC(int irow, int icol, int nROCcolumns) final
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 312 of file SiPixelStatusProducer.cc.

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

Definition at line 317 of file SiPixelStatusProducer.cc.

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

317  {
318 
319  edm::LogInfo("SiPixelStatusProducer")
320  << "endlumi producer "<<endl;
321 
322  endLumi_ = lumiSeg.luminosityBlock();
323  endRun_ = lumiSeg.run();
324 
325  // check if countLumi_ is large enough to read out/save data and reset for the next round
326  if ( resetNLumi_ == -1 ) return;
327  if ( countLumi_ < resetNLumi_ ) return;
328 
329  // set the FEDerror25 flag to be true for ROCs send out FEDerror25 for all events in the lumi section
330  if(!FEDerror25_.empty()){
331  std::map<int, std::vector<PixelFEDChannel> >::iterator itFEDerror25;
332  for (itFEDerror25 = FEDerror25_.begin(); itFEDerror25 != FEDerror25_.end(); itFEDerror25++) {
333  int detid = itFEDerror25->first;
334  std::vector<PixelFEDChannel> chs = itFEDerror25->second;
335  for(unsigned int ich = 0; ich<chs.size(); ich++){
336  fDet.fillFEDerror25(detid,chs[ich]);
337  }
338  }
339  }
340 
344 
345  // save result
346  auto result = std::make_unique<SiPixelDetectorStatus>();
347  *result = fDet;
348 
349  // only save for the lumi sections with NON-ZERO events
350  lumiSeg.put(std::move(result), std::string("siPixelStatus"));
351  edm::LogInfo("SiPixelStatusProducer")
352  << "new lumi-based data stored for run "<<beginRun_<<" lumi from "<<beginLumi_<<" to "<<endLumi_<<std::endl;
353 
354  // reset detector status and lumi-counter
356  countLumi_=0;
357  ftotalevents=0;
358  FEDerror25_.clear();
359 }
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:510
int SiPixelStatusProducer::indexROC ( int  irow,
int  icol,
int  nROCcolumns 
)
finalprivatevirtual

Definition at line 397 of file SiPixelStatusProducer.cc.

References DEFINE_FWK_MODULE, and createfilelist::int.

397  {
398 
399  return int(icol+irow*nROCcolumns);
400 
401  // generate the folling roc index that is going to map with ROC id as
402  // 8 9 10 11 12 13 14 15
403  // 0 1 2 3 4 5 6 7
404 
405 }
void SiPixelStatusProducer::onlineRocColRow ( const DetId detId,
int  offlineRow,
int  offlineCol,
int &  roc,
int &  row,
int &  col 
)
finalprivatevirtual

Definition at line 362 of file SiPixelStatusProducer.cc.

References sipixelobjects::DetectorIndex::col, sipixelobjects::ElectronicIndex::dcol, sipixelobjects::LocalPixel::DcolPxid::dcol, gamEcalExtractorBlocks_cff::detector, l1t::stage2::layer2::fedId, sipixelobjects::PixelROC::idInDetUnit(), sipixelobjects::ElectronicIndex::link, create_public_lumi_plots::loc, 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().

362  {
363 
364  int fedId = fFedIds[detId.rawId()];
365 
366  // from detector to cabling
368  sipixelobjects::DetectorIndex detector; //{detId.rawId(), offlineRow, offlineCol};
369  detector.rawId = detId.rawId(); detector.row = offlineRow; detector.col = offlineCol;
370 
372  converter.toCabling(cabling, detector);
373 
374  // then one can construct local pixel
376  loc.dcol = cabling.dcol;
377  loc.pxid = cabling.pxid;
378  // and get local(online) row/column
379  sipixelobjects::LocalPixel locpixel(loc);
380  col = locpixel.rocCol();
381  row = locpixel.rocRow();
382  //sipixelobjects::CablingPathToDetUnit path = {(unsigned int) fedId, (unsigned int)cabling.link, (unsigned int)cabling.roc};
383  //const sipixelobjects::PixelROC *theRoc = fCablingMap->findItem(path);
384  const sipixelobjects::PixelROC *theRoc = converter.toRoc(cabling.link, cabling.roc);
385  roc = theRoc->idInDetUnit();
386 
387  // has to be BPIX; has to be minus side; has to be half module
388  // for phase-I, there is no half module
389  if (detId.subdetId() == PixelSubdetector::PixelBarrel && coord_.side(detId)==1 && coord_.half(detId))
390  {
391  roc += 8;
392  }
393 
394 }
int side(const DetId &)
constexpr uint32_t rawId() const
get the raw id
Definition: DetId.h:47
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:40
constexpr int subdetId() const
get the contents of the subdetector field (not cast into any detector&#39;s numbering enum) ...
Definition: DetId.h:41
std::unordered_map< uint32_t, unsigned int > fFedIds
double collumn and pixel ID in double collumn representation
Definition: LocalPixel.h:22
const SiPixelFedCablingMap * fCablingMap_
col
Definition: cuy.py:1009
SiPixelCoordinates coord_

Member Data Documentation

int SiPixelStatusProducer::beginLumi_
private

Definition at line 52 of file SiPixelStatusProducer.h.

int SiPixelStatusProducer::beginRun_
private

Definition at line 54 of file SiPixelStatusProducer.h.

SiPixelCoordinates SiPixelStatusProducer::coord_
private

Definition at line 71 of file SiPixelStatusProducer.h.

int SiPixelStatusProducer::countLumi_
private

Definition at line 50 of file SiPixelStatusProducer.h.

int SiPixelStatusProducer::endLumi_
private

Definition at line 53 of file SiPixelStatusProducer.h.

int SiPixelStatusProducer::endRun_
private

Definition at line 55 of file SiPixelStatusProducer.h.

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

Definition at line 60 of file SiPixelStatusProducer.h.

const SiPixelFedCablingMap* SiPixelStatusProducer::fCablingMap_
private

Definition at line 61 of file SiPixelStatusProducer.h.

SiPixelDetectorStatus SiPixelStatusProducer::fDet
private

Definition at line 91 of file SiPixelStatusProducer.h.

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

Definition at line 88 of file SiPixelStatusProducer.h.

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

Definition at line 78 of file SiPixelStatusProducer.h.

edm::InputTag SiPixelStatusProducer::fPixelClusterLabel_
private

Definition at line 83 of file SiPixelStatusProducer.h.

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

Definition at line 80 of file SiPixelStatusProducer.h.

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

Definition at line 76 of file SiPixelStatusProducer.h.

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

Definition at line 74 of file SiPixelStatusProducer.h.

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

Definition at line 84 of file SiPixelStatusProducer.h.

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

Definition at line 65 of file SiPixelStatusProducer.h.

unsigned long int SiPixelStatusProducer::ftotalevents
private

Definition at line 48 of file SiPixelStatusProducer.h.

int SiPixelStatusProducer::resetNLumi_
private

Definition at line 49 of file SiPixelStatusProducer.h.

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

Definition at line 59 of file SiPixelStatusProducer.h.

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

Definition at line 85 of file SiPixelStatusProducer.h.

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

Definition at line 64 of file SiPixelStatusProducer.h.

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

Definition at line 67 of file SiPixelStatusProducer.h.