42 std::unique_ptr<TrackerTopology>
tTopo_;
48 printdebug_(iConfig.getUntrackedParameter<bool>(
"printDebug",
false)),
49 BadModuleList_(iConfig.getUntrackedParameter<
Parameters>(
"BadModuleList")),
50 ROCListFile_(iConfig.getUntrackedParameter<std::
string>(
"ROCListFile")) {}
55 auto obj = std::make_unique<SiPixelQuality>();
59 edm::LogInfo(
"SiPixelBadModuleByHandBuilder") <<
" BadModule " << *it <<
" \t" << std::endl;
65 BadModule.
DetID = it->getParameter<uint32_t>(
"detid");
69 <<
"now looking at detid " << BadModule.
DetID <<
", string " << errorstring << std::endl;
89 if (errorstring ==
"whole") {
93 else if (errorstring ==
"tbmA") {
97 else if (errorstring ==
"tbmB") {
101 else if (errorstring ==
"none") {
104 std::vector<uint32_t> BadRocList = it->getParameter<std::vector<uint32_t> >(
"badroclist");
106 for (std::vector<uint32_t>::iterator iter = BadRocList.begin(); iter != BadRocList.end(); ++iter) {
107 badrocs += 1 << *iter;
113 edm::LogError(
"SiPixelQuality") <<
"trying to fill error type " << errorstring <<
", which is not defined!";
114 obj->addDisabledModule(BadModule);
119 std::map<uint32_t, uint32_t> disabledModules;
122 while (std::getline(aFile, aLine)) {
125 sscanf(aLine.c_str(),
"%s %d",
name, &
roc);
127 if (name[0] ==
'B') {
134 std::map<uint32_t, uint32_t>::iterator it = disabledModules.find(detId);
135 if (it == disabledModules.end())
136 it = disabledModules.insert(disabledModules.begin(), std::make_pair(detId, 0));
137 it->second |= 1 <<
roc;
141 for (
const auto& it : disabledModules) {
143 BadModule.
DetID = it.first;
144 if (it.second == 65535) {
148 else if (it.second == 255) {
152 else if (it.second == 65280) {
161 obj->addDisabledModule(BadModule);
164 <<
"New module added: " <<
tTopo_->print(BadModule.
DetID) <<
", errorType: " << BadModule.
errorType
165 <<
", BadRocs: " << std::bitset<16>(it.second) << std::endl;
Log< level::Info, true > LogVerbatim
#define DEFINE_FWK_MODULE(type)
void algoBeginRun(const edm::Run &run, const edm::EventSetup &es) override
SiPixelBadModuleByHandBuilder(const edm::ParameterSet &)
Log< level::Error, false > LogError
std::vector< edm::ParameterSet > Parameters
bool getData(T &iHolder) const
~SiPixelBadModuleByHandBuilder() override
const std::string ROCListFile_
PXFDetId getDetId()
return DetId
Parameters BadModuleList_
Log< level::Info, false > LogInfo
std::unique_ptr< SiPixelQuality > getNewObject() override
std::unique_ptr< TrackerTopology > tTopo_
const edm::ESGetToken< TrackerTopology, TrackerTopologyRcd > tkTopoToken_
PXBDetId getDetId()
return the DetId