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

Public Member Functions

void analyze (const edm::Event &, const edm::EventSetup &)
 
std::string detIdToString (const DetId &detid)
 
void printError (std::stringstream &ss, const bool error, const std::string &errorText)
 
 SiStripBadComponentsDQMServiceReader (const edm::ParameterSet &)
 
 ~SiStripBadComponentsDQMServiceReader ()
 
- Public Member Functions inherited from edm::EDAnalyzer
 EDAnalyzer ()
 
std::string workerType () const
 
virtual ~EDAnalyzer ()
 

Private Attributes

bool printdebug_
 

Additional Inherited Members

- Public Types inherited from edm::EDAnalyzer
typedef EDAnalyzer ModuleType
 
typedef WorkerT< EDAnalyzerWorkerType
 
- 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::EDAnalyzer
CurrentProcessingContext const * currentContext () const
 

Detailed Description

Definition at line 27 of file SiStripBadComponentsDQMServiceReader.h.

Constructor & Destructor Documentation

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

Definition at line 14 of file SiStripBadComponentsDQMServiceReader.cc.

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

Definition at line 17 of file SiStripBadComponentsDQMServiceReader.cc.

17 {}

Member Function Documentation

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

Implements edm::EDAnalyzer.

Definition at line 19 of file SiStripBadComponentsDQMServiceReader.cc.

References cond::rpcobgas::detid, detIdToString(), edm::EventSetup::get(), errorMatrix2Lands_multiChannel::id, printdebug_, printError(), and relativeConstraints::value.

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

Definition at line 74 of file SiStripBadComponentsDQMServiceReader.cc.

References TOBDetId::layer(), TIBDetId::layer(), mergeVDriftHistosByStation::name, DetId::rawId(), TIDDetId::side(), TECDetId::side(), DetId::subdetId(), StripSubdetector::TEC, StripSubdetector::TIB, StripSubdetector::TID, and StripSubdetector::TOB.

Referenced by analyze().

75 {
76  std::string detector;
77  int layer = 0;
78  int stereo = 0;
79  int side = -1;
80 
81  // Using the operator[] if the element does not exist it is created with the default value. That is 0 for integral types.
82  switch (detid.subdetId()) {
84  {
85  TIBDetId theTIBDetId(detid.rawId());
86  detector = "TIB";
87  layer = theTIBDetId.layer();
88  stereo = theTIBDetId.stereo();
89  break;
90  }
92  {
93  TOBDetId theTOBDetId(detid.rawId());
94  detector = "TOB";
95  layer = theTOBDetId.layer();
96  stereo = theTOBDetId.stereo();
97  break;
98  }
100  {
101  TECDetId theTECDetId(detid.rawId());
102  // is this module in TEC+ or TEC-?
103  side = theTECDetId.side();
104  detector = "TEC";
105  layer = theTECDetId.wheel();
106  stereo = theTECDetId.stereo();
107  break;
108  }
110  {
111  TIDDetId theTIDDetId(detid.rawId());
112  // is this module in TID+ or TID-?
113  side = theTIDDetId.side();
114  detector = "TID";
115  layer = theTIDDetId.wheel();
116  stereo = theTIDDetId.stereo();
117  break;
118  }
119  }
120  std::string name( detector + "\t" + boost::lexical_cast<string>(layer) + "\t" + boost::lexical_cast<string>(stereo) + "\t" );
121  if( side == 1 ) {
122  name += "-";
123  }
124  else if ( side == 2 ) {
125  name += "+";
126  }
127 // if( side != -1 ) {
128 // name += boost::lexical_cast<string>(side);
129 // }
130 
131  return name;
132 }
unsigned int layer() const
layer id
Definition: TOBDetId.h:39
unsigned int side() const
positive or negative id
Definition: TECDetId.h:47
uint32_t rawId() const
get the raw id
Definition: DetId.h:45
int subdetId() const
get the contents of the subdetector field (not cast into any detector&#39;s numbering enum) ...
Definition: DetId.h:39
unsigned int side() const
positive or negative id
Definition: TIDDetId.h:45
unsigned int layer() const
layer id
Definition: TIBDetId.h:41
void SiStripBadComponentsDQMServiceReader::printError ( std::stringstream &  ss,
const bool  error,
const std::string &  errorText 
)

Definition at line 64 of file SiStripBadComponentsDQMServiceReader.cc.

Referenced by analyze().

65 {
66  if( error ) {
67  ss << errorText << "\t ";
68  }
69  else {
70  ss << "\t\t ";
71  }
72 }

Member Data Documentation

bool SiStripBadComponentsDQMServiceReader::printdebug_
private

Definition at line 40 of file SiStripBadComponentsDQMServiceReader.h.

Referenced by analyze().