CMS 3D CMS Logo

SiStripBadModuleByHandBuilder.cc
Go to the documentation of this file.
2 
3 #include <iostream>
4 #include <fstream>
5 
9  "file", edm::FileInPath("CalibTracker/SiStripCommon/data/SiStripDetInfo.dat"));
10  BadModuleList_ = iConfig.getUntrackedParameter<std::vector<uint32_t> >("BadModuleList");
11  printdebug_ = iConfig.getUntrackedParameter<bool>("printDebug", false);
12 
14 }
15 
17 
18 std::unique_ptr<SiStripBadStrip> SiStripBadModuleByHandBuilder::getNewObject() {
19  auto obj = std::make_unique<SiStripBadStrip>();
20 
21  unsigned int firstBadStrip = 0;
22  unsigned short NconsecutiveBadStrips;
23  unsigned int theBadStripRange;
24 
25  for (std::vector<uint32_t>::const_iterator it = BadModuleList_.begin(); it != BadModuleList_.end(); ++it) {
26  std::vector<unsigned int> theSiStripVector;
27 
28  NconsecutiveBadStrips = reader->getNumberOfApvsAndStripLength(*it).first * 128;
29  theBadStripRange = obj->encode(firstBadStrip, NconsecutiveBadStrips);
30  if (printdebug_)
31  edm::LogInfo("SiStripBadModuleByHandBuilder")
32  << " BadModule " << *it << " \t"
33  << " firstBadStrip " << firstBadStrip << "\t "
34  << " NconsecutiveBadStrips " << NconsecutiveBadStrips << "\t "
35  << " packed integer " << std::hex << theBadStripRange << std::dec << std::endl;
36 
37  theSiStripVector.push_back(theBadStripRange);
38  SiStripBadStrip::Range range(theSiStripVector.begin(), theSiStripVector.end());
39  if (!obj->put(*it, range))
40  edm::LogError("SiStripBadModuleByHandBuilder")
41  << "[SiStripBadModuleByHandBuilder::analyze] detid already exists" << std::endl;
42  }
43  return obj;
44 }
T getUntrackedParameter(std::string const &, T const &) const
const std::pair< unsigned short, double > getNumberOfApvsAndStripLength(uint32_t detId) const
std::unique_ptr< SiStripBadStrip > getNewObject() override
std::pair< ContainerIterator, ContainerIterator > Range
std::string fullPath() const
Definition: FileInPath.cc:163
SiStripBadModuleByHandBuilder(const edm::ParameterSet &)