30 : TkMapFileName_(iConfig.getUntrackedParameter<std::
string>(
"TkMapFileName",
"")),
31 saveTkHistoMap_(iConfig.getUntrackedParameter<bool>(
"SaveTkHistoMap",
true)),
33 tkMapFullIOVs(nullptr),
41 tkMapFullIOVs =
new TrackerMap(
"BadComponents");
51 descriptions.
add(
"siStripQualityStatistics", desc);
59 if (!filename.empty()) {
61 filename.erase(filename.begin() + filename.find(
'.'), filename.end());
65 tkhisto->save(filename +
".root");
66 tkhisto->saveAsCanvas(filename +
"_Canvas.root",
"E");
85 for (
int i = 0;
i < 4; ++
i) {
87 for (
int j = 0;
j < 19; ++
j) {
89 for (
int k = 0;
k < 4; ++
k)
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";
106 LogDebug(
"SiStripQualityStatistics") << ss.str() << std::endl;
110 for (
size_t i = 0;
i < BC.size(); ++
i) {
118 NTkBadComponent[1] += ((BC[
i].BadFibers >> 2) & 0x1) + ((BC[
i].BadFibers >> 1) & 0x1) + ((BC[
i].BadFibers) & 0x1);
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);
134 component =
tTopo_->tibLayer(BC[
i].detid);
142 component =
tTopo_->tidSide(BC[
i].detid) == 2 ?
tTopo_->tidWheel(BC[
i].detid) :
tTopo_->tidWheel(BC[
i].detid) + 3;
150 component =
tTopo_->tobLayer(BC[
i].detid);
158 component =
tTopo_->tecSide(BC[
i].detid) == 2 ?
tTopo_->tecWheel(BC[
i].detid) :
tTopo_->tecWheel(BC[
i].detid) + 9;
166 float percentage = 0;
172 uint32_t detid = rp->detid;
175 int component = -999;
180 component =
tTopo_->tibLayer(detid);
183 component =
tTopo_->tidSide(detid) == 2 ?
tTopo_->tidWheel(detid) :
tTopo_->tidWheel(detid) + 3;
186 component =
tTopo_->tobLayer(detid);
189 component =
tTopo_->tecSide(detid) == 2 ?
tTopo_->tecWheel(detid) :
tTopo_->tecWheel(detid) + 9;
196 for (
int it = 0; it < sqrange.second - sqrange.first; it++) {
206 edm::LogError(
"SiStripQualityStatistics") <<
"PROBLEM detid " << detid <<
" value " << percentage << std::endl;
211 tkhisto->fill(detid, percentage);
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----------------------------------------------------------------";
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];
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];
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];
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];
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];
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();
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();
269 for (
int i = 1;
i < 7; ++
i)
270 ss <<
"\nTOB Layer " <<
i <<
" :" <<
ssV[2][
i].
str();
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();
277 edm::LogInfo(
"SiStripQualityStatistics") << ss.str() << std::endl;
280 std::stringstream sRun;
282 sRun <<
"_Run_" << std::setw(6) << std::setfill(
'0') <<
run_.
run() << std::setw(0);
284 if (!filename.empty()) {
285 filename.insert(filename.find(
'.'), sRun.str());
287 filename.erase(filename.begin() + filename.find(
'.'), filename.end());
301 ssV[
i][component] <<
" \t " << ((BC.
BadApvs) & 0x1) <<
" " << ((BC.
BadApvs >> 1) & 0x1) <<
" ";
303 ssV[
i][component] <<
"x x " << ((BC.
BadApvs >> 2) & 0x1) <<
" " << ((BC.
BadApvs >> 3) & 0x1);
305 ssV[
i][component] << ((BC.
BadApvs >> 2) & 0x1) <<
" " << ((BC.
BadApvs >> 3) & 0x1) <<
" "
306 << ((BC.
BadApvs >> 4) & 0x1) <<
" " << ((BC.
BadApvs >> 5) & 0x1) <<
" ";
std::string TkMapFileName_
static constexpr auto TEC
const std::vector< BadComponent > & getBadComponentList() const
ParameterDescriptionBase * addUntracked(U const &iLabel, T const &value)
edm::ESGetToken< TkDetMap, TrackerTopologyRcd > tkDetMapToken_
void SetBadComponents(int, int, SiStripQuality::BadComponent &)
bool endRun(const edm::EventSetup &)
TrackerMap * tkMapFullIOVs
void updateAndSave(const SiStripQuality *siStripQuality)
int NBadComponent[4][19][4]
Registry::const_iterator RegistryIterator
Log< level::Error, false > LogError
const uint16_t range(const Frame &aFrame)
bool getData(T &iHolder) const
edm::ESGetToken< TrackerTopology, TrackerTopologyRcd > tTopoToken_
std::unique_ptr< TrackerTopology > tTopo_
RegistryIterator getRegistryVectorEnd() const
bool IsModuleUsable(const uint32_t &detid) const
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)
constexpr int subdetId() const
get the contents of the subdetector field (not cast into any detector's numbering enum) ...
void endRun(edm::Run const &, edm::EventSetup const &) override
const std::pair< unsigned short, double > getNumberOfApvsAndStripLength(uint32_t detId) const
SiStripDetInfo read(std::string filePath)
static constexpr auto TOB
void fillc(int idmod, int RGBcode)
std::stringstream ssV[4][19]
ContainerIterator getDataVectorBegin() const
Log< level::Info, false > LogInfo
static constexpr auto TIB
void dqmEndJob(DQMStore::IBooker &, DQMStore::IGetter &) override
std::unique_ptr< TkHistoMap > tkhisto
const SiStripQuality & getMergedQuality(dqm::harvesting::DQMStore::IGetter &getter)
void add(std::string const &label, ParameterSetDescription const &psetDescription)
const edm::ESGetToken< SiStripQuality, SiStripQualityRcd > & qualityToken() const
SiStripQualityWithFromFedErrorsHelper withFedErrHelper_
RegistryIterator getRegistryVectorBegin() const
std::pair< ContainerIterator, ContainerIterator > Range
void print(bool print_total=true, float minval=0., float maxval=0., std::string s="svgmap")
std::string fullPath() const
static constexpr char const *const kDefaultFile
static void fillDescription(edm::ParameterSetDescription &desc)
SiStripQualityStatistics(const edm::ParameterSet &)
bool addBadCompFromFedErr() const
static constexpr auto TID
const std::vector< uint32_t > & getAllDetIds() const noexcept
void fill(int layer, int ring, int nmod, float x)
data decode(const unsigned int &value) const