CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros 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 &)
 
std::string detIdToString (const DetId &detid, const TrackerTopology *tTopo)
 
void printError (std::stringstream &ss, const bool error, const std::string &errorText)
 
 SiStripBadComponentsDQMServiceReader (const edm::ParameterSet &)
 
 ~SiStripBadComponentsDQMServiceReader ()
 
- Public Member Functions inherited from edm::EDAnalyzer
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
 EDAnalyzer ()
 
ModuleDescription const & moduleDescription () const
 
std::string workerType () const
 
virtual ~EDAnalyzer ()
 
- Public Member Functions inherited from edm::EDConsumerBase
 EDConsumerBase ()
 
ProductHolderIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductHolderIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductHolderIndexAndSkipBit > &) const
 
std::vector
< ProductHolderIndexAndSkipBit >
const & 
itemsToGetFromEvent () const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void modulesDependentUpon (const std::string &iProcessName, std::vector< const char * > &oModuleLabels) const
 
bool registeredToConsume (ProductHolderIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
void updateLookup (BranchType iBranchType, ProductHolderIndexHelper const &)
 
virtual ~EDConsumerBase ()
 

Private Attributes

bool printdebug_
 

Additional Inherited Members

- Public Types inherited from edm::EDAnalyzer
typedef EDAnalyzer ModuleType
 
- Static Public Member Functions inherited from edm::EDAnalyzer
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &)
 
- Protected Member Functions inherited from edm::EDConsumerBase
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (edm::InputTag const &tag)
 
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 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)
 

Detailed Description

Definition at line 24 of file SiStripBadComponentsDQMServiceReader.h.

Constructor & Destructor Documentation

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

Definition at line 17 of file SiStripBadComponentsDQMServiceReader.cc.

17  :
18  printdebug_(iConfig.getUntrackedParameter<bool>("printDebug",true)){}
T getUntrackedParameter(std::string const &, T const &) const
SiStripBadComponentsDQMServiceReader::~SiStripBadComponentsDQMServiceReader ( )

Definition at line 20 of file SiStripBadComponentsDQMServiceReader.cc.

20 {}

Member Function Documentation

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

Implements edm::EDAnalyzer.

Definition at line 22 of file SiStripBadComponentsDQMServiceReader.cc.

References cond::rpcobgas::detid, detIdToString(), archive::flag, edm::EventSetup::get(), printdebug_, printError(), edm::ESHandle< class >::product(), contentValuesCheck::ss, and relativeConstraints::value.

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

Definition at line 82 of file SiStripBadComponentsDQMServiceReader.cc.

References 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().

83 {
84  std::string detector;
85  int layer = 0;
86  int stereo = 0;
87  int side = -1;
88 
89  // Using the operator[] if the element does not exist it is created with the default value. That is 0 for integral types.
90  switch (detid.subdetId()) {
92  {
93 
94  detector = "TIB";
95  layer = tTopo->tibLayer(detid.rawId());
96  stereo = tTopo->tibStereo(detid.rawId());
97  break;
98  }
100  {
101 
102  detector = "TOB";
103  layer = tTopo->tobLayer(detid.rawId());
104  stereo = tTopo->tobStereo(detid.rawId());
105  break;
106  }
108  {
109 
110  // is this module in TEC+ or TEC-?
111  side = tTopo->tecSide(detid.rawId());
112  detector = "TEC";
113  layer = tTopo->tecWheel(detid.rawId());
114  stereo = tTopo->tecStereo(detid.rawId());
115  break;
116  }
118  {
119 
120  // is this module in TID+ or TID-?
121  side = tTopo->tidSide(detid.rawId());
122  detector = "TID";
123  layer = tTopo->tidWheel(detid.rawId());
124  stereo = tTopo->tidStereo(detid.rawId());
125  break;
126  }
127  }
128  std::string name( detector + "\t" + boost::lexical_cast<string>(layer) + "\t" + boost::lexical_cast<string>(stereo) + "\t" );
129  if( side == 1 ) {
130  name += "-";
131  }
132  else if ( side == 2 ) {
133  name += "+";
134  }
135 // if( side != -1 ) {
136 // name += boost::lexical_cast<string>(side);
137 // }
138 
139  return name;
140 }
unsigned int tibLayer(const DetId &id) const
uint32_t tobStereo(const DetId &id) const
unsigned int tidWheel(const DetId &id) const
uint32_t rawId() const
get the raw id
Definition: DetId.h:43
unsigned int tidSide(const DetId &id) const
uint32_t tidStereo(const DetId &id) const
int subdetId() const
get the contents of the subdetector field (not cast into any detector&#39;s numbering enum) ...
Definition: DetId.h:37
uint32_t tecStereo(const DetId &id) const
uint32_t tibStereo(const DetId &id) const
unsigned int tecWheel(const DetId &id) const
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 72 of file SiStripBadComponentsDQMServiceReader.cc.

Referenced by analyze().

73 {
74  if( error ) {
75  ss << errorText << "\t ";
76  }
77  else {
78  ss << "\t\t ";
79  }
80 }

Member Data Documentation

bool SiStripBadComponentsDQMServiceReader::printdebug_
private

Definition at line 37 of file SiStripBadComponentsDQMServiceReader.h.

Referenced by analyze().