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::EndRunProducer, edm::one::WatchRuns, edm::EndLuminosityBlockProducer, edm::one::WatchLuminosityBlocks, edm::Accumulator > 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 dqmEndRun (edm::Run const &run, edm::EventSetup const &eSetup) override
 
void endJob () override
 
 SiStripMonitorQuality (const edm::ParameterSet &)
 
 ~SiStripMonitorQuality () override
 
- Public Member Functions inherited from DQMEDAnalyzer
void accumulate (edm::Event const &event, edm::EventSetup const &setup) final
 
virtual void analyze (edm::Event const &, edm::EventSetup const &)
 
void beginLuminosityBlock (edm::LuminosityBlock const &lumi, edm::EventSetup const &setup) final
 
void beginRun (edm::Run const &run, edm::EventSetup const &setup) final
 
virtual void dqmBeginLuminosityBlock (edm::LuminosityBlock const &, edm::EventSetup const &)
 
virtual void dqmBeginRun (edm::Run const &, edm::EventSetup const &)
 
 DQMEDAnalyzer ()
 
virtual void dqmEndLuminosityBlock (edm::LuminosityBlock const &, edm::EventSetup const &)
 
void endLuminosityBlock (edm::LuminosityBlock const &, edm::EventSetup const &) final
 
void endLuminosityBlockProduce (edm::LuminosityBlock &lumi, edm::EventSetup const &setup) final
 
void endRun (edm::Run const &, edm::EventSetup const &) final
 
void endRunProduce (edm::Run &run, edm::EventSetup const &setup) final
 
virtual bool getCanSaveByLumi ()
 
- Public Member Functions inherited from edm::one::EDProducer< edm::EndRunProducer, edm::one::WatchRuns, edm::EndLuminosityBlockProducer, edm::one::WatchLuminosityBlocks, edm::Accumulator >
 EDProducer ()=default
 
SerialTaskQueueglobalLuminosityBlocksQueue () final
 
SerialTaskQueueglobalRunsQueue () final
 
bool hasAbilityToProduceInBeginLumis () const final
 
bool hasAbilityToProduceInBeginRuns () const final
 
bool hasAbilityToProduceInEndLumis () const final
 
bool hasAbilityToProduceInEndRuns () 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 () noexcept(false) 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
 
ESProxyIndex const * esGetTokenIndices (edm::Transition iTrans) const
 
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)
 
void updateLookup (eventsetup::ESRecordsToProxyIndices const &)
 
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 DQMEDAnalyzer
typedef dqm::reco::DQMStore DQMStore
 
typedef dqm::reco::MonitorElement MonitorElement
 
- 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::ProducerBase
ProducesCollector producesCollector ()
 
- 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 ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes ()
 
template<typename ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes (ESInputTag const &tag)
 
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 46 of file SiStripMonitorQuality.h.

Constructor & Destructor Documentation

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

Definition at line 43 of file SiStripMonitorQuality.cc.

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

Definition at line 53 of file SiStripMonitorQuality.cc.

53  {
54  edm::LogInfo("SiStripMonitorQuality") << "SiStripMonitorQuality "
55  << " Destructing....... ";
56 }

Member Function Documentation

void SiStripMonitorQuality::analyze ( const edm::Event ,
const edm::EventSetup  
)
override

Definition at line 124 of file SiStripMonitorQuality.cc.

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

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

References dqm::dqmstoreimpl::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, dqm::impl::MonitorElement::setAxisTitle(), SiStripFolderOrganizer::setDetectorFolder(), AlCaHLTBitMon_QueryRunRegistry::string, and stripQuality_.

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

Reimplemented from DQMEDAnalyzer.

Definition at line 182 of file SiStripMonitorQuality.cc.

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

182  {
183  bool outputMEsInRootFile = conf_.getParameter<bool>("OutputMEsInRootFile");
185  if (outputMEsInRootFile) {
186  // dqmStore_->showDirStructure();
187  dqmStore_->save(outputFileName);
188  }
189 }
T getParameter(std::string const &) const
void save(std::string const &filename, std::string const &path="", std::string const &pattern="", std::string const &rewrite="", uint32_t run=0, uint32_t lumi=0, SaveReferenceTag ref=SaveWithReference, int minStatus=dqm::qstatus::STATUS_OK, std::string const &fileupdate="RECREATE")
Definition: DQMStore.cc:2244
void SiStripMonitorQuality::endJob ( void  )
overridevirtual

Reimplemented from edm::one::EDProducerBase.

Definition at line 193 of file SiStripMonitorQuality.cc.

193  {
194  edm::LogInfo("SiStripMonitorQuality") << "SiStripMonitorQuality::EndJob: "
195  << " Finishing!! ";
196 }
SiStripMonitorQuality::MonitorElement * SiStripMonitorQuality::getQualityME ( uint32_t  idet,
const TrackerTopology tTopo 
)
private

Definition at line 200 of file SiStripMonitorQuality.cc.

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

Referenced by analyze().

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

Member Data Documentation

edm::ParameterSet SiStripMonitorQuality::conf_
private

Definition at line 60 of file SiStripMonitorQuality.h.

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

std::string SiStripMonitorQuality::dataLabel_
private

Definition at line 65 of file SiStripMonitorQuality.h.

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

Definition at line 61 of file SiStripMonitorQuality.h.

Referenced by analyze(), and bookHistograms().

DQMStore* SiStripMonitorQuality::dqmStore_
private

Definition at line 59 of file SiStripMonitorQuality.h.

Referenced by dqmEndRun().

unsigned long long SiStripMonitorQuality::m_cacheID_
private

Definition at line 67 of file SiStripMonitorQuality.h.

Referenced by analyze(), and bookHistograms().

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

Definition at line 64 of file SiStripMonitorQuality.h.

Referenced by bookHistograms(), and getQualityME().

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

Definition at line 62 of file SiStripMonitorQuality.h.

Referenced by analyze(), and bookHistograms().