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
 
const SiPixelFEDChannelCollectiongetSiPixelBadFedChannels (const std::string &ScenarioId)
 
SiPixelFEDChannelCollection getSiPixelBadFedChannels (const std::string &ScenarioId) const
 
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

◆ SiPixelBadFEDChannelsScenarioMap

Definition at line 15 of file SiPixelFEDChannelContainer.h.

◆ SiPixelFEDChannelCollection

Definition at line 14 of file SiPixelFEDChannelContainer.h.

Constructor & Destructor Documentation

◆ SiPixelFEDChannelContainer() [1/2]

SiPixelFEDChannelContainer::SiPixelFEDChannelContainer ( )
inline

Definition at line 17 of file SiPixelFEDChannelContainer.h.

17 {}

◆ SiPixelFEDChannelContainer() [2/2]

SiPixelFEDChannelContainer::SiPixelFEDChannelContainer ( const SiPixelFEDChannelContainer rhs)
inline

Definition at line 18 of file SiPixelFEDChannelContainer.h.

18 { m_scenarioMap = rhs.getScenarioMap(); };

References getScenarioMap(), and m_scenarioMap.

◆ ~SiPixelFEDChannelContainer()

virtual SiPixelFEDChannelContainer::~SiPixelFEDChannelContainer ( )
inlinevirtual

Definition at line 19 of file SiPixelFEDChannelContainer.h.

19 {}

Member Function Documentation

◆ getDetSetBadPixelFedChannels()

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

Definition at line 65 of file SiPixelFEDChannelContainer.cc.

66  {
67  SiPixelBadFEDChannelsScenarioMap::const_iterator it = m_scenarioMap.find(theScenarioId);
68 
69  if (it == m_scenarioMap.end()) {
70  throw cms::Exception("SiPixelFEDChannelContainer")
71  << "No Bad Pixel FEDChannels defined for Scenario id: " << theScenarioId << "\n";
72  }
73 
74  std::unique_ptr<PixelFEDChannelCollection> disabled_channelcollection =
75  std::make_unique<edmNew::DetSetVector<PixelFEDChannel> >();
76  auto SiPixelBadFedChannels = it->second;
77  for (const auto &entry : SiPixelBadFedChannels) {
78  disabled_channelcollection->insert(entry.first, entry.second.data(), entry.second.size());
79  }
80  return disabled_channelcollection;
81 }

References mps_splice::entry, Exception, and m_scenarioMap.

◆ getScenarioList()

std::vector< std::string > SiPixelFEDChannelContainer::getScenarioList ( ) const

Definition at line 121 of file SiPixelFEDChannelContainer.cc.

121  {
122  std::vector<std::string> scenarios;
123  scenarios.reserve(m_scenarioMap.size());
124 
125  for (auto it = m_scenarioMap.begin(); it != m_scenarioMap.end(); ++it) {
126  scenarios.push_back(it->first);
127  }
128  return scenarios;
129 }

References m_scenarioMap, and visualization-live-secondInstance_cfg::scenarios.

◆ getScenarioMap()

const SiPixelBadFEDChannelsScenarioMap& SiPixelFEDChannelContainer::getScenarioMap ( ) const
inline

Definition at line 23 of file SiPixelFEDChannelContainer.h.

23 { return m_scenarioMap; }

References m_scenarioMap.

Referenced by SiPixelFEDChannelContainer().

◆ getSiPixelBadFedChannels() [1/2]

const SiPixelFEDChannelContainer::SiPixelFEDChannelCollection & SiPixelFEDChannelContainer::getSiPixelBadFedChannels ( const std::string &  ScenarioId)

Definition at line 33 of file SiPixelFEDChannelContainer.cc.

34  {
35  SiPixelBadFEDChannelsScenarioMap::const_iterator it = m_scenarioMap.find(theScenarioId);
36 
37  if (it != m_scenarioMap.end()) {
38  return it->second;
39  } else {
40  throw cms::Exception("SiPixelFEDChannelContainer")
41  << "No Bad Pixel FEDChannels defined for Scenario id: " << theScenarioId << "\n";
42  }
43 }

References Exception, and m_scenarioMap.

◆ getSiPixelBadFedChannels() [2/2]

SiPixelFEDChannelContainer::SiPixelFEDChannelCollection SiPixelFEDChannelContainer::getSiPixelBadFedChannels ( const std::string &  ScenarioId) const

Definition at line 20 of file SiPixelFEDChannelContainer.cc.

21  {
22  SiPixelBadFEDChannelsScenarioMap::const_iterator it = m_scenarioMap.find(theScenarioId);
23 
24  if (it != m_scenarioMap.end()) {
25  return it->second;
26  } else {
27  throw cms::Exception("SiPixelFEDChannelContainer")
28  << "No Bad Pixel FEDChannels defined for Scenario id: " << theScenarioId << "\n";
29  }
30 }

References Exception, and m_scenarioMap.

◆ getSiPixelBadFedChannelsInDetId()

const std::vector< PixelFEDChannel > & SiPixelFEDChannelContainer::getSiPixelBadFedChannelsInDetId ( const std::string &  theScenarioId,
DetId  theDetId 
)

Definition at line 46 of file SiPixelFEDChannelContainer.cc.

47  {
48  SiPixelBadFEDChannelsScenarioMap::const_iterator it = m_scenarioMap.find(theScenarioId);
49 
50  if (it == m_scenarioMap.end()) {
51  throw cms::Exception("SiPixelFEDChannelContainer")
52  << "No Bad Pixel FEDChannels defined for Scenario id: " << theScenarioId << "\n";
53  } else {
54  SiPixelFEDChannelCollection::const_iterator it2 = (it->second).find(theDetId);
55 
56  if (it2 == (it->second).end()) {
57  throw cms::Exception("SiPixelFEDChannelContainer")
58  << "No Bad Pixel FEDChannels defined for DetId:" << theDetId << " in Scenario id: " << theScenarioId << "\n";
59  }
60  return it2->second;
61  }
62 }

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

◆ print()

void SiPixelFEDChannelContainer::print ( std::ostream &  os) const

Definition at line 106 of file SiPixelFEDChannelContainer.cc.

106  {
107  for (auto it = m_scenarioMap.begin(); it != m_scenarioMap.end(); ++it) {
108  os << "run :" << it->first << " \n ";
109  for (const auto &thePixelFEDChannel : it->second) {
110  DetId detId = thePixelFEDChannel.first;
111  os << "DetId :" << detId << " \n ";
112  for (const auto &entry : thePixelFEDChannel.second) {
113  os << " fed : " << entry.fed << " link : " << entry.link << " roc_first : " << entry.roc_first
114  << " roc_last: : " << entry.roc_last;
115  }
116  }
117  }
118 }

References mps_splice::entry, and m_scenarioMap.

Referenced by operator<<().

◆ printAll()

void SiPixelFEDChannelContainer::printAll ( ) const

Definition at line 84 of file SiPixelFEDChannelContainer.cc.

84  {
85  edm::LogVerbatim("SiPixelFEDChannelContainer") << "SiPixelFEDChannelContainer::printAll()";
86  edm::LogVerbatim("SiPixelFEDChannelContainer") << " ================================================================="
87  "==================================================";
88  for (auto it = m_scenarioMap.begin(); it != m_scenarioMap.end(); ++it) {
89  edm::LogVerbatim("SiPixelFEDChannelContainer") << "run :" << it->first << " \n ";
90  for (const auto &thePixelFEDChannel : it->second) {
91  DetId detId = thePixelFEDChannel.first;
92 
93  edm::LogVerbatim("SiPixelFEDChannelContainer") << "DetId :" << detId << " \n ";
94 
95  for (const auto &entry : thePixelFEDChannel.second) {
96  //unsigned int fed, link, roc_first, roc_last;
97  edm::LogVerbatim("SiPixelFEDChannelContainer")
98  << " fed : " << entry.fed << " link : " << entry.link << " roc_first : " << entry.roc_first
99  << " roc_last: : " << entry.roc_last;
100  }
101  }
102  }
103 }

References mps_splice::entry, and m_scenarioMap.

◆ serialize()

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

◆ setScenario()

void SiPixelFEDChannelContainer::setScenario ( const std::string &  theScenarioId,
const SiPixelFEDChannelCollection theBadFEDChannels 
)

Definition at line 8 of file SiPixelFEDChannelContainer.cc.

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

References m_scenarioMap.

◆ size()

double SiPixelFEDChannelContainer::size ( void  ) const
inline

Definition at line 32 of file SiPixelFEDChannelContainer.h.

32 { return m_scenarioMap.size(); }

References m_scenarioMap.

Referenced by ntupleDataFormat._Collection::__iter__(), and ntupleDataFormat._Collection::__len__().

Friends And Related Function Documentation

◆ boost::serialization::access

friend class boost::serialization::access
friend

Definition at line 43 of file SiPixelFEDChannelContainer.h.

◆ cond::serialization::access

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

Definition at line 43 of file SiPixelFEDChannelContainer.h.

Member Data Documentation

◆ m_scenarioMap

SiPixelBadFEDChannelsScenarioMap SiPixelFEDChannelContainer::m_scenarioMap
private
mps_splice.entry
entry
Definition: mps_splice.py:68
spr::find
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
Definition: FindCaloHit.cc:19
edm::LogWarning
Log< level::Warning, false > LogWarning
Definition: MessageLogger.h:122
DetId
Definition: DetId.h:17
visualization-live-secondInstance_cfg.scenarios
scenarios
Definition: visualization-live-secondInstance_cfg.py:22
SiPixelFEDChannelContainer::getScenarioMap
const SiPixelBadFEDChannelsScenarioMap & getScenarioMap() const
Definition: SiPixelFEDChannelContainer.h:23
edm::LogVerbatim
Log< level::Info, true > LogVerbatim
Definition: MessageLogger.h:128
Exception
Definition: hltDiff.cc:246
SiPixelFEDChannelContainer::m_scenarioMap
SiPixelBadFEDChannelsScenarioMap m_scenarioMap
Definition: SiPixelFEDChannelContainer.h:41