CMS 3D CMS Logo

List of all members | Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes
SiStripQualityStatistics Class Reference
Inheritance diagram for SiStripQualityStatistics:
DQMEDHarvester edm::one::EDProducer< edm::EndLuminosityBlockProducer, edm::EndRunProducer, edm::EndProcessBlockProducer, edm::one::WatchLuminosityBlocks, edm::one::WatchRuns, edm::one::SharedResources, edm::Accumulator > 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=default
 
- Public Member Functions inherited from DQMEDHarvester
void accumulate (edm::Event const &ev, edm::EventSetup const &es) final
 
void beginJob () override
 
void beginLuminosityBlock (edm::LuminosityBlock const &lumi, edm::EventSetup const &) final
 
void beginRun (edm::Run const &run, edm::EventSetup const &) override
 
virtual void dqmAnalyze (DQMStore::IBooker &, DQMStore::IGetter &, edm::Event const &, edm::EventSetup const &)
 
 DQMEDHarvester (edm::ParameterSet const &iConfig)
 
 DQMEDHarvester ()
 
virtual void dqmEndLuminosityBlock (DQMStore::IBooker &, DQMStore::IGetter &, edm::LuminosityBlock const &, edm::EventSetup const &)
 
virtual void dqmEndRun (DQMStore::IBooker &, DQMStore::IGetter &, edm::Run const &, edm::EventSetup const &)
 
void endLuminosityBlock (edm::LuminosityBlock const &, edm::EventSetup const &) final
 
void endLuminosityBlockProduce (edm::LuminosityBlock &lumi, edm::EventSetup const &es) final
 
void endProcessBlockProduce (edm::ProcessBlock &) final
 
void endRun (edm::Run const &, edm::EventSetup const &) override
 
void endRunProduce (edm::Run &run, edm::EventSetup const &es) final
 
 ~DQMEDHarvester () override=default
 
- Public Member Functions inherited from edm::one::EDProducer< edm::EndLuminosityBlockProducer, edm::EndRunProducer, edm::EndProcessBlockProducer, edm::one::WatchLuminosityBlocks, edm::one::WatchRuns, edm::one::SharedResources, edm::Accumulator >
 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 noexcept final
 
bool wantsGlobalRuns () const noexcept final
 
bool wantsInputProcessBlocks () const noexcept final
 
bool wantsProcessBlocks () const noexcept final
 
- Public Member Functions inherited from edm::one::EDProducerBase
 EDProducerBase ()
 
ModuleDescription const & moduleDescription () const
 
bool wantsStreamLuminosityBlocks () const noexcept
 
bool wantsStreamRuns () const noexcept
 
 ~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
 
std::vector< bool > const & recordProvenanceList () 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)
 
TypeLabelList const & typeLabelList () const
 used by the fwk to register the list of products of this module More...
 
 ~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
 
ESResolverIndex const * esGetTokenIndices (edm::Transition iTrans) const
 
std::vector< ESResolverIndex > 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
 
void selectInputProcessBlocks (ProductRegistry const &productRegistry, ProcessBlockHelperBase const &processBlockHelperBase)
 
ProductResolverIndexAndSkipBit uncheckedIndexFrom (EDGetToken) const
 
void updateLookup (BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet)
 
void updateLookup (eventsetup::ESRecordsToProductResolverIndices const &)
 
virtual ~EDConsumerBase () noexcept(false)
 

Static Public Member Functions

static void fillDescriptions (edm::ConfigurationDescriptions &descriptions)
 
- Static Public Member Functions inherited from edm::one::EDProducerBase
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 

Private Member Functions

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

Private Attributes

std::string dataLabel_
 
SiStripDetInfo detInfo_
 
int NBadComponent [4][19][4]
 
int NTkBadComponent [4]
 
edm::RunID run_
 
const bool saveTkHistoMap_
 
std::stringstream ssV [4][19]
 
const edm::ESGetToken< TkDetMap, TrackerTopologyRcdtkDetMapToken_
 
std::unique_ptr< TkHistoMaptkhisto
 
TrackerMaptkMap
 
const std::string TkMapFileName_
 
TrackerMaptkMapFullIOVs
 
std::unique_ptr< TrackerTopologytTopo_
 
const edm::ESGetToken< TrackerTopology, TrackerTopologyRcdtTopoToken_
 
SiStripQualityWithFromFedErrorsHelper withFedErrHelper_
 

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
template<typename T >
using BranchAliasSetterT = ProductRegistryHelper::BranchAliasSetterT< T >
 
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
 
- Protected Member Functions inherited from edm::ProducerBase
template<Transition Tr = Transition::Event>
auto produces (std::string instanceName) noexcept
 declare what type of product will make and with which optional label More...
 
template<Transition B>
BranchAliasSetter produces (const TypeID &id, std::string instanceName=std::string(), bool recordProvenance=true)
 
template<BranchType B>
BranchAliasSetter produces (const TypeID &id, std::string instanceName=std::string(), bool recordProvenance=true)
 
BranchAliasSetter produces (const TypeID &id, std::string instanceName=std::string(), bool recordProvenance=true)
 
template<typename ProductType , Transition B>
BranchAliasSetterT< ProductType > produces (std::string instanceName)
 
template<class ProductType >
BranchAliasSetterT< ProductType > produces ()
 
template<typename ProductType , BranchType B>
BranchAliasSetterT< ProductType > produces (std::string instanceName)
 
template<typename ProductType , BranchType B>
BranchAliasSetterT< ProductType > produces ()
 
template<class ProductType >
BranchAliasSetterT< ProductType > produces (std::string instanceName)
 
template<typename ProductType , Transition B>
BranchAliasSetterT< ProductType > produces ()
 
template<Transition Tr = Transition::Event>
auto produces () noexcept
 
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< Bconsumes (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 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 ()
 
template<Transition Tr = Transition::Event>
auto esConsumes (ESInputTag tag)
 
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 DQMEDHarvester
DQMStoredqmstore_
 
edm::GetterOfProducts< DQMTokenjobmegetter_
 
edm::EDPutTokenT< DQMTokenjobToken_
 
edm::GetterOfProducts< DQMTokenlumimegetter_
 
edm::EDPutTokenT< DQMTokenlumiToken_
 
edm::GetterOfProducts< DQMTokenrunmegetter_
 
edm::EDPutTokenT< DQMTokenrunToken_
 

Detailed Description

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

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

Definition at line 38 of file SiStripQualityStatistics.cc.

Constructor & Destructor Documentation

◆ SiStripQualityStatistics()

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

Definition at line 73 of file SiStripQualityStatistics.cc.

References edm::EDConsumerBase::consumesCollector().

74  : TkMapFileName_(iConfig.getUntrackedParameter<std::string>("TkMapFileName", "")),
75  saveTkHistoMap_(iConfig.getUntrackedParameter<bool>("SaveTkHistoMap", true)),
76  tkMap(nullptr),
77  tkMapFullIOVs(nullptr),
78  tTopoToken_(esConsumes<edm::Transition::EndRun>()),
79  tkDetMapToken_(esConsumes<edm::Transition::EndRun>()),
80  withFedErrHelper_{iConfig, consumesCollector(), true} {
83  .fullPath());
84 
85  tkMapFullIOVs = new TrackerMap("BadComponents");
86  tkhisto = nullptr;
87 }
const edm::ESGetToken< TrackerTopology, TrackerTopologyRcd > tTopoToken_
std::string fullPath() const
Definition: FileInPath.cc:161
const edm::ESGetToken< TkDetMap, TrackerTopologyRcd > tkDetMapToken_
T getUntrackedParameter(std::string const &, T const &) const
ConsumesCollector consumesCollector()
Use a ConsumesCollector to gather consumes information from helper functions.
SiStripDetInfo read(std::string filePath)
std::unique_ptr< TkHistoMap > tkhisto
SiStripQualityWithFromFedErrorsHelper withFedErrHelper_
static constexpr char const *const kDefaultFile

◆ ~SiStripQualityStatistics()

SiStripQualityStatistics::~SiStripQualityStatistics ( )
overridedefault

Member Function Documentation

◆ dqmEndJob()

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

Implements DQMEDHarvester.

Definition at line 98 of file SiStripQualityStatistics.cc.

References SiStripQualityWithFromFedErrorsHelper::addBadCompFromFedErr(), corrVsCorr::filename, SiStripQualityWithFromFedErrorsHelper::getMergedQuality(), TrackerMap::print(), TrackerMap::save(), saveTkHistoMap_, AlCaHLTBitMon_QueryRunRegistry::string, tkhisto, TkMapFileName_, tkMapFullIOVs, updateAndSave(), and withFedErrHelper_.

98  {
101  }
103  if (!filename.empty()) {
104  tkMapFullIOVs->save(false, 0, 0, filename);
105  filename.erase(filename.begin() + filename.find('.'), filename.end());
106  tkMapFullIOVs->print(false, 0, 0, filename);
107 
108  if (saveTkHistoMap_) {
109  tkhisto->save(filename + ".root");
110  tkhisto->saveAsCanvas(filename + "_Canvas.root", "E");
111  }
112  }
113 }
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:844
std::unique_ptr< TkHistoMap > tkhisto
const SiStripQuality & getMergedQuality(dqm::harvesting::DQMStore::IGetter &getter)
SiStripQualityWithFromFedErrorsHelper withFedErrHelper_
void print(bool print_total=true, float minval=0., float maxval=0., std::string s="svgmap")
Definition: TrackerMap.cc:3096

◆ endRun()

void SiStripQualityStatistics::endRun ( edm::Run const &  run,
edm::EventSetup const &  iSetup 
)
override

Definition at line 115 of file SiStripQualityStatistics.cc.

References SiStripQualityWithFromFedErrorsHelper::addBadCompFromFedErr(), SiStripQualityWithFromFedErrorsHelper::endRun(), edm::EventSetup::getData(), SiStripQualityWithFromFedErrorsHelper::qualityToken(), writedatasetfile::run, run_, tkDetMapToken_, tkhisto, TkMapFileName_, tTopo_, tTopoToken_, updateAndSave(), and withFedErrHelper_.

115  {
116  tTopo_ = std::make_unique<TrackerTopology>(iSetup.getData(tTopoToken_));
117  if ((!tkhisto) && (!TkMapFileName_.empty())) {
118  //here the baseline (the value of the empty,not assigned bins) is put to -1 (default is zero)
119  tkhisto = std::make_unique<TkHistoMap>(&iSetup.getData(tkDetMapToken_), "BadComp", "BadComp", -1.);
120  }
121 
123  run_ = run.id();
124  updateAndSave(&iSetup.getData(withFedErrHelper_.qualityToken()));
125  }
126 }
const edm::ESGetToken< TrackerTopology, TrackerTopologyRcd > tTopoToken_
void updateAndSave(const SiStripQuality *siStripQuality)
const edm::ESGetToken< TkDetMap, TrackerTopologyRcd > tkDetMapToken_
std::unique_ptr< TrackerTopology > tTopo_
const edm::ESGetToken< SiStripQuality, SiStripQualityRcd > & qualityToken() const
std::unique_ptr< TkHistoMap > tkhisto
SiStripQualityWithFromFedErrorsHelper withFedErrHelper_

◆ fillDescriptions()

void SiStripQualityStatistics::fillDescriptions ( edm::ConfigurationDescriptions descriptions)
static

◆ SetBadComponents()

void SiStripQualityStatistics::SetBadComponents ( int  i,
int  component,
SiStripQuality::BadComponent BC 
)
private

Definition at line 336 of file SiStripQualityStatistics.cc.

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

Referenced by updateAndSave().

336  {
337  int napv = detInfo_.getNumberOfApvsAndStripLength(BC.detid).first;
338 
339  ssV[i][component] << "\n\t\t " << BC.detid << " \t " << BC.BadModule << " \t " << ((BC.BadFibers) & 0x1) << " ";
340  if (napv == 4)
341  ssV[i][component] << "x " << ((BC.BadFibers >> 1) & 0x1);
342 
343  if (napv == 6)
344  ssV[i][component] << ((BC.BadFibers >> 1) & 0x1) << " " << ((BC.BadFibers >> 2) & 0x1);
345  ssV[i][component] << " \t " << ((BC.BadApvs) & 0x1) << " " << ((BC.BadApvs >> 1) & 0x1) << " ";
346  if (napv == 4)
347  ssV[i][component] << "x x " << ((BC.BadApvs >> 2) & 0x1) << " " << ((BC.BadApvs >> 3) & 0x1);
348  if (napv == 6)
349  ssV[i][component] << ((BC.BadApvs >> 2) & 0x1) << " " << ((BC.BadApvs >> 3) & 0x1) << " "
350  << ((BC.BadApvs >> 4) & 0x1) << " " << ((BC.BadApvs >> 5) & 0x1) << " ";
351 
352  if (BC.BadApvs) {
353  NBadComponent[i][0][2] += ((BC.BadApvs >> 5) & 0x1) + ((BC.BadApvs >> 4) & 0x1) + ((BC.BadApvs >> 3) & 0x1) +
354  ((BC.BadApvs >> 2) & 0x1) + ((BC.BadApvs >> 1) & 0x1) + ((BC.BadApvs) & 0x1);
355  NBadComponent[i][component][2] += ((BC.BadApvs >> 5) & 0x1) + ((BC.BadApvs >> 4) & 0x1) +
356  ((BC.BadApvs >> 3) & 0x1) + ((BC.BadApvs >> 2) & 0x1) +
357  ((BC.BadApvs >> 1) & 0x1) + ((BC.BadApvs) & 0x1);
358  tkMap->fillc(BC.detid, 0xff0000);
359  }
360  if (BC.BadFibers) {
361  NBadComponent[i][0][1] += ((BC.BadFibers >> 2) & 0x1) + ((BC.BadFibers >> 1) & 0x1) + ((BC.BadFibers) & 0x1);
362  NBadComponent[i][component][1] +=
363  ((BC.BadFibers >> 2) & 0x1) + ((BC.BadFibers >> 1) & 0x1) + ((BC.BadFibers) & 0x1);
364  tkMap->fillc(BC.detid, 0x0000ff);
365  }
366  if (BC.BadModule) {
367  NBadComponent[i][0][0]++;
368  NBadComponent[i][component][0]++;
369  tkMap->fillc(BC.detid, 0x0);
370  }
371 }
void fillc(int idmod, int RGBcode)
Definition: TrackerMap.h:134
std::stringstream ssV[4][19]
const std::pair< unsigned short, double > getNumberOfApvsAndStripLength(uint32_t detId) const

◆ updateAndSave()

void SiStripQualityStatistics::updateAndSave ( const SiStripQuality siStripQuality)
private

Definition at line 128 of file SiStripQualityStatistics.cc.

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

Referenced by dqmEndJob(), and endRun().

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

Member Data Documentation

◆ dataLabel_

std::string SiStripQualityStatistics::dataLabel_
private

Definition at line 53 of file SiStripQualityStatistics.cc.

◆ detInfo_

SiStripDetInfo SiStripQualityStatistics::detInfo_
private

Definition at line 65 of file SiStripQualityStatistics.cc.

Referenced by SetBadComponents(), and updateAndSave().

◆ NBadComponent

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

Definition at line 58 of file SiStripQualityStatistics.cc.

Referenced by SetBadComponents(), and updateAndSave().

◆ NTkBadComponent

int SiStripQualityStatistics::NTkBadComponent[4]
private

Definition at line 57 of file SiStripQualityStatistics.cc.

Referenced by updateAndSave().

◆ run_

edm::RunID SiStripQualityStatistics::run_
private

Definition at line 52 of file SiStripQualityStatistics.cc.

Referenced by endRun(), and updateAndSave().

◆ saveTkHistoMap_

const bool SiStripQualityStatistics::saveTkHistoMap_
private

Definition at line 55 of file SiStripQualityStatistics.cc.

Referenced by dqmEndJob().

◆ ssV

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

Definition at line 62 of file SiStripQualityStatistics.cc.

Referenced by SetBadComponents(), and updateAndSave().

◆ tkDetMapToken_

const edm::ESGetToken<TkDetMap, TrackerTopologyRcd> SiStripQualityStatistics::tkDetMapToken_
private

Definition at line 68 of file SiStripQualityStatistics.cc.

Referenced by endRun().

◆ tkhisto

std::unique_ptr<TkHistoMap> SiStripQualityStatistics::tkhisto
private

Definition at line 66 of file SiStripQualityStatistics.cc.

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

◆ tkMap

TrackerMap* SiStripQualityStatistics::tkMap
private

Definition at line 64 of file SiStripQualityStatistics.cc.

Referenced by SetBadComponents(), and updateAndSave().

◆ TkMapFileName_

const std::string SiStripQualityStatistics::TkMapFileName_
private

Definition at line 54 of file SiStripQualityStatistics.cc.

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

◆ tkMapFullIOVs

TrackerMap * SiStripQualityStatistics::tkMapFullIOVs
private

Definition at line 64 of file SiStripQualityStatistics.cc.

Referenced by dqmEndJob(), and updateAndSave().

◆ tTopo_

std::unique_ptr<TrackerTopology> SiStripQualityStatistics::tTopo_
private

Definition at line 69 of file SiStripQualityStatistics.cc.

Referenced by endRun(), and updateAndSave().

◆ tTopoToken_

const edm::ESGetToken<TrackerTopology, TrackerTopologyRcd> SiStripQualityStatistics::tTopoToken_
private

Definition at line 67 of file SiStripQualityStatistics.cc.

Referenced by endRun().

◆ withFedErrHelper_

SiStripQualityWithFromFedErrorsHelper SiStripQualityStatistics::withFedErrHelper_
private

Definition at line 70 of file SiStripQualityStatistics.cc.

Referenced by dqmEndJob(), and endRun().