CMS 3D CMS Logo

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

#include <CalibTracker/SiStripQuality/plugins/SiStripQualityStatistics.cc>

Inheritance diagram for SiStripQualityStatistics:
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

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

void SetBadComponents (int, int, SiStripQuality::BadComponent &)
 
void updateAndSave (const SiStripQuality *siStripQuality)
 

Private Attributes

bool addBadCompFromFedErr_
 
std::string dataLabel_
 
const SiStripFedCablingfedCabling_
 
float fedErrCutoff_
 
unsigned long long m_cacheID_
 
int NBadComponent [4][19][4]
 
int NTkBadComponent [4]
 
SiStripDetInfoFileReaderreader
 
edm::RunID run_
 
bool saveTkHistoMap_
 
const SiStripQualitysiStripQuality_
 
std::stringstream ssV [4][19]
 
std::unique_ptr< TkHistoMaptkhisto
 
TrackerMaptkMap
 
std::string TkMapFileName_
 
TrackerMaptkMapFullIOVs
 
const TrackerTopologytTopo_
 

Additional Inherited Members

- Public Types inherited from DQMEDHarvester
typedef dqm::harvesting::DQMStore DQMStore
 
typedef dqm::harvesting::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 DQMEDHarvester
edm::EDPutTokenT< DQMTokenlumiToken_
 
edm::EDPutTokenT< DQMTokenrunToken_
 

Detailed Description

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

Implementation: <Notes on="" implementation>="">

Definition at line 17 of file SiStripQualityStatistics.h.

Constructor & Destructor Documentation

SiStripQualityStatistics::SiStripQualityStatistics ( const edm::ParameterSet iConfig)
explicit

Definition at line 31 of file SiStripQualityStatistics.cc.

References contentValuesFiles::fullPath, reader, tkhisto, and tkMapFullIOVs.

32  : m_cacheID_(0),
33  dataLabel_(iConfig.getUntrackedParameter<std::string>("dataLabel", "")),
34  TkMapFileName_(iConfig.getUntrackedParameter<std::string>("TkMapFileName", "")),
35  saveTkHistoMap_(iConfig.getUntrackedParameter<bool>("SaveTkHistoMap", true)),
36  tkMap(nullptr),
37  tkMapFullIOVs(nullptr),
38  addBadCompFromFedErr_(iConfig.getUntrackedParameter<bool>("AddBadComponentsFromFedErrors", false)),
39  fedErrCutoff_(float(iConfig.getUntrackedParameter<double>("FedErrorBadComponentsCutoff", 0.8))) {
41  iConfig
42  .getUntrackedParameter<edm::FileInPath>("file",
43  edm::FileInPath("CalibTracker/SiStripCommon/data/SiStripDetInfo.dat"))
44  .fullPath());
45 
46  tkMapFullIOVs = new TrackerMap("BadComponents");
47  tkhisto = nullptr;
48 }
T getUntrackedParameter(std::string const &, T const &) const
std::unique_ptr< TkHistoMap > tkhisto
SiStripDetInfoFileReader * reader
SiStripQualityStatistics::~SiStripQualityStatistics ( )
override

Definition at line 50 of file SiStripQualityStatistics.cc.

50 {}

Member Function Documentation

void SiStripQualityStatistics::dqmEndJob ( DQMStore::IBooker booker,
DQMStore::IGetter getter 
)
overridevirtual

Implements DQMEDHarvester.

Definition at line 52 of file SiStripQualityStatistics.cc.

References addBadCompFromFedErr_, sistrip::badStripFromFedErr(), fedCabling_, fedErrCutoff_, corrVsCorr::filename, TrackerMap::print(), TrackerMap::save(), saveTkHistoMap_, siStripQuality_, AlCaHLTBitMon_QueryRunRegistry::string, tkhisto, TkMapFileName_, tkMapFullIOVs, and updateAndSave().

52  {
54  SiStripQuality mergedQuality{*siStripQuality_};
55  auto fedErrQuality = sistrip::badStripFromFedErr(getter, *fedCabling_, fedErrCutoff_);
56  mergedQuality.add(fedErrQuality.get());
57  mergedQuality.cleanUp();
58  mergedQuality.fillBadComponents();
59  updateAndSave(&mergedQuality);
60  }
62  if (!filename.empty()) {
63  tkMapFullIOVs->save(false, 0, 0, filename);
64  filename.erase(filename.begin() + filename.find("."), filename.end());
65  tkMapFullIOVs->print(false, 0, 0, filename);
66 
67  if (saveTkHistoMap_) {
68  tkhisto->save(filename + ".root");
69  tkhisto->saveAsCanvas(filename + "_Canvas.root", "E");
70  }
71  }
72 }
void updateAndSave(const SiStripQuality *siStripQuality)
void save(bool print_total=true, float minval=0., float maxval=0., std::string s="svgmap.svg", int width=1500, int height=800)
Definition: TrackerMap.cc:811
std::unique_ptr< SiStripQuality > badStripFromFedErr(dqm::harvesting::DQMStore::IGetter &dqmStore, const SiStripFedCabling &fedCabling, float cutoff)
std::unique_ptr< TkHistoMap > tkhisto
const SiStripQuality * siStripQuality_
const SiStripFedCabling * fedCabling_
void print(bool print_total=true, float minval=0., float maxval=0., std::string s="svgmap")
Definition: TrackerMap.cc:2943
void SiStripQualityStatistics::endRun ( edm::Run const &  run,
edm::EventSetup const &  iSetup 
)
override

Definition at line 74 of file SiStripQualityStatistics.cc.

References addBadCompFromFedErr_, dataLabel_, fedCabling_, edm::EventSetup::get(), edm::RunBase::id(), m_cacheID_, edm::ESHandle< T >::product(), run_, siStripQuality_, tkhisto, TkMapFileName_, tTopo_, and updateAndSave().

74  {
75  //Retrieve tracker topology from geometry
77  iSetup.get<TrackerTopologyRcd>().get(tTopoHandle);
78  tTopo_ = tTopoHandle.product();
79  if ((!tkhisto) && (!TkMapFileName_.empty())) {
80  edm::ESHandle<TkDetMap> tkDetMapHandle;
81  iSetup.get<TrackerTopologyRcd>().get(tkDetMapHandle);
82  //here the baseline (the value of the empty,not assigned bins) is put to -1 (default is zero)
83  tkhisto = std::make_unique<TkHistoMap>(tkDetMapHandle.product(), "BadComp", "BadComp", -1.);
84  }
85 
86  unsigned long long cacheID = iSetup.get<SiStripQualityRcd>().cacheIdentifier();
87 
88  if (m_cacheID_ == cacheID)
89  return;
90 
91  m_cacheID_ = cacheID;
92  run_ = run.id();
93 
94  edm::ESHandle<SiStripQuality> qualityHandle;
95  iSetup.get<SiStripQualityRcd>().get(dataLabel_, qualityHandle);
96 
97  if (!addBadCompFromFedErr_) {
98  updateAndSave(qualityHandle.product());
99  } else {
100  siStripQuality_ = qualityHandle.product();
101  edm::ESHandle<SiStripFedCabling> fedCablingHandle;
102  iSetup.get<SiStripFedCablingRcd>().get(fedCablingHandle);
103  fedCabling_ = fedCablingHandle.product();
104  }
105 }
const TrackerTopology * tTopo_
void updateAndSave(const SiStripQuality *siStripQuality)
std::unique_ptr< TkHistoMap > tkhisto
const SiStripQuality * siStripQuality_
const SiStripFedCabling * fedCabling_
T const * product() const
Definition: ESHandle.h:86
void SiStripQualityStatistics::SetBadComponents ( int  i,
int  component,
SiStripQuality::BadComponent BC 
)
private

Definition at line 316 of file SiStripQualityStatistics.cc.

References SiStripQuality::BadComponent::BadApvs, SiStripQuality::BadComponent::BadFibers, SiStripQuality::BadComponent::BadModule, SiStripQuality::BadComponent::detid, TrackerMap::fillc(), SiStripDetInfoFileReader::getNumberOfApvsAndStripLength(), mps_fire::i, NBadComponent, reader, ssV, tkMap, and testProducerWithPsetDescEmpty_cfi::x1.

Referenced by updateAndSave().

316  {
317  int napv = reader->getNumberOfApvsAndStripLength(BC.detid).first;
318 
319  ssV[i][component] << "\n\t\t " << BC.detid << " \t " << BC.BadModule << " \t " << ((BC.BadFibers) & 0x1) << " ";
320  if (napv == 4)
321  ssV[i][component] << "x " << ((BC.BadFibers >> 1) & 0x1);
322 
323  if (napv == 6)
324  ssV[i][component] << ((BC.BadFibers >> 1) & 0x1) << " " << ((BC.BadFibers >> 2) & 0x1);
325  ssV[i][component] << " \t " << ((BC.BadApvs) & 0x1) << " " << ((BC.BadApvs >> 1) & 0x1) << " ";
326  if (napv == 4)
327  ssV[i][component] << "x x " << ((BC.BadApvs >> 2) & 0x1) << " " << ((BC.BadApvs >> 3) & 0x1);
328  if (napv == 6)
329  ssV[i][component] << ((BC.BadApvs >> 2) & 0x1) << " " << ((BC.BadApvs >> 3) & 0x1) << " "
330  << ((BC.BadApvs >> 4) & 0x1) << " " << ((BC.BadApvs >> 5) & 0x1) << " ";
331 
332  if (BC.BadApvs) {
333  NBadComponent[i][0][2] += ((BC.BadApvs >> 5) & 0x1) + ((BC.BadApvs >> 4) & 0x1) + ((BC.BadApvs >> 3) & 0x1) +
334  ((BC.BadApvs >> 2) & 0x1) + ((BC.BadApvs >> 1) & 0x1) + ((BC.BadApvs) & 0x1);
335  NBadComponent[i][component][2] += ((BC.BadApvs >> 5) & 0x1) + ((BC.BadApvs >> 4) & 0x1) +
336  ((BC.BadApvs >> 3) & 0x1) + ((BC.BadApvs >> 2) & 0x1) +
337  ((BC.BadApvs >> 1) & 0x1) + ((BC.BadApvs) & 0x1);
338  tkMap->fillc(BC.detid, 0xff0000);
339  }
340  if (BC.BadFibers) {
341  NBadComponent[i][0][1] += ((BC.BadFibers >> 2) & 0x1) + ((BC.BadFibers >> 1) & 0x1) + ((BC.BadFibers) & 0x1);
342  NBadComponent[i][component][1] +=
343  ((BC.BadFibers >> 2) & 0x1) + ((BC.BadFibers >> 1) & 0x1) + ((BC.BadFibers) & 0x1);
344  tkMap->fillc(BC.detid, 0x0000ff);
345  }
346  if (BC.BadModule) {
347  NBadComponent[i][0][0]++;
348  NBadComponent[i][component][0]++;
349  tkMap->fillc(BC.detid, 0x0);
350  }
351 }
const std::pair< unsigned short, double > getNumberOfApvsAndStripLength(uint32_t detId) const
void fillc(int idmod, int RGBcode)
Definition: TrackerMap.h:135
std::stringstream ssV[4][19]
SiStripDetInfoFileReader * reader
void SiStripQualityStatistics::updateAndSave ( const SiStripQuality siStripQuality)
private

Definition at line 107 of file SiStripQualityStatistics.cc.

References SiStripBadStrip::decode(), corrVsCorr::filename, TrackerMap::fill(), TrackerMap::fillc(), SiStripDetInfoFileReader::getAllDetIds(), SiStripQuality::getBadComponentList(), SiStripBadStrip::getDataVectorBegin(), SiStripDetInfoFileReader::getNumberOfApvsAndStripLength(), SiStripBadStrip::getRegistryVectorBegin(), SiStripBadStrip::getRegistryVectorEnd(), mps_fire::i, SiStripQuality::IsModuleUsable(), dqmiolumiharvest::j, dqmdumpme::k, LogDebug, m_cacheID_, NBadComponent, NTkBadComponent, TrackerMap::print(), FastTimerService_cff::range, SiStripBadStrip::data::range, reader, edm::RunID::run(), run_, TrackerMap::save(), SetBadComponents(), contentValuesCheck::ss, ssV, str, AlCaHLTBitMon_QueryRunRegistry::string, DetId::subdetId(), StripSubdetector::TEC, TrackerTopology::tecSide(), TrackerTopology::tecWheel(), StripSubdetector::TIB, TrackerTopology::tibLayer(), StripSubdetector::TID, TrackerTopology::tidSide(), TrackerTopology::tidWheel(), tkhisto, tkMap, TkMapFileName_, tkMapFullIOVs, StripSubdetector::TOB, TrackerTopology::tobLayer(), tTopo_, and testProducerWithPsetDescEmpty_cfi::x1.

Referenced by dqmEndJob(), and endRun().

107  {
108  for (int i = 0; i < 4; ++i) {
109  NTkBadComponent[i] = 0;
110  for (int j = 0; j < 19; ++j) {
111  ssV[i][j].str("");
112  for (int k = 0; k < 4; ++k)
113  NBadComponent[i][j][k] = 0;
114  }
115  }
116 
117  if (tkMap)
118  delete tkMap;
119  tkMap = new TrackerMap("BadComponents");
120 
121  std::stringstream ss;
122  std::vector<uint32_t> detids = reader->getAllDetIds();
123  std::vector<uint32_t>::const_iterator idet = detids.begin();
124  for (; idet != detids.end(); ++idet) {
125  ss << "detid " << (*idet) << " IsModuleUsable " << siStripQuality->IsModuleUsable((*idet)) << "\n";
126  if (siStripQuality->IsModuleUsable((*idet)))
127  tkMap->fillc(*idet, 0x00ff00);
128  }
129  LogDebug("SiStripQualityStatistics") << ss.str() << std::endl;
130 
131  std::vector<SiStripQuality::BadComponent> BC = siStripQuality->getBadComponentList();
132 
133  for (size_t i = 0; i < BC.size(); ++i) {
134  //&&&&&&&&&&&&&
135  //Full Tk
136  //&&&&&&&&&&&&&
137 
138  if (BC[i].BadModule)
139  NTkBadComponent[0]++;
140  if (BC[i].BadFibers)
141  NTkBadComponent[1] += ((BC[i].BadFibers >> 2) & 0x1) + ((BC[i].BadFibers >> 1) & 0x1) + ((BC[i].BadFibers) & 0x1);
142  if (BC[i].BadApvs)
143  NTkBadComponent[2] += ((BC[i].BadApvs >> 5) & 0x1) + ((BC[i].BadApvs >> 4) & 0x1) + ((BC[i].BadApvs >> 3) & 0x1) +
144  ((BC[i].BadApvs >> 2) & 0x1) + ((BC[i].BadApvs >> 1) & 0x1) + ((BC[i].BadApvs) & 0x1);
145 
146  //&&&&&&&&&&&&&&&&&
147  //Single SubSyste
148  //&&&&&&&&&&&&&&&&&
149  int component;
150  DetId detectorId = DetId(BC[i].detid);
151  int subDet = detectorId.subdetId();
152  if (subDet == StripSubdetector::TIB) {
153  //&&&&&&&&&&&&&&&&&
154  //TIB
155  //&&&&&&&&&&&&&&&&&
156 
157  component = tTopo_->tibLayer(BC[i].detid);
158  SetBadComponents(0, component, BC[i]);
159 
160  } else if (subDet == StripSubdetector::TID) {
161  //&&&&&&&&&&&&&&&&&
162  //TID
163  //&&&&&&&&&&&&&&&&&
164 
165  component = tTopo_->tidSide(BC[i].detid) == 2 ? tTopo_->tidWheel(BC[i].detid) : tTopo_->tidWheel(BC[i].detid) + 3;
166  SetBadComponents(1, component, BC[i]);
167 
168  } else if (subDet == StripSubdetector::TOB) {
169  //&&&&&&&&&&&&&&&&&
170  //TOB
171  //&&&&&&&&&&&&&&&&&
172 
173  component = tTopo_->tobLayer(BC[i].detid);
174  SetBadComponents(2, component, BC[i]);
175 
176  } else if (subDet == StripSubdetector::TEC) {
177  //&&&&&&&&&&&&&&&&&
178  //TEC
179  //&&&&&&&&&&&&&&&&&
180 
181  component = tTopo_->tecSide(BC[i].detid) == 2 ? tTopo_->tecWheel(BC[i].detid) : tTopo_->tecWheel(BC[i].detid) + 9;
182  SetBadComponents(3, component, BC[i]);
183  }
184  }
185 
186  //&&&&&&&&&&&&&&&&&&
187  // Single Strip Info
188  //&&&&&&&&&&&&&&&&&&
189  float percentage = 0;
190 
191  SiStripQuality::RegistryIterator rbegin = siStripQuality->getRegistryVectorBegin();
193 
194  for (SiStripBadStrip::RegistryIterator rp = rbegin; rp != rend; ++rp) {
195  uint32_t detid = rp->detid;
196 
197  int subdet = -999;
198  int component = -999;
199  DetId detectorId = DetId(detid);
200  int subDet = detectorId.subdetId();
201  if (subDet == StripSubdetector::TIB) {
202  subdet = 0;
203  component = tTopo_->tibLayer(detid);
204  } else if (subDet == StripSubdetector::TID) {
205  subdet = 1;
206  component = tTopo_->tidSide(detid) == 2 ? tTopo_->tidWheel(detid) : tTopo_->tidWheel(detid) + 3;
207  } else if (subDet == StripSubdetector::TOB) {
208  subdet = 2;
209  component = tTopo_->tobLayer(detid);
210  } else if (subDet == StripSubdetector::TEC) {
211  subdet = 3;
212  component = tTopo_->tecSide(detid) == 2 ? tTopo_->tecWheel(detid) : tTopo_->tecWheel(detid) + 9;
213  }
214 
215  SiStripQuality::Range sqrange = SiStripQuality::Range(siStripQuality->getDataVectorBegin() + rp->ibegin,
216  siStripQuality->getDataVectorBegin() + rp->iend);
217 
218  percentage = 0;
219  for (int it = 0; it < sqrange.second - sqrange.first; it++) {
220  unsigned int range = siStripQuality->decode(*(sqrange.first + it)).range;
221  NTkBadComponent[3] += range;
222  NBadComponent[subdet][0][3] += range;
223  NBadComponent[subdet][component][3] += range;
224  percentage += range;
225  }
226  if (percentage != 0)
227  percentage /= 128. * reader->getNumberOfApvsAndStripLength(detid).first;
228  if (percentage > 1)
229  edm::LogError("SiStripQualityStatistics") << "PROBLEM detid " << detid << " value " << percentage << std::endl;
230 
231  //------- Global Statistics on percentage of bad components along the IOVs ------//
232  tkMapFullIOVs->fill(detid, percentage);
233  if (tkhisto != nullptr)
234  tkhisto->fill(detid, percentage);
235  }
236 
237  //&&&&&&&&&&&&&&&&&&
238  // printout
239  //&&&&&&&&&&&&&&&&&&
240 
241  ss.str("");
242  ss << "\n-----------------\nNew IOV starting from run " << run_.run() << " chacheID " << m_cacheID_
243  << "\n-----------------\n";
244  ss << "\n-----------------\nGlobal Info\n-----------------";
245  ss << "\nBadComponent \t Modules \tFibers "
246  "\tApvs\tStrips\n----------------------------------------------------------------";
247  ss << "\nTracker:\t\t" << NTkBadComponent[0] << "\t" << NTkBadComponent[1] << "\t" << NTkBadComponent[2] << "\t"
248  << NTkBadComponent[3];
249  ss << "\n";
250  ss << "\nTIB:\t\t\t" << NBadComponent[0][0][0] << "\t" << NBadComponent[0][0][1] << "\t" << NBadComponent[0][0][2]
251  << "\t" << NBadComponent[0][0][3];
252  ss << "\nTID:\t\t\t" << NBadComponent[1][0][0] << "\t" << NBadComponent[1][0][1] << "\t" << NBadComponent[1][0][2]
253  << "\t" << NBadComponent[1][0][3];
254  ss << "\nTOB:\t\t\t" << NBadComponent[2][0][0] << "\t" << NBadComponent[2][0][1] << "\t" << NBadComponent[2][0][2]
255  << "\t" << NBadComponent[2][0][3];
256  ss << "\nTEC:\t\t\t" << NBadComponent[3][0][0] << "\t" << NBadComponent[3][0][1] << "\t" << NBadComponent[3][0][2]
257  << "\t" << NBadComponent[3][0][3];
258  ss << "\n";
259 
260  for (int i = 1; i < 5; ++i)
261  ss << "\nTIB Layer " << i << " :\t\t" << NBadComponent[0][i][0] << "\t" << NBadComponent[0][i][1] << "\t"
262  << NBadComponent[0][i][2] << "\t" << NBadComponent[0][i][3];
263  ss << "\n";
264  for (int i = 1; i < 4; ++i)
265  ss << "\nTID+ Disk " << i << " :\t\t" << NBadComponent[1][i][0] << "\t" << NBadComponent[1][i][1] << "\t"
266  << NBadComponent[1][i][2] << "\t" << NBadComponent[1][i][3];
267  for (int i = 4; i < 7; ++i)
268  ss << "\nTID- Disk " << i - 3 << " :\t\t" << NBadComponent[1][i][0] << "\t" << NBadComponent[1][i][1] << "\t"
269  << NBadComponent[1][i][2] << "\t" << NBadComponent[1][i][3];
270  ss << "\n";
271  for (int i = 1; i < 7; ++i)
272  ss << "\nTOB Layer " << i << " :\t\t" << NBadComponent[2][i][0] << "\t" << NBadComponent[2][i][1] << "\t"
273  << NBadComponent[2][i][2] << "\t" << NBadComponent[2][i][3];
274  ss << "\n";
275  for (int i = 1; i < 10; ++i)
276  ss << "\nTEC+ Disk " << i << " :\t\t" << NBadComponent[3][i][0] << "\t" << NBadComponent[3][i][1] << "\t"
277  << NBadComponent[3][i][2] << "\t" << NBadComponent[3][i][3];
278  for (int i = 10; i < 19; ++i)
279  ss << "\nTEC- Disk " << i - 9 << " :\t\t" << NBadComponent[3][i][0] << "\t" << NBadComponent[3][i][1] << "\t"
280  << NBadComponent[3][i][2] << "\t" << NBadComponent[3][i][3];
281  ss << "\n";
282 
283  ss << "\n----------------------------------------------------------------\n\t\t Detid \tModules Fibers "
284  "Apvs\n----------------------------------------------------------------";
285  for (int i = 1; i < 5; ++i)
286  ss << "\nTIB Layer " << i << " :" << ssV[0][i].str();
287  ss << "\n";
288  for (int i = 1; i < 4; ++i)
289  ss << "\nTID+ Disk " << i << " :" << ssV[1][i].str();
290  for (int i = 4; i < 7; ++i)
291  ss << "\nTID- Disk " << i - 3 << " :" << ssV[1][i].str();
292  ss << "\n";
293  for (int i = 1; i < 7; ++i)
294  ss << "\nTOB Layer " << i << " :" << ssV[2][i].str();
295  ss << "\n";
296  for (int i = 1; i < 10; ++i)
297  ss << "\nTEC+ Disk " << i << " :" << ssV[3][i].str();
298  for (int i = 10; i < 19; ++i)
299  ss << "\nTEC- Disk " << i - 9 << " :" << ssV[3][i].str();
300 
301  edm::LogInfo("SiStripQualityStatistics") << ss.str() << std::endl;
302 
304  std::stringstream sRun;
305  sRun.str("");
306  sRun << "_Run_" << std::setw(6) << std::setfill('0') << run_.run() << std::setw(0);
307 
308  if (!filename.empty()) {
309  filename.insert(filename.find("."), sRun.str());
310  tkMap->save(true, 0, 0, filename);
311  filename.erase(filename.begin() + filename.find("."), filename.end());
312  tkMap->print(true, 0, 0, filename);
313  }
314 }
#define LogDebug(id)
unsigned short range
static constexpr auto TEC
const std::vector< BadComponent > & getBadComponentList() const
unsigned int tibLayer(const DetId &id) const
const TrackerTopology * tTopo_
void SetBadComponents(int, int, SiStripQuality::BadComponent &)
RunNumber_t run() const
Definition: RunID.h:36
const std::pair< unsigned short, double > getNumberOfApvsAndStripLength(uint32_t detId) const
unsigned int tidWheel(const DetId &id) const
Registry::const_iterator RegistryIterator
RegistryIterator getRegistryVectorEnd() const
unsigned int tidSide(const DetId &id) const
const std::vector< uint32_t > & getAllDetIds() const
bool IsModuleUsable(const uint32_t &detid) const
void save(bool print_total=true, float minval=0., float maxval=0., std::string s="svgmap.svg", int width=1500, int height=800)
Definition: TrackerMap.cc:811
constexpr int subdetId() const
get the contents of the subdetector field (not cast into any detector&#39;s numbering enum) ...
Definition: DetId.h:48
static constexpr auto TOB
void fillc(int idmod, int RGBcode)
Definition: TrackerMap.h:135
std::stringstream ssV[4][19]
ContainerIterator getDataVectorBegin() const
Definition: DetId.h:17
static constexpr auto TIB
std::unique_ptr< TkHistoMap > tkhisto
RegistryIterator getRegistryVectorBegin() const
std::pair< ContainerIterator, ContainerIterator > Range
void print(bool print_total=true, float minval=0., float maxval=0., std::string s="svgmap")
Definition: TrackerMap.cc:2943
SiStripDetInfoFileReader * reader
#define str(s)
unsigned int tecWheel(const DetId &id) const
static constexpr auto TID
void fill(int layer, int ring, int nmod, float x)
Definition: TrackerMap.cc:3289
data decode(const unsigned int &value) const
unsigned int tobLayer(const DetId &id) const
unsigned int tecSide(const DetId &id) const

Member Data Documentation

bool SiStripQualityStatistics::addBadCompFromFedErr_
private

Definition at line 45 of file SiStripQualityStatistics.h.

Referenced by dqmEndJob(), and endRun().

std::string SiStripQualityStatistics::dataLabel_
private

Definition at line 31 of file SiStripQualityStatistics.h.

Referenced by endRun().

const SiStripFedCabling* SiStripQualityStatistics::fedCabling_
private

Definition at line 48 of file SiStripQualityStatistics.h.

Referenced by dqmEndJob(), and endRun().

float SiStripQualityStatistics::fedErrCutoff_
private

Definition at line 46 of file SiStripQualityStatistics.h.

Referenced by dqmEndJob().

unsigned long long SiStripQualityStatistics::m_cacheID_
private

Definition at line 29 of file SiStripQualityStatistics.h.

Referenced by endRun(), and updateAndSave().

int SiStripQualityStatistics::NBadComponent[4][19][4]
private

Definition at line 36 of file SiStripQualityStatistics.h.

Referenced by SetBadComponents(), and updateAndSave().

int SiStripQualityStatistics::NTkBadComponent[4]
private

Definition at line 35 of file SiStripQualityStatistics.h.

Referenced by updateAndSave().

SiStripDetInfoFileReader* SiStripQualityStatistics::reader
private
edm::RunID SiStripQualityStatistics::run_
private

Definition at line 30 of file SiStripQualityStatistics.h.

Referenced by endRun(), and updateAndSave().

bool SiStripQualityStatistics::saveTkHistoMap_
private

Definition at line 33 of file SiStripQualityStatistics.h.

Referenced by dqmEndJob().

const SiStripQuality* SiStripQualityStatistics::siStripQuality_
private

Definition at line 49 of file SiStripQualityStatistics.h.

Referenced by dqmEndJob(), and endRun().

std::stringstream SiStripQualityStatistics::ssV[4][19]
private

Definition at line 40 of file SiStripQualityStatistics.h.

Referenced by SetBadComponents(), and updateAndSave().

std::unique_ptr<TkHistoMap> SiStripQualityStatistics::tkhisto
private
TrackerMap* SiStripQualityStatistics::tkMap
private

Definition at line 42 of file SiStripQualityStatistics.h.

Referenced by SetBadComponents(), and updateAndSave().

std::string SiStripQualityStatistics::TkMapFileName_
private

Definition at line 32 of file SiStripQualityStatistics.h.

Referenced by dqmEndJob(), endRun(), and updateAndSave().

TrackerMap * SiStripQualityStatistics::tkMapFullIOVs
private

Definition at line 42 of file SiStripQualityStatistics.h.

Referenced by dqmEndJob(), SiStripQualityStatistics(), and updateAndSave().

const TrackerTopology* SiStripQualityStatistics::tTopo_
private

Definition at line 47 of file SiStripQualityStatistics.h.

Referenced by endRun(), and updateAndSave().