Commit 117acc6e authored by Susumu Oda's avatar Susumu Oda Committed by Graeme Stewart
Browse files

Add printouts for disable chips and strips (SCT_ConditionsServices-00-04-47)

	* Add printouts for disable chips and strips
	  SCT_ConfigurationConditionsSvc.cxx
	* tag as SCT_ConditionsServices-00-04-47

2016-06-15 Susumu Oda <Susumu.Oda@cern.ch>
	* Fix cppcheck defect in src/SCT_ChargeTrappingSvc.cxx
	  1888853453 (Medium) uninitMemberVar m_PotentialValue
	* tag as SCT_ConditionsServices-00-04-45

2016-06-10 Susumu Oda <Susumu.Oda@cern.ch>
	* Add SCT_ByteStreamErrors::MaskedROD to separate
	  it from SCT_ByteStreamErrors::MaskedLink.
	  SCT_ConditionsServices/ISCT_ByteStreamErrorsSvc.h
	  src/SCT_ByteStreamErrorsSvc.h
	  src/SCT_ByteStreamErrorsSvc.cxx
	* tag as SCT_ConditionsServices-00-04-44
parent ff7d3328
......@@ -44,6 +44,7 @@ namespace SCT_ByteStreamErrors {
TruncatedROD,
ROBFragmentError,
MissingLinkHeaderError,
MaskedROD,
NUM_ERROR_TYPES // always have this one last, so we can use it as a loop index
};
}
......
......@@ -50,6 +50,7 @@ SCT_ByteStreamErrorsSvc::SCT_ByteStreamErrorsSvc( const std::string& name, ISvcL
m_truncatedRod(0),
m_robFragErrors(0),
m_missingLinkHeaderErrors(0),
m_maskedRods(0),
m_rxRedundancy(0),
//
m_numTimeOutErrors(0),
......@@ -66,6 +67,7 @@ SCT_ByteStreamErrorsSvc::SCT_ByteStreamErrorsSvc( const std::string& name, ISvcL
m_numTruncatedRod(0),
m_numRobFragErrors(0),
m_numMissingLinkHeaderErrors(0),
m_numMaskedRods(0),
m_isRODSimulatedData(false),
m_numRODsHVon(0),
m_numRODsTotal(0),
......@@ -105,6 +107,7 @@ SCT_ByteStreamErrorsSvc::initialize(){
m_truncatedRod = new std::set<IdentifierHash>;
m_robFragErrors = new std::set<IdentifierHash>;
m_missingLinkHeaderErrors = new std::set<IdentifierHash>;
m_maskedRods = new std::set<IdentifierHash>;
m_rxRedundancy = new std::set<IdentifierHash>;
......@@ -179,6 +182,7 @@ SCT_ByteStreamErrorsSvc::finalize(){
delete m_truncatedRod;
delete m_robFragErrors;
delete m_missingLinkHeaderErrors;
delete m_maskedRods;
delete m_rxRedundancy;
return sc;
......@@ -258,7 +262,7 @@ SCT_ByteStreamErrorsSvc::disableRODs() {
std::vector<IdentifierHash>::iterator hashIt = listOfHashes.begin();
std::vector<IdentifierHash>::iterator hashEnd = listOfHashes.end();
for (; hashIt != hashEnd; ++hashIt) {
addError(*hashIt,SCT_ByteStreamErrors::MaskedLink);
addError(*hashIt,SCT_ByteStreamErrors::MaskedROD);
}
}
}
......@@ -377,6 +381,11 @@ SCT_ByteStreamErrorsSvc::isGood(const IdentifierHash & elementIdHash) {
m_missingLinkHeaderErrors->end(),
elementIdHash) == m_missingLinkHeaderErrors->end());
if (!result) return result;
result = (std::find(m_maskedRods->begin(),
m_maskedRods->end(),
elementIdHash) == m_maskedRods->end());
if (!result) return result;
return result;
}
......@@ -413,6 +422,7 @@ SCT_ByteStreamErrorsSvc::resetSets() {
m_rodClockErrors->clear();
m_truncatedRod->clear();
m_robFragErrors->clear();
m_maskedRods->clear();
m_missingLinkHeaderErrors->clear();
return;
}
......@@ -466,6 +476,8 @@ SCT_ByteStreamErrorsSvc::getErrorSet(int errType) {
return m_robFragErrors;
case SCT_ByteStreamErrors::MissingLinkHeaderError:
return m_missingLinkHeaderErrors;
case SCT_ByteStreamErrors::MaskedROD:
return m_maskedRods;
}
return 0;
}
......@@ -611,6 +623,9 @@ SCT_ByteStreamErrorsSvc::addError(IdentifierHash& id, int errorType) {
case SCT_ByteStreamErrors::MissingLinkHeaderError:
m_missingLinkHeaderErrors->insert(id);
break;
case SCT_ByteStreamErrors::MaskedROD:
m_maskedRods->insert(id);
break;
}
}
......@@ -675,6 +690,9 @@ SCT_ByteStreamErrorsSvc::addErrorCount(int errorType) {
case SCT_ByteStreamErrors::MissingLinkHeaderError:
m_numMissingLinkHeaderErrors++;
break;
case SCT_ByteStreamErrors::MaskedROD:
m_numMaskedRods++;
break;
}
}
......@@ -713,6 +731,7 @@ SCT_ByteStreamErrorsSvc::resetCounts() {
m_numTruncatedRod=0;
m_numRobFragErrors=0;
m_numMissingLinkHeaderErrors=0;
m_numMaskedRods=0;
}
int
......@@ -746,6 +765,8 @@ SCT_ByteStreamErrorsSvc::getNumberOfErrors(int errorType) {
return m_numRobFragErrors;
case SCT_ByteStreamErrors::MissingLinkHeaderError:
return m_numMissingLinkHeaderErrors;
case SCT_ByteStreamErrors::MaskedROD:
return m_numMaskedRods;
}
return 0;
}
......
......@@ -125,6 +125,7 @@ private:
std::set<IdentifierHash>* m_truncatedRod;
std::set<IdentifierHash>* m_robFragErrors;
std::set<IdentifierHash>* m_missingLinkHeaderErrors;
std::set<IdentifierHash>* m_maskedRods;
std::set<IdentifierHash>* m_rxRedundancy;
......@@ -142,6 +143,7 @@ private:
int m_numTruncatedRod;
int m_numRobFragErrors;
int m_numMissingLinkHeaderErrors;
int m_numMaskedRods;
bool m_isRODSimulatedData;
......
......@@ -50,6 +50,7 @@ SCT_ChargeTrappingSvc::SCT_ChargeTrappingSvc( const std::string& name, ISvcLoca
m_isSCT(true),
m_detManager(0),
m_getdoCTrap(false),
m_PotentialValue{0.},
m_electricFieldTool("SCT_ElectricFieldTool")
{
......
......@@ -169,6 +169,9 @@ StatusCode SCT_ConfigurationConditionsSvc::fillData(int& /*i*/ , std::list<std::
// Fill bad strip, chip and link info
StatusCode SCT_ConfigurationConditionsSvc::fillChannelData(){
unsigned int nDisabledChips(0);
unsigned int nDisabledChipsExclusive(0);
unsigned int nDisabledStripsExclusive(0);
const std::string channelFolderName=determineFolder(coolChannelFolderName,coolChannelFolderName2);
const bool run1=(channelFolderName==coolChannelFolderName);
//
......@@ -219,6 +222,9 @@ StatusCode SCT_ConfigurationConditionsSvc::fillChannelData(){
if (not hash.is_valid()) continue;
const Identifier waferId(m_pHelper->wafer_id(hash));
const Identifier moduleId(m_pHelper->module_id(waferId));
bool isBadModule(m_badModuleIds->find(moduleId) != m_badModuleIds->end());
// Don't need to bother checking chips if the module is already bad
// Commented out until fully tested
//if (m_badModuleIds->find(moduleId) == m_badModuleIds->end()) continue;
......@@ -267,7 +273,14 @@ StatusCode SCT_ConfigurationConditionsSvc::fillChannelData(){
}
// Bad chips (= all strips bad) bitpacked
// Should only do this for modules with at least one chip bad?
if (thisChip->numberOfMaskedChannels() == stripsPerChip) chipStatusWord |= (1<<thisChip->id());
if (thisChip->numberOfMaskedChannels() == stripsPerChip) {
chipStatusWord |= (1<<thisChip->id());
nDisabledChips++; // A bad chip
if(!isBadModule) nDisabledChipsExclusive++; // A bad chip in a good module
} else { // Good chip
if(!isBadModule) nDisabledStripsExclusive += thisChip->numberOfMaskedChannels(); // Bad strips in a good chip of a good module
}
}
// Store chip status if not all good (==0)
if (chipStatusWord != 0) (*m_badChips)[moduleId] = chipStatusWord;
......@@ -281,7 +294,10 @@ StatusCode SCT_ConfigurationConditionsSvc::fillChannelData(){
m_IOVDbSvc->dropObject(channelFolderName,true);
const unsigned int totalBad(m_badChannelIds->size());
msg(MSG:: INFO)<< "Total number of bad chips is " << nDisabledChips << endreq;
msg(MSG:: INFO)<< "Total number of bad chips not in bad modules is " << nDisabledChipsExclusive << endreq;
msg(MSG:: INFO)<< "Total number of bad strip identifiers is " << totalBad << endreq;
msg(MSG:: INFO)<< "Total number of bad strip identifiers not in bad modules nor bad chips is " << nDisabledStripsExclusive << endreq;
return StatusCode::SUCCESS;
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment