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:
DQMEDAnalyzer edm::stream::EDAnalyzer< edm::RunSummaryCache< dqmDetails::NoCache >, edm::LuminosityBlockSummaryCache< dqmDetails::NoCache > > edm::stream::EDAnalyzerBase edm::EDConsumerBase

Public Member Functions

virtual void analyze (const edm::Event &, const edm::EventSetup &)
 
virtual void beginJob ()
 
void bookHistograms (DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override
 
virtual void endJob ()
 
virtual void endRun (edm::Run const &run, edm::EventSetup const &eSetup)
 
 SiStripMonitorQuality (const edm::ParameterSet &)
 
 ~SiStripMonitorQuality ()
 
- Public Member Functions inherited from DQMEDAnalyzer
virtual void beginRun (edm::Run const &, edm::EventSetup const &) final
 
virtual void beginStream (edm::StreamID id) final
 
virtual void dqmBeginRun (edm::Run const &, edm::EventSetup const &)
 
 DQMEDAnalyzer (void)
 
virtual void endLuminosityBlockSummary (edm::LuminosityBlock const &, edm::EventSetup const &, dqmDetails::NoCache *) const final
 
virtual void endRunSummary (edm::Run const &, edm::EventSetup const &, dqmDetails::NoCache *) const final
 
uint32_t streamId () const
 
- Public Member Functions inherited from edm::stream::EDAnalyzer< edm::RunSummaryCache< dqmDetails::NoCache >, edm::LuminosityBlockSummaryCache< dqmDetails::NoCache > >
 EDAnalyzer ()=default
 
- Public Member Functions inherited from edm::stream::EDAnalyzerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
 EDAnalyzerBase ()
 
ModuleDescription const & moduleDescription () const
 
virtual ~EDAnalyzerBase ()
 
- Public Member Functions inherited from edm::EDConsumerBase
std::vector< ConsumesInfoconsumesInfo () const
 
 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
 
void modulesDependentUpon (std::string const &iProcessName, std::string const &iModuleLabel, bool iPrint, std::vector< char const * > &oModuleLabels) const
 
void modulesWhoseProductsAreConsumed (std::vector< ModuleDescription const * > &modules, ProductRegistry const &preg, std::map< std::string, ModuleDescription const * > const &labelsToDesc, std::string const &processName) 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::stream::EDAnalyzer< edm::RunSummaryCache< dqmDetails::NoCache >, edm::LuminosityBlockSummaryCache< dqmDetails::NoCache > >
typedef CacheContexts< T...> CacheTypes
 
typedef CacheTypes::GlobalCache GlobalCache
 
typedef AbilityChecker< T...> HasAbility
 
typedef
CacheTypes::LuminosityBlockCache 
LuminosityBlockCache
 
typedef
LuminosityBlockContextT
< LuminosityBlockCache,
RunCache, GlobalCache
LuminosityBlockContext
 
typedef
CacheTypes::LuminosityBlockSummaryCache 
LuminosityBlockSummaryCache
 
typedef CacheTypes::RunCache RunCache
 
typedef RunContextT< RunCache,
GlobalCache
RunContext
 
typedef CacheTypes::RunSummaryCache RunSummaryCache
 
- Public Types inherited from edm::stream::EDAnalyzerBase
typedef EDAnalyzerAdaptorBase ModuleType
 
- Public Types inherited from edm::EDConsumerBase
typedef ProductLabels Labels
 
- Static Public Member Functions inherited from DQMEDAnalyzer
static std::shared_ptr
< dqmDetails::NoCache
globalBeginLuminosityBlockSummary (edm::LuminosityBlock const &, edm::EventSetup const &, LuminosityBlockContext const *)
 
static std::shared_ptr
< dqmDetails::NoCache
globalBeginRunSummary (edm::Run const &, edm::EventSetup const &, RunContext const *)
 
static void globalEndLuminosityBlockSummary (edm::LuminosityBlock const &, edm::EventSetup const &, LuminosityBlockContext const *, dqmDetails::NoCache *)
 
static void globalEndRunSummary (edm::Run const &, edm::EventSetup const &, RunContext const *, dqmDetails::NoCache *)
 
- Static Public Member Functions inherited from edm::stream::EDAnalyzerBase
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)
 

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 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::stream::EDAnalyzerBase.

Definition at line 133 of file SiStripMonitorQuality.cc.

References conf_, detCabling_, 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.

134 {
135  unsigned long long cacheID = eSetup.get<SiStripQualityRcd>().cacheIdentifier();
136  if (m_cacheID_ == cacheID) return;
137 
138  //Retrieve tracker topology from geometry
139  edm::ESHandle<TrackerTopology> tTopoHandle;
140  eSetup.get<TrackerTopologyRcd>().get(tTopoHandle);
141  const TrackerTopology* const tTopo = tTopoHandle.product();
142 
143  m_cacheID_ = cacheID;
144 
145  std::string quality_label = conf_.getParameter<std::string>("StripQualityLabel");
146  eSetup.get<SiStripQualityRcd>().get(quality_label,stripQuality_);
147  eSetup.get<SiStripDetCablingRcd>().get( detCabling_ );
148 
149  edm::LogInfo("SiStripMonitorQuality") << "SiStripMonitorQuality::analyze: "<<
150  " Reading SiStripQuality "<< std::endl;
151 
152  SiStripBadStrip::RegistryIterator rbegin = stripQuality_->getRegistryVectorBegin();
153  SiStripBadStrip::RegistryIterator rend = stripQuality_->getRegistryVectorEnd();
154  uint32_t detid;
155 
156  if (rbegin==rend) return;
157 
158  for (SiStripBadStrip::RegistryIterator rp=rbegin; rp != rend; ++rp) {
159 
160  detid = rp->detid;
161  // Check consistency in DetId
162  if (detid == 0 || detid == 0xFFFFFFFF){
163  edm::LogError("SiStripMonitorQuality") <<"SiStripMonitorQuality::analyze : "
164  << "Wrong DetId !!!!!! " << detid << " Neglecting !!!!!! ";
165  continue;
166  }
167  // check if the detid is connected in cabling
168  if (!detCabling_->IsConnected(detid)) {
169  edm::LogError("SiStripMonitorQuality") <<"SiStripMonitorQuality::analyze : "
170  << " DetId " << detid << " not connected, Neglecting !!!!!! ";
171  continue;
172  }
173  MonitorElement* me = getQualityME(detid, tTopo);
174  SiStripBadStrip::Range range = SiStripBadStrip::Range( stripQuality_->getDataVectorBegin()+rp->ibegin ,
175  stripQuality_->getDataVectorBegin()+rp->iend );
176  SiStripBadStrip::ContainerIterator it=range.first;
177  for(;it!=range.second;++it){
178  unsigned int value=(*it);
179  short str_start = stripQuality_->decode(value).firstStrip;
180  short str_end = str_start + stripQuality_->decode(value).range;
181  for ( short isr = str_start; isr < str_end + 1; isr++) {
182  if (isr <= (me->getNbinsX()-1)) me->Fill(isr+1, 1.0);
183  }
184  }
185  }
186 }
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:56
T const * product() const
Definition: ESHandle.h:86
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

Definition at line 64 of file SiStripMonitorQuality.cc.

64  {
65 }
void SiStripMonitorQuality::bookHistograms ( DQMStore::IBooker ibooker,
edm::Run const &  run,
edm::EventSetup const &  eSetup 
)
overridevirtual

Implements DQMEDAnalyzer.

Definition at line 67 of file SiStripMonitorQuality.cc.

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

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

Definition at line 201 of file SiStripMonitorQuality.cc.

201  {
202  edm::LogInfo("SiStripMonitorQuality") <<"SiStripMonitorQuality::EndJob: "
203  << " Finishing!! ";
204 }
void SiStripMonitorQuality::endRun ( edm::Run const &  run,
edm::EventSetup const &  eSetup 
)
virtual

Reimplemented from edm::stream::EDAnalyzerBase.

Definition at line 190 of file SiStripMonitorQuality.cc.

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

190  {
191  bool outputMEsInRootFile = conf_.getParameter<bool>("OutputMEsInRootFile");
193  if (outputMEsInRootFile) {
194  //dqmStore_->showDirStructure();
195  dqmStore_->save(outputFileName);
196  }
197 }
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", const bool resetMEsAfterWriting=false)
Definition: DQMStore.cc:2615
MonitorElement * SiStripMonitorQuality::getQualityME ( uint32_t  idet,
const TrackerTopology tTopo 
)
private

Definition at line 208 of file SiStripMonitorQuality.cc.

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

Referenced by analyze().

208  {
209 
210  std::map<uint32_t, MonitorElement* >::iterator pos = QualityMEs.find(idet);
211  MonitorElement* det_me = NULL;
212  if (pos != QualityMEs.end()) {
213  det_me = pos->second;
214  det_me->Reset();
215  } else {
216  //this should never happen because of bookHistograms()
217  edm::LogError("SiStripMonitorQuality") <<"SiStripMonitorQuality::getQualityME : "
218  << "Wrong DetId !!!!!! " << idet << " No ME found!";
219  }
220  return det_me;
221 }
#define NULL
Definition: scimark2.h:8
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 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().