CMS 3D CMS Logo

List of all members | Public Member Functions | Private Attributes
SiStripBadComponentsDQMServiceReader Class Reference

#include <SiStripBadComponentsDQMServiceReader.h>

Inheritance diagram for SiStripBadComponentsDQMServiceReader:
edm::EDAnalyzer 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
 
- Public Member Functions inherited from edm::EDAnalyzer
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
 EDAnalyzer ()
 
SerialTaskQueueglobalLuminosityBlocksQueue ()
 
SerialTaskQueueglobalRunsQueue ()
 
ModuleDescription const & moduleDescription () const
 
std::string workerType () const
 
 ~EDAnalyzer () 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 &&)=default
 
 EDConsumerBase (EDConsumerBase const &)=delete
 
ESProxyIndex const * esGetTokenIndices (edm::Transition iTrans) const
 
std::vector< ESProxyIndex > 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
 
EDConsumerBaseoperator= (EDConsumerBase &&)=default
 
EDConsumerBase const & operator= (EDConsumerBase const &)=delete
 
bool registeredToConsume (ProductResolverIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
ProductResolverIndexAndSkipBit uncheckedIndexFrom (EDGetToken) const
 
void updateLookup (BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet)
 
void updateLookup (eventsetup::ESRecordsToProxyIndices const &)
 
virtual ~EDConsumerBase () noexcept(false)
 

Private Attributes

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

Additional Inherited Members

- Public Types inherited from edm::EDAnalyzer
typedef EDAnalyzer ModuleType
 
- Public Types inherited from edm::EDConsumerBase
typedef ProductLabels Labels
 
- Static Public Member Functions inherited from edm::EDAnalyzer
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &)
 
static bool wantsGlobalLuminosityBlocks ()
 
static bool wantsGlobalRuns ()
 
static bool wantsInputProcessBlocks ()
 
static bool wantsProcessBlocks ()
 
static bool wantsStreamLuminosityBlocks ()
 
static bool wantsStreamRuns ()
 
- Protected Member Functions inherited from edm::EDConsumerBase
EDGetToken consumes (const TypeToGet &id, edm::InputTag const &tag)
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (edm::InputTag const &tag)
 
template<BranchType B = InEvent>
EDConsumerBaseAdaptor< B > consumes (edm::InputTag tag) noexcept
 
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 ProductType , BranchType B = InEvent>
void consumesMany ()
 
void consumesMany (const TypeToGet &id)
 
template<BranchType B>
void consumesMany (const TypeToGet &id)
 
template<typename ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes ()
 
template<Transition Tr = Transition::Event>
constexpr auto esConsumes () noexcept
 
template<typename ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes (ESInputTag const &tag)
 
template<Transition Tr = Transition::Event>
auto esConsumes (ESInputTag tag) noexcept
 
template<Transition Tr = Transition::Event>
ESGetTokenGeneric esConsumes (eventsetup::EventSetupRecordKey const &iRecord, eventsetup::DataKey const &iKey)
 Used with EventSetupRecord::doGet. More...
 
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > mayConsume (edm::InputTag const &tag)
 

Detailed Description

Definition at line 25 of file SiStripBadComponentsDQMServiceReader.h.

Constructor & Destructor Documentation

◆ SiStripBadComponentsDQMServiceReader()

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

Definition at line 15 of file SiStripBadComponentsDQMServiceReader.cc.

16  : printdebug_(iConfig.getUntrackedParameter<bool>("printDebug", true)),

◆ ~SiStripBadComponentsDQMServiceReader()

SiStripBadComponentsDQMServiceReader::~SiStripBadComponentsDQMServiceReader ( )
override

Definition at line 20 of file SiStripBadComponentsDQMServiceReader.cc.

20 {}

Member Function Documentation

◆ analyze()

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

Implements edm::EDAnalyzer.

Definition at line 22 of file SiStripBadComponentsDQMServiceReader.cc.

22  {
23  //Retrieve tracker topology from geometry
24  const auto& tTopo = iSetup.getData(tTopoToken_);
25 
26  uint32_t FedErrorMask = 1; // bit 0
27  uint32_t DigiErrorMask = 2; // bit 1
28  uint32_t ClusterErrorMask = 4; // bit 2
29 
30  const auto& siStripBadStrip = iSetup.getData(badStripToken_);
31  edm::LogInfo("SiStripBadComponentsDQMServiceReader")
32  << "[SiStripBadComponentsDQMServiceReader::analyze] End Reading SiStripBadStrip" << std::endl;
33 
34  std::vector<uint32_t> detid;
35  siStripBadStrip.getDetIds(detid);
36 
37  std::stringstream ss;
38 
39  // ss << " detid" << " \t\t\t" << "FED error" << " \t" << "Digi test failed" << " \t" << "Cluster test failed" << std::endl;
40 
41  ss << "subdet layer stereo side \t detId \t\t Errors" << std::endl;
42 
43  for (size_t id = 0; id < detid.size(); id++) {
44  SiStripBadStrip::Range range = siStripBadStrip.getRange(detid[id]);
45 
46  for (int it = 0; it < range.second - range.first; it++) {
47  unsigned int value = (*(range.first + it));
48  ss << detIdToString(detid[id], tTopo) << "\t" << detid[id] << "\t";
49 
50  uint32_t flag = boost::lexical_cast<uint32_t>(siStripBadStrip.decode(value).flag);
51 
52  printError(ss, ((flag & FedErrorMask) == FedErrorMask), "Fed error, ");
53  printError(ss, ((flag & DigiErrorMask) == DigiErrorMask), "Digi error, ");
54  printError(ss, ((flag & ClusterErrorMask) == ClusterErrorMask), "Cluster error");
55  ss << std::endl;
56 
57  if (printdebug_) {
58  ss << " firstBadStrip " << siStripBadStrip.decode(value).firstStrip << "\t "
59  << " NconsecutiveBadStrips " << siStripBadStrip.decode(value).range << "\t " // << std::endl;
60  << " flag " << siStripBadStrip.decode(value).flag << "\t "
61  << " packed integer " << std::hex << value << std::dec << "\t " << std::endl;
62  }
63  }
64  ss << std::endl;
65  }
66  edm::LogInfo("SiStripBadComponentsDQMServiceReader") << ss.str();
67 }

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

◆ detIdToString()

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

Definition at line 79 of file SiStripBadComponentsDQMServiceReader.cc.

79  {
81  int layer = 0;
82  int stereo = 0;
83  int side = -1;
84 
85  // Using the operator[] if the element does not exist it is created with the default value. That is 0 for integral types.
86  switch (detid.subdetId()) {
87  case StripSubdetector::TIB: {
88  detector = "TIB";
89  layer = tTopo.tibLayer(detid.rawId());
90  stereo = tTopo.tibStereo(detid.rawId());
91  break;
92  }
93  case StripSubdetector::TOB: {
94  detector = "TOB";
95  layer = tTopo.tobLayer(detid.rawId());
96  stereo = tTopo.tobStereo(detid.rawId());
97  break;
98  }
99  case StripSubdetector::TEC: {
100  // is this module in TEC+ or TEC-?
101  side = tTopo.tecSide(detid.rawId());
102  detector = "TEC";
103  layer = tTopo.tecWheel(detid.rawId());
104  stereo = tTopo.tecStereo(detid.rawId());
105  break;
106  }
107  case StripSubdetector::TID: {
108  // is this module in TID+ or TID-?
109  side = tTopo.tidSide(detid.rawId());
110  detector = "TID";
111  layer = tTopo.tidWheel(detid.rawId());
112  stereo = tTopo.tidStereo(detid.rawId());
113  break;
114  }
115  }
116  std::string name(detector + "\t" + std::to_string(layer) + "\t" + std::to_string(stereo) + "\t");
117  if (side == 1) {
118  name += "-";
119  } else if (side == 2) {
120  name += "+";
121  }
122  // if( side != -1 ) {
123  // name += boost::lexical_cast<string>(side);
124  // }
125 
126  return name;
127 }

References hgcalTestNeighbor_cfi::detector, phase1PixelTopology::layer, Skims_PA_cff::name, DetId::rawId(), 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(), StripSubdetector::TOB, TrackerTopology::tobLayer(), and TrackerTopology::tobStereo().

Referenced by analyze().

◆ printError()

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

Definition at line 69 of file SiStripBadComponentsDQMServiceReader.cc.

71  {
72  if (error) {
73  ss << errorText << "\t ";
74  } else {
75  ss << "\t\t ";
76  }
77 }

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

Referenced by analyze().

Member Data Documentation

◆ badStripToken_

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

Definition at line 39 of file SiStripBadComponentsDQMServiceReader.h.

Referenced by analyze().

◆ printdebug_

bool SiStripBadComponentsDQMServiceReader::printdebug_
private

Definition at line 37 of file SiStripBadComponentsDQMServiceReader.h.

Referenced by analyze().

◆ tTopoToken_

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

Definition at line 38 of file SiStripBadComponentsDQMServiceReader.h.

Referenced by analyze().

FastTimerService_cff.range
range
Definition: FastTimerService_cff.py:34
edm::ParameterSet::getUntrackedParameter
T getUntrackedParameter(std::string const &, T const &) const
edm::LogInfo
Log< level::Info, false > LogInfo
Definition: MessageLogger.h:125
relativeConstraints.error
error
Definition: relativeConstraints.py:53
TrackerTopology::tobStereo
uint32_t tobStereo(const DetId &id) const
Definition: TrackerTopology.h:275
TrackerTopology::tidWheel
unsigned int tidWheel(const DetId &id) const
Definition: TrackerTopology.h:201
contentValuesCheck.ss
ss
Definition: contentValuesCheck.py:33
SiStripBadComponentsDQMServiceReader::printdebug_
bool printdebug_
Definition: SiStripBadComponentsDQMServiceReader.h:37
SiStripBadStrip::Range
std::pair< ContainerIterator, ContainerIterator > Range
Definition: SiStripBadStrip.h:53
SiStripBadComponentsDQMServiceReader::tTopoToken_
edm::ESGetToken< TrackerTopology, TrackerTopologyRcd > tTopoToken_
Definition: SiStripBadComponentsDQMServiceReader.h:38
StripSubdetector::TIB
static constexpr auto TIB
Definition: StripSubdetector.h:16
DetId::subdetId
constexpr int subdetId() const
get the contents of the subdetector field (not cast into any detector's numbering enum)
Definition: DetId.h:48
phase1PixelTopology::layer
constexpr std::array< uint8_t, layerIndexSize > layer
Definition: phase1PixelTopology.h:99
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
TrackerTopology::tibStereo
uint32_t tibStereo(const DetId &id) const
Definition: TrackerTopology.h:279
SiStripBadComponentsDQMServiceReader::printError
void printError(std::stringstream &ss, const bool error, const std::string &errorText)
Definition: SiStripBadComponentsDQMServiceReader.cc:69
SiStripBadComponentsDQMServiceReader::badStripToken_
edm::ESGetToken< SiStripBadStrip, SiStripBadStripRcd > badStripToken_
Definition: SiStripBadComponentsDQMServiceReader.h:39
TrackerTopology::tidStereo
uint32_t tidStereo(const DetId &id) const
Definition: TrackerTopology.h:283
TrackerTopology::tidSide
unsigned int tidSide(const DetId &id) const
Definition: TrackerTopology.h:190
value
Definition: value.py:1
edm::EventSetup::getData
bool getData(T &iHolder) const
Definition: EventSetup.h:127
TrackerTopology::tobLayer
unsigned int tobLayer(const DetId &id) const
Definition: TrackerTopology.h:147
DetId::rawId
constexpr uint32_t rawId() const
get the raw id
Definition: DetId.h:57
StripSubdetector::TEC
static constexpr auto TEC
Definition: StripSubdetector.h:19
triggerObjects_cff.id
id
Definition: triggerObjects_cff.py:29
StripSubdetector::TOB
static constexpr auto TOB
Definition: StripSubdetector.h:18
Skims_PA_cff.name
name
Definition: Skims_PA_cff.py:17
hgcalTestNeighbor_cfi.detector
detector
Definition: hgcalTestNeighbor_cfi.py:6
edm::EDConsumerBase::esConsumes
auto esConsumes()
Definition: EDConsumerBase.h:202
SiStripBadComponentsDQMServiceReader::detIdToString
std::string detIdToString(DetId detid, const TrackerTopology &tTopo)
Definition: SiStripBadComponentsDQMServiceReader.cc:79
TrackerTopology::tecWheel
unsigned int tecWheel(const DetId &id) const
Definition: TrackerTopology.h:198
TauDecayModes.dec
dec
Definition: TauDecayModes.py:143
StripSubdetector::TID
static constexpr auto TID
Definition: StripSubdetector.h:17
TrackerTopology::tecStereo
uint32_t tecStereo(const DetId &id) const
Definition: TrackerTopology.h:287
RemoveAddSevLevel.flag
flag
Definition: RemoveAddSevLevel.py:116
TrackerTopology::tibLayer
unsigned int tibLayer(const DetId &id) const
Definition: TrackerTopology.h:150
TrackerTopology::tecSide
unsigned int tecSide(const DetId &id) const
Definition: TrackerTopology.h:184