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 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
 
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::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 32 of file SiPixelStatusProducer.h.

Constructor & Destructor Documentation

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

Definition at line 49 of file SiPixelStatusProducer.cc.

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

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

72  {
73 
74 }

Member Function Documentation

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

Definition at line 156 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().

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

77  {
78 
79  edm::LogInfo("SiPixelStatusProducer")
80  << "beginlumi setup "<<endl;
81 
82  if ( countLumi_ == 0 && resetNLumi_ > 0 ) {
83 
84  beginLumi_ = lumiSeg.luminosityBlock();
85  beginRun_ = lumiSeg.run();
86  ftotalevents = 0;
87 
88  }
89 
90  // The es watcher is acutally not needed if run parallel jobs for each lumi section
92 
93  coord_.init(iSetup);
96  iSetup.get<TrackerDigiGeometryRecord>().get(fTG);
97 
99 
100  } // if conditionWatcher_.check(iSetup)
101 
102  // init the SiPixelDetectorStatus fDet and sensor size fSensors in the begining (when countLumi is zero)
103  if(countLumi_ == 0){
104 
105  for (TrackerGeometry::DetContainer::const_iterator it = fTG->dets().begin(); it != fTG->dets().end(); it++){
106 
107  const PixelGeomDetUnit *pgdu = dynamic_cast<const PixelGeomDetUnit*>((*it));
108  if (pgdu == nullptr) continue;
109  DetId detId = (*it)->geographicalId();
110  int detid = detId.rawId();
111 
112  // don't want to use magic number row 80 column 52
113  const PixelTopology* topo = static_cast<const PixelTopology*>(&pgdu->specificTopology());
114  int rowsperroc = topo->rowsperroc();
115  int colsperroc = topo->colsperroc();
116 
117  int nROCrows = pgdu->specificTopology().nrows()/rowsperroc;
118  int nROCcolumns = pgdu->specificTopology().ncolumns()/colsperroc;
119  int nrocs = nROCrows*nROCcolumns;
120 
121  fDet.addModule(detid, nrocs);
122 
123  fSensors[detid] = std::make_pair(rowsperroc,colsperroc);
124  fSensorLayout[detid] = std::make_pair(nROCrows,nROCcolumns);
125 
126  std::map<int, int> rocIdMap;
127  for(int irow = 0; irow<nROCrows; irow++){
128 
129  for(int icol = 0; icol<nROCcolumns; icol++){
130 
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 
145  fRocIds[detid] = rocIdMap;
146  }
147 
148  } // init when countLumi = 0
149 
150  FEDerror25_.clear();
151  countLumi_++;
152 
153 }
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:50
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:52
std::map< int, std::vector< PixelFEDChannel > > FEDerror25_
virtual int ncolumns() const =0
T get() const
Definition: EventSetup.h:71
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 307 of file SiPixelStatusProducer.cc.

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

Definition at line 312 of file SiPixelStatusProducer.cc.

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

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

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

404  {
405  // siPixelStatusProducer
407  {
409  psd0.addUntracked<int>("resetEveryNLumi", 1);
410  psd0.addUntracked<edm::InputTag>("pixelClusterLabel", edm::InputTag("siPixelClusters","","RECO"));
411  psd0.add<std::vector<edm::InputTag>>("badPixelFEDChannelCollections", {
412  edm::InputTag("siPixelDigis"),
413  });
414  desc.add<edm::ParameterSetDescription>("SiPixelStatusProducerParameters", psd0);
415  }
416  descriptions.add("siPixelStatusProducer", desc);
417 
418 }
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 392 of file SiPixelStatusProducer.cc.

References createfilelist::int.

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

Definition at line 357 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().

357  {
358 
359  int fedId = fFedIds[detId.rawId()];
360 
361  // from detector to cabling
363  sipixelobjects::DetectorIndex detector; //{detId.rawId(), offlineRow, offlineCol};
364  detector.rawId = detId.rawId(); detector.row = offlineRow; detector.col = offlineCol;
365 
367  converter.toCabling(cabling, detector);
368 
369  // then one can construct local pixel
371  loc.dcol = cabling.dcol;
372  loc.pxid = cabling.pxid;
373  // and get local(online) row/column
374  sipixelobjects::LocalPixel locpixel(loc);
375  col = locpixel.rocCol();
376  row = locpixel.rocRow();
377  //sipixelobjects::CablingPathToDetUnit path = {(unsigned int) fedId, (unsigned int)cabling.link, (unsigned int)cabling.roc};
378  //const sipixelobjects::PixelROC *theRoc = fCablingMap->findItem(path);
379  const sipixelobjects::PixelROC *theRoc = converter.toRoc(cabling.link, cabling.roc);
380  roc = theRoc->idInDetUnit();
381 
382  // has to be BPIX; has to be minus side; has to be half module
383  // for phase-I, there is no half module
384  if (detId.subdetId() == PixelSubdetector::PixelBarrel && coord_.side(detId)==1 && coord_.half(detId))
385  {
386  roc += 8;
387  }
388 
389 }
int side(const DetId &)
constexpr uint32_t rawId() const
get the raw id
Definition: DetId.h:50
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:1010
SiPixelCoordinates coord_

Member Data Documentation

int SiPixelStatusProducer::beginLumi_
private

Definition at line 56 of file SiPixelStatusProducer.h.

int SiPixelStatusProducer::beginRun_
private

Definition at line 58 of file SiPixelStatusProducer.h.

SiPixelCoordinates SiPixelStatusProducer::coord_
private

Definition at line 75 of file SiPixelStatusProducer.h.

int SiPixelStatusProducer::countLumi_
private

Definition at line 54 of file SiPixelStatusProducer.h.

int SiPixelStatusProducer::endLumi_
private

Definition at line 57 of file SiPixelStatusProducer.h.

int SiPixelStatusProducer::endRun_
private

Definition at line 59 of file SiPixelStatusProducer.h.

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

Definition at line 64 of file SiPixelStatusProducer.h.

const SiPixelFedCablingMap* SiPixelStatusProducer::fCablingMap_
private

Definition at line 65 of file SiPixelStatusProducer.h.

SiPixelDetectorStatus SiPixelStatusProducer::fDet
private

Definition at line 95 of file SiPixelStatusProducer.h.

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

Definition at line 92 of file SiPixelStatusProducer.h.

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

Definition at line 82 of file SiPixelStatusProducer.h.

edm::InputTag SiPixelStatusProducer::fPixelClusterLabel_
private

Definition at line 87 of file SiPixelStatusProducer.h.

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

Definition at line 84 of file SiPixelStatusProducer.h.

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

Definition at line 80 of file SiPixelStatusProducer.h.

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

Definition at line 78 of file SiPixelStatusProducer.h.

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

Definition at line 88 of file SiPixelStatusProducer.h.

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

Definition at line 69 of file SiPixelStatusProducer.h.

unsigned long int SiPixelStatusProducer::ftotalevents
private

Definition at line 52 of file SiPixelStatusProducer.h.

int SiPixelStatusProducer::resetNLumi_
private

Definition at line 53 of file SiPixelStatusProducer.h.

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

Definition at line 63 of file SiPixelStatusProducer.h.

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

Definition at line 89 of file SiPixelStatusProducer.h.

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

Definition at line 68 of file SiPixelStatusProducer.h.

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

Definition at line 71 of file SiPixelStatusProducer.h.