#include <SiStripBadFiberBuilder.h>
Public Member Functions | |
void | algoAnalyze (const edm::Event &event, const edm::EventSetup &iSetup) |
SiStripBadFiberBuilder (const edm::ParameterSet &) | |
~SiStripBadFiberBuilder () | |
Private Types | |
typedef std::vector < edm::ParameterSet > | Parameters |
Private Member Functions | |
SiStripBadStrip * | getNewObject () |
Private Attributes | |
Parameters | BadComponentList_ |
edm::FileInPath | fp_ |
SiStripBadStrip * | obj |
bool | printdebug_ |
Definition at line 16 of file SiStripBadFiberBuilder.h.
typedef std::vector< edm::ParameterSet > SiStripBadFiberBuilder::Parameters [private] |
Definition at line 34 of file SiStripBadFiberBuilder.h.
SiStripBadFiberBuilder::SiStripBadFiberBuilder | ( | const edm::ParameterSet & | iConfig | ) | [explicit] |
Definition at line 9 of file SiStripBadFiberBuilder.cc.
References BadComponentList_, fp_, edm::ParameterSet::getUntrackedParameter(), and printdebug_.
: ConditionDBWriter<SiStripBadStrip>(iConfig){ fp_ = iConfig.getUntrackedParameter<edm::FileInPath>("file",edm::FileInPath("CalibTracker/SiStripCommon/data/SiStripDetInfo.dat")); printdebug_ = iConfig.getUntrackedParameter<bool>("printDebug",false); BadComponentList_ = iConfig.getUntrackedParameter<Parameters>("BadComponentList"); }
SiStripBadFiberBuilder::~SiStripBadFiberBuilder | ( | ) |
Definition at line 17 of file SiStripBadFiberBuilder.cc.
{ }
void SiStripBadFiberBuilder::algoAnalyze | ( | const edm::Event & | event, |
const edm::EventSetup & | iSetup | ||
) | [virtual] |
Reimplemented from ConditionDBWriter< SiStripBadStrip >.
Definition at line 20 of file SiStripBadFiberBuilder.cc.
References BadComponentList_, SiStripBadStrip::encode(), fp_, edm::FileInPath::fullPath(), SiStripDetInfoFileReader::getAllDetIds(), obj, printdebug_, SiStripBadStrip::put(), and DTTTrigCorrFirst::run.
{ unsigned int run=event.id().run(); edm::LogInfo("SiStripBadFiberBuilder") << "... creating dummy SiStripBadStrip Data for Run " << run << "\n " << std::endl; obj = new SiStripBadStrip(); SiStripDetInfoFileReader reader(fp_.fullPath()); const std::vector<uint32_t> DetIds = reader.getAllDetIds(); std::stringstream ss; for(Parameters::iterator iBadComponent = BadComponentList_.begin(); iBadComponent != BadComponentList_.end(); ++iBadComponent ) { uint32_t BadModule_ = iBadComponent->getParameter<uint32_t>("BadModule"); std::vector<uint32_t> BadApvList_ = iBadComponent->getParameter<std::vector<uint32_t> >("BadApvList"); std::vector<unsigned int> theSiStripVector; unsigned short firstBadStrip=0, NconsecutiveBadStrips=0; unsigned int theBadStripRange; for(std::vector<uint32_t>::const_iterator is=BadApvList_.begin(); is!=BadApvList_.end(); ++is){ firstBadStrip=(*is)*128; NconsecutiveBadStrips=128; theBadStripRange = obj->encode(firstBadStrip,NconsecutiveBadStrips); if (printdebug_) ss << "detid " << BadModule_ << " \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(BadModule_,range) ) edm::LogError("SiStripBadFiberBuilder")<<"[SiStripBadFiberBuilder::analyze] detid already exists"<<std::endl; } if (printdebug_) edm::LogInfo("SiStripBadFiberBuilder") << ss.str(); }
SiStripBadStrip* SiStripBadFiberBuilder::getNewObject | ( | ) | [inline, private, virtual] |
Implements ConditionDBWriter< SiStripBadStrip >.
Definition at line 27 of file SiStripBadFiberBuilder.h.
References obj.
{return obj;}
Definition at line 35 of file SiStripBadFiberBuilder.h.
Referenced by algoAnalyze(), and SiStripBadFiberBuilder().
edm::FileInPath SiStripBadFiberBuilder::fp_ [private] |
Definition at line 30 of file SiStripBadFiberBuilder.h.
Referenced by algoAnalyze(), and SiStripBadFiberBuilder().
SiStripBadStrip* SiStripBadFiberBuilder::obj [private] |
Definition at line 32 of file SiStripBadFiberBuilder.h.
Referenced by algoAnalyze(), and getNewObject().
bool SiStripBadFiberBuilder::printdebug_ [private] |
Definition at line 31 of file SiStripBadFiberBuilder.h.
Referenced by algoAnalyze(), and SiStripBadFiberBuilder().