CMS 3D CMS Logo

List of all members | Public Member Functions | Private Member Functions | Private Attributes
SiStripMonitorQuality Class Reference

#include <SiStripMonitorQuality.h>

Inheritance diagram for SiStripMonitorQuality:
DQMEDAnalyzer edm::one::EDProducer< edm::Accumulator, edm::EndLuminosityBlockProducer, edm::EndRunProducer, edm::one::WatchLuminosityBlocks, edm::one::WatchRuns > edm::one::EDProducerBase edm::ProducerBase edm::EDConsumerBase edm::ProductRegistryHelper

Public Member Functions

void analyze (const edm::Event &, const edm::EventSetup &) override
 
void bookHistograms (DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override
 
void endJob () override
 
void endRun (edm::Run const &run, edm::EventSetup const &eSetup) override
 
 SiStripMonitorQuality (const edm::ParameterSet &)
 
 ~SiStripMonitorQuality () override
 
- Public Member Functions inherited from DQMEDAnalyzer
void accumulate (edm::Event const &ev, edm::EventSetup const &es) final
 
virtual void analyze (edm::Event const &, edm::EventSetup const &)
 
void beginLuminosityBlock (edm::LuminosityBlock const &lumi, edm::EventSetup const &setup) override
 
void beginRun (edm::Run const &run, edm::EventSetup const &setup) final
 
virtual void dqmBeginRun (edm::Run const &, edm::EventSetup const &)
 
 DQMEDAnalyzer ()
 
 DQMEDAnalyzer (DQMEDAnalyzer const &)=delete
 
 DQMEDAnalyzer (DQMEDAnalyzer &&)=delete
 
void endLuminosityBlock (edm::LuminosityBlock const &, edm::EventSetup const &) override
 
void endLuminosityBlockProduce (edm::LuminosityBlock &lumi, edm::EventSetup const &setup) final
 
void endRun (edm::Run const &run, edm::EventSetup const &setup) override
 
void endRunProduce (edm::Run &run, edm::EventSetup const &setup) override
 
 ~DQMEDAnalyzer () override=default
 
- Public Member Functions inherited from edm::one::EDProducer< edm::Accumulator, edm::EndLuminosityBlockProducer, edm::EndRunProducer, edm::one::WatchLuminosityBlocks, edm::one::WatchRuns >
 EDProducer ()=default
 
SerialTaskQueueglobalLuminosityBlocksQueue () final
 
SerialTaskQueueglobalRunsQueue () final
 
bool hasAbilityToProduceInLumis () const final
 
bool hasAbilityToProduceInRuns () const final
 
bool wantsGlobalLuminosityBlocks () const final
 
bool wantsGlobalRuns () const final
 
- Public Member Functions inherited from edm::one::EDProducerBase
 EDProducerBase ()
 
ModuleDescription const & moduleDescription () const
 
bool wantsStreamLuminosityBlocks () const
 
bool wantsStreamRuns () const
 
 ~EDProducerBase () override
 
- Public Member Functions inherited from edm::ProducerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
std::vector< edm::ProductResolverIndex > const & indiciesForPutProducts (BranchType iBranchType) const
 
 ProducerBase ()
 
std::vector< edm::ProductResolverIndex > const & putTokenIndexToProductResolverIndex () const
 
void registerProducts (ProducerBase *, ProductRegistry *, ModuleDescription const &)
 
std::function< void(BranchDescription const &)> registrationCallback () const
 used by the fwk to register list of products More...
 
void resolvePutIndicies (BranchType iBranchType, ModuleToResolverIndicies const &iIndicies, std::string const &moduleLabel)
 
 ~ProducerBase () 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
 
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::vector< ModuleDescription const * > &modules, 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
 
ProductResolverIndexAndSkipBit uncheckedIndexFrom (EDGetToken) const
 
void updateLookup (BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet)
 
virtual ~EDConsumerBase () noexcept(false)
 

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::one::EDProducerBase
typedef EDProducerBase ModuleType
 
- Public Types inherited from edm::ProducerBase
using ModuleToResolverIndicies = std::unordered_multimap< std::string, std::tuple< edm::TypeID const *, const char *, edm::ProductResolverIndex >>
 
typedef ProductRegistryHelper::TypeLabelList TypeLabelList
 
- Public Types inherited from edm::EDConsumerBase
typedef ProductLabels Labels
 
- Static Public Member Functions inherited from edm::one::EDProducerBase
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 
- 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)
 
- Protected Attributes inherited from DQMEDAnalyzer
edm::EDPutTokenT< DQMTokenlumiToken_
 
edm::EDPutTokenT< DQMTokenrunToken_
 

Detailed Description

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

Usage: <usage>

Definition at line 47 of file SiStripMonitorQuality.h.

Constructor & Destructor Documentation

SiStripMonitorQuality::SiStripMonitorQuality ( const edm::ParameterSet )
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 ( )
override

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 ,
const edm::EventSetup  
)
override

Definition at line 128 of file SiStripMonitorQuality.cc.

References conf_, SiStripBadStrip::decode(), detCabling_, MonitorElement::Fill(), SiStripBadStrip::data::firstStrip, edm::EventSetup::get(), SiStripBadStrip::getDataVectorBegin(), MonitorElement::getNbinsX(), edm::ParameterSet::getParameter(), getQualityME(), SiStripBadStrip::getRegistryVectorBegin(), SiStripBadStrip::getRegistryVectorEnd(), SiStripDetCabling::IsConnected(), m_cacheID_, edm::ESHandle< T >::product(), SiStripBadStrip::data::range, create_public_lumi_plots::str_end, AlCaHLTBitMon_QueryRunRegistry::string, and stripQuality_.

129 {
130  unsigned long long cacheID = eSetup.get<SiStripQualityRcd>().cacheIdentifier();
131  if (m_cacheID_ == cacheID) return;
132 
133  //Retrieve tracker topology from geometry
134  edm::ESHandle<TrackerTopology> tTopoHandle;
135  eSetup.get<TrackerTopologyRcd>().get(tTopoHandle);
136  const TrackerTopology* const tTopo = tTopoHandle.product();
137 
138  m_cacheID_ = cacheID;
139 
140  std::string quality_label = conf_.getParameter<std::string>("StripQualityLabel");
141  eSetup.get<SiStripQualityRcd>().get(quality_label,stripQuality_);
142  eSetup.get<SiStripDetCablingRcd>().get( detCabling_ );
143 
144  edm::LogInfo("SiStripMonitorQuality") << "SiStripMonitorQuality::analyze: "<<
145  " Reading SiStripQuality "<< std::endl;
146 
149  uint32_t detid;
150 
151  if (rbegin==rend) return;
152 
153  for (SiStripBadStrip::RegistryIterator rp=rbegin; rp != rend; ++rp) {
154 
155  detid = rp->detid;
156  // Check consistency in DetId
157  if (detid == 0 || detid == 0xFFFFFFFF){
158  edm::LogError("SiStripMonitorQuality") <<"SiStripMonitorQuality::analyze : "
159  << "Wrong DetId !!!!!! " << detid << " Neglecting !!!!!! ";
160  continue;
161  }
162  // check if the detid is connected in cabling
163  if (!detCabling_->IsConnected(detid)) {
164  edm::LogError("SiStripMonitorQuality") <<"SiStripMonitorQuality::analyze : "
165  << " DetId " << detid << " not connected, Neglecting !!!!!! ";
166  continue;
167  }
168  MonitorElement* me = getQualityME(detid, tTopo);
170  stripQuality_->getDataVectorBegin()+rp->iend );
171  SiStripBadStrip::ContainerIterator it=range.first;
172  for(;it!=range.second;++it){
173  unsigned int value=(*it);
174  short str_start = stripQuality_->decode(value).firstStrip;
175  short str_end = str_start + stripQuality_->decode(value).range;
176  for ( short isr = str_start; isr < str_end + 1; isr++) {
177  if (isr <= (me->getNbinsX()-1)) me->Fill(isr+1, 1.0);
178  }
179  }
180  }
181 }
unsigned short range
T getParameter(std::string const &) const
edm::ESHandle< SiStripDetCabling > detCabling_
std::vector< unsigned int >::const_iterator ContainerIterator
bool IsConnected(const uint32_t &det_id) const
Registry::const_iterator RegistryIterator
void Fill(long long x)
MonitorElement * getQualityME(uint32_t idet, const TrackerTopology *tTopo)
RegistryIterator getRegistryVectorEnd() const
edm::ESHandle< SiStripQuality > stripQuality_
Definition: value.py:1
ContainerIterator getDataVectorBegin() const
unsigned short firstStrip
RegistryIterator getRegistryVectorBegin() const
std::pair< ContainerIterator, ContainerIterator > Range
unsigned long long m_cacheID_
int getNbinsX() const
get # of bins in X-axis
T const * product() const
Definition: ESHandle.h:86
data decode(const unsigned int &value) const
void SiStripMonitorQuality::bookHistograms ( DQMStore::IBooker ,
edm::Run const &  ,
edm::EventSetup const &   
)
overridevirtual

Implements DQMEDAnalyzer.

Definition at line 62 of file SiStripMonitorQuality.cc.

References DQMStore::IBooker::book1D(), conf_, SiStripHistoId::createHistoId(), detCabling_, edm::EventSetup::get(), edm::ParameterSet::getParameter(), SiStripBadStrip::getRegistryVectorBegin(), SiStripBadStrip::getRegistryVectorEnd(), SiStripDetCabling::IsConnected(), m_cacheID_, SiStripDetCabling::nApvPairs(), edm::ESHandle< T >::product(), QualityMEs, MonitorElement::setAxisTitle(), SiStripFolderOrganizer::setDetectorFolder(), AlCaHLTBitMon_QueryRunRegistry::string, stripQuality_, and DQMStore::IBooker::tag().

62  {
63 
64  unsigned long long cacheID = eSetup.get<SiStripQualityRcd>().cacheIdentifier();
65  if (m_cacheID_ == cacheID) return;
66 
67  //Retrieve tracker topology from geometry
69  eSetup.get<TrackerTopologyRcd>().get(tTopoHandle);
70  const TrackerTopology* const tTopo = tTopoHandle.product();
71 
72  m_cacheID_ = cacheID;
73 
74  std::string quality_label = conf_.getParameter<std::string>("StripQualityLabel");
75  eSetup.get<SiStripQualityRcd>().get(quality_label,stripQuality_);
76  eSetup.get<SiStripDetCablingRcd>().get( detCabling_ );
77 
78  edm::LogInfo("SiStripMonitorQuality") << "SiStripMonitorQuality::analyze: "<<
79  " Reading SiStripQuality "<< std::endl;
80 
83  uint32_t detid;
84 
85  if (rbegin==rend) return;
86 
87  for (SiStripBadStrip::RegistryIterator rp=rbegin; rp != rend; ++rp) {
88 
89  detid = rp->detid;
90  // Check consistency in DetId
91  if (detid == 0 || detid == 0xFFFFFFFF){
92  edm::LogError("SiStripMonitorQuality") <<"SiStripMonitorQuality::bookHistograms : "
93  << "Wrong DetId !!!!!! " << detid << " Neglecting !!!!!! ";
94  continue;
95  }
96  // check if the detid is connected in cabling
97  if (!detCabling_->IsConnected(detid)) {
98  edm::LogError("SiStripMonitorQuality") <<"SiStripMonitorQuality::bookHistograms : "
99  << " DetId " << detid << " not connected, Neglecting !!!!!! ";
100  continue;
101  }
102 
103  MonitorElement* det_me;
104 
105  int nStrip = detCabling_->nApvPairs(detid) * 256;
106 
107  // use SistripHistoId for producing histogram id (and title)
108  SiStripHistoId hidmanager;
109  // create SiStripFolderOrganizer
110  SiStripFolderOrganizer folder_organizer;
111  // set appropriate folder using SiStripFolderOrganizer
112  folder_organizer.setDetectorFolder(detid, tTopo); // pass the detid to this method
113 
114  std::string hid;
115  hid = hidmanager.createHistoId("StripQualityFromCondDB","det", detid);
116 
117  det_me = ibooker.book1D(hid, hid, nStrip,0.5,nStrip+0.5);
118  ibooker.tag(det_me, detid);
119  det_me->setAxisTitle("Strip Number",1);
120  det_me->setAxisTitle("Quality Flag from CondDB ",2);
121  QualityMEs.insert( std::make_pair(detid, det_me));
122  }
123 
124 }
T getParameter(std::string const &) const
edm::ESHandle< SiStripDetCabling > detCabling_
bool IsConnected(const uint32_t &det_id) const
Registry::const_iterator RegistryIterator
void setDetectorFolder(uint32_t rawdetid, const TrackerTopology *tTopo)
RegistryIterator getRegistryVectorEnd() const
edm::ESHandle< SiStripQuality > stripQuality_
std::string createHistoId(std::string description, std::string id_type, uint32_t component_id)
RegistryIterator getRegistryVectorBegin() const
const uint16_t nApvPairs(uint32_t det_id) const
unsigned long long m_cacheID_
void setAxisTitle(const std::string &title, int axis=1)
set x-, y- or z-axis title (axis=1, 2, 3 respectively)
T const * product() const
Definition: ESHandle.h:86
std::map< uint32_t, MonitorElement * > QualityMEs
void SiStripMonitorQuality::endJob ( void  )
overridevirtual

Reimplemented from edm::one::EDProducerBase.

Definition at line 196 of file SiStripMonitorQuality.cc.

196  {
197  edm::LogInfo("SiStripMonitorQuality") <<"SiStripMonitorQuality::EndJob: "
198  << " Finishing!! ";
199 }
void SiStripMonitorQuality::endRun ( edm::Run const &  run,
edm::EventSetup const &  eSetup 
)
override

Definition at line 185 of file SiStripMonitorQuality.cc.

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

185  {
186  bool outputMEsInRootFile = conf_.getParameter<bool>("OutputMEsInRootFile");
188  if (outputMEsInRootFile) {
189  //dqmStore_->showDirStructure();
190  dqmStore_->save(outputFileName);
191  }
192 }
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, const uint32_t lumi=0, SaveReferenceTag ref=SaveWithReference, int minStatus=dqm::qstatus::STATUS_OK, const std::string &fileupdate="RECREATE")
Definition: DQMStore.cc:2555
MonitorElement * SiStripMonitorQuality::getQualityME ( uint32_t  idet,
const TrackerTopology tTopo 
)
private

Definition at line 203 of file SiStripMonitorQuality.cc.

References DEFINE_FWK_MODULE, QualityMEs, and MonitorElement::Reset().

Referenced by analyze().

203  {
204 
205  std::map<uint32_t, MonitorElement* >::iterator pos = QualityMEs.find(idet);
206  MonitorElement* det_me = nullptr;
207  if (pos != QualityMEs.end()) {
208  det_me = pos->second;
209  det_me->Reset();
210  } else {
211  //this should never happen because of bookHistograms()
212  edm::LogError("SiStripMonitorQuality") <<"SiStripMonitorQuality::getQualityME : "
213  << "Wrong DetId !!!!!! " << idet << " No ME found!";
214  }
215  return det_me;
216 }
void Reset()
reset ME (ie. contents, errors, etc)
std::map< uint32_t, MonitorElement * > QualityMEs

Member Data Documentation

edm::ParameterSet SiStripMonitorQuality::conf_
private

Definition at line 64 of file SiStripMonitorQuality.h.

Referenced by analyze(), bookHistograms(), and endRun().

std::string SiStripMonitorQuality::dataLabel_
private

Definition at line 69 of file SiStripMonitorQuality.h.

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

Definition at line 65 of file SiStripMonitorQuality.h.

Referenced by analyze(), and bookHistograms().

DQMStore* SiStripMonitorQuality::dqmStore_
private

Definition at line 63 of file SiStripMonitorQuality.h.

Referenced by endRun().

unsigned long long SiStripMonitorQuality::m_cacheID_
private

Definition at line 71 of file SiStripMonitorQuality.h.

Referenced by analyze(), and bookHistograms().

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

Definition at line 68 of file SiStripMonitorQuality.h.

Referenced by bookHistograms(), and getQualityME().

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

Definition at line 66 of file SiStripMonitorQuality.h.

Referenced by analyze(), and bookHistograms().