CMS 3D CMS Logo

List of all members | Public Types | Public Member Functions | Private Member Functions | Private Attributes | Friends
SiPixelFEDChannelContainer Class Reference

#include <SiPixelFEDChannelContainer.h>

Public Types

typedef std::unordered_map< std::string, SiPixelFEDChannelCollectionSiPixelBadFEDChannelsScenarioMap
 
typedef std::map< DetId, std::vector< PixelFEDChannel > > SiPixelFEDChannelCollection
 

Public Member Functions

std::unique_ptr< PixelFEDChannelCollectiongetDetSetBadPixelFedChannels (const std::string &ScenarioId) const
 
std::vector< std::string > getScenarioList () const
 
const SiPixelBadFEDChannelsScenarioMapgetScenarioMap () const
 
SiPixelFEDChannelCollection getSiPixelBadFedChannels (const std::string &ScenarioId) const
 
const SiPixelFEDChannelCollectiongetSiPixelBadFedChannels (const std::string &ScenarioId)
 
const std::vector< PixelFEDChannel > & getSiPixelBadFedChannelsInDetId (const std::string &theScenarioId, DetId theDetId)
 
void print (std::ostream &os) const
 
void printAll () const
 
void setScenario (const std::string &theScenarioId, const SiPixelFEDChannelCollection &theBadFEDChannels)
 
 SiPixelFEDChannelContainer ()
 
 SiPixelFEDChannelContainer (const SiPixelFEDChannelContainer &rhs)
 
double size () const
 
virtual ~SiPixelFEDChannelContainer ()
 

Private Member Functions

template<class Archive >
void serialize (Archive &ar, const unsigned int version)
 

Private Attributes

SiPixelBadFEDChannelsScenarioMap m_scenarioMap
 

Friends

class boost::serialization::access
 
template<typename CondSerializationT , typename Enabled >
struct cond::serialization::access
 

Detailed Description

Definition at line 12 of file SiPixelFEDChannelContainer.h.

Member Typedef Documentation

Definition at line 15 of file SiPixelFEDChannelContainer.h.

Definition at line 14 of file SiPixelFEDChannelContainer.h.

Constructor & Destructor Documentation

SiPixelFEDChannelContainer::SiPixelFEDChannelContainer ( )
inline

Definition at line 17 of file SiPixelFEDChannelContainer.h.

17 {}
SiPixelFEDChannelContainer::SiPixelFEDChannelContainer ( const SiPixelFEDChannelContainer rhs)
inline

Definition at line 18 of file SiPixelFEDChannelContainer.h.

References getScenarioMap(), and m_scenarioMap.

18 { m_scenarioMap = rhs.getScenarioMap(); };
SiPixelBadFEDChannelsScenarioMap m_scenarioMap
const SiPixelBadFEDChannelsScenarioMap & getScenarioMap() const
virtual SiPixelFEDChannelContainer::~SiPixelFEDChannelContainer ( )
inlinevirtual

Definition at line 19 of file SiPixelFEDChannelContainer.h.

References setScenario(), and AlCaHLTBitMon_QueryRunRegistry::string.

19 {}

Member Function Documentation

std::unique_ptr< PixelFEDChannelCollection > SiPixelFEDChannelContainer::getDetSetBadPixelFedChannels ( const std::string &  ScenarioId) const

Definition at line 58 of file SiPixelFEDChannelContainer.cc.

References mps_splice::entry, Exception, and m_scenarioMap.

Referenced by getScenarioMap().

58  {
59 
60  SiPixelBadFEDChannelsScenarioMap::const_iterator it = m_scenarioMap.find(theScenarioId);
61 
62  if(it == m_scenarioMap.end()){
63  throw cms::Exception("SiPixelFEDChannelContainer")<< "No Bad Pixel FEDChannels defined for Scenario id: " << theScenarioId << "\n";
64  }
65 
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());
70  }
71  return disabled_channelcollection;
72 }
SiPixelBadFEDChannelsScenarioMap m_scenarioMap
std::vector< std::string > SiPixelFEDChannelContainer::getScenarioList ( ) const

Definition at line 118 of file SiPixelFEDChannelContainer.cc.

References m_scenarioMap.

Referenced by size().

118  {
119  std::vector<std::string> scenarios;
120  scenarios.reserve(m_scenarioMap.size());
121 
122  for(auto it = m_scenarioMap.begin(); it != m_scenarioMap.end() ; ++it){
123  scenarios.push_back(it->first);
124  }
125  return scenarios;
126 }
SiPixelBadFEDChannelsScenarioMap m_scenarioMap
const SiPixelBadFEDChannelsScenarioMap& SiPixelFEDChannelContainer::getScenarioMap ( ) const
inline
SiPixelFEDChannelContainer::SiPixelFEDChannelCollection SiPixelFEDChannelContainer::getSiPixelBadFedChannels ( const std::string &  ScenarioId) const

Definition at line 18 of file SiPixelFEDChannelContainer.cc.

References Exception, and m_scenarioMap.

Referenced by getScenarioMap().

18  {
19  SiPixelBadFEDChannelsScenarioMap::const_iterator it = m_scenarioMap.find(theScenarioId);
20 
21  if (it != m_scenarioMap.end()){
22  return it->second;
23  } else {
24  throw cms::Exception("SiPixelFEDChannelContainer")<< "No Bad Pixel FEDChannels defined for Scenario id: " << theScenarioId << "\n";
25  }
26 }
SiPixelBadFEDChannelsScenarioMap m_scenarioMap
const SiPixelFEDChannelContainer::SiPixelFEDChannelCollection & SiPixelFEDChannelContainer::getSiPixelBadFedChannels ( const std::string &  ScenarioId)

Definition at line 29 of file SiPixelFEDChannelContainer.cc.

References Exception, and m_scenarioMap.

29  {
30  SiPixelBadFEDChannelsScenarioMap::const_iterator it = m_scenarioMap.find(theScenarioId);
31 
32  if (it != m_scenarioMap.end()){
33  return it->second;
34  } else {
35  throw cms::Exception("SiPixelFEDChannelContainer")<< "No Bad Pixel FEDChannels defined for Scenario id: " << theScenarioId << "\n";
36  }
37 }
SiPixelBadFEDChannelsScenarioMap m_scenarioMap
const std::vector< PixelFEDChannel > & SiPixelFEDChannelContainer::getSiPixelBadFedChannelsInDetId ( const std::string &  theScenarioId,
DetId  theDetId 
)

Definition at line 40 of file SiPixelFEDChannelContainer.cc.

References Exception, spr::find(), and m_scenarioMap.

Referenced by getScenarioMap().

40  {
41 
42  SiPixelBadFEDChannelsScenarioMap::const_iterator it = m_scenarioMap.find(theScenarioId);
43 
44  if(it == m_scenarioMap.end()){
45  throw cms::Exception("SiPixelFEDChannelContainer")<< "No Bad Pixel FEDChannels defined for Scenario id: " << theScenarioId << "\n";
46  } else {
47 
48  SiPixelFEDChannelCollection::const_iterator it2 = (it->second).find(theDetId);
49 
50  if(it2 == (it->second).end()){
51  throw cms::Exception("SiPixelFEDChannelContainer")<< "No Bad Pixel FEDChannels defined for DetId:" <<theDetId <<" in Scenario id: " << theScenarioId << "\n";
52  }
53  return it2->second;
54  }
55 }
SiPixelBadFEDChannelsScenarioMap m_scenarioMap
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
Definition: FindCaloHit.cc:20
void SiPixelFEDChannelContainer::print ( std::ostream &  os) const

Definition at line 100 of file SiPixelFEDChannelContainer.cc.

References mps_splice::entry, and m_scenarioMap.

Referenced by operator<<(), and size().

100  {
101  for(auto it = m_scenarioMap.begin(); it != m_scenarioMap.end() ; ++it){
102  os<< "run :"<< it->first << " \n ";
103  for (const auto& thePixelFEDChannel : it->second){
104 
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;
112  }
113  }
114  }
115 }
SiPixelBadFEDChannelsScenarioMap m_scenarioMap
Definition: DetId.h:18
void SiPixelFEDChannelContainer::printAll ( ) const

Definition at line 76 of file SiPixelFEDChannelContainer.cc.

References mps_splice::entry, and m_scenarioMap.

Referenced by size().

76  {
77 
78  edm::LogVerbatim("SiPixelFEDChannelContainer")<<"SiPixelFEDChannelContainer::printAll()";
79  edm::LogVerbatim("SiPixelFEDChannelContainer")<<" ===================================================================================================================";
80  for(auto it = m_scenarioMap.begin(); it != m_scenarioMap.end() ; ++it){
81  edm::LogVerbatim("SiPixelFEDChannelContainer")<< "run :"<< it->first << " \n ";
82  for (const auto& thePixelFEDChannel : it->second){
83 
84  DetId detId = thePixelFEDChannel.first;
85 
86  edm::LogVerbatim("SiPixelFEDChannelContainer")<< "DetId :"<< detId << " \n ";
87 
88  for(const auto& entry: thePixelFEDChannel.second) {
89  //unsigned int fed, link, roc_first, roc_last;
90  edm::LogVerbatim("SiPixelFEDChannelContainer")<< " fed : "<< entry.fed
91  << " link : "<< entry.link
92  << " roc_first : "<< entry.roc_first
93  << " roc_last: : "<< entry.roc_last;
94  }
95  }
96  }
97 }
SiPixelBadFEDChannelsScenarioMap m_scenarioMap
Definition: DetId.h:18
template<class Archive >
void SiPixelFEDChannelContainer::serialize ( Archive &  ar,
const unsigned int  version 
)
private
void SiPixelFEDChannelContainer::setScenario ( const std::string &  theScenarioId,
const SiPixelFEDChannelCollection theBadFEDChannels 
)

Definition at line 8 of file SiPixelFEDChannelContainer.cc.

References m_scenarioMap.

Referenced by ~SiPixelFEDChannelContainer().

8  {
9  if( m_scenarioMap.find(theScenarioId) != m_scenarioMap.end()){
10  edm::LogWarning("SiPixelFEDChannelContainer") << "Scenario: " <<theScenarioId <<" is already in the map!"<<std::endl;
11  return;
12  } else {
13  m_scenarioMap.emplace(theScenarioId,theBadFEDChannels);
14  }
15 }
SiPixelBadFEDChannelsScenarioMap m_scenarioMap
double SiPixelFEDChannelContainer::size ( void  ) const
inline

Friends And Related Function Documentation

friend class boost::serialization::access
friend

Definition at line 44 of file SiPixelFEDChannelContainer.h.

template<typename CondSerializationT , typename Enabled >
friend struct cond::serialization::access
friend

Definition at line 44 of file SiPixelFEDChannelContainer.h.

Member Data Documentation

SiPixelBadFEDChannelsScenarioMap SiPixelFEDChannelContainer::m_scenarioMap
private