CMS 3D CMS Logo

SiStripBadFiberBuilder.cc
Go to the documentation of this file.
2 
4 
5 #include <iostream>
6 #include <fstream>
7 #include <sstream>
8 
12  "file", edm::FileInPath("CalibTracker/SiStripCommon/data/SiStripDetInfo.dat"));
13  printdebug_ = iConfig.getUntrackedParameter<bool>("printDebug", false);
14  BadComponentList_ = iConfig.getUntrackedParameter<Parameters>("BadComponentList");
15 }
16 
18 
19 std::unique_ptr<SiStripBadStrip> SiStripBadFiberBuilder::getNewObject() {
20  edm::LogInfo("SiStripBadFiberBuilder") << "... creating dummy SiStripBadStrip Data" << std::endl;
21 
22  auto obj = std::make_unique<SiStripBadStrip>();
23 
25 
26  std::stringstream ss;
27  for (Parameters::iterator iBadComponent = BadComponentList_.begin(); iBadComponent != BadComponentList_.end();
28  ++iBadComponent) {
29  uint32_t BadModule_ = iBadComponent->getParameter<uint32_t>("BadModule");
30  std::vector<uint32_t> BadApvList_ = iBadComponent->getParameter<std::vector<uint32_t> >("BadApvList");
31 
32  std::vector<unsigned int> theSiStripVector;
33 
34  unsigned short firstBadStrip = 0, NconsecutiveBadStrips = 0;
35  unsigned int theBadStripRange;
36 
37  for (std::vector<uint32_t>::const_iterator is = BadApvList_.begin(); is != BadApvList_.end(); ++is) {
38  firstBadStrip = (*is) * 128;
39  NconsecutiveBadStrips = 128;
40 
41  theBadStripRange = obj->encode(firstBadStrip, NconsecutiveBadStrips);
42 
43  if (printdebug_)
44  ss << "detid " << BadModule_ << " \t"
45  << " firstBadStrip " << firstBadStrip << "\t "
46  << " NconsecutiveBadStrips " << NconsecutiveBadStrips << "\t "
47  << " packed integer " << std::hex << theBadStripRange << std::dec << std::endl;
48 
49  theSiStripVector.push_back(theBadStripRange);
50  }
51 
52  SiStripBadStrip::Range range(theSiStripVector.begin(), theSiStripVector.end());
53  if (!obj->put(BadModule_, range))
54  edm::LogError("SiStripBadFiberBuilder") << "[SiStripBadFiberBuilder::analyze] detid already exists" << std::endl;
55  }
56  if (printdebug_)
57  edm::LogInfo("SiStripBadFiberBuilder") << ss.str();
58 
59  return obj;
60 }
FastTimerService_cff.range
range
Definition: FastTimerService_cff.py:34
SiStripBadFiberBuilder::fp_
edm::FileInPath fp_
Definition: SiStripBadFiberBuilder.h:24
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
SiStripBadFiberBuilder::printdebug_
bool printdebug_
Definition: SiStripBadFiberBuilder.h:25
SiStripBadStrip
Definition: SiStripBadStrip.h:30
SiStripBadFiberBuilder::~SiStripBadFiberBuilder
~SiStripBadFiberBuilder() override
Definition: SiStripBadFiberBuilder.cc:17
contentValuesCheck.ss
ss
Definition: contentValuesCheck.py:33
edm::FileInPath
Definition: FileInPath.h:64
SiStripBadStrip::Range
std::pair< ContainerIterator, ContainerIterator > Range
Definition: SiStripBadStrip.h:53
ConditionDBWriter
Definition: ConditionDBWriter.h:149
SiStripBadFiberBuilder::getNewObject
std::unique_ptr< SiStripBadStrip > getNewObject() override
Definition: SiStripBadFiberBuilder.cc:19
DQM.reader
reader
Definition: DQM.py:105
SiStripDetInfoFileReader.h
getGTfromDQMFile.obj
obj
Definition: getGTfromDQMFile.py:32
edm::ParameterSet
Definition: ParameterSet.h:47
SiStripBadFiberBuilder::SiStripBadFiberBuilder
SiStripBadFiberBuilder(const edm::ParameterSet &)
Definition: SiStripBadFiberBuilder.cc:9
SiStripBadFiberBuilder.h
SiStripBadFiberBuilder::Parameters
std::vector< edm::ParameterSet > Parameters
Definition: SiStripBadFiberBuilder.h:27
SiStripBadFiberBuilder::BadComponentList_
Parameters BadComponentList_
Definition: SiStripBadFiberBuilder.h:28
edm::Log
Definition: MessageLogger.h:70
TauDecayModes.dec
dec
Definition: TauDecayModes.py:143
edm::FileInPath::fullPath
std::string fullPath() const
Definition: FileInPath.cc:161