CMS 3D CMS Logo

List of all members | Public Member Functions | Private Attributes
SiStripBadComponentsDQMServiceReader Class Reference
Inheritance diagram for SiStripBadComponentsDQMServiceReader:
edm::one::EDAnalyzer<> edm::one::EDAnalyzerBase edm::EDConsumerBase

Public Member Functions

void analyze (const edm::Event &, const edm::EventSetup &) override
 
std::string detIdToString (DetId detid, const TrackerTopology &tTopo)
 
void printError (std::stringstream &ss, const bool error, const std::string &errorText)
 
 SiStripBadComponentsDQMServiceReader (const edm::ParameterSet &)
 
 ~SiStripBadComponentsDQMServiceReader () override=default
 
- Public Member Functions inherited from edm::one::EDAnalyzer<>
 EDAnalyzer ()=default
 
 EDAnalyzer (const EDAnalyzer &)=delete
 
SerialTaskQueueglobalLuminosityBlocksQueue () final
 
SerialTaskQueueglobalRunsQueue () final
 
const EDAnalyzeroperator= (const EDAnalyzer &)=delete
 
bool wantsGlobalLuminosityBlocks () const final
 
bool wantsGlobalRuns () const final
 
bool wantsInputProcessBlocks () const final
 
bool wantsProcessBlocks () const final
 
- Public Member Functions inherited from edm::one::EDAnalyzerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
 EDAnalyzerBase ()
 
ModuleDescription const & moduleDescription () const
 
bool wantsStreamLuminosityBlocks () const
 
bool wantsStreamRuns () const
 
 ~EDAnalyzerBase () override
 
- Public Member Functions inherited from edm::EDConsumerBase
std::vector< ConsumesInfoconsumesInfo () const
 
void convertCurrentProcessAlias (std::string const &processName)
 Convert "@currentProcess" in InputTag process names to the actual current process name. More...
 
 EDConsumerBase ()
 
 EDConsumerBase (EDConsumerBase const &)=delete
 
 EDConsumerBase (EDConsumerBase &&)=default
 
ESResolverIndex const * esGetTokenIndices (edm::Transition iTrans) const
 
std::vector< ESResolverIndex > const & esGetTokenIndicesVector (edm::Transition iTrans) const
 
std::vector< ESRecordIndex > const & esGetTokenRecordIndicesVector (edm::Transition iTrans) const
 
ProductResolverIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
std::vector< ProductResolverIndexAndSkipBit > const & itemsToGetFrom (BranchType iType) const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void modulesWhoseProductsAreConsumed (std::array< std::vector< ModuleDescription const *> *, NumBranchTypes > &modulesAll, std::vector< ModuleProcessName > &modulesInPreviousProcesses, ProductRegistry const &preg, std::map< std::string, ModuleDescription const *> const &labelsToDesc, std::string const &processName) const
 
EDConsumerBase const & operator= (EDConsumerBase const &)=delete
 
EDConsumerBaseoperator= (EDConsumerBase &&)=default
 
bool registeredToConsume (ProductResolverIndex, bool, BranchType) const
 
void selectInputProcessBlocks (ProductRegistry const &productRegistry, ProcessBlockHelperBase const &processBlockHelperBase)
 
ProductResolverIndexAndSkipBit uncheckedIndexFrom (EDGetToken) const
 
void updateLookup (BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet)
 
void updateLookup (eventsetup::ESRecordsToProductResolverIndices const &)
 
virtual ~EDConsumerBase () noexcept(false)
 

Private Attributes

const edm::ESGetToken< SiStripBadStrip, SiStripBadStripRcdbadStripToken_
 
const bool printdebug_
 
const edm::ESGetToken< TrackerTopology, TrackerTopologyRcdtTopoToken_
 

Additional Inherited Members

- Public Types inherited from edm::one::EDAnalyzerBase
typedef EDAnalyzerBase ModuleType
 
- Public Types inherited from edm::EDConsumerBase
typedef ProductLabels Labels
 
- Static Public Member Functions inherited from edm::one::EDAnalyzerBase
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 
- Protected Member Functions inherited from edm::EDConsumerBase
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (edm::InputTag const &tag)
 
template<BranchType B = InEvent>
EDConsumerBaseAdaptor< Bconsumes (edm::InputTag tag) noexcept
 
EDGetToken consumes (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken consumes (TypeToGet const &id, edm::InputTag const &tag)
 
ConsumesCollector consumesCollector ()
 Use a ConsumesCollector to gather consumes information from helper functions. More...
 
template<typename ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes ()
 
template<typename ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes (ESInputTag const &tag)
 
template<Transition Tr = Transition::Event>
constexpr auto esConsumes ()
 
template<Transition Tr = Transition::Event>
auto esConsumes (ESInputTag tag)
 
template<Transition Tr = Transition::Event>
ESGetTokenGeneric esConsumes (eventsetup::EventSetupRecordKey const &iRecord, eventsetup::DataKey const &iKey)
 Used with EventSetupRecord::doGet. More...
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > mayConsume (edm::InputTag const &tag)
 
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
void resetItemsToGetFrom (BranchType iType)
 

Detailed Description

Definition at line 26 of file SiStripBadComponentsDQMServiceReader.cc.

Constructor & Destructor Documentation

◆ SiStripBadComponentsDQMServiceReader()

SiStripBadComponentsDQMServiceReader::SiStripBadComponentsDQMServiceReader ( const edm::ParameterSet iConfig)
explicit

Definition at line 45 of file SiStripBadComponentsDQMServiceReader.cc.

46  : printdebug_(iConfig.getUntrackedParameter<bool>("printDebug", true)),
const edm::ESGetToken< TrackerTopology, TrackerTopologyRcd > tTopoToken_
T getUntrackedParameter(std::string const &, T const &) const
const edm::ESGetToken< SiStripBadStrip, SiStripBadStripRcd > badStripToken_

◆ ~SiStripBadComponentsDQMServiceReader()

SiStripBadComponentsDQMServiceReader::~SiStripBadComponentsDQMServiceReader ( )
overridedefault

Member Function Documentation

◆ analyze()

void SiStripBadComponentsDQMServiceReader::analyze ( const edm::Event e,
const edm::EventSetup iSetup 
)
overridevirtual

Implements edm::one::EDAnalyzerBase.

Definition at line 50 of file SiStripBadComponentsDQMServiceReader.cc.

References badStripToken_, TauDecayModes::dec, detIdToString(), RemoveAddSevLevel::flag, edm::EventSetup::getData(), l1ctLayer2EG_cff::id, ALPAKA_ACCELERATOR_NAMESPACE::vertexFinder::it, printdebug_, printError(), FastTimerService_cff::range, contentValuesCheck::ss, and tTopoToken_.

50  {
51  //Retrieve tracker topology from geometry
52  const auto& tTopo = iSetup.getData(tTopoToken_);
53 
54  uint32_t FedErrorMask = 1; // bit 0
55  uint32_t DigiErrorMask = 2; // bit 1
56  uint32_t ClusterErrorMask = 4; // bit 2
57 
58  const auto& siStripBadStrip = iSetup.getData(badStripToken_);
59  edm::LogInfo("SiStripBadComponentsDQMServiceReader")
60  << "[SiStripBadComponentsDQMServiceReader::analyze] End Reading SiStripBadStrip" << std::endl;
61 
62  std::vector<uint32_t> detid;
63  siStripBadStrip.getDetIds(detid);
64 
65  std::stringstream ss;
66 
67  // ss << " detid" << " \t\t\t" << "FED error" << " \t" << "Digi test failed" << " \t" << "Cluster test failed" << std::endl;
68 
69  ss << "subdet layer stereo side \t detId \t\t Errors" << std::endl;
70 
71  for (size_t id = 0; id < detid.size(); id++) {
72  SiStripBadStrip::Range range = siStripBadStrip.getRange(detid[id]);
73 
74  for (int it = 0; it < range.second - range.first; it++) {
75  unsigned int value = (*(range.first + it));
76  ss << detIdToString(detid[id], tTopo) << "\t" << detid[id] << "\t";
77 
78  uint32_t flag = static_cast<uint32_t>(siStripBadStrip.decode(value).flag);
79 
80  printError(ss, ((flag & FedErrorMask) == FedErrorMask), "Fed error, ");
81  printError(ss, ((flag & DigiErrorMask) == DigiErrorMask), "Digi error, ");
82  printError(ss, ((flag & ClusterErrorMask) == ClusterErrorMask), "Cluster error");
83  ss << std::endl;
84 
85  if (printdebug_) {
86  ss << " firstBadStrip " << siStripBadStrip.decode(value).firstStrip << "\t "
87  << " NconsecutiveBadStrips " << siStripBadStrip.decode(value).range << "\t " // << std::endl;
88  << " flag " << siStripBadStrip.decode(value).flag << "\t "
89  << " packed integer " << std::hex << value << std::dec << "\t " << std::endl;
90  }
91  }
92  ss << std::endl;
93  }
94  edm::LogInfo("SiStripBadComponentsDQMServiceReader") << ss.str();
95 }
std::string detIdToString(DetId detid, const TrackerTopology &tTopo)
T const & getData(const ESGetToken< T, R > &iToken) const noexcept(false)
Definition: EventSetup.h:119
void printError(std::stringstream &ss, const bool error, const std::string &errorText)
const edm::ESGetToken< TrackerTopology, TrackerTopologyRcd > tTopoToken_
Definition: value.py:1
Log< level::Info, false > LogInfo
const edm::ESGetToken< SiStripBadStrip, SiStripBadStripRcd > badStripToken_
std::pair< ContainerIterator, ContainerIterator > Range

◆ detIdToString()

string SiStripBadComponentsDQMServiceReader::detIdToString ( DetId  detid,
const TrackerTopology tTopo 
)

Definition at line 107 of file SiStripBadComponentsDQMServiceReader.cc.

References hgcalTestNeighbor_cfi::detector, nano_mu_digi_cff::layer, Skims_PA_cff::name, DetId::rawId(), ALPAKA_ACCELERATOR_NAMESPACE::ecal::reconstruction::internal::barrel::side(), AlCaHLTBitMon_QueryRunRegistry::string, DetId::subdetId(), StripSubdetector::TEC, TrackerTopology::tecSide(), TrackerTopology::tecStereo(), TrackerTopology::tecWheel(), StripSubdetector::TIB, TrackerTopology::tibLayer(), TrackerTopology::tibStereo(), StripSubdetector::TID, TrackerTopology::tidSide(), TrackerTopology::tidStereo(), TrackerTopology::tidWheel(), to_string(), StripSubdetector::TOB, TrackerTopology::tobLayer(), and TrackerTopology::tobStereo().

Referenced by analyze().

107  {
109  int layer = 0;
110  int stereo = 0;
111  int side = -1;
112 
113  // Using the operator[] if the element does not exist it is created with the default value. That is 0 for integral types.
114  switch (detid.subdetId()) {
115  case StripSubdetector::TIB: {
116  detector = "TIB";
117  layer = tTopo.tibLayer(detid.rawId());
118  stereo = tTopo.tibStereo(detid.rawId());
119  break;
120  }
121  case StripSubdetector::TOB: {
122  detector = "TOB";
123  layer = tTopo.tobLayer(detid.rawId());
124  stereo = tTopo.tobStereo(detid.rawId());
125  break;
126  }
127  case StripSubdetector::TEC: {
128  // is this module in TEC+ or TEC-?
129  side = tTopo.tecSide(detid.rawId());
130  detector = "TEC";
131  layer = tTopo.tecWheel(detid.rawId());
132  stereo = tTopo.tecStereo(detid.rawId());
133  break;
134  }
135  case StripSubdetector::TID: {
136  // is this module in TID+ or TID-?
137  side = tTopo.tidSide(detid.rawId());
138  detector = "TID";
139  layer = tTopo.tidWheel(detid.rawId());
140  stereo = tTopo.tidStereo(detid.rawId());
141  break;
142  }
143  }
144  std::string name(detector + "\t" + std::to_string(layer) + "\t" + std::to_string(stereo) + "\t");
145  if (side == 1) {
146  name += "-";
147  } else if (side == 2) {
148  name += "+";
149  }
150  // if( side != -1 ) {
151  // name += std::to_string(side);
152  // }
153 
154  return name;
155 }
static constexpr auto TEC
unsigned int tobLayer(const DetId &id) const
uint32_t tidStereo(const DetId &id) const
unsigned int tidSide(const DetId &id) const
unsigned int tidWheel(const DetId &id) const
unsigned int tecWheel(const DetId &id) const
static std::string to_string(const XMLCh *ch)
uint32_t tobStereo(const DetId &id) const
unsigned int tecSide(const DetId &id) const
constexpr int subdetId() const
get the contents of the subdetector field (not cast into any detector&#39;s numbering enum) ...
Definition: DetId.h:48
static constexpr auto TOB
static constexpr auto TIB
constexpr uint32_t rawId() const
get the raw id
Definition: DetId.h:57
uint32_t tecStereo(const DetId &id) const
unsigned int tibLayer(const DetId &id) const
static constexpr auto TID
uint32_t tibStereo(const DetId &id) const

◆ printError()

void SiStripBadComponentsDQMServiceReader::printError ( std::stringstream &  ss,
const bool  error,
const std::string &  errorText 
)

Definition at line 97 of file SiStripBadComponentsDQMServiceReader.cc.

References relativeConstraints::error, and contentValuesCheck::ss.

Referenced by analyze().

99  {
100  if (error) {
101  ss << errorText << "\t ";
102  } else {
103  ss << "\t\t ";
104  }
105 }

Member Data Documentation

◆ badStripToken_

const edm::ESGetToken<SiStripBadStrip, SiStripBadStripRcd> SiStripBadComponentsDQMServiceReader::badStripToken_
private

Definition at line 40 of file SiStripBadComponentsDQMServiceReader.cc.

Referenced by analyze().

◆ printdebug_

const bool SiStripBadComponentsDQMServiceReader::printdebug_
private

Definition at line 38 of file SiStripBadComponentsDQMServiceReader.cc.

Referenced by analyze().

◆ tTopoToken_

const edm::ESGetToken<TrackerTopology, TrackerTopologyRcd> SiStripBadComponentsDQMServiceReader::tTopoToken_
private

Definition at line 39 of file SiStripBadComponentsDQMServiceReader.cc.

Referenced by analyze().