32 dataLabel_(iConfig.getUntrackedParameter<
std::
string>(
"dataLabel",
"")),
33 TkMapFileName_(iConfig.getUntrackedParameter<
std::
string>(
"TkMapFileName",
"")),
34 fp_(iConfig.getUntrackedParameter<
edm::FileInPath>(
35 "file",
edm::FileInPath(
"CalibTracker/SiStripCommon/data/SiStripDetInfo.dat"))),
36 saveTkHistoMap_(iConfig.getUntrackedParameter<
bool>(
"SaveTkHistoMap",
true)),
49 if (!filename.empty()) {
51 filename.erase(filename.begin() + filename.find(
"."), filename.end());
55 tkhisto->save(filename +
".root");
56 tkhisto->saveAsCanvas(filename +
"_Canvas.root",
"E");
74 tkhisto = std::make_unique<TkHistoMap>(tkDetMapHandle.
product(),
"BadComp",
"BadComp", -1.);
89 for (
int i = 0;
i < 4; ++
i) {
91 for (
int j = 0; j < 19; ++j) {
93 for (
int k = 0;
k < 4; ++
k)
104 std::vector<uint32_t>::const_iterator idet = detids.begin();
105 for (; idet != detids.end(); ++idet) {
106 ss <<
"detid " << (*idet) <<
" IsModuleUsable " << SiStripQuality_->
IsModuleUsable((*idet)) <<
"\n";
110 LogDebug(
"SiStripQualityStatistics") << ss.str() << std::endl;
114 for (
size_t i = 0;
i < BC.size(); ++
i) {
125 ((BC[
i].BadApvs >> 2) & 0
x1) + ((BC[
i].BadApvs >> 1) & 0
x1) + ((BC[
i].BadApvs) & 0
x1);
138 component = tTopo->
tibLayer(BC[
i].detid);
154 component = tTopo->
tobLayer(BC[
i].detid);
170 float percentage = 0;
176 uint32_t detid = rp->detid;
179 int component = -999;
200 for (
int it = 0; it < sqrange.second - sqrange.first; it++) {
201 unsigned int range = SiStripQuality_->
decode(*(sqrange.first + it)).
range;
210 edm::LogError(
"SiStripQualityStatistics") <<
"PROBLEM detid " << detid <<
" value " << percentage << std::endl;
215 tkhisto->fill(detid, percentage);
223 ss <<
"\n-----------------\nNew IOV starting from run " << e.
id().
run() <<
" event " << e.
id().
event()
225 <<
"\n-----------------\n";
226 ss <<
"\n-----------------\nGlobal Info\n-----------------";
227 ss <<
"\nBadComponent \t Modules \tFibers " 228 "\tApvs\tStrips\n----------------------------------------------------------------";
234 ss <<
"\nTID:\t\t\t" << NBadComponent[1][0][0] <<
"\t" << NBadComponent[1][0][1] <<
"\t" << NBadComponent[1][0][2]
235 <<
"\t" << NBadComponent[1][0][3];
236 ss <<
"\nTOB:\t\t\t" << NBadComponent[2][0][0] <<
"\t" << NBadComponent[2][0][1] <<
"\t" << NBadComponent[2][0][2]
237 <<
"\t" << NBadComponent[2][0][3];
238 ss <<
"\nTEC:\t\t\t" << NBadComponent[3][0][0] <<
"\t" << NBadComponent[3][0][1] <<
"\t" << NBadComponent[3][0][2]
239 <<
"\t" << NBadComponent[3][0][3];
242 for (
int i = 1;
i < 5; ++
i)
243 ss <<
"\nTIB Layer " <<
i <<
" :\t\t" << NBadComponent[0][
i][0] <<
"\t" << NBadComponent[0][
i][1] <<
"\t" 244 << NBadComponent[0][
i][2] <<
"\t" << NBadComponent[0][
i][3];
246 for (
int i = 1;
i < 4; ++
i)
247 ss <<
"\nTID+ Disk " <<
i <<
" :\t\t" << NBadComponent[1][
i][0] <<
"\t" << NBadComponent[1][
i][1] <<
"\t" 248 << NBadComponent[1][
i][2] <<
"\t" << NBadComponent[1][
i][3];
249 for (
int i = 4;
i < 7; ++
i)
250 ss <<
"\nTID- Disk " <<
i - 3 <<
" :\t\t" << NBadComponent[1][
i][0] <<
"\t" << NBadComponent[1][
i][1] <<
"\t" 251 << NBadComponent[1][
i][2] <<
"\t" << NBadComponent[1][
i][3];
253 for (
int i = 1;
i < 7; ++
i)
254 ss <<
"\nTOB Layer " <<
i <<
" :\t\t" << NBadComponent[2][
i][0] <<
"\t" << NBadComponent[2][
i][1] <<
"\t" 255 << NBadComponent[2][
i][2] <<
"\t" << NBadComponent[2][
i][3];
257 for (
int i = 1;
i < 10; ++
i)
258 ss <<
"\nTEC+ Disk " <<
i <<
" :\t\t" << NBadComponent[3][
i][0] <<
"\t" << NBadComponent[3][
i][1] <<
"\t" 259 << NBadComponent[3][
i][2] <<
"\t" << NBadComponent[3][
i][3];
260 for (
int i = 10;
i < 19; ++
i)
261 ss <<
"\nTEC- Disk " <<
i - 9 <<
" :\t\t" << NBadComponent[3][
i][0] <<
"\t" << NBadComponent[3][
i][1] <<
"\t" 262 << NBadComponent[3][
i][2] <<
"\t" << NBadComponent[3][
i][3];
265 ss <<
"\n----------------------------------------------------------------\n\t\t Detid \tModules Fibers " 266 "Apvs\n----------------------------------------------------------------";
267 for (
int i = 1;
i < 5; ++
i)
268 ss <<
"\nTIB Layer " <<
i <<
" :" <<
ssV[0][
i].
str();
270 for (
int i = 1;
i < 4; ++
i)
271 ss <<
"\nTID+ Disk " <<
i <<
" :" <<
ssV[1][
i].
str();
272 for (
int i = 4;
i < 7; ++
i)
273 ss <<
"\nTID- Disk " <<
i - 3 <<
" :" <<
ssV[1][
i].
str();
275 for (
int i = 1;
i < 7; ++
i)
276 ss <<
"\nTOB Layer " <<
i <<
" :" <<
ssV[2][
i].
str();
278 for (
int i = 1;
i < 10; ++
i)
279 ss <<
"\nTEC+ Disk " <<
i <<
" :" <<
ssV[3][
i].
str();
280 for (
int i = 10;
i < 19; ++
i)
281 ss <<
"\nTEC- Disk " <<
i - 9 <<
" :" <<
ssV[3][
i].
str();
283 edm::LogInfo(
"SiStripQualityStatistics") << ss.str() << std::endl;
286 std::stringstream sRun;
288 sRun <<
"_Run_" << std::setw(6) << std::setfill(
'0') << e.
id().
run() << std::setw(0);
290 if (!filename.empty()) {
291 filename.insert(filename.find(
"."), sRun.str());
293 filename.erase(filename.begin() + filename.find(
"."), filename.end());
std::string TkMapFileName_
EventNumber_t event() const
const std::vector< BadComponent > & getBadComponentList() const
unsigned int tibLayer(const DetId &id) const
void SetBadComponents(int, int, SiStripQuality::BadComponent &)
TrackerMap * tkMapFullIOVs
const std::pair< unsigned short, double > getNumberOfApvsAndStripLength(uint32_t detId) const
edm::LuminosityBlockNumber_t luminosityBlock() const
int NBadComponent[4][19][4]
unsigned int tidWheel(const DetId &id) const
Registry::const_iterator RegistryIterator
RegistryIterator getRegistryVectorEnd() const
unsigned int tidSide(const DetId &id) const
~SiStripQualityStatistics() override
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)
void bookHistograms(DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override
constexpr int subdetId() const
get the contents of the subdetector field (not cast into any detector's numbering enum) ...
void fillc(int idmod, int RGBcode)
std::stringstream ssV[4][19]
ContainerIterator getDataVectorBegin() const
void analyze(const edm::Event &, const edm::EventSetup &) override
std::unique_ptr< TkHistoMap > tkhisto
unsigned long long m_cacheID_
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
SiStripDetInfoFileReader * reader
SiStripQualityStatistics(const edm::ParameterSet &)
unsigned int tecWheel(const DetId &id) const
T const * product() const
TimeValue_t value() const
edm::Timestamp time() const
void fill(int layer, int ring, int nmod, float x)
data decode(const unsigned int &value) const
unsigned int tobLayer(const DetId &id) const
unsigned int tecSide(const DetId &id) const