19 #include "CLHEP/Random/RandFlat.h"
20 #include "CLHEP/Random/RandGauss.h"
28 printdebug_(iConfig.getUntrackedParameter<bool>(
"printDebug",
false)) {
30 "file",
edm::FileInPath(
"CalibTracker/SiStripQuality/data/DefectsFromConstructionDB.dat"));
34 auto SiStripBadStrip_ = std::make_unique<SiStripBadStrip>();
48 short tempchannel = 0;
50 std::vector<unsigned int> theSiStripVector;
52 uint32_t tempdetid = 0;
59 infile >> detid >> channel;
62 unsigned int theBadStripRange = 0;
67 tempchannel = channel;
73 if (detid == tempdetid) {
74 if (channel != tempchannel + count || flag != tempflag) {
76 theBadStripRange = SiStripBadStrip_->encode(
82 <<
"detid " << tempdetid <<
" \t"
83 <<
" firstBadStrip " << tempchannel <<
"\t "
84 <<
" NconsecutiveBadStrips " << count <<
"\t "
85 <<
"flag " << tempflag <<
"\t"
86 <<
" packed integer " << std::hex << theBadStripRange <<
std::dec << std::endl;
88 theSiStripVector.push_back(theBadStripRange);
92 if (!SiStripBadStrip_->put(tempdetid,
range))
94 <<
"[SiStripBadStripFromASCIIFile::GetNewObject] detid already exists" << std::endl;
95 theSiStripVector.clear();
99 tempchannel = channel;
107 if (detid != tempdetid) {
109 theBadStripRange = SiStripBadStrip_->encode(
115 <<
"detid " << tempdetid <<
" \t"
116 <<
" firstBadStrip " << tempchannel <<
"\t "
117 <<
" NconsecutiveBadStrips " << count <<
"\t "
118 <<
"flag " << tempflag <<
"\t"
119 <<
" packed integer " << std::hex << theBadStripRange <<
std::dec << std::endl;
121 theSiStripVector.push_back(theBadStripRange);
125 if (!SiStripBadStrip_->put(tempdetid,
range))
127 <<
"[SiStripBadStripFromASCIIFile::GetNewObject] detid already exists" << std::endl;
128 theSiStripVector.clear();
132 tempchannel = channel;
137 return SiStripBadStrip_;
T getUntrackedParameter(std::string const &, T const &) const
SiStripBadStripFromASCIIFile(const edm::ParameterSet &iConfig)
const uint16_t range(const Frame &aFrame)
Log< level::Info, false > LogInfo
std::pair< ContainerIterator, ContainerIterator > Range
std::string fullPath() const
std::unique_ptr< SiStripBadStrip > getNewObject() override