CMS 3D CMS Logo

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