CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
SiStripBadModuleByHandBuilder.cc
Go to the documentation of this file.
2 
3 
4 #include <iostream>
5 #include <fstream>
6 
7 
9 
10  fp_ = iConfig.getUntrackedParameter<edm::FileInPath>("file",edm::FileInPath("CalibTracker/SiStripCommon/data/SiStripDetInfo.dat"));
11  BadModuleList_ = iConfig.getUntrackedParameter<std::vector<uint32_t> >("BadModuleList");
12  printdebug_ = iConfig.getUntrackedParameter<bool>("printDebug",false);
13 
15 }
16 
17 
19 }
20 
22 
24 
25  unsigned int firstBadStrip=0;
26  unsigned short NconsecutiveBadStrips;
27  unsigned int theBadStripRange;
28 
29  for(std::vector<uint32_t>::const_iterator it=BadModuleList_.begin(); it!=BadModuleList_.end(); ++it){
30 
31  std::vector<unsigned int> theSiStripVector;
32 
33  NconsecutiveBadStrips=reader->getNumberOfApvsAndStripLength(*it).first*128;
34  theBadStripRange = obj->encode(firstBadStrip,NconsecutiveBadStrips);
35  if (printdebug_)
36  edm::LogInfo("SiStripBadModuleByHandBuilder") << " BadModule " << *it << " \t"
37  << " firstBadStrip " << firstBadStrip << "\t "
38  << " NconsecutiveBadStrips " << NconsecutiveBadStrips << "\t "
39  << " packed integer " << std::hex << theBadStripRange << std::dec
40  << std::endl;
41 
42  theSiStripVector.push_back(theBadStripRange);
43  SiStripBadStrip::Range range(theSiStripVector.begin(),theSiStripVector.end());
44  if ( ! obj->put(*it,range) )
45  edm::LogError("SiStripBadModuleByHandBuilder")<<"[SiStripBadModuleByHandBuilder::analyze] detid already exists"<<std::endl;
46  }
47  return obj;
48 }
49 
50 
T getUntrackedParameter(std::string const &, T const &) const
const std::pair< unsigned short, double > getNumberOfApvsAndStripLength(uint32_t detId) const
std::pair< ContainerIterator, ContainerIterator > Range
std::string fullPath() const
Definition: FileInPath.cc:184
bool put(const uint32_t &detID, const InputVector &vect)
unsigned int encode(const unsigned short &first, const unsigned short &NconsecutiveBadStrips, const unsigned short &flag=0)
SiStripBadModuleByHandBuilder(const edm::ParameterSet &)