CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
List of all members | Public Member Functions | Private Member Functions | Private Attributes
SiStripMonitorQuality Class Reference

#include <SiStripMonitorQuality.h>

Inheritance diagram for SiStripMonitorQuality:
DQMOneEDAnalyzer<> edm::one::EDProducer< edm::EndRunProducer, edm::one::WatchRuns, edm::Accumulator, Args...> 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 DQMOneEDAnalyzer<>
void accumulate (edm::Event const &event, edm::EventSetup const &setup) override
 
void beginRun (edm::Run const &run, edm::EventSetup const &setup) final
 
 DQMOneEDAnalyzer ()
 
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::Accumulator, Args...>
 EDProducer ()=default
 
 EDProducer (const EDProducer &)=delete
 
SerialTaskQueueglobalLuminosityBlocksQueue () final
 
SerialTaskQueueglobalRunsQueue () final
 
bool hasAbilityToProduceInBeginLumis () const final
 
bool hasAbilityToProduceInBeginProcessBlocks () const final
 
bool hasAbilityToProduceInBeginRuns () const final
 
bool hasAbilityToProduceInEndLumis () const final
 
bool hasAbilityToProduceInEndProcessBlocks () const final
 
bool hasAbilityToProduceInEndRuns () const final
 
const EDProduceroperator= (const EDProducer &)=delete
 
bool wantsGlobalLuminosityBlocks () const final
 
bool wantsGlobalRuns () const final
 
bool wantsInputProcessBlocks () const final
 
bool wantsProcessBlocks () 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
 
std::vector< ESProxyIndex > const & esGetTokenIndicesVector (edm::Transition iTrans) const
 
std::vector< ESRecordIndex >
const & 
esGetTokenRecordIndicesVector (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::array< std::vector< ModuleDescription const * > *, NumBranchTypes > &modulesAll, std::vector< ModuleProcessName > &modulesInPreviousProcesses, 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
 
void selectInputProcessBlocks (ProductRegistry const &productRegistry, ProcessBlockHelperBase const &processBlockHelperBase)
 
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_
 
const SiStripDetCablingdetCabling_
 
edm::ESGetToken
< SiStripDetCabling,
SiStripDetCablingRcd
detCablingToken_
 
DQMStoredqmStore_
 
unsigned long long m_cacheID_
 
std::map< uint32_t,
MonitorElement * > 
QualityMEs
 
edm::ESGetToken
< SiStripQuality,
SiStripQualityRcd
qualityToken_
 
edm::ESWatcher< SiStripQualityRcdqualityWatcher_
 
const SiStripQualitystripQuality_
 
edm::ESGetToken
< TrackerTopology,
TrackerTopologyRcd
tTopoToken_
 

Additional Inherited Members

- Public Types inherited from DQMOneEDAnalyzer<>
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 DQMOneEDAnalyzer<>
virtual void dqmBeginRun (edm::Run const &, edm::EventSetup const &)
 
- 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)
 
template<BranchType B = InEvent>
EDConsumerBaseAdaptor< B > consumes (edm::InputTag tag) noexcept
 
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<Transition Tr = Transition::Event>
constexpr auto esConsumes () noexcept
 
template<Transition Tr = Transition::Event>
auto esConsumes (ESInputTag tag) noexcept
 
template<Transition Tr = Transition::Event>
ESGetTokenGeneric esConsumes (eventsetup::EventSetupRecordKey const &iRecord, eventsetup::DataKey const &iKey)
 Used with EventSetupRecord::doGet. More...
 
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)
 
void resetItemsToGetFrom (BranchType iType)
 
- Protected Attributes inherited from DQMOneEDAnalyzer<>
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 iConfig)
explicit

Definition at line 43 of file SiStripMonitorQuality.cc.

References edm::ParameterSet::getParameter(), and AlCaHLTBitMon_QueryRunRegistry::string.

45  conf_(iConfig),
46  tTopoToken_(esConsumes<edm::Transition::BeginRun>()),
47  detCablingToken_(esConsumes<edm::Transition::BeginRun>()),
48  qualityToken_(esConsumes<edm::Transition::BeginRun>(
49  edm::ESInputTag{"", iConfig.getParameter<std::string>("StripQualityLabel")})) {
50  edm::LogInfo("SiStripMonitorQuality") << "SiStripMonitorQuality "
51  << " Constructing....... ";
52 }
edm::ESGetToken< TrackerTopology, TrackerTopologyRcd > tTopoToken_
edm::ESGetToken< SiStripQuality, SiStripQualityRcd > qualityToken_
edm::ESGetToken< SiStripDetCabling, SiStripDetCablingRcd > detCablingToken_
Log< level::Info, false > LogInfo
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
SiStripMonitorQuality::~SiStripMonitorQuality ( )
override

Definition at line 54 of file SiStripMonitorQuality.cc.

54  {
55  edm::LogInfo("SiStripMonitorQuality") << "SiStripMonitorQuality "
56  << " Destructing....... ";
57 }
Log< level::Info, false > LogInfo

Member Function Documentation

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

Reimplemented from DQMOneEDAnalyzer<>.

Definition at line 118 of file SiStripMonitorQuality.cc.

References edm::ESWatcher< T >::check(), SiStripBadStrip::decode(), detCabling_, detCablingToken_, dqm::impl::MonitorElement::Fill(), SiStripBadStrip::data::firstStrip, edm::EventSetup::getData(), SiStripBadStrip::getDataVectorBegin(), dqm::impl::MonitorElement::getNbinsX(), getQualityME(), SiStripBadStrip::getRegistryVectorBegin(), SiStripBadStrip::getRegistryVectorEnd(), SiStripDetCabling::IsConnected(), hlt_dqm_clientPB-live_cfg::me, qualityToken_, qualityWatcher_, SiStripBadStrip::data::range, sistrip::SpyUtilities::range(), stripQuality_, tTopoToken_, and relativeConstraints::value.

118  {
119  if (!qualityWatcher_.check(eSetup))
120  return;
121 
122  const auto tTopo = &eSetup.getData(tTopoToken_);
125 
126  edm::LogInfo("SiStripMonitorQuality") << "SiStripMonitorQuality::analyze: "
127  << " Reading SiStripQuality " << std::endl;
128 
131  uint32_t detid;
132 
133  if (rbegin == rend)
134  return;
135 
136  for (SiStripBadStrip::RegistryIterator rp = rbegin; rp != rend; ++rp) {
137  detid = rp->detid;
138  // Check consistency in DetId
139  if (detid == 0 || detid == 0xFFFFFFFF) {
140  edm::LogError("SiStripMonitorQuality") << "SiStripMonitorQuality::analyze : "
141  << "Wrong DetId !!!!!! " << detid << " Neglecting !!!!!! ";
142  continue;
143  }
144  // check if the detid is connected in cabling
145  if (!detCabling_->IsConnected(detid)) {
146  edm::LogError("SiStripMonitorQuality") << "SiStripMonitorQuality::analyze : "
147  << " DetId " << detid << " not connected, Neglecting !!!!!! ";
148  continue;
149  }
150  MonitorElement *me = getQualityME(detid, tTopo);
152  stripQuality_->getDataVectorBegin() + rp->iend);
153  SiStripBadStrip::ContainerIterator it = range.first;
154  for (; it != range.second; ++it) {
155  unsigned int value = (*it);
156  short str_start = stripQuality_->decode(value).firstStrip;
157  short str_end = str_start + stripQuality_->decode(value).range;
158  for (short isr = str_start; isr < str_end + 1; isr++) {
159  if (isr <= (me->getNbinsX() - 1))
160  me->Fill(isr + 1, 1.0);
161  }
162  }
163  }
164 }
unsigned short range
edm::ESGetToken< TrackerTopology, TrackerTopologyRcd > tTopoToken_
std::vector< unsigned int >::const_iterator ContainerIterator
bool IsConnected(const uint32_t &det_id) const
Registry::const_iterator RegistryIterator
MonitorElement * getQualityME(uint32_t idet, const TrackerTopology *tTopo)
Log< level::Error, false > LogError
edm::ESGetToken< SiStripQuality, SiStripQualityRcd > qualityToken_
const uint16_t range(const Frame &aFrame)
void Fill(long long x)
bool getData(T &iHolder) const
Definition: EventSetup.h:128
edm::ESWatcher< SiStripQualityRcd > qualityWatcher_
RegistryIterator getRegistryVectorEnd() const
virtual int getNbinsX() const
get # of bins in X-axis
const SiStripDetCabling * detCabling_
edm::ESGetToken< SiStripDetCabling, SiStripDetCablingRcd > detCablingToken_
ContainerIterator getDataVectorBegin() const
const SiStripQuality * stripQuality_
Log< level::Info, false > LogInfo
unsigned short firstStrip
bool check(const edm::EventSetup &iSetup)
Definition: ESWatcher.h:57
RegistryIterator getRegistryVectorBegin() const
std::pair< ContainerIterator, ContainerIterator > Range
data decode(const unsigned int &value) const
void SiStripMonitorQuality::bookHistograms ( DQMStore::IBooker ibooker,
edm::Run const &  run,
edm::EventSetup const &  eSetup 
)
overridevirtual

Implements DQMOneEDAnalyzer<>.

Definition at line 59 of file SiStripMonitorQuality.cc.

References dqm::implementation::IBooker::book1D(), edm::ESWatcher< T >::check(), SiStripHistoId::createHistoId(), detCabling_, detCablingToken_, folder_organizer, edm::EventSetup::getData(), SiStripBadStrip::getRegistryVectorBegin(), SiStripBadStrip::getRegistryVectorEnd(), hidmanager, SiStripDetCabling::IsConnected(), SiStripDetCabling::nApvPairs(), QualityMEs, qualityToken_, qualityWatcher_, dqm::impl::MonitorElement::setAxisTitle(), SiStripFolderOrganizer::setDetectorFolder(), AlCaHLTBitMon_QueryRunRegistry::string, stripQuality_, and tTopoToken_.

61  {
62  if (!qualityWatcher_.check(eSetup))
63  return;
64 
65  const auto tTopo = &eSetup.getData(tTopoToken_);
66 
67  stripQuality_ = &eSetup.getData(qualityToken_);
68  detCabling_ = &eSetup.getData(detCablingToken_);
69 
70  edm::LogInfo("SiStripMonitorQuality") << "SiStripMonitorQuality::analyze: "
71  << " Reading SiStripQuality " << std::endl;
72 
75  uint32_t detid;
76 
77  if (rbegin == rend)
78  return;
79 
80  for (SiStripBadStrip::RegistryIterator rp = rbegin; rp != rend; ++rp) {
81  detid = rp->detid;
82  // Check consistency in DetId
83  if (detid == 0 || detid == 0xFFFFFFFF) {
84  edm::LogError("SiStripMonitorQuality") << "SiStripMonitorQuality::bookHistograms : "
85  << "Wrong DetId !!!!!! " << detid << " Neglecting !!!!!! ";
86  continue;
87  }
88  // check if the detid is connected in cabling
89  if (!detCabling_->IsConnected(detid)) {
90  edm::LogError("SiStripMonitorQuality") << "SiStripMonitorQuality::bookHistograms : "
91  << " DetId " << detid << " not connected, Neglecting !!!!!! ";
92  continue;
93  }
94 
95  MonitorElement *det_me;
96 
97  int nStrip = detCabling_->nApvPairs(detid) * 256;
98 
99  // use SistripHistoId for producing histogram id (and title)
101  // create SiStripFolderOrganizer
103  // set appropriate folder using SiStripFolderOrganizer
104  folder_organizer.setDetectorFolder(detid,
105  tTopo); // pass the detid to this method
106 
107  std::string hid;
108  hid = hidmanager.createHistoId("StripQualityFromCondDB", "det", detid);
109 
110  det_me = ibooker.book1D(hid, hid, nStrip, 0.5, nStrip + 0.5);
111  det_me->setAxisTitle("Strip Number", 1);
112  det_me->setAxisTitle("Quality Flag from CondDB ", 2);
113  QualityMEs.insert(std::make_pair(detid, det_me));
114  }
115 }
edm::ESGetToken< TrackerTopology, TrackerTopologyRcd > tTopoToken_
std::map< uint32_t, MonitorElement * > QualityMEs
bool IsConnected(const uint32_t &det_id) const
Registry::const_iterator RegistryIterator
Log< level::Error, false > LogError
edm::ESGetToken< SiStripQuality, SiStripQualityRcd > qualityToken_
void setDetectorFolder(uint32_t rawdetid, const TrackerTopology *tTopo)
edm::ESWatcher< SiStripQualityRcd > qualityWatcher_
RegistryIterator getRegistryVectorEnd() const
const SiStripDetCabling * detCabling_
edm::ESGetToken< SiStripDetCabling, SiStripDetCablingRcd > detCablingToken_
SiStripHistoId hidmanager
const SiStripQuality * stripQuality_
Log< level::Info, false > LogInfo
std::string createHistoId(std::string description, std::string id_type, uint32_t component_id)
SiStripFolderOrganizer folder_organizer
bool check(const edm::EventSetup &iSetup)
Definition: ESWatcher.h:57
RegistryIterator getRegistryVectorBegin() const
const uint16_t nApvPairs(uint32_t det_id) const
MonitorElement * book1D(TString const &name, TString const &title, int const nchX, double const lowX, double const highX, FUNC onbooking=NOOP())
Definition: DQMStore.h:98
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 DQMOneEDAnalyzer<>.

Definition at line 168 of file SiStripMonitorQuality.cc.

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

168  {
169  bool outputMEsInRootFile = conf_.getParameter<bool>("OutputMEsInRootFile");
171  if (outputMEsInRootFile) {
172  dqmStore_->save(outputFileName);
173  }
174 }
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
DQM_DEPRECATED void save(std::string const &filename, std::string const &path="")
Definition: DQMStore.cc:784
void SiStripMonitorQuality::endJob ( void  )
overridevirtual

Reimplemented from edm::one::EDProducerBase.

Definition at line 178 of file SiStripMonitorQuality.cc.

178  {
179  edm::LogInfo("SiStripMonitorQuality") << "SiStripMonitorQuality::EndJob: "
180  << " Finishing!! ";
181 }
Log< level::Info, false > LogInfo
SiStripMonitorQuality::MonitorElement * SiStripMonitorQuality::getQualityME ( uint32_t  idet,
const TrackerTopology tTopo 
)
private

Definition at line 185 of file SiStripMonitorQuality.cc.

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

Referenced by analyze().

186  {
187  std::map<uint32_t, MonitorElement *>::iterator pos = QualityMEs.find(idet);
188  MonitorElement *det_me = nullptr;
189  if (pos != QualityMEs.end()) {
190  det_me = pos->second;
191  det_me->Reset();
192  } else {
193  // this should never happen because of bookHistograms()
194  edm::LogError("SiStripMonitorQuality") << "SiStripMonitorQuality::getQualityME : "
195  << "Wrong DetId !!!!!! " << idet << " No ME found!";
196  }
197  return det_me;
198 }
std::map< uint32_t, MonitorElement * > QualityMEs
Log< level::Error, false > LogError
virtual void Reset()
Remove all data from the ME, keept the empty histogram with all its settings.

Member Data Documentation

edm::ParameterSet SiStripMonitorQuality::conf_
private

Definition at line 60 of file SiStripMonitorQuality.h.

Referenced by dqmEndRun().

std::string SiStripMonitorQuality::dataLabel_
private

Definition at line 65 of file SiStripMonitorQuality.h.

const SiStripDetCabling* SiStripMonitorQuality::detCabling_
private

Definition at line 61 of file SiStripMonitorQuality.h.

Referenced by analyze(), and bookHistograms().

edm::ESGetToken<SiStripDetCabling, SiStripDetCablingRcd> SiStripMonitorQuality::detCablingToken_
private

Definition at line 68 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 72 of file SiStripMonitorQuality.h.

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

Definition at line 64 of file SiStripMonitorQuality.h.

Referenced by bookHistograms(), and getQualityME().

edm::ESGetToken<SiStripQuality, SiStripQualityRcd> SiStripMonitorQuality::qualityToken_
private

Definition at line 69 of file SiStripMonitorQuality.h.

Referenced by analyze(), and bookHistograms().

edm::ESWatcher<SiStripQualityRcd> SiStripMonitorQuality::qualityWatcher_
private

Definition at line 70 of file SiStripMonitorQuality.h.

Referenced by analyze(), and bookHistograms().

const SiStripQuality* SiStripMonitorQuality::stripQuality_
private

Definition at line 62 of file SiStripMonitorQuality.h.

Referenced by analyze(), and bookHistograms().

edm::ESGetToken<TrackerTopology, TrackerTopologyRcd> SiStripMonitorQuality::tTopoToken_
private

Definition at line 67 of file SiStripMonitorQuality.h.

Referenced by analyze(), and bookHistograms().