Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-02-14 12:51:31

0001 #ifndef CondFormats_SiPixelObjects_SiPixelFEDChannelContainer_h
0002 #define CondFormats_SiPixelObjects_SiPixelFEDChannelContainer_h
0003 
0004 #include "CondFormats/Serialization/interface/Serializable.h"
0005 #include "DataFormats/DetId/interface/DetId.h"
0006 #include "DataFormats/SiPixelDetId/interface/PixelFEDChannel.h"  // N.B. a DataFormat is serialized here (need for dedicated serialization rules, see CondFormats/External/interface/PixelFEDChannel.h)
0007 
0008 #include <map>
0009 #include <string>
0010 #include <vector>
0011 
0012 class SiPixelFEDChannelContainer {
0013 public:
0014   typedef std::map<DetId, std::vector<PixelFEDChannel> > SiPixelFEDChannelCollection;
0015   typedef std::unordered_map<std::string, SiPixelFEDChannelCollection> SiPixelBadFEDChannelsScenarioMap;
0016 
0017   SiPixelFEDChannelContainer() {}
0018   SiPixelFEDChannelContainer(const SiPixelFEDChannelContainer &rhs) { m_scenarioMap = rhs.getScenarioMap(); };
0019   virtual ~SiPixelFEDChannelContainer() {}
0020 
0021   void setScenario(const std::string &theScenarioId, const SiPixelFEDChannelCollection &theBadFEDChannels);
0022 
0023   const SiPixelBadFEDChannelsScenarioMap &getScenarioMap() const { return m_scenarioMap; }
0024 
0025   SiPixelFEDChannelCollection getSiPixelBadFedChannels(const std::string &ScenarioId) const;
0026   const SiPixelFEDChannelCollection &getSiPixelBadFedChannels(const std::string &ScenarioId);
0027 
0028   const std::vector<PixelFEDChannel> &getSiPixelBadFedChannelsInDetId(const std::string &theScenarioId, DetId theDetId);
0029 
0030   std::unique_ptr<PixelFEDChannelCollection> getDetSetBadPixelFedChannels(const std::string &ScenarioId) const;
0031 
0032   double size() const { return m_scenarioMap.size(); }
0033   std::vector<std::string> getScenarioList() const;
0034 
0035   void printAll() const;
0036 
0037   //dumping values on output stream
0038   void print(std::ostream &os) const;
0039 
0040 private:
0041   SiPixelBadFEDChannelsScenarioMap m_scenarioMap;
0042 
0043   COND_SERIALIZABLE;
0044 };
0045 
0046 std::ostream &operator<<(std::ostream &, SiPixelFEDChannelContainer FEDChannels);
0047 
0048 #endif  //CondFormats_SiPixelObjects_SiPixelFEDChannelContainer_h