17 #include "CLHEP/Random/RandFlat.h"
18 #include "CLHEP/Random/RandGauss.h"
26 std::unique_ptr<SiStripBadStrip>
getNewObject()
override;
45 edm::LogInfo(
"SiStripBadChannelBuilder") <<
"... creating dummy SiStripBadStrip Data" << std::endl;
47 auto obj = std::make_unique<SiStripBadStrip>();
53 uint32_t BadModule_ = iBadComponent->getParameter<uint32_t>(
"BadModule");
54 std::vector<uint32_t> BadChannelList_ = iBadComponent->getParameter<std::vector<uint32_t> >(
"BadChannelList");
56 std::vector<unsigned int> theSiStripVector;
59 uint32_t lastBad = 999;
60 unsigned short firstBadStrip = 0, NconsecutiveBadStrips = 0;
61 unsigned int theBadStripRange;
63 for (std::vector<uint32_t>::const_iterator is = BadChannelList_.begin(); is != BadChannelList_.end(); ++is) {
64 if (*is > NStrips - 1)
66 if (*is != lastBad + 1) {
71 theBadStripRange =
obj->encode(firstBadStrip, NconsecutiveBadStrips);
75 <<
"detid " << BadModule_ <<
" \t"
76 <<
" firstBadStrip " << firstBadStrip <<
"\t "
77 <<
" NconsecutiveBadStrips " << NconsecutiveBadStrips <<
"\t "
78 <<
" packed integer " << std::hex << theBadStripRange <<
std::dec << std::endl;
80 theSiStripVector.push_back(theBadStripRange);
84 NconsecutiveBadStrips = 0;
86 NconsecutiveBadStrips++;
90 theBadStripRange =
obj->encode(firstBadStrip, NconsecutiveBadStrips);
93 <<
"detid " << BadModule_ <<
" \t"
94 <<
" firstBadStrip " << firstBadStrip <<
"\t "
95 <<
" NconsecutiveBadStrips " << NconsecutiveBadStrips <<
"\t "
96 <<
" packed integer " << std::hex << theBadStripRange <<
std::dec << std::endl;
98 theSiStripVector.push_back(theBadStripRange);
103 <<
"[SiStripBadChannelBuilder::analyze] detid already exists" << std::endl;
115 edm::LogError(
"SiStripBadStripBuilder") <<
"Service is unavailable" << std::endl;
Parameters BadComponentList_
T getUntrackedParameter(std::string const &, T const &) const
SiStripBadChannelBuilder(const edm::ParameterSet &)
#define DEFINE_FWK_MODULE(type)
Log< level::Error, false > LogError
std::vector< edm::ParameterSet > Parameters
void createOneIOV(const T &payload, cond::Time_t firstSinceTime, const std::string &recordName)
const uint16_t range(const Frame &aFrame)
void appendOneIOV(const T &payload, cond::Time_t sinceTime, const std::string &recordName)
bool isNewTagRequest(const std::string &recordName)
cond::Time_t beginOfTime() const
const std::pair< unsigned short, double > getNumberOfApvsAndStripLength(uint32_t detId) const
SiStripDetInfo read(std::string filePath)
Log< level::Info, false > LogInfo
cond::Time_t currentTime() const
std::pair< ContainerIterator, ContainerIterator > Range
std::string fullPath() const
static constexpr char const *const kDefaultFile
~SiStripBadChannelBuilder() override
std::unique_ptr< SiStripBadStrip > getNewObject() override