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 Member Functions | Private Attributes
SiStripMonitorQuality Class Reference

#include <SiStripMonitorQuality.h>

Inheritance diagram for SiStripMonitorQuality:
edm::EDAnalyzer

Public Member Functions

virtual void analyze (const edm::Event &, const edm::EventSetup &)
 
virtual void beginJob ()
 
virtual void beginRun (edm::Run const &run, edm::EventSetup const &eSetup)
 
virtual void endJob ()
 
virtual void endRun (edm::Run const &run, edm::EventSetup const &eSetup)
 
 SiStripMonitorQuality (const edm::ParameterSet &)
 
 ~SiStripMonitorQuality ()
 
- Public Member Functions inherited from edm::EDAnalyzer
 EDAnalyzer ()
 
std::string workerType () const
 
virtual ~EDAnalyzer ()
 

Private Member Functions

MonitorElementgetQualityME (uint32_t idet)
 

Private Attributes

edm::ParameterSet conf_
 
std::string dataLabel_
 
edm::ESHandle< SiStripDetCablingdetCabling_
 
DQMStoredqmStore_
 
unsigned long long m_cacheID_
 
std::map< uint32_t,
MonitorElement * > 
QualityMEs
 
edm::ESHandle< SiStripQualitystripQuality_
 

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)
 
- Protected Member Functions inherited from edm::EDAnalyzer
CurrentProcessingContext const * currentContext () const
 

Detailed Description

Description: <one line="" class="" summary>="">

Usage: <usage>

Definition at line 45 of file SiStripMonitorQuality.h.

Constructor & Destructor Documentation

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

Definition at line 44 of file SiStripMonitorQuality.cc.

44  :
46  conf_(iConfig),
47  m_cacheID_(0)
48 
49 
50 {
51  edm::LogInfo("SiStripMonitorQuality") <<"SiStripMonitorQuality "
52  << " Constructing....... ";
53 }
unsigned long long m_cacheID_
SiStripMonitorQuality::~SiStripMonitorQuality ( )

Definition at line 56 of file SiStripMonitorQuality.cc.

57 {
58  edm::LogInfo("SiStripMonitorQuality") <<"SiStripMonitorQuality "
59  << " Destructing....... ";
60 }

Member Function Documentation

void SiStripMonitorQuality::analyze ( const edm::Event iEvent,
const edm::EventSetup eSetup 
)
virtual

Implements edm::EDAnalyzer.

Definition at line 74 of file SiStripMonitorQuality.cc.

References conf_, detCabling_, cond::rpcobgas::detid, MonitorElement::Fill(), edm::EventSetup::get(), MonitorElement::getNbinsX(), edm::ParameterSet::getParameter(), getQualityME(), m_cacheID_, stripQuality_, and relativeConstraints::value.

75 {
76  unsigned long long cacheID = eSetup.get<SiStripQualityRcd>().cacheIdentifier();
77  if (m_cacheID_ == cacheID) return;
78 
79  m_cacheID_ = cacheID;
80 
81  std::string quality_label = conf_.getParameter<std::string>("StripQualityLabel");
82  eSetup.get<SiStripQualityRcd>().get(quality_label,stripQuality_);
83  eSetup.get<SiStripDetCablingRcd>().get( detCabling_ );
84 
85  edm::LogInfo("SiStripMonitorQuality") << "SiStripMonitorQuality::analyze: "<<
86  " Reading SiStripQuality "<< std::endl;
87 
88  SiStripBadStrip::RegistryIterator rbegin = stripQuality_->getRegistryVectorBegin();
89  SiStripBadStrip::RegistryIterator rend = stripQuality_->getRegistryVectorEnd();
90  uint32_t detid;
91 
92  if (rbegin==rend) return;
93 
94  for (SiStripBadStrip::RegistryIterator rp=rbegin; rp != rend; ++rp) {
95 
96  detid = rp->detid;
97  // Check consistency in DetId
98  if (detid == 0 || detid == 0xFFFFFFFF){
99  edm::LogError("SiStripMonitorQuality") <<"SiStripMonitorQuality::analyze : "
100  << "Wrong DetId !!!!!! " << detid << " Neglecting !!!!!! ";
101  continue;
102  }
103  // check if the detid is connected in cabling
104  if (!detCabling_->IsConnected(detid)) {
105  edm::LogError("SiStripMonitorQuality") <<"SiStripMonitorQuality::analyze : "
106  << " DetId " << detid << " not connected, Neglecting !!!!!! ";
107  continue;
108  }
109  MonitorElement* me = getQualityME(detid);
110  SiStripBadStrip::Range range = SiStripBadStrip::Range( stripQuality_->getDataVectorBegin()+rp->ibegin ,
111  stripQuality_->getDataVectorBegin()+rp->iend );
112  SiStripBadStrip::ContainerIterator it=range.first;
113  for(;it!=range.second;++it){
114  unsigned int value=(*it);
115  short str_start = stripQuality_->decode(value).firstStrip;
116  short str_end = str_start + stripQuality_->decode(value).range;
117  for ( short isr = str_start; isr < str_end + 1; isr++) {
118  if (isr <= (me->getNbinsX()-1)) me->Fill(isr+1, 1.0);
119  }
120  }
121  }
122 }
T getParameter(std::string const &) const
edm::ESHandle< SiStripDetCabling > detCabling_
std::vector< unsigned int >::const_iterator ContainerIterator
Registry::const_iterator RegistryIterator
void Fill(long long x)
edm::ESHandle< SiStripQuality > stripQuality_
const T & get() const
Definition: EventSetup.h:55
std::pair< ContainerIterator, ContainerIterator > Range
unsigned long long m_cacheID_
int getNbinsX(void) const
get # of bins in X-axis
MonitorElement * getQualityME(uint32_t idet)
void SiStripMonitorQuality::beginJob ( void  )
virtual

Reimplemented from edm::EDAnalyzer.

Definition at line 64 of file SiStripMonitorQuality.cc.

64  {
65 }
void SiStripMonitorQuality::beginRun ( edm::Run const &  run,
edm::EventSetup const &  eSetup 
)
virtual

Reimplemented from edm::EDAnalyzer.

Definition at line 69 of file SiStripMonitorQuality.cc.

69  {
70 }
void SiStripMonitorQuality::endJob ( void  )
virtual

Reimplemented from edm::EDAnalyzer.

Definition at line 137 of file SiStripMonitorQuality.cc.

137  {
138  edm::LogInfo("SiStripMonitorQuality") <<"SiStripMonitorQuality::EndJob: "
139  << " Finishing!! ";
140 }
void SiStripMonitorQuality::endRun ( edm::Run const &  run,
edm::EventSetup const &  eSetup 
)
virtual

Reimplemented from edm::EDAnalyzer.

Definition at line 126 of file SiStripMonitorQuality.cc.

References conf_, dqmStore_, edm::ParameterSet::getParameter(), dumpDBToFile_GT_ttrig_cfg::outputFileName, DQMStore::save(), and DQMStore::showDirStructure().

126  {
127  bool outputMEsInRootFile = conf_.getParameter<bool>("OutputMEsInRootFile");
128  std::string outputFileName = conf_.getParameter<std::string>("OutputFileName");
129  if (outputMEsInRootFile) {
131  dqmStore_->save(outputFileName);
132  }
133 }
T getParameter(std::string const &) const
void save(const std::string &filename, const std::string &path="", const std::string &pattern="", const std::string &rewrite="", SaveReferenceTag ref=SaveWithReference, int minStatus=dqm::qstatus::STATUS_OK, const std::string &fileupdate="RECREATE")
Definition: DQMStore.cc:1898
void showDirStructure(void) const
Definition: DQMStore.cc:2554
MonitorElement * SiStripMonitorQuality::getQualityME ( uint32_t  idet)
private

Definition at line 144 of file SiStripMonitorQuality.cc.

References DQMStore::book1D(), SiStripHistoId::createHistoId(), detCabling_, dqmStore_, pos, QualityMEs, MonitorElement::Reset(), MonitorElement::setAxisTitle(), SiStripFolderOrganizer::setDetectorFolder(), and DQMStore::tag().

Referenced by analyze().

144  {
145 
146  std::map<uint32_t, MonitorElement* >::iterator pos = QualityMEs.find(idet);
147  MonitorElement* det_me;
148  if (pos != QualityMEs.end()) {
149  det_me = pos->second;
150  det_me->Reset();
151  } else {
152  int nStrip = detCabling_->nApvPairs(idet) * 256;
153 
154  // use SistripHistoId for producing histogram id (and title)
155  SiStripHistoId hidmanager;
156  // create SiStripFolderOrganizer
157  SiStripFolderOrganizer folder_organizer;
158  // set appropriate folder using SiStripFolderOrganizer
159  folder_organizer.setDetectorFolder(idet); // pass the detid to this method
160 
161  std::string hid;
162  hid = hidmanager.createHistoId("StripQualityFromCondDB","det", idet);
163 
164  std::map<uint32_t, MonitorElement* >::iterator pos = QualityMEs.find(idet);
165 
166  det_me = dqmStore_->book1D(hid, hid, nStrip,0.5,nStrip+0.5);
167  dqmStore_->tag(det_me, idet);
168  det_me->setAxisTitle("Strip Number",1);
169  det_me->setAxisTitle("Quality Flag from CondDB ",2);
170  QualityMEs.insert( std::make_pair(idet, det_me));
171  }
172  return det_me;
173 }
edm::ESHandle< SiStripDetCabling > detCabling_
MonitorElement * book1D(const char *name, const char *title, int nchX, double lowX, double highX)
Book 1D histogram.
Definition: DQMStore.cc:514
void tag(MonitorElement *me, unsigned int myTag)
Definition: DQMStore.cc:1151
void setDetectorFolder(uint32_t rawdetid=0)
std::string createHistoId(std::string description, std::string id_type, uint32_t component_id)
void setAxisTitle(const std::string &title, int axis=1)
set x-, y- or z-axis title (axis=1, 2, 3 respectively)
void Reset(void)
reset ME (ie. contents, errors, etc)
std::map< uint32_t, MonitorElement * > QualityMEs

Member Data Documentation

edm::ParameterSet SiStripMonitorQuality::conf_
private

Definition at line 63 of file SiStripMonitorQuality.h.

Referenced by analyze(), and endRun().

std::string SiStripMonitorQuality::dataLabel_
private

Definition at line 68 of file SiStripMonitorQuality.h.

edm::ESHandle< SiStripDetCabling > SiStripMonitorQuality::detCabling_
private

Definition at line 64 of file SiStripMonitorQuality.h.

Referenced by analyze(), and getQualityME().

DQMStore* SiStripMonitorQuality::dqmStore_
private

Definition at line 62 of file SiStripMonitorQuality.h.

Referenced by endRun(), and getQualityME().

unsigned long long SiStripMonitorQuality::m_cacheID_
private

Definition at line 70 of file SiStripMonitorQuality.h.

Referenced by analyze().

std::map<uint32_t, MonitorElement*> SiStripMonitorQuality::QualityMEs
private

Definition at line 67 of file SiStripMonitorQuality.h.

Referenced by getQualityME().

edm::ESHandle< SiStripQuality > SiStripMonitorQuality::stripQuality_
private

Definition at line 65 of file SiStripMonitorQuality.h.

Referenced by analyze().