CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
List of all members | Public Member Functions | Static 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< T > 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< T >
 EDProducer ()=default
 
 EDProducer (const EDProducer &)=delete
 
SerialTaskQueueglobalLuminosityBlocksQueue () final
 
SerialTaskQueueglobalRunsQueue () final
 
bool hasAbilityToProduceInBeginLumis () const final
 
bool hasAbilityToProduceInBeginProcessBlocks () const final
 
bool hasAbilityToProduceInBeginRuns () const final
 
bool hasAbilityToProduceInEndLumis () const final
 
bool hasAbilityToProduceInEndProcessBlocks () const final
 
bool hasAbilityToProduceInEndRuns () const final
 
const EDProduceroperator= (const EDProducer &)=delete
 
bool wantsGlobalLuminosityBlocks () const final
 
bool wantsGlobalRuns () const final
 
bool wantsInputProcessBlocks () const final
 
bool wantsProcessBlocks () const final
 
- Public Member Functions inherited from edm::one::EDProducerBase
 EDProducerBase ()
 
ModuleDescription const & moduleDescription () const
 
bool wantsStreamLuminosityBlocks () const
 
bool wantsStreamRuns () const
 
 ~EDProducerBase () override
 
- Public Member Functions inherited from edm::ProducerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
std::vector
< edm::ProductResolverIndex >
const & 
indiciesForPutProducts (BranchType iBranchType) const
 
 ProducerBase ()
 
std::vector
< edm::ProductResolverIndex >
const & 
putTokenIndexToProductResolverIndex () const
 
void registerProducts (ProducerBase *, ProductRegistry *, ModuleDescription const &)
 
std::function< void(BranchDescription
const &)> 
registrationCallback () const
 used by the fwk to register list of products More...
 
void resolvePutIndicies (BranchType iBranchType, ModuleToResolverIndicies const &iIndicies, std::string const &moduleLabel)
 
 ~ProducerBase () noexcept(false) override
 
- Public Member Functions inherited from edm::EDConsumerBase
std::vector< ConsumesInfoconsumesInfo () const
 
void convertCurrentProcessAlias (std::string const &processName)
 Convert "@currentProcess" in InputTag process names to the actual current process name. More...
 
 EDConsumerBase ()
 
 EDConsumerBase (EDConsumerBase const &)=delete
 
 EDConsumerBase (EDConsumerBase &&)=default
 
ESProxyIndex const * esGetTokenIndices (edm::Transition iTrans) const
 
std::vector< ESProxyIndex > const & esGetTokenIndicesVector (edm::Transition iTrans) const
 
std::vector< ESRecordIndex >
const & 
esGetTokenRecordIndicesVector (edm::Transition iTrans) const
 
ProductResolverIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
std::vector
< ProductResolverIndexAndSkipBit >
const & 
itemsToGetFrom (BranchType iType) const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void modulesWhoseProductsAreConsumed (std::array< std::vector< ModuleDescription const * > *, NumBranchTypes > &modulesAll, std::vector< ModuleProcessName > &modulesInPreviousProcesses, ProductRegistry const &preg, std::map< std::string, ModuleDescription const * > const &labelsToDesc, std::string const &processName) const
 
EDConsumerBase const & operator= (EDConsumerBase const &)=delete
 
EDConsumerBaseoperator= (EDConsumerBase &&)=default
 
bool registeredToConsume (ProductResolverIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
void selectInputProcessBlocks (ProductRegistry const &productRegistry, ProcessBlockHelperBase const &processBlockHelperBase)
 
ProductResolverIndexAndSkipBit uncheckedIndexFrom (EDGetToken) const
 
void updateLookup (BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet)
 
void updateLookup (eventsetup::ESRecordsToProxyIndices const &)
 
virtual ~EDConsumerBase () noexcept(false)
 

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_
 
bool saveTkHistoMap_
 
std::stringstream ssV [4][19]
 
edm::ESGetToken< TkDetMap,
TrackerTopologyRcd
tkDetMapToken_
 
std::unique_ptr< TkHistoMaptkhisto
 
TrackerMaptkMap
 
std::string TkMapFileName_
 
TrackerMaptkMapFullIOVs
 
std::unique_ptr< TrackerTopologytTopo_
 
edm::ESGetToken
< TrackerTopology,
TrackerTopologyRcd
tTopoToken_
 
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
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
ProducesCollector producesCollector ()
 
- Protected Member Functions inherited from edm::EDConsumerBase
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (edm::InputTag const &tag)
 
template<BranchType B = InEvent>
EDConsumerBaseAdaptor< B > consumes (edm::InputTag tag) noexcept
 
EDGetToken consumes (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken consumes (TypeToGet const &id, edm::InputTag const &tag)
 
ConsumesCollector consumesCollector ()
 Use a ConsumesCollector to gather consumes information from helper functions. More...
 
template<typename ProductType , BranchType B = InEvent>
void consumesMany ()
 
void consumesMany (const TypeToGet &id)
 
template<BranchType B>
void consumesMany (const TypeToGet &id)
 
template<typename ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes ()
 
template<typename ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes (ESInputTag const &tag)
 
template<Transition Tr = Transition::Event>
constexpr auto esConsumes () noexcept
 
template<Transition Tr = Transition::Event>
auto esConsumes (ESInputTag tag) noexcept
 
template<Transition Tr = Transition::Event>
ESGetTokenGeneric esConsumes (eventsetup::EventSetupRecordKey const &iRecord, eventsetup::DataKey const &iKey)
 Used with EventSetupRecord::doGet. More...
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > mayConsume (edm::InputTag const &tag)
 
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
void resetItemsToGetFrom (BranchType iType)
 
- Protected Attributes inherited from 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 18 of file SiStripQualityStatistics.h.

Constructor & Destructor Documentation

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

Definition at line 29 of file SiStripQualityStatistics.cc.

References edm::EDConsumerBase::consumesCollector(), and iConfig.

30  : TkMapFileName_(iConfig.getUntrackedParameter<std::string>("TkMapFileName", "")),
31  saveTkHistoMap_(iConfig.getUntrackedParameter<bool>("SaveTkHistoMap", true)),
32  tkMap(nullptr),
33  tkMapFullIOVs(nullptr),
34  tTopoToken_(esConsumes<edm::Transition::EndRun>()),
35  tkDetMapToken_(esConsumes<edm::Transition::EndRun>()),
39  .fullPath());
40 
41  tkMapFullIOVs = new TrackerMap("BadComponents");
42  tkhisto = nullptr;
43 }
T getUntrackedParameter(std::string const &, T const &) const
edm::ESGetToken< TkDetMap, TrackerTopologyRcd > tkDetMapToken_
edm::ESGetToken< TrackerTopology, TrackerTopologyRcd > tTopoToken_
ConsumesCollector consumesCollector()
Use a ConsumesCollector to gather consumes information from helper functions.
SiStripDetInfo read(std::string filePath)
std::unique_ptr< TkHistoMap > tkhisto
SiStripQualityWithFromFedErrorsHelper withFedErrHelper_
std::string fullPath() const
Definition: FileInPath.cc:161
static constexpr char const *const kDefaultFile
SiStripQualityStatistics::~SiStripQualityStatistics ( )
overridedefault

Member Function Documentation

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

Implements DQMEDHarvester.

Definition at line 54 of file SiStripQualityStatistics.cc.

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

54  {
57  }
59  if (!filename.empty()) {
60  tkMapFullIOVs->save(false, 0, 0, filename);
61  filename.erase(filename.begin() + filename.find('.'), filename.end());
62  tkMapFullIOVs->print(false, 0, 0, filename);
63 
64  if (saveTkHistoMap_) {
65  tkhisto->save(filename + ".root");
66  tkhisto->saveAsCanvas(filename + "_Canvas.root", "E");
67  }
68  }
69 }
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< 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:2943
tuple filename
Definition: lut2db_cfg.py:20
void SiStripQualityStatistics::endRun ( edm::Run const &  run,
edm::EventSetup const &  iSetup 
)
override

Definition at line 71 of file SiStripQualityStatistics.cc.

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

71  {
72  tTopo_ = std::make_unique<TrackerTopology>(iSetup.getData(tTopoToken_));
73  if ((!tkhisto) && (!TkMapFileName_.empty())) {
74  //here the baseline (the value of the empty,not assigned bins) is put to -1 (default is zero)
75  tkhisto = std::make_unique<TkHistoMap>(&iSetup.getData(tkDetMapToken_), "BadComp", "BadComp", -1.);
76  }
77 
79  run_ = run.id();
80  updateAndSave(&iSetup.getData(withFedErrHelper_.qualityToken()));
81  }
82 }
edm::ESGetToken< TkDetMap, TrackerTopologyRcd > tkDetMapToken_
void updateAndSave(const SiStripQuality *siStripQuality)
edm::ESGetToken< TrackerTopology, TrackerTopologyRcd > tTopoToken_
std::unique_ptr< TrackerTopology > tTopo_
std::unique_ptr< TkHistoMap > tkhisto
const edm::ESGetToken< SiStripQuality, SiStripQualityRcd > & qualityToken() const
SiStripQualityWithFromFedErrorsHelper withFedErrHelper_
void SiStripQualityStatistics::fillDescriptions ( edm::ConfigurationDescriptions descriptions)
static

Definition at line 45 of file SiStripQualityStatistics.cc.

References edm::ConfigurationDescriptions::add(), edm::ParameterSetDescription::addUntracked(), submitPVResolutionJobs::desc, SiStripQualityWithFromFedErrorsHelper::fillDescription(), SiStripDetInfoFileReader::kDefaultFile, and AlCaHLTBitMon_QueryRunRegistry::string.

45  {
47  desc.addUntracked<std::string>("TkMapFileName", "");
48  desc.addUntracked<bool>("SaveTkHistoMap", true);
51  descriptions.add("siStripQualityStatistics", desc);
52 }
ParameterDescriptionBase * addUntracked(U const &iLabel, T const &value)
void add(std::string const &label, ParameterSetDescription const &psetDescription)
static constexpr char const *const kDefaultFile
static void fillDescription(edm::ParameterSetDescription &desc)
void SiStripQualityStatistics::SetBadComponents ( int  i,
int  component,
SiStripQuality::BadComponent BC 
)
private

Definition at line 292 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, and tkMap.

Referenced by updateAndSave().

292  {
293  int napv = detInfo_.getNumberOfApvsAndStripLength(BC.detid).first;
294 
295  ssV[i][component] << "\n\t\t " << BC.detid << " \t " << BC.BadModule << " \t " << ((BC.BadFibers) & 0x1) << " ";
296  if (napv == 4)
297  ssV[i][component] << "x " << ((BC.BadFibers >> 1) & 0x1);
298 
299  if (napv == 6)
300  ssV[i][component] << ((BC.BadFibers >> 1) & 0x1) << " " << ((BC.BadFibers >> 2) & 0x1);
301  ssV[i][component] << " \t " << ((BC.BadApvs) & 0x1) << " " << ((BC.BadApvs >> 1) & 0x1) << " ";
302  if (napv == 4)
303  ssV[i][component] << "x x " << ((BC.BadApvs >> 2) & 0x1) << " " << ((BC.BadApvs >> 3) & 0x1);
304  if (napv == 6)
305  ssV[i][component] << ((BC.BadApvs >> 2) & 0x1) << " " << ((BC.BadApvs >> 3) & 0x1) << " "
306  << ((BC.BadApvs >> 4) & 0x1) << " " << ((BC.BadApvs >> 5) & 0x1) << " ";
307 
308  if (BC.BadApvs) {
309  NBadComponent[i][0][2] += ((BC.BadApvs >> 5) & 0x1) + ((BC.BadApvs >> 4) & 0x1) + ((BC.BadApvs >> 3) & 0x1) +
310  ((BC.BadApvs >> 2) & 0x1) + ((BC.BadApvs >> 1) & 0x1) + ((BC.BadApvs) & 0x1);
311  NBadComponent[i][component][2] += ((BC.BadApvs >> 5) & 0x1) + ((BC.BadApvs >> 4) & 0x1) +
312  ((BC.BadApvs >> 3) & 0x1) + ((BC.BadApvs >> 2) & 0x1) +
313  ((BC.BadApvs >> 1) & 0x1) + ((BC.BadApvs) & 0x1);
314  tkMap->fillc(BC.detid, 0xff0000);
315  }
316  if (BC.BadFibers) {
317  NBadComponent[i][0][1] += ((BC.BadFibers >> 2) & 0x1) + ((BC.BadFibers >> 1) & 0x1) + ((BC.BadFibers) & 0x1);
318  NBadComponent[i][component][1] +=
319  ((BC.BadFibers >> 2) & 0x1) + ((BC.BadFibers >> 1) & 0x1) + ((BC.BadFibers) & 0x1);
320  tkMap->fillc(BC.detid, 0x0000ff);
321  }
322  if (BC.BadModule) {
323  NBadComponent[i][0][0]++;
324  NBadComponent[i][component][0]++;
325  tkMap->fillc(BC.detid, 0x0);
326  }
327 }
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]
void SiStripQualityStatistics::updateAndSave ( const SiStripQuality siStripQuality)
private

Definition at line 84 of file SiStripQualityStatistics.cc.

References SiStripBadStrip::decode(), detInfo_, lut2db_cfg::filename, TrackerMap::fill(), TrackerMap::fillc(), SiStripDetInfo::getAllDetIds(), SiStripQuality::getBadComponentList(), SiStripBadStrip::getDataVectorBegin(), SiStripDetInfo::getNumberOfApvsAndStripLength(), SiStripBadStrip::getRegistryVectorBegin(), SiStripBadStrip::getRegistryVectorEnd(), mps_fire::i, SiStripQuality::IsModuleUsable(), dqmiolumiharvest::j, isotrackApplyRegressor::k, LogDebug, NBadComponent, NTkBadComponent, TrackerMap::print(), SiStripBadStrip::data::range, sistrip::SpyUtilities::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, and tTopo_.

Referenced by dqmEndJob(), and endRun().

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

Member Data Documentation

std::string SiStripQualityStatistics::dataLabel_
private

Definition at line 33 of file SiStripQualityStatistics.h.

SiStripDetInfo SiStripQualityStatistics::detInfo_
private

Definition at line 45 of file SiStripQualityStatistics.h.

Referenced by SetBadComponents(), and updateAndSave().

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

Definition at line 38 of file SiStripQualityStatistics.h.

Referenced by SetBadComponents(), and updateAndSave().

int SiStripQualityStatistics::NTkBadComponent[4]
private

Definition at line 37 of file SiStripQualityStatistics.h.

Referenced by updateAndSave().

edm::RunID SiStripQualityStatistics::run_
private

Definition at line 32 of file SiStripQualityStatistics.h.

Referenced by endRun(), and updateAndSave().

bool SiStripQualityStatistics::saveTkHistoMap_
private

Definition at line 35 of file SiStripQualityStatistics.h.

Referenced by dqmEndJob().

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

Definition at line 42 of file SiStripQualityStatistics.h.

Referenced by SetBadComponents(), and updateAndSave().

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

Definition at line 48 of file SiStripQualityStatistics.h.

Referenced by endRun().

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

Definition at line 46 of file SiStripQualityStatistics.h.

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

TrackerMap* SiStripQualityStatistics::tkMap
private

Definition at line 44 of file SiStripQualityStatistics.h.

Referenced by SetBadComponents(), and updateAndSave().

std::string SiStripQualityStatistics::TkMapFileName_
private

Definition at line 34 of file SiStripQualityStatistics.h.

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

TrackerMap * SiStripQualityStatistics::tkMapFullIOVs
private

Definition at line 44 of file SiStripQualityStatistics.h.

Referenced by dqmEndJob(), and updateAndSave().

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

Definition at line 49 of file SiStripQualityStatistics.h.

Referenced by endRun(), and updateAndSave().

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

Definition at line 47 of file SiStripQualityStatistics.h.

Referenced by endRun().

SiStripQualityWithFromFedErrorsHelper SiStripQualityStatistics::withFedErrHelper_
private

Definition at line 50 of file SiStripQualityStatistics.h.

Referenced by dqmEndJob(), and endRun().