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 }
FastTimerService_cff.range
range
Definition: FastTimerService_cff.py:34
SiStripBadModuleByHandBuilder::reader
SiStripDetInfoFileReader * reader
Definition: SiStripBadModuleByHandBuilder.h:28
SiStripBadModuleByHandBuilder::printdebug_
bool printdebug_
Definition: SiStripBadModuleByHandBuilder.h:26
SiStripBadModuleByHandBuilder::~SiStripBadModuleByHandBuilder
~SiStripBadModuleByHandBuilder() override
Definition: SiStripBadModuleByHandBuilder.cc:16
edm::ParameterSet::getUntrackedParameter
T getUntrackedParameter(std::string const &, T const &) const
edm::LogInfo
Log< level::Info, false > LogInfo
Definition: MessageLogger.h:125
SiStripDetInfoFileReader
Definition: SiStripDetInfoFileReader.h:30
SiStripBadStrip
Definition: SiStripBadStrip.h:30
edm::FileInPath
Definition: FileInPath.h:64
SiStripBadStrip::Range
std::pair< ContainerIterator, ContainerIterator > Range
Definition: SiStripBadStrip.h:53
ConditionDBWriter
Definition: ConditionDBWriter.h:149
getGTfromDQMFile.obj
obj
Definition: getGTfromDQMFile.py:32
SiStripBadModuleByHandBuilder::getNewObject
std::unique_ptr< SiStripBadStrip > getNewObject() override
Definition: SiStripBadModuleByHandBuilder.cc:18
edm::ParameterSet
Definition: ParameterSet.h:47
SiStripBadModuleByHandBuilder::BadModuleList_
std::vector< uint32_t > BadModuleList_
Definition: SiStripBadModuleByHandBuilder.h:27
SiStripBadModuleByHandBuilder.h
SiStripDetInfoFileReader::getNumberOfApvsAndStripLength
const std::pair< unsigned short, double > getNumberOfApvsAndStripLength(uint32_t detId) const
Definition: SiStripDetInfoFileReader.cc:101
SiStripBadModuleByHandBuilder::fp_
edm::FileInPath fp_
Definition: SiStripBadModuleByHandBuilder.h:25
SiStripBadModuleByHandBuilder::SiStripBadModuleByHandBuilder
SiStripBadModuleByHandBuilder(const edm::ParameterSet &)
Definition: SiStripBadModuleByHandBuilder.cc:6
edm::Log
Definition: MessageLogger.h:70
TauDecayModes.dec
dec
Definition: TauDecayModes.py:143
edm::FileInPath::fullPath
std::string fullPath() const
Definition: FileInPath.cc:163