Public Types | |
typedef boost::shared_ptr < HcalTPGCoder > | ReturnType |
Public Member Functions | |
void | dbRecordCallback (const HcalDbRecord &) |
HcalTPGCoderULUT (const edm::ParameterSet &) | |
ReturnType | produce (const HcalTPGRecord &) |
~HcalTPGCoderULUT () | |
Private Attributes | |
ReturnType | coder_ |
edm::FileInPath | fgfile_ |
bool | read_FGLut_ |
HcaluLUTTPGCoder * | theCoder_ |
Description: <one line="" class="" summary>="">
Implementation: <Notes on="" implementation>="">
Definition at line 41 of file HcalTPGCoderULUT.cc.
typedef boost::shared_ptr<HcalTPGCoder> HcalTPGCoderULUT::ReturnType |
Definition at line 46 of file HcalTPGCoderULUT.cc.
HcalTPGCoderULUT::HcalTPGCoderULUT | ( | const edm::ParameterSet & | iConfig | ) |
Definition at line 69 of file HcalTPGCoderULUT.cc.
References coder_, dbRecordCallback(), edm::eventsetup::dependsOn(), fgfile_, edm::FileInPath::fullPath(), edm::ParameterSet::getParameter(), read_FGLut_, HcaluLUTTPGCoder::setLUTGenerationMode(), HcaluLUTTPGCoder::setMaskBit(), edm::ESProducer::setWhatProduced(), theCoder_, HcaluLUTTPGCoder::update(), and HcaluLUTTPGCoder::updateXML().
{ bool read_Ascii = iConfig.getParameter<bool>("read_Ascii_LUTs"); bool read_XML = iConfig.getParameter<bool>("read_XML_LUTs"); read_FGLut_ = iConfig.getParameter<bool>("read_FG_LUTs"); fgfile_ = iConfig.getParameter<edm::FileInPath>("FGLUTs"); //the following line is needed to tell the framework what // data is being produced if (!(read_Ascii || read_XML)) setWhatProduced(this,(dependsOn(&HcalTPGCoderULUT::dbRecordCallback))); else setWhatProduced(this); //now do what ever other initialization is needed using namespace edm::es; theCoder_ = new HcaluLUTTPGCoder(); if (read_Ascii || read_XML){ edm::FileInPath ifilename(iConfig.getParameter<edm::FileInPath>("inputLUTs")); edm::LogInfo("HCAL") << "Using ASCII/XML LUTs" << ifilename.fullPath() << " for HcalTPGCoderULUT initialization"; if (read_Ascii) theCoder_->update(ifilename.fullPath().c_str()); else if (read_XML) theCoder_->updateXML(ifilename.fullPath().c_str()); // Read FG LUT and append to most significant bit 11 if (read_FGLut_) theCoder_->update(fgfile_.fullPath().c_str(), true); } else { bool LUTGenerationMode = iConfig.getParameter<bool>("LUTGenerationMode"); int maskBit = iConfig.getParameter<int>("MaskBit"); theCoder_->setLUTGenerationMode(LUTGenerationMode); theCoder_->setMaskBit(maskBit); } coder_=ReturnType(theCoder_); }
HcalTPGCoderULUT::~HcalTPGCoderULUT | ( | ) |
Definition at line 103 of file HcalTPGCoderULUT.cc.
{ // do anything here that needs to be done at desctruction time // (e.g. close files, deallocate resources etc.) }
void HcalTPGCoderULUT::dbRecordCallback | ( | const HcalDbRecord & | theRec | ) |
Definition at line 122 of file HcalTPGCoderULUT.cc.
References fgfile_, edm::FileInPath::fullPath(), edm::eventsetup::EventSetupRecord::get(), read_FGLut_, theCoder_, and HcaluLUTTPGCoder::update().
Referenced by HcalTPGCoderULUT().
{ edm::ESHandle<HcalDbService> conditions; theRec.get(conditions); theCoder_->update(*conditions); // Temporary update for FG Lut // Will be moved to DB if (read_FGLut_) theCoder_->update(fgfile_.fullPath().c_str(), true); }
HcalTPGCoderULUT::ReturnType HcalTPGCoderULUT::produce | ( | const HcalTPGRecord & | iRecord | ) |
ReturnType HcalTPGCoderULUT::coder_ [private] |
Definition at line 52 of file HcalTPGCoderULUT.cc.
Referenced by HcalTPGCoderULUT(), and produce().
edm::FileInPath HcalTPGCoderULUT::fgfile_ [private] |
Definition at line 55 of file HcalTPGCoderULUT.cc.
Referenced by dbRecordCallback(), and HcalTPGCoderULUT().
bool HcalTPGCoderULUT::read_FGLut_ [private] |
Definition at line 54 of file HcalTPGCoderULUT.cc.
Referenced by dbRecordCallback(), and HcalTPGCoderULUT().
HcaluLUTTPGCoder* HcalTPGCoderULUT::theCoder_ [private] |
Definition at line 53 of file HcalTPGCoderULUT.cc.
Referenced by dbRecordCallback(), and HcalTPGCoderULUT().