7 #include "boost/cstdint.hpp"
8 #include "boost/lexical_cast.hpp"
24 edm::LogInfo(
"SiStripBadModuleFedErrService") <<
"[SiStripBadModuleFedErrService::SiStripBadModuleFedErrService]";
29 edm::LogInfo(
"SiStripBadModuleFedErrService") <<
"[SiStripBadModuleFedErrService::~SiStripBadModuleFedErrService]";
40 std::stringstream localString;
42 if( ss == localString.str() )
return false;
62 hpath +=
"/FedIdVsApvId";
63 if (dqmStore_->dirExists(dname)) {
66 std::vector<std::pair<uint16_t, uint16_t>> channelList;
68 uint16_t fId_last = 9999;
69 uint16_t fChan_last = 9999;
70 std::map< uint32_t , std::set<int> > detectorMap;
71 for (std::vector<std::pair<uint16_t, uint16_t>>::iterator it = channelList.begin(); it != channelList.end(); it++) {
72 uint16_t fId = it->first;
74 uint16_t fChan = it->second/2;
75 if (fId == fId_last && fChan == fChan_last)
continue;
78 const uint32_t detId = channel.
detId();
80 detectorMap[detId].insert(ipair);
82 for (std::map< uint32_t , std::set<int> >::iterator im = detectorMap.begin(); im != detectorMap.end(); im++) {
83 const uint32_t detId = im->first;
84 std::set<int> pairs = im->second;
86 unsigned short firstBadStrip = 0;
87 unsigned short fNconsecutiveBadStrips = 0;
88 unsigned int theBadStripRange;
90 for (std::set<int>::iterator ip = pairs.begin(); ip != pairs.end(); ip++) {
91 if (last_pair == -1) {
92 firstBadStrip = (*ip) * 128 * 2;
93 fNconsecutiveBadStrips = 128*2;
94 }
else if ((*ip) - last_pair > 1) {
95 theBadStripRange = obj_->
encode(firstBadStrip,fNconsecutiveBadStrips);
96 theSiStripVector.push_back(theBadStripRange);
97 firstBadStrip = (*ip) * 128 * 2;
98 fNconsecutiveBadStrips = 128*2;
100 fNconsecutiveBadStrips += 128*2;
104 theBadStripRange = obj_->
encode(firstBadStrip,fNconsecutiveBadStrips);
105 theSiStripVector.push_back(theBadStripRange);
107 edm::LogInfo(
"SiStripBadModuleFedErrService") <<
" SiStripBadModuleFedErrService::readBadComponentsFromFed "
108 <<
" detid " << detId
109 <<
" firstBadStrip " << firstBadStrip
110 <<
" NconsecutiveBadStrips " << fNconsecutiveBadStrips
111 <<
" packed integer " << std::hex << theBadStripRange <<
std::dec;
113 if ( !obj_->
put(detId,range) ) {
114 edm::LogError(
"SiStripBadModuleFedErrService")<<
"[SiStripBadModuleFedErrService::readBadComponentsFromFed] detid already exists"<<std::endl;
128 edm::LogInfo(
"SiStripBadModuleFedErrService") <<
"[SiStripBadModuleFedErrService::openRequestedFile] Accessing root File" <<
fileName;
130 if (!
dqmStore_->load(fileName, DQMStore::OpenRunDirs::StripRunDirs,
true) ) {
131 edm::LogError(
"SiStripBadModuleFedErrService")<<
"[SiStripBadModuleFedErrService::openRequestedFile] Requested file " << fileName <<
"Can not be opened!! ";
145 if (!entries) entries = th2->GetBinContent(th2->GetMaximumBin());
146 for (uint16_t
i = 1;
i < th2->GetNbinsY()+1;
i++) {
147 for (uint16_t
j = 1;
j < th2->GetNbinsX()+1;
j++) {
148 if (th2->GetBinContent(
j,
i) > cutoff * entries) {
149 edm::LogInfo(
"SiStripBadModuleFedErrService") <<
" [SiStripBadModuleFedErrService::getFedBadChannelList] :: FedId & Channel " << th2->GetYaxis()->GetBinLowEdge(
i) <<
" " << th2->GetXaxis()->GetBinLowEdge(
j);
150 list.push_back(std::pair<uint16_t, uint16_t>(th2->GetYaxis()->GetBinLowEdge(
i), th2->GetXaxis()->GetBinLowEdge(
j)));
162 hpath +=
"/nTotalBadActiveChannels";
T getParameter(std::string const &) const
bool cleanUp(bool force=false)
void printSummary(std::stringstream &ss) const
FedChannelConnection fedConnection(uint16_t fed_id, uint16_t fed_ch) const
uint16_t apvPairNumber() const
edm::ParameterSet iConfig_
float getProcessedEvents()
double getEntries(void) const
get # of entries
void getMetaDataString(std::stringstream &ss)
Used to fill the logDB.
const uint32_t & detId() const
SiStripBadModuleFedErrService(const edm::ParameterSet &, const edm::ActivityRegistry &)
Class containning control, module, detector and connection information, at the level of a FED channel...
Kind kind(void) const
Get the type of the monitor element.
~SiStripBadModuleFedErrService()
uint32_t getRunNumber() const
SiStripBadStrip * readBadComponentsFromFed(const SiStripFedCabling *cabling)
Contains cabling info at the device level, including DetId, APV pair numbers, hardware addresses...
void getFedBadChannelList(MonitorElement *me, std::vector< std::pair< uint16_t, uint16_t >> &list)
std::pair< ContainerIterator, ContainerIterator > Range
virtual bool checkForCompatibility(std::string ss)
Check is the transfer is needed.
TH2F * getTH2F(void) const
bool put(const uint32_t &detID, const InputVector &vect)
unsigned int encode(const unsigned short &first, const unsigned short &NconsecutiveBadStrips, const unsigned short &flag=0)
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