CMS 3D CMS Logo

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

#include <DQM/SiStripMonitorCluster/interface/SiStripBadComponentInfo.h>

Inheritance diagram for SiStripBadComponentInfo:
DQMEDHarvester edm::one::EDProducer< edm::Accumulator, edm::EndLuminosityBlockProducer, edm::EndRunProducer, edm::one::WatchLuminosityBlocks, edm::one::WatchRuns, edm::one::SharedResources > edm::one::EDProducerBase edm::ProducerBase edm::EDConsumerBase edm::ProductRegistryHelper

Public Member Functions

 SiStripBadComponentInfo (const edm::ParameterSet &ps)
 Constructor. More...
 
 ~SiStripBadComponentInfo () override
 
- Public Member Functions inherited from DQMEDHarvester
void accumulate (edm::Event const &ev, edm::EventSetup const &es) final
 
void beginLuminosityBlock (edm::LuminosityBlock const &, edm::EventSetup const &) final
 
void beginRun (edm::Run const &, edm::EventSetup const &) override
 
 DQMEDHarvester ()
 
virtual void dqmEndLuminosityBlock (DQMStore::IBooker &, DQMStore::IGetter &, edm::LuminosityBlock const &, edm::EventSetup const &)
 
void endJob () final
 
void endLuminosityBlock (edm::LuminosityBlock const &, edm::EventSetup const &) final
 
void endLuminosityBlockProduce (edm::LuminosityBlock &, edm::EventSetup const &) final
 
void endRun (edm::Run const &, edm::EventSetup const &) override
 
void endRunProduce (edm::Run &run, edm::EventSetup const &setup) override
 
 ~DQMEDHarvester () override=default
 
- Public Member Functions inherited from edm::one::EDProducer< edm::Accumulator, edm::EndLuminosityBlockProducer, edm::EndRunProducer, edm::one::WatchLuminosityBlocks, edm::one::WatchRuns, edm::one::SharedResources >
 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)
 

Protected Member Functions

void beginRun (edm::Run const &, edm::EventSetup const &) override
 
void dqmEndJob (DQMStore::IBooker &, DQMStore::IGetter &) override
 
- 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)
 

Private Member Functions

void bookBadComponentHistos (DQMStore::IBooker &ibooker, DQMStore::IGetter &igetter)
 
void checkBadComponents ()
 
void createSummary (MonitorElement *me)
 
void fillBadComponentHistos (int xbin, int component, SiStripQuality::BadComponent &BC)
 

Private Attributes

MonitorElementbadAPVME_
 
MonitorElementbadFiberME_
 
MonitorElementbadStripME_
 
bool bookedStatus_
 
unsigned long long m_cacheID_
 
int nSubSystem_
 
std::string qualityLabel_
 
edm::ESHandle< SiStripQualitysiStripQuality_
 
edm::ESHandle< TrackerTopologytTopoHandle_
 

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 Attributes inherited from DQMEDHarvester
edm::EDPutTokenT< DQMTokenlumiToken_
 
edm::EDPutTokenT< DQMTokenrunToken_
 

Detailed Description

Description: Checks the # of SiStrip FEDs from DAQ Usage: <usage>

Definition at line 42 of file SiStripBadComponentInfo.h.

Constructor & Destructor Documentation

SiStripBadComponentInfo::SiStripBadComponentInfo ( const edm::ParameterSet ps)

Constructor.

Definition at line 23 of file SiStripBadComponentInfo.cc.

References LogDebug.

23  :
24  m_cacheID_(0),
25  bookedStatus_(false),
26  nSubSystem_(6),
27  qualityLabel_(pSet.getParameter<std::string>("StripQualityLabel"))
28 {
29  // Create MessageSender
30  LogDebug( "SiStripBadComponentInfo") << "SiStripBadComponentInfo::Deleting SiStripBadComponentInfo ";
31 }
#define LogDebug(id)
SiStripBadComponentInfo::~SiStripBadComponentInfo ( )
override

Definition at line 35 of file SiStripBadComponentInfo.cc.

References LogDebug.

35  {
36  LogDebug("SiStripBadComponentInfo") << "SiStripBadComponentInfo::Deleting SiStripBadComponentInfo ";
37 
38 }
#define LogDebug(id)

Member Function Documentation

void SiStripBadComponentInfo::beginRun ( edm::Run const &  run,
edm::EventSetup const &  eSetup 
)
overrideprotected

Definition at line 42 of file SiStripBadComponentInfo.cc.

References edm::EventSetup::get(), LogDebug, m_cacheID_, qualityLabel_, siStripQuality_, and tTopoHandle_.

42  {
43  LogDebug ("SiStripBadComponentInfo") <<"SiStripBadComponentInfo:: Begining of Run";
44 
45  //Retrieve tracker topology from geometry
46  eSetup.get<TrackerTopologyRcd>().get(tTopoHandle_);
47 
48  unsigned long long cacheID = eSetup.get<SiStripQualityRcd>().cacheIdentifier();
49  if (m_cacheID_ == !cacheID) {
50 
51  m_cacheID_ = cacheID;
52  LogDebug("SiStripBadComponentInfo") <<"SiStripBadchannelInfoNew::readCondition : "
53  << " Change in Cache";
55 
56  }
57 }
#define LogDebug(id)
edm::ESHandle< SiStripQuality > siStripQuality_
edm::ESHandle< TrackerTopology > tTopoHandle_
void SiStripBadComponentInfo::bookBadComponentHistos ( DQMStore::IBooker ibooker,
DQMStore::IGetter igetter 
)
private

Definition at line 153 of file SiStripBadComponentInfo.cc.

References badAPVME_, badFiberME_, badStripME_, DQMStore::IBooker::book2D(), bookedStatus_, DQMStore::IBooker::cd(), gather_cfg::cout, DQMStore::IGetter::dirExists(), mps_fire::i, cscdqm::h::names, nSubSystem_, DQMStore::IBooker::pwd(), MonitorElement::setAxisTitle(), MonitorElement::setBinLabel(), DQMStore::IBooker::setCurrentFolder(), and AlCaHLTBitMon_QueryRunRegistry::string.

Referenced by dqmEndJob().

153  {
154  if (!bookedStatus_) {
155  std::string strip_dir = "";
156  ibooker.cd();
157  // SiStripUtility::getTopFolderPath(dqmStore_, "SiStrip", strip_dir);
158  if (igetter.dirExists("SiStrip")) {
159  ibooker.cd("SiStrip");
160  strip_dir = ibooker.pwd();
161  }
162  std::cout << "SiStripBadComponentInfo::bookBadComponentHistos ==> " << strip_dir << " " << ibooker.pwd() << std::endl;
163  if (!strip_dir.empty()) ibooker.setCurrentFolder(strip_dir+"/EventInfo");
164  else ibooker.setCurrentFolder("SiStrip/EventInfo");
165 
166  ibooker.cd();
167  if (!strip_dir.empty()) ibooker.setCurrentFolder(strip_dir+"/EventInfo/BadComponentContents");
168 
169  std::string hname, htitle;
170  hname = "BadAPVMap";
171  htitle = "SiStrip Bad APVs";
172  badAPVME_ = ibooker.book2D(hname, htitle, nSubSystem_, 0.5, nSubSystem_+0.5, 10, 0.5, 10.5);
173  badAPVME_->setAxisTitle("Sub Detector Type", 1);
174  badAPVME_->setAxisTitle("Layer/Disc Number", 2);
175 
176  hname = "BadFiberMap";
177  htitle = "SiStrip Bad Fibers";
178  badFiberME_ = ibooker.book2D(hname, htitle, nSubSystem_, 0.5, nSubSystem_+0.5, 10, 0.5, 10.5);
179  badFiberME_->setAxisTitle("Sub Detector Type", 1);
180  badFiberME_->setAxisTitle("Layer/Disc Number", 2);
181 
182  hname = "BadStripMap";
183  htitle = "SiStrip Bad Strips";
184  badStripME_ = ibooker.book2D(hname, htitle, nSubSystem_, 0.5, nSubSystem_+0.5, 10, 0.5, 10.5);
185  badStripME_->setAxisTitle("Sub Detector Type", 1);
186  badStripME_->setAxisTitle("Layer/Disc Number", 2);
187 
188  std::vector<std::string> names;
189  names.push_back("TECB");
190  names.push_back("TECF");
191  names.push_back("TIB");
192  names.push_back("TIDB");
193  names.push_back("TIDF");
194  names.push_back("TOB");
195 
196  for (unsigned int i=0; i < names.size(); i++) {
197  badAPVME_->setBinLabel(i+1, names[i]);
198  badFiberME_->setBinLabel(i+1, names[i]);
199  badStripME_->setBinLabel(i+1, names[i]);
200  }
201 
202  bookedStatus_ = true;
203  ibooker.cd();
204  }
205 }
static const HistoName names[]
void setBinLabel(int bin, const std::string &label, int axis=1)
set bin label for x, y or z axis (axis=1, 2, 3 respectively)
bool dirExists(const std::string &path)
Definition: DQMStore.cc:337
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:279
MonitorElement * book2D(Args &&...args)
Definition: DQMStore.h:136
const std::string & pwd()
Definition: DQMStore.cc:287
void setAxisTitle(const std::string &title, int axis=1)
set x-, y- or z-axis title (axis=1, 2, 3 respectively)
void SiStripBadComponentInfo::checkBadComponents ( )
private

Definition at line 61 of file SiStripBadComponentInfo.cc.

References badStripME_, SiStripBadStrip::decode(), fillBadComponentHistos(), SiStripQuality::getBadComponentList(), MonitorElement::getBinContent(), SiStripBadStrip::getDataVectorBegin(), SiStripBadStrip::getRegistryVectorBegin(), SiStripBadStrip::getRegistryVectorEnd(), mps_fire::i, edm::ESHandle< T >::product(), SiStripBadStrip::data::range, MonitorElement::setBinContent(), siStripQuality_, DetId::subdetId(), StripSubdetector::TEC, TrackerTopology::tecSide(), TrackerTopology::tecWheel(), StripSubdetector::TIB, TrackerTopology::tibLayer(), StripSubdetector::TID, TrackerTopology::tidSide(), TrackerTopology::tidWheel(), StripSubdetector::TOB, TrackerTopology::tobLayer(), tTopoHandle_, and heppy_batch::val.

Referenced by dqmEndJob().

61  {
62  const TrackerTopology* const topo = tTopoHandle_.product();
63 
64  std::vector<SiStripQuality::BadComponent> BC = siStripQuality_->getBadComponentList();
65 
66  for (size_t i=0;i<BC.size();++i){
67  int subdet=-999; int component=-999;
68  //&&&&&&&&&&&&&&&&&
69  //Single SubSyste
70  //&&&&&&&&&&&&&&&&&
71  int subDet = DetId(BC[i].detid).subdetId();
72  if ( subDet == StripSubdetector::TIB ){
73  //&&&&&&&&&&&&&&&&&
74  //TIB
75  //&&&&&&&&&&&&&&&&&
76  subdet = 3;
77  component=topo->tibLayer(BC[i].detid);
78  } else if ( subDet == StripSubdetector::TID ) {
79  //&&&&&&&&&&&&&&&&&
80  //TID
81  //&&&&&&&&&&&&&&&&&
82  if (topo->tidSide(BC[i].detid)==2) subdet = 4;
83  else subdet = 5;
84  component = topo->tidWheel(BC[i].detid);
85  } else if ( subDet == StripSubdetector::TOB ) {
86  //&&&&&&&&&&&&&&&&&
87  //TOB
88  //&&&&&&&&&&&&&&&&&
89  subdet = 6;
90  component=topo->tobLayer(BC[i].detid);
91  } else if ( subDet == StripSubdetector::TEC ) {
92  //&&&&&&&&&&&&&&&&&
93  //TEC
94  //&&&&&&&&&&&&&&&&&
95  if (topo->tecSide(BC[i].detid)==2) subdet = 2;
96  else subdet=1;
97  component=topo->tecWheel(BC[i].detid);
98  }
99  fillBadComponentHistos(subdet,component,BC[i]);
100  }
101  //&&&&&&&&&&&&&&&&&&
102  // Single Strip Info
103  //&&&&&&&&&&&&&&&&&&
104 
107 
108  for (SiStripBadStrip::RegistryIterator rp=rbegin; rp != rend; ++rp) {
109  uint32_t detid=rp->detid;
110  int subdet=-999; int component=-999;
111  DetId detectorId=DetId(detid);
112  int subDet = detectorId.subdetId();
113  if ( subDet == StripSubdetector::TIB ){
114  subdet=3;
115  component=topo->tibLayer(detid);
116  } else if ( subDet == StripSubdetector::TID ) {
117  if (topo->tidSide(detid)==2) subdet = 5;
118  else subdet = 4;
119  component = topo->tidWheel(detid);
120  } else if ( subDet == StripSubdetector::TOB ) {
121  subdet=6;
122  component=topo->tobLayer(detid);
123  } else if ( subDet == StripSubdetector::TEC ) {
124  if (topo->tecSide(detid) == 2) subdet = 2;
125  else subdet=1;
126  component=topo->tecWheel(detid);
127  }
128 
130 
131  for(int it=0;it<sqrange.second-sqrange.first;it++){
132  unsigned int range=siStripQuality_->decode( *(sqrange.first+it) ).range;
133  float val = badStripME_->getBinContent(subdet, component);
134  val += range;
135  badStripME_->setBinContent(subdet, component,val);
136  }
137  }
138 }
unsigned short range
void setBinContent(int binx, double content)
set content of bin (1-D)
const std::vector< BadComponent > & getBadComponentList() const
unsigned int tibLayer(const DetId &id) const
unsigned int tidWheel(const DetId &id) const
Registry::const_iterator RegistryIterator
edm::ESHandle< SiStripQuality > siStripQuality_
void fillBadComponentHistos(int xbin, int component, SiStripQuality::BadComponent &BC)
RegistryIterator getRegistryVectorEnd() const
unsigned int tidSide(const DetId &id) const
int subdetId() const
get the contents of the subdetector field (not cast into any detector&#39;s numbering enum) ...
Definition: DetId.h:38
ContainerIterator getDataVectorBegin() const
Definition: DetId.h:18
RegistryIterator getRegistryVectorBegin() const
double getBinContent(int binx) const
get content of bin (1-D)
edm::ESHandle< TrackerTopology > tTopoHandle_
std::pair< ContainerIterator, ContainerIterator > Range
unsigned int tecWheel(const DetId &id) const
T const * product() const
Definition: ESHandle.h:86
data decode(const unsigned int &value) const
unsigned int tobLayer(const DetId &id) const
unsigned int tecSide(const DetId &id) const
void SiStripBadComponentInfo::createSummary ( MonitorElement me)
private

Definition at line 221 of file SiStripBadComponentInfo.cc.

References DEFINE_FWK_MODULE, MonitorElement::getBinContent(), MonitorElement::getNbinsY(), mps_fire::i, gen::k, nSubSystem_, and MonitorElement::setBinContent().

Referenced by dqmEndJob().

221  {
222  for (int i=1; i<nSubSystem_+1; i++) {
223  float sum = 0.0;
224  for (int k=1; k<me->getNbinsY(); k++) {
225  if (me->getBinContent(i,k)) sum+= me->getBinContent(i,k);
226  }
227  me->setBinContent(i,me->getNbinsY(), sum);
228  }
229 }
void setBinContent(int binx, double content)
set content of bin (1-D)
int k[5][pyjets_maxn]
int getNbinsY() const
get # of bins in Y-axis
double getBinContent(int binx) const
get content of bin (1-D)
void SiStripBadComponentInfo::dqmEndJob ( DQMStore::IBooker ibooker,
DQMStore::IGetter igetter 
)
overrideprotectedvirtual

Implements DQMEDHarvester.

Definition at line 142 of file SiStripBadComponentInfo.cc.

References badAPVME_, badFiberME_, badStripME_, bookBadComponentHistos(), checkBadComponents(), createSummary(), and LogDebug.

142  {
143  LogDebug ("SiStripBadComponentInfo") <<"SiStripBadComponentInfo::dqmEndRun";
144  bookBadComponentHistos(ibooker, igetter);
149 }
#define LogDebug(id)
void createSummary(MonitorElement *me)
void bookBadComponentHistos(DQMStore::IBooker &ibooker, DQMStore::IGetter &igetter)
void SiStripBadComponentInfo::fillBadComponentHistos ( int  xbin,
int  component,
SiStripQuality::BadComponent BC 
)
private

Definition at line 206 of file SiStripBadComponentInfo.cc.

References badAPVME_, SiStripQuality::BadComponent::BadApvs, badFiberME_, SiStripQuality::BadComponent::BadFibers, KineDebug3::count(), MonitorElement::getBinContent(), MonitorElement::setBinContent(), and heppy_batch::val.

Referenced by checkBadComponents().

206  {
207 
208  if (BC.BadApvs){
209  int ntot = std::bitset<16>(BC.BadApvs&0x3f).count();
210  float val = badAPVME_->getBinContent(xbin, component);
211  val += ntot;
212  badAPVME_->setBinContent(xbin, component, val);
213  }
214  if (BC.BadFibers){
215  int ntot = std::bitset<16>(BC.BadFibers&0x7).count();
216  float val = badFiberME_->getBinContent(xbin, component);
217  val+= ntot;
218  badFiberME_->setBinContent(xbin, component, val);
219  }
220 }
void setBinContent(int binx, double content)
set content of bin (1-D)
double getBinContent(int binx) const
get content of bin (1-D)

Member Data Documentation

MonitorElement* SiStripBadComponentInfo::badAPVME_
private
MonitorElement* SiStripBadComponentInfo::badFiberME_
private
MonitorElement* SiStripBadComponentInfo::badStripME_
private

Definition at line 63 of file SiStripBadComponentInfo.h.

Referenced by bookBadComponentHistos(), checkBadComponents(), and dqmEndJob().

bool SiStripBadComponentInfo::bookedStatus_
private

Definition at line 67 of file SiStripBadComponentInfo.h.

Referenced by bookBadComponentHistos().

unsigned long long SiStripBadComponentInfo::m_cacheID_
private

Definition at line 66 of file SiStripBadComponentInfo.h.

Referenced by beginRun().

int SiStripBadComponentInfo::nSubSystem_
private

Definition at line 68 of file SiStripBadComponentInfo.h.

Referenced by bookBadComponentHistos(), and createSummary().

std::string SiStripBadComponentInfo::qualityLabel_
private

Definition at line 69 of file SiStripBadComponentInfo.h.

Referenced by beginRun().

edm::ESHandle<SiStripQuality> SiStripBadComponentInfo::siStripQuality_
private

Definition at line 71 of file SiStripBadComponentInfo.h.

Referenced by beginRun(), and checkBadComponents().

edm::ESHandle<TrackerTopology> SiStripBadComponentInfo::tTopoHandle_
private

Definition at line 72 of file SiStripBadComponentInfo.h.

Referenced by beginRun(), and checkBadComponents().