62 std::stringstream
ssV[4][19];
69 std::unique_ptr<TrackerTopology>
tTopo_;
74 : TkMapFileName_(iConfig.getUntrackedParameter<
std::
string>(
"TkMapFileName",
"")),
75 saveTkHistoMap_(iConfig.getUntrackedParameter<
bool>(
"SaveTkHistoMap",
true)),
77 tkMapFullIOVs(nullptr),
85 tkMapFullIOVs =
new TrackerMap(
"BadComponents");
92 desc.addUntracked<
bool>(
"SaveTkHistoMap",
true);
95 descriptions.
add(
"siStripQualityStatistics",
desc);
129 for (
int i = 0;
i < 4; ++
i) {
131 for (
int j = 0;
j < 19; ++
j) {
133 for (
int k = 0;
k < 4; ++
k)
142 std::stringstream
ss;
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";
150 LogDebug(
"SiStripQualityStatistics") <<
ss.str() << std::endl;
154 for (
size_t i = 0;
i < BC.size(); ++
i) {
165 ((BC[
i].BadApvs >> 2) & 0
x1) + ((BC[
i].BadApvs >> 1) & 0
x1) + ((BC[
i].BadApvs) & 0
x1);
178 component =
tTopo_->tibLayer(BC[
i].detid);
186 component =
tTopo_->tidSide(BC[
i].detid) == 2 ?
tTopo_->tidWheel(BC[
i].detid) :
tTopo_->tidWheel(BC[
i].detid) + 3;
194 component =
tTopo_->tobLayer(BC[
i].detid);
202 component =
tTopo_->tecSide(BC[
i].detid) == 2 ?
tTopo_->tecWheel(BC[
i].detid) :
tTopo_->tecWheel(BC[
i].detid) + 9;
210 float percentage = 0;
216 uint32_t detid = rp->detid;
219 int component = -999;
224 component =
tTopo_->tibLayer(detid);
227 component =
tTopo_->tidSide(detid) == 2 ?
tTopo_->tidWheel(detid) :
tTopo_->tidWheel(detid) + 3;
230 component =
tTopo_->tobLayer(detid);
233 component =
tTopo_->tecSide(detid) == 2 ?
tTopo_->tecWheel(detid) :
tTopo_->tecWheel(detid) + 9;
240 for (
int it = 0; it < sqrange.second - sqrange.first; it++) {
250 edm::LogError(
"SiStripQualityStatistics") <<
"PROBLEM detid " << detid <<
" value " << percentage << std::endl;
255 tkhisto->fill(detid, percentage);
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----------------------------------------------------------------";
280 for (
int i = 1;
i < 5; ++
i)
284 for (
int i = 1;
i < 4; ++
i)
287 for (
int i = 4;
i < 7; ++
i)
291 for (
int i = 1;
i < 7; ++
i)
295 for (
int i = 1;
i < 10; ++
i)
298 for (
int i = 10;
i < 19; ++
i)
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();
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();
313 for (
int i = 1;
i < 7; ++
i)
314 ss <<
"\nTOB Layer " <<
i <<
" :" <<
ssV[2][
i].
str();
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();
321 edm::LogInfo(
"SiStripQualityStatistics") <<
ss.str() << std::endl;
324 std::stringstream sRun;
326 sRun <<
"_Run_" << std::setw(6) << std::setfill(
'0') <<
run_.
run() << std::setw(0);
static constexpr auto TEC
ContainerIterator getDataVectorBegin() const
const edm::ESGetToken< TrackerTopology, TrackerTopologyRcd > tTopoToken_
T const & getData(const ESGetToken< T, R > &iToken) const noexcept(false)
bool endRun(const edm::EventSetup &)
void SetBadComponents(int, int, SiStripQuality::BadComponent &)
TrackerMap * tkMapFullIOVs
std::string fullPath() const
void updateAndSave(const SiStripQuality *siStripQuality)
int NBadComponent[4][19][4]
Registry::const_iterator RegistryIterator
Log< level::Error, false > LogError
const std::vector< BadComponent > & getBadComponentList() const
const edm::ESGetToken< TkDetMap, TrackerTopologyRcd > tkDetMapToken_
~SiStripQualityStatistics() override=default
std::unique_ptr< TrackerTopology > tTopo_
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
ConsumesCollector consumesCollector()
Use a ConsumesCollector to gather consumes information from helper functions.
void save(bool print_total=true, float minval=0., float maxval=0., std::string s="svgmap.svg", int width=1500, int height=800)
RegistryIterator getRegistryVectorEnd() const
void endRun(edm::Run const &, edm::EventSetup const &) override
#define DEFINE_FWK_MODULE(type)
constexpr int subdetId() const
get the contents of the subdetector field (not cast into any detector's numbering enum) ...
SiStripDetInfo read(std::string filePath)
static constexpr auto TOB
bool addBadCompFromFedErr() const
void fillc(int idmod, int RGBcode)
std::stringstream ssV[4][19]
Log< level::Info, false > LogInfo
const bool saveTkHistoMap_
const edm::ESGetToken< SiStripQuality, SiStripQualityRcd > & qualityToken() const
static constexpr auto TIB
void dqmEndJob(DQMStore::IBooker &, DQMStore::IGetter &) override
const std::pair< unsigned short, double > getNumberOfApvsAndStripLength(uint32_t detId) const
std::unique_ptr< TkHistoMap > tkhisto
const SiStripQuality & getMergedQuality(dqm::harvesting::DQMStore::IGetter &getter)
void add(std::string const &label, ParameterSetDescription const &psetDescription)
Contains cabling info at the device level, including DetId, APV pair numbers, hardware addresses...
SiStripQualityWithFromFedErrorsHelper withFedErrHelper_
std::pair< ContainerIterator, ContainerIterator > Range
void print(bool print_total=true, float minval=0., float maxval=0., std::string s="svgmap")
const std::string TkMapFileName_
data decode(const unsigned int &value) const
static constexpr char const *const kDefaultFile
static void fillDescription(edm::ParameterSetDescription &desc)
SiStripQualityStatistics(const edm::ParameterSet &)
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)