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 edm::EDConsumerBase

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
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
 
bool registeredToConsume (ProductHolderIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
void updateLookup (BranchType iBranchType, ProductHolderIndexHelper const &)
 
virtual ~EDConsumerBase ()
 

Private Member Functions

MonitorElementgetQualityME (uint32_t idet, const TrackerTopology *tTopo)
 

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
 
- 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

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

Usage: <usage>

Definition at line 44 of file SiStripMonitorQuality.h.

Constructor & Destructor Documentation

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

Definition at line 43 of file SiStripMonitorQuality.cc.

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

Definition at line 55 of file SiStripMonitorQuality.cc.

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

Member Function Documentation

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

Implements edm::EDAnalyzer.

Definition at line 73 of file SiStripMonitorQuality.cc.

References conf_, detCabling_, cond::rpcobgas::detid, MonitorElement::Fill(), edm::EventSetup::get(), MonitorElement::getNbinsX(), edm::ParameterSet::getParameter(), getQualityME(), m_cacheID_, edm::ESHandle< class >::product(), create_public_lumi_plots::str_end, AlCaHLTBitMon_QueryRunRegistry::string, stripQuality_, and relativeConstraints::value.

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

Reimplemented from edm::EDAnalyzer.

Definition at line 63 of file SiStripMonitorQuality.cc.

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

Reimplemented from edm::EDAnalyzer.

Definition at line 68 of file SiStripMonitorQuality.cc.

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

Reimplemented from edm::EDAnalyzer.

Definition at line 141 of file SiStripMonitorQuality.cc.

141  {
142  edm::LogInfo("SiStripMonitorQuality") <<"SiStripMonitorQuality::EndJob: "
143  << " Finishing!! ";
144 }
void SiStripMonitorQuality::endRun ( edm::Run const &  run,
edm::EventSetup const &  eSetup 
)
virtual

Reimplemented from edm::EDAnalyzer.

Definition at line 130 of file SiStripMonitorQuality.cc.

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

130  {
131  bool outputMEsInRootFile = conf_.getParameter<bool>("OutputMEsInRootFile");
133  if (outputMEsInRootFile) {
135  dqmStore_->save(outputFileName);
136  }
137 }
T getParameter(std::string const &) const
void save(const std::string &filename, const std::string &path="", const std::string &pattern="", const std::string &rewrite="", const uint32_t run=0, SaveReferenceTag ref=SaveWithReference, int minStatus=dqm::qstatus::STATUS_OK, const std::string &fileupdate="RECREATE")
Definition: DQMStore.cc:2296
void showDirStructure(void) const
Definition: DQMStore.cc:2961
MonitorElement * SiStripMonitorQuality::getQualityME ( uint32_t  idet,
const TrackerTopology tTopo 
)
private

Definition at line 148 of file SiStripMonitorQuality.cc.

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

Referenced by analyze().

148  {
149 
150  std::map<uint32_t, MonitorElement* >::iterator pos = QualityMEs.find(idet);
151  MonitorElement* det_me;
152  if (pos != QualityMEs.end()) {
153  det_me = pos->second;
154  det_me->Reset();
155  } else {
156  int nStrip = detCabling_->nApvPairs(idet) * 256;
157 
158  // use SistripHistoId for producing histogram id (and title)
159  SiStripHistoId hidmanager;
160  // create SiStripFolderOrganizer
161  SiStripFolderOrganizer folder_organizer;
162  // set appropriate folder using SiStripFolderOrganizer
163  folder_organizer.setDetectorFolder(idet, tTopo); // pass the detid to this method
164 
165  std::string hid;
166  hid = hidmanager.createHistoId("StripQualityFromCondDB","det", idet);
167 
168  det_me = dqmStore_->book1D(hid, hid, nStrip,0.5,nStrip+0.5);
169  dqmStore_->tag(det_me, idet);
170  det_me->setAxisTitle("Strip Number",1);
171  det_me->setAxisTitle("Quality Flag from CondDB ",2);
172  QualityMEs.insert( std::make_pair(idet, det_me));
173  }
174  return det_me;
175 }
edm::ESHandle< SiStripDetCabling > detCabling_
MonitorElement * book1D(const char *name, const char *title, int nchX, double lowX, double highX)
Book 1D histogram.
Definition: DQMStore.cc:872
void setDetectorFolder(uint32_t rawdetid, const TrackerTopology *tTopo)
void tag(MonitorElement *me, unsigned int myTag)
Definition: DQMStore.cc:1509
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 62 of file SiStripMonitorQuality.h.

Referenced by analyze(), and endRun().

std::string SiStripMonitorQuality::dataLabel_
private

Definition at line 67 of file SiStripMonitorQuality.h.

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

Definition at line 63 of file SiStripMonitorQuality.h.

Referenced by analyze(), and getQualityME().

DQMStore* SiStripMonitorQuality::dqmStore_
private

Definition at line 61 of file SiStripMonitorQuality.h.

Referenced by endRun(), and getQualityME().

unsigned long long SiStripMonitorQuality::m_cacheID_
private

Definition at line 69 of file SiStripMonitorQuality.h.

Referenced by analyze().

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

Definition at line 66 of file SiStripMonitorQuality.h.

Referenced by getQualityME().

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

Definition at line 64 of file SiStripMonitorQuality.h.

Referenced by analyze().