10 edm::LogWarning(
"SiPixelFEDChannelContainer") <<
"Scenario: " <<theScenarioId <<
" is already in the map!"<<std::endl;
19 SiPixelBadFEDChannelsScenarioMap::const_iterator it =
m_scenarioMap.find(theScenarioId);
24 throw cms::Exception(
"SiPixelFEDChannelContainer")<<
"No Bad Pixel FEDChannels defined for Scenario id: " << theScenarioId <<
"\n";
30 SiPixelBadFEDChannelsScenarioMap::const_iterator it =
m_scenarioMap.find(theScenarioId);
35 throw cms::Exception(
"SiPixelFEDChannelContainer")<<
"No Bad Pixel FEDChannels defined for Scenario id: " << theScenarioId <<
"\n";
42 SiPixelBadFEDChannelsScenarioMap::const_iterator it =
m_scenarioMap.find(theScenarioId);
45 throw cms::Exception(
"SiPixelFEDChannelContainer")<<
"No Bad Pixel FEDChannels defined for Scenario id: " << theScenarioId <<
"\n";
48 SiPixelFEDChannelCollection::const_iterator it2 = (it->second).
find(theDetId);
50 if(it2 == (it->second).end()){
51 throw cms::Exception(
"SiPixelFEDChannelContainer")<<
"No Bad Pixel FEDChannels defined for DetId:" <<theDetId <<
" in Scenario id: " << theScenarioId <<
"\n";
60 SiPixelBadFEDChannelsScenarioMap::const_iterator it =
m_scenarioMap.find(theScenarioId);
63 throw cms::Exception(
"SiPixelFEDChannelContainer")<<
"No Bad Pixel FEDChannels defined for Scenario id: " << theScenarioId <<
"\n";
66 std::unique_ptr<PixelFEDChannelCollection> disabled_channelcollection = std::make_unique<edmNew::DetSetVector<PixelFEDChannel> >();
67 auto SiPixelBadFedChannels = it->second;
68 for(
const auto &
entry : SiPixelBadFedChannels){
69 disabled_channelcollection->insert(
entry.first,
entry.second.data(),
entry.second.size());
71 return disabled_channelcollection;
78 edm::LogVerbatim(
"SiPixelFEDChannelContainer")<<
"SiPixelFEDChannelContainer::printAll()";
79 edm::LogVerbatim(
"SiPixelFEDChannelContainer")<<
" ===================================================================================================================";
81 edm::LogVerbatim(
"SiPixelFEDChannelContainer")<<
"run :"<< it->first <<
" \n ";
82 for (
const auto& thePixelFEDChannel : it->second){
84 DetId detId = thePixelFEDChannel.first;
86 edm::LogVerbatim(
"SiPixelFEDChannelContainer")<<
"DetId :"<< detId <<
" \n ";
88 for(
const auto&
entry: thePixelFEDChannel.second) {
91 <<
" link : "<<
entry.link
92 <<
" roc_first : "<<
entry.roc_first
93 <<
" roc_last: : "<<
entry.roc_last;
102 os<<
"run :"<< it->first <<
" \n ";
103 for (
const auto& thePixelFEDChannel : it->second){
105 DetId detId = thePixelFEDChannel.first;
106 os<<
"DetId :"<< detId <<
" \n ";
107 for(
const auto&
entry: thePixelFEDChannel.second) {
108 os<<
" fed : "<<
entry.fed
109 <<
" link : "<<
entry.link
110 <<
" roc_first : "<<
entry.roc_first
111 <<
" roc_last: : "<<
entry.roc_last;
119 std::vector<std::string> scenarios;
123 scenarios.push_back(it->first);
130 std::stringstream ss;
131 FEDChannels.
print( ss );
SiPixelBadFEDChannelsScenarioMap m_scenarioMap
std::vector< std::string > getScenarioList() const
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
std::ostream & operator<<(std::ostream &os, SiPixelFEDChannelContainer FEDChannels)
void print(std::ostream &os) const
void setScenario(const std::string &theScenarioId, const SiPixelFEDChannelCollection &theBadFEDChannels)
SiPixelFEDChannelCollection getSiPixelBadFedChannels(const std::string &ScenarioId) const
std::unique_ptr< PixelFEDChannelCollection > getDetSetBadPixelFedChannels(const std::string &ScenarioId) const
std::map< DetId, std::vector< PixelFEDChannel > > SiPixelFEDChannelCollection
const std::vector< PixelFEDChannel > & getSiPixelBadFedChannelsInDetId(const std::string &theScenarioId, DetId theDetId)