#include <SiStripBadModuleByHandBuilder.h>
Public Member Functions | |
SiStripBadModuleByHandBuilder (const edm::ParameterSet &) | |
~SiStripBadModuleByHandBuilder () | |
Private Member Functions | |
SiStripBadStrip * | getNewObject () |
Private Attributes | |
std::vector< uint32_t > | BadModuleList_ |
edm::FileInPath | fp_ |
bool | printdebug_ |
SiStripDetInfoFileReader * | reader |
Definition at line 17 of file SiStripBadModuleByHandBuilder.h.
SiStripBadModuleByHandBuilder::SiStripBadModuleByHandBuilder | ( | const edm::ParameterSet & | iConfig | ) | [explicit] |
Definition at line 8 of file SiStripBadModuleByHandBuilder.cc.
References BadModuleList_, fp_, edm::FileInPath::fullPath(), edm::ParameterSet::getUntrackedParameter(), printdebug_, reader, and python::OfflineSiStripConfigDb_cff::SiStripDetInfoFileReader.
: ConditionDBWriter<SiStripBadStrip>(iConfig){ fp_ = iConfig.getUntrackedParameter<edm::FileInPath>("file",edm::FileInPath("CalibTracker/SiStripCommon/data/SiStripDetInfo.dat")); BadModuleList_ = iConfig.getUntrackedParameter<std::vector<uint32_t> >("BadModuleList"); printdebug_ = iConfig.getUntrackedParameter<bool>("printDebug",false); reader = new SiStripDetInfoFileReader(fp_.fullPath()); }
SiStripBadModuleByHandBuilder::~SiStripBadModuleByHandBuilder | ( | ) |
Definition at line 18 of file SiStripBadModuleByHandBuilder.cc.
{ }
SiStripBadStrip * SiStripBadModuleByHandBuilder::getNewObject | ( | ) | [private, virtual] |
Implements ConditionDBWriter< SiStripBadStrip >.
Definition at line 21 of file SiStripBadModuleByHandBuilder.cc.
References BadModuleList_, SiStripBadStrip::encode(), SiStripDetInfoFileReader::getNumberOfApvsAndStripLength(), VarParsing::obj, printdebug_, SiStripBadStrip::put(), and reader.
{ SiStripBadStrip* obj = new SiStripBadStrip(); unsigned int firstBadStrip=0; unsigned short NconsecutiveBadStrips; unsigned int theBadStripRange; for(std::vector<uint32_t>::const_iterator it=BadModuleList_.begin(); it!=BadModuleList_.end(); ++it){ std::vector<unsigned int> theSiStripVector; NconsecutiveBadStrips=reader->getNumberOfApvsAndStripLength(*it).first*128; theBadStripRange = obj->encode(firstBadStrip,NconsecutiveBadStrips); if (printdebug_) edm::LogInfo("SiStripBadModuleByHandBuilder") << " BadModule " << *it << " \t" << " firstBadStrip " << firstBadStrip << "\t " << " NconsecutiveBadStrips " << NconsecutiveBadStrips << "\t " << " packed integer " << std::hex << theBadStripRange << std::dec << std::endl; theSiStripVector.push_back(theBadStripRange); SiStripBadStrip::Range range(theSiStripVector.begin(),theSiStripVector.end()); if ( ! obj->put(*it,range) ) edm::LogError("SiStripBadModuleByHandBuilder")<<"[SiStripBadModuleByHandBuilder::analyze] detid already exists"<<std::endl; } return obj; }
std::vector<uint32_t> SiStripBadModuleByHandBuilder::BadModuleList_ [private] |
Definition at line 32 of file SiStripBadModuleByHandBuilder.h.
Referenced by getNewObject(), and SiStripBadModuleByHandBuilder().
Definition at line 30 of file SiStripBadModuleByHandBuilder.h.
Referenced by SiStripBadModuleByHandBuilder().
bool SiStripBadModuleByHandBuilder::printdebug_ [private] |
Definition at line 31 of file SiStripBadModuleByHandBuilder.h.
Referenced by getNewObject(), and SiStripBadModuleByHandBuilder().
Definition at line 33 of file SiStripBadModuleByHandBuilder.h.
Referenced by getNewObject(), and SiStripBadModuleByHandBuilder().