CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
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 const &)=delete
 
 EDConsumerBase (EDConsumerBase &&)=default
 
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
 
EDConsumerBase const & operator= (EDConsumerBase const &)=delete
 
EDConsumerBaseoperator= (EDConsumerBase &&)=default
 
bool registeredToConsume (ProductResolverIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, 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::ESRecordsToProxyIndices const &)
 
virtual ~EDConsumerBase () noexcept(false)
 

Private Attributes

edm::ESGetToken
< SiStripBadStrip,
SiStripBadStripRcd
badStripToken_
 
bool printdebug_
 
edm::ESGetToken
< TrackerTopology,
TrackerTopologyRcd
tTopoToken_
 

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
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (edm::InputTag const &tag)
 
template<BranchType B = InEvent>
EDConsumerBaseAdaptor< B > consumes (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 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<typename ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes (ESInputTag const &tag)
 
template<Transition Tr = Transition::Event>
constexpr auto esConsumes () noexcept
 
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...
 
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 25 of file SiStripBadComponentsDQMServiceReader.h.

Constructor & Destructor Documentation

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

Definition at line 13 of file SiStripBadComponentsDQMServiceReader.cc.

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

Definition at line 18 of file SiStripBadComponentsDQMServiceReader.cc.

18 {}

Member Function Documentation

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

Implements edm::EDAnalyzer.

Definition at line 20 of file SiStripBadComponentsDQMServiceReader.cc.

References badStripToken_, TauDecayModes::dec, detIdToString(), edm::EventSetup::getData(), gpuClustering::id, printdebug_, printError(), sistrip::SpyUtilities::range(), contentValuesCheck::ss, tTopoToken_, and relativeConstraints::value.

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

Definition at line 77 of file SiStripBadComponentsDQMServiceReader.cc.

References phase1PixelTopology::layer, mergeVDriftHistosByStation::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().

77  {
78  std::string detector;
79  int layer = 0;
80  int stereo = 0;
81  int side = -1;
82 
83  // Using the operator[] if the element does not exist it is created with the default value. That is 0 for integral types.
84  switch (detid.subdetId()) {
85  case StripSubdetector::TIB: {
86  detector = "TIB";
87  layer = tTopo.tibLayer(detid.rawId());
88  stereo = tTopo.tibStereo(detid.rawId());
89  break;
90  }
91  case StripSubdetector::TOB: {
92  detector = "TOB";
93  layer = tTopo.tobLayer(detid.rawId());
94  stereo = tTopo.tobStereo(detid.rawId());
95  break;
96  }
97  case StripSubdetector::TEC: {
98  // is this module in TEC+ or TEC-?
99  side = tTopo.tecSide(detid.rawId());
100  detector = "TEC";
101  layer = tTopo.tecWheel(detid.rawId());
102  stereo = tTopo.tecStereo(detid.rawId());
103  break;
104  }
105  case StripSubdetector::TID: {
106  // is this module in TID+ or TID-?
107  side = tTopo.tidSide(detid.rawId());
108  detector = "TID";
109  layer = tTopo.tidWheel(detid.rawId());
110  stereo = tTopo.tidStereo(detid.rawId());
111  break;
112  }
113  }
114  std::string name(detector + "\t" + std::to_string(layer) + "\t" + std::to_string(stereo) + "\t");
115  if (side == 1) {
116  name += "-";
117  } else if (side == 2) {
118  name += "+";
119  }
120  // if( side != -1 ) {
121  // name += std::to_string(side);
122  // }
123 
124  return name;
125 }
static constexpr auto TEC
unsigned int tibLayer(const DetId &id) const
uint32_t tobStereo(const DetId &id) const
constexpr uint32_t rawId() const
get the raw id
Definition: DetId.h:57
unsigned int tidWheel(const DetId &id) const
constexpr std::array< uint8_t, layerIndexSize > layer
unsigned int tidSide(const DetId &id) const
uint32_t tidStereo(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
uint32_t tecStereo(const DetId &id) const
uint32_t tibStereo(const DetId &id) const
unsigned int tecWheel(const DetId &id) const
static constexpr auto TID
unsigned int tobLayer(const DetId &id) const
unsigned int tecSide(const DetId &id) const
void SiStripBadComponentsDQMServiceReader::printError ( std::stringstream &  ss,
const bool  error,
const std::string &  errorText 
)

Definition at line 67 of file SiStripBadComponentsDQMServiceReader.cc.

Referenced by analyze().

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

Member Data Documentation

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

Definition at line 39 of file SiStripBadComponentsDQMServiceReader.h.

Referenced by analyze().

bool SiStripBadComponentsDQMServiceReader::printdebug_
private

Definition at line 37 of file SiStripBadComponentsDQMServiceReader.h.

Referenced by analyze().

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

Definition at line 38 of file SiStripBadComponentsDQMServiceReader.h.

Referenced by analyze().