55 outputBase_(iConfig.getParameter<
ParameterSet>(
"SiPixelStatusManagerParameters").getUntrackedParameter<
std::
string>(
"outputBase")),
56 aveDigiOcc_(iConfig.getParameter<
ParameterSet>(
"SiPixelStatusManagerParameters").getUntrackedParameter<
int>(
"aveDigiOcc")),
57 nLumi_(iConfig.getParameter<
edm::
ParameterSet>(
"SiPixelStatusManagerParameters").getUntrackedParameter<
int>(
"resetEveryNLumi")),
58 moduleName_(iConfig.getParameter<
ParameterSet>(
"SiPixelStatusManagerParameters").getUntrackedParameter<
std::
string>(
"moduleName")),
59 label_(iConfig.getParameter<
ParameterSet>(
"SiPixelStatusManagerParameters").getUntrackedParameter<
std::
string>(
"label")){
88 for(
auto& histoman :
histo ){
89 histoman.book( iBooker, iSetup );
110 if (pgdu ==
nullptr)
continue;
111 DetId detId = (*it)->geographicalId();
112 int detid = detId.
rawId();
121 unsigned int nrocs = nROCrows*nROCcolumns;
124 std::map<int, std::pair<int,int> > rocToOfflinePixel;
127 typedef std::vector<sipixelobjects::CablingPathToDetUnit>::const_iterator
IT;
128 for(IT it = path.begin(); it != path.end(); ++it) {
137 rocToOfflinePixel[idInDetUnit] = std::pair<int,int>(global.
row, global.
col);
159 std::vector<int> vDetId;
163 for(
unsigned int i = 0;
i<badComponentList.size();
i++){
167 uint32_t detId = badComponentList[
i].DetID;
168 int detid =
int(detId);
171 for(
int iroc = 0; iroc<
int(nroc); iroc++){
173 std::map<int, std::pair<int,int> > rocToOfflinePixel =
pixelO2O_[detid];
174 int row = rocToOfflinePixel[iroc].first;
175 int column = rocToOfflinePixel[iroc].second;
187 std::map<edm::LuminosityBlockNumber_t, edm::LuminosityBlockNumber_t> finalIOV;
188 std::map<edm::LuminosityBlockNumber_t, edm::LuminosityBlockNumber_t> fedError25IOV;
189 std::map<edm::LuminosityBlockNumber_t, edm::LuminosityBlockNumber_t> pclIOV;
194 std::map<int, SiPixelQuality*> siPixelQualityStuckTBM_Tag;
206 if(nextIt!=FEDerror25Map.end()) interval =
int(nextIt->first - it->first);
212 std::map<int, std::vector<int> > tmpFEDerror25 = it->second;
213 for(
std::map<
int, std::vector<int> >::iterator ilist = tmpFEDerror25.begin(); ilist!=tmpFEDerror25.end();ilist++){
215 int detid = ilist->first;
216 uint32_t detId = uint32_t(detid);
220 BadModule_stuckTBM.
DetID = uint32_t(detid); BadModule_FEDerror25.
DetID = uint32_t(detid);
224 std::vector<uint32_t> BadRocList_stuckTBM, BadRocList_FEDerror25;
225 std::vector<int>
list = ilist->second;
227 for(
unsigned int i=0;
i<list.size();
i++){
230 std::map<int, std::pair<int,int> > rocToOfflinePixel =
pixelO2O_[detid];
231 int row = rocToOfflinePixel[iroc].first;
232 int column = rocToOfflinePixel[iroc].second;
234 BadRocList_FEDerror25.push_back(uint32_t(iroc));
235 for (
int iLumi = 0; iLumi<interval;iLumi++){
241 BadRocList_stuckTBM.push_back(uint32_t(iroc));
242 for (
int iLumi = 0; iLumi<interval;iLumi++){
253 short badrocs_stuckTBM = 0;
254 for(std::vector<uint32_t>::iterator iter = BadRocList_stuckTBM.begin(); iter != BadRocList_stuckTBM.end(); ++iter){
255 badrocs_stuckTBM += 1 << *iter;
258 if(badrocs_stuckTBM!=0){
259 BadModule_stuckTBM.
BadRocs = badrocs_stuckTBM;
264 if(BadRocList_FEDerror25.size()==
sensorSize_[detid])
267 short badrocs_FEDerror25 = 0;
268 for(std::vector<uint32_t>::iterator iter = BadRocList_FEDerror25.begin(); iter != BadRocList_FEDerror25.end(); ++iter){
269 badrocs_FEDerror25 += 1 << *iter;
272 if(badrocs_FEDerror25!=0){
273 BadModule_FEDerror25.
BadRocs = badrocs_FEDerror25;
279 siPixelQualityStuckTBM_Tag[it->first] = siPixelQuality_stuckTBM;
281 finalIOV[it->first] = it->first;
282 fedError25IOV[it->first] = it->first;
287 delete siPixelQuality_FEDerror25;
293 finalIOV[it->first] = it->first;
294 pclIOV[it->first] = it->first;
298 std::map<edm::LuminosityBlockNumber_t, edm::LuminosityBlockNumber_t>::iterator itIOV;
301 std::map<int, SiPixelQuality*> siPixelQualityPCL_Tag;
302 std::map<int, SiPixelQuality*> siPixelQualityPrompt_Tag;
303 std::map<int, SiPixelQuality*> siPixelQualityOther_Tag;
305 for(itIOV=finalIOV.begin();itIOV!=finalIOV.end();itIOV++){
308 std::map<edm::LuminosityBlockNumber_t, edm::LuminosityBlockNumber_t>::iterator nextItIOV =
std::next(itIOV);
309 if(nextItIOV!=finalIOV.end()) interval =
int(nextItIOV->first - itIOV->first);
316 std::map<int, std::vector<int> > tmpFEDerror25 = FEDerror25Map[lumiFEDerror25];
327 <<
"Tag requested for prompt in low statistics IOV in the "<<
outputBase_<<
" harvester"<< std::endl;
328 siPixelQualityPCL_Tag[itIOV->first] = siPixelQualityPermBad;
329 siPixelQualityPrompt_Tag[itIOV->first] = siPixelQualityPermBad;
332 std::map<int, SiPixelModuleStatus> detectorStatus = tmpSiPixelStatus.
getDetectorStatus();
333 std::map<int, SiPixelModuleStatus>::iterator itModEnd = detectorStatus.end();
334 for (std::map<int, SiPixelModuleStatus>::iterator itMod = detectorStatus.begin(); itMod != itModEnd; ++itMod) {
336 int detid = itMod->first;
337 uint32_t detId = uint32_t(detid);
340 for (
int iroc = 0; iroc < modStatus.
nrocs(); ++iroc) {
343 std::map<int, std::pair<int,int> > rocToOfflinePixel =
pixelO2O_[detid];
344 int row = rocToOfflinePixel[iroc].first;
345 int column = rocToOfflinePixel[iroc].second;
for (
int iLumi = 0; iLumi<interval;iLumi++){
357 <<
"Tag requested for other in low statistics IOV in the "<<
outputBase_<<
" harvester"<< std::endl;
374 std::map<int, SiPixelModuleStatus> detectorStatus = tmpSiPixelStatus.
getDetectorStatus();
375 std::map<int, SiPixelModuleStatus>::iterator itModEnd = detectorStatus.end();
376 for (std::map<int, SiPixelModuleStatus>::iterator itMod = detectorStatus.begin(); itMod != itModEnd; ++itMod) {
381 int detid = itMod->first;
382 uint32_t detId = uint32_t(detid);
384 BadModulePCL.
DetID = uint32_t(detid); BadModuleOther.
DetID = uint32_t(detid);
388 std::vector<uint32_t> BadRocListPCL, BadRocListOther;
392 std::vector<int> listFEDerror25 = tmpFEDerror25[detid];
394 for (
int iroc = 0; iroc < modStatus.
nrocs(); ++iroc) {
396 unsigned int rocOccupancy = modStatus.
digiOccROC(iroc);
399 if(rocOccupancy<1.
e-4*DetAverage){
401 std::map<int, std::pair<int,int> > rocToOfflinePixel =
pixelO2O_[detid];
402 int row = rocToOfflinePixel[iroc].first;
403 int column = rocToOfflinePixel[iroc].second;
406 BadRocListPCL.push_back(uint32_t(iroc));
407 for (
int iLumi = 0; iLumi<interval;iLumi++){
412 std::vector<int>::iterator it =
std::find(listFEDerror25.begin(), listFEDerror25.end(),iroc);
417 BadRocListOther.push_back(uint32_t(iroc));
418 for (
int iLumi = 0; iLumi<interval;iLumi++){
432 short badrocsPCL = 0;
433 for(std::vector<uint32_t>::iterator iterPCL = BadRocListPCL.begin(); iterPCL != BadRocListPCL.end(); ++iterPCL){
434 badrocsPCL += 1 << *iterPCL;
437 BadModulePCL.
BadRocs = badrocsPCL;
442 short badrocsOther = 0;
443 for(std::vector<uint32_t>::iterator iterOther = BadRocListOther.begin(); iterOther != BadRocListOther.end(); ++iterOther){
444 badrocsOther += 1 << *iterOther;
447 BadModuleOther.
BadRocs = badrocsOther;
453 BadModulePrompt.
DetID = uint32_t(detid);
457 std::vector<uint32_t> BadRocListPrompt;
458 for (
int iroc = 0; iroc < modStatus.
nrocs(); ++iroc) {
461 BadRocListPrompt.push_back(uint32_t(iroc));
463 std::map<int, std::pair<int,int> > rocToOfflinePixel =
pixelO2O_[detid];
464 int row = rocToOfflinePixel[iroc].first;
465 int column = rocToOfflinePixel[iroc].second;
466 for (
int iLumi = 0; iLumi<interval;iLumi++){
475 short badrocsPrompt = 0;
476 for(std::vector<uint32_t>::iterator iterPrompt = BadRocListPrompt.begin(); iterPrompt != BadRocListPrompt.end(); ++iterPrompt){
477 badrocsPrompt += 1 << *iterPrompt;
479 if(badrocsPrompt!=0){
480 BadModulePrompt.
BadRocs = badrocsPrompt;
487 siPixelQualityPCL_Tag[itIOV->first] = siPixelQualityPCL;
489 siPixelQualityPrompt_Tag[itIOV->first] = siPixelQualityPrompt;
491 siPixelQualityOther_Tag[itIOV->first] = siPixelQualityOther;
518 delete siPixelQualityDummy;
521 delete siPixelQualityPermBad;
546 std::map<edm::LuminosityBlockNumber_t, edm::LuminosityBlockNumber_t>::iterator itIOV;
547 for(itIOV=IOV.begin();itIOV!=IOV.end();itIOV++){
548 std::map<edm::LuminosityBlockNumber_t, edm::LuminosityBlockNumber_t>::iterator nextItIOV;
549 nextItIOV = itIOV; nextItIOV++;
551 if(nextItIOV!=IOV.end()){
552 if(pin>=itIOV->first && pin<nextItIOV->
first){
557 if(pin>=itIOV->first){
565 return (IOV.begin())->
first;
571 std::vector<SiPixelQuality::disabledModuleType> badRocListA;
572 std::vector<SiPixelQuality::disabledModuleType> badRocListB;
581 if(badRocListA.size()!=badRocListB.size())
return false;
587 for(
unsigned int i = 0;
i<badRocListA.size();
i++){
589 uint32_t detIdA = badRocListA[
i].DetID;
590 uint32_t detIdB = badRocListB[
i].DetID;
591 if(detIdA!=detIdB)
return false;
593 unsigned short BadRocsA = badRocListA[
i].BadRocs;
594 unsigned short BadRocsB = badRocListB[
i].BadRocs;
595 if(BadRocsA!=BadRocsB)
return false;
609 for (std::map<int, SiPixelQuality*>::iterator qIt = siPixelQualityTag.begin(); qIt != siPixelQualityTag.end(); ++qIt) {
615 if(qIt==siPixelQualityTag.begin())
void endLuminosityBlock(const edm::LuminosityBlock &, const edm::EventSetup &) final
void addDisabledModule(disabledModuleType module)
T getUntrackedParameter(std::string const &, T const &) const
virtual int nrows() const =0
virtual int rowsperroc() const =0
bool equal(SiPixelQuality *a, SiPixelQuality *b)
std::map< int, unsigned int > sensorSize_
void constructTag(std::map< int, SiPixelQuality * >siPixelQualityTag, edm::Service< cond::service::PoolDBOutputService > &poolDbService, std::string tagName, edm::Run &iRun)
const std::map< edm::LuminosityBlockNumber_t, std::map< int, std::vector< int > > > & getFEDerror25Rocs()
edm::LuminosityBlockNumber_t endLumiBlock_
constexpr uint32_t rawId() const
get the raw id
virtual std::map< uint32_t, std::vector< sipixelobjects::CablingPathToDetUnit > > det2PathMap() const =0
bool IsRocBad(const uint32_t &detid, const short &rocNb) const
edm::LuminosityBlockNumber_t stepIOV(edm::LuminosityBlockNumber_t pin, std::map< edm::LuminosityBlockNumber_t, edm::LuminosityBlockNumber_t > IOV)
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
unsigned int LuminosityBlockNumber_t
~SiPixelStatusHarvester() override
SiPixelStatusManager siPixelStatusManager_
identify pixel inside single ROC
void bookHistograms(DQMStore::IBooker &iBooker, edm::Run const &, edm::EventSetup const &iSetup) final
global coordinates (row and column in DetUnit, as in PixelDigi)
LuminosityBlockNumber_t luminosityBlock() const
U second(std::pair< T, U > const &p)
const DetContainer & dets() const override
Returm a vector of all GeomDet (including all GeomDetUnits)
#define DEFINE_FWK_MODULE(type)
unsigned long long Time_t
virtual int colsperroc() const =0
const SiPixelQuality * badPixelInfo_
unsigned int idInDetUnit() const
id of this ROC in DetUnit etermined by token path
void writeOne(T *payload, Time_t time, const std::string &recordName, bool withlogging=false)
const std::vector< disabledModuleType > getBadComponentList() const
const SiPixelFedCabling * cablingMap_
std::vector< LinkConnSpec >::const_iterator IT
const TrackerGeometry * trackerGeometry_
void endRunProduce(edm::Run &, const edm::EventSetup &) final
std::map< int, SiPixelModuleStatus > getDetectorStatus()
std::map< edm::LuminosityBlockNumber_t, std::map< int, std::vector< int > > >::iterator FEDerror25Map_iterator
virtual const sipixelobjects::PixelROC * findItem(const sipixelobjects::CablingPathToDetUnit &) const =0
SiPixelStatusHarvester(const edm::ParameterSet &)
virtual const PixelTopology & specificTopology() const
Returns a reference to the pixel proxy topology.
row and collumn in ROC representation
std::map< int, std::map< int, std::pair< int, int > > > pixelO2O_
std::map< edm::LuminosityBlockNumber_t, SiPixelDetectorStatus >::iterator siPixelStatusMap_iterator
void beginLuminosityBlock(const edm::LuminosityBlock &, const edm::EventSetup &) final
std::vector< HistogramManager > histo
virtual int ncolumns() const =0
unsigned int digiOccROC(int iroc)
return ROC status (= hits on ROC iroc)
void readLumi(const edm::LuminosityBlock &)
const std::map< edm::LuminosityBlockNumber_t, SiPixelDetectorStatus > & getBadComponents()
T const * product() const
void analyze(const edm::Event &iEvent, const edm::EventSetup &iSetup) final
How EventSelector::AcceptEvent() decides whether to accept an event for output otherwise it is excluding the probing of A single or multiple positive and the trigger will pass if any such matching triggers are PASS or EXCEPTION[A criterion thatmatches no triggers at all is detected and causes a throw.] A single negative with an expectation of appropriate bit checking in the decision and the trigger will pass if any such matching triggers are FAIL or EXCEPTION A wildcarded negative criterion that matches more than one trigger in the trigger list("!*","!HLTx*"if it matches 2 triggers or more) will accept the event if all the matching triggers are FAIL.It will reject the event if any of the triggers are PASS or EXCEPTION(this matches the behavior of"!*"before the partial wildcard feature was incorporated).Triggers which are in the READY state are completely ignored.(READY should never be returned since the trigger paths have been run
GlobalPixel toGlobal(const LocalPixel &loc) const