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 Member Functions | |
void | buildCoder (const HcalTopology *) |
Private Attributes | |
ReturnType | coder_ |
edm::FileInPath | fgfile_ |
edm::FileInPath | ifilename_ |
bool | LUTGenerationMode_ |
int | maskBit_ |
bool | read_Ascii_ |
bool | read_FGLut_ |
bool | read_XML_ |
HcaluLUTTPGCoder * | theCoder_ |
Description: <one line="" class="" summary>="">
Implementation: <Notes on="" implementation>="">
Definition at line 42 of file HcalTPGCoderULUT.cc.
typedef boost::shared_ptr<HcalTPGCoder> HcalTPGCoderULUT::ReturnType |
Definition at line 47 of file HcalTPGCoderULUT.cc.
HcalTPGCoderULUT::HcalTPGCoderULUT | ( | const edm::ParameterSet & | iConfig | ) |
Definition at line 72 of file HcalTPGCoderULUT.cc.
References dbRecordCallback(), edm::eventsetup::dependsOn(), fgfile_, edm::ParameterSet::getParameter(), ifilename_, LUTGenerationMode_, maskBit_, read_Ascii_, read_FGLut_, read_XML_, edm::ESProducer::setWhatProduced(), and theCoder_.
{ read_Ascii_ = iConfig.getParameter<bool>("read_Ascii_LUTs"); 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))); LUTGenerationMode_ = iConfig.getParameter<bool>("LUTGenerationMode"); maskBit_ = iConfig.getParameter<int>("MaskBit"); } else { ifilename_=iConfig.getParameter<edm::FileInPath>("inputLUTs"); setWhatProduced(this); } theCoder_=0; }
HcalTPGCoderULUT::~HcalTPGCoderULUT | ( | ) |
Definition at line 114 of file HcalTPGCoderULUT.cc.
{ // do anything here that needs to be done at desctruction time // (e.g. close files, deallocate resources etc.) }
void HcalTPGCoderULUT::buildCoder | ( | const HcalTopology * | topo | ) | [private] |
Definition at line 93 of file HcalTPGCoderULUT.cc.
References coder_, fgfile_, edm::FileInPath::fullPath(), ifilename_, LUTGenerationMode_, maskBit_, read_Ascii_, read_FGLut_, read_XML_, HcaluLUTTPGCoder::setLUTGenerationMode(), HcaluLUTTPGCoder::setMaskBit(), theCoder_, HcaluLUTTPGCoder::update(), and HcaluLUTTPGCoder::updateXML().
Referenced by dbRecordCallback(), and produce().
{ using namespace edm::es; theCoder_ = new HcaluLUTTPGCoder(); if (read_Ascii_ || read_XML_){ edm::LogInfo("HCAL") << "Using ASCII/XML LUTs" << ifilename_.fullPath() << " for HcalTPGCoderULUT initialization"; if (read_Ascii_) { theCoder_->update(ifilename_.fullPath().c_str(),*topo); } else if (read_XML_) theCoder_->updateXML(ifilename_.fullPath().c_str(),*topo); // Read FG LUT and append to most significant bit 11 if (read_FGLut_) { theCoder_->update(fgfile_.fullPath().c_str(), *topo,true); } } else { theCoder_->setLUTGenerationMode(LUTGenerationMode_); theCoder_->setMaskBit(maskBit_); } coder_=ReturnType(theCoder_); }
void HcalTPGCoderULUT::dbRecordCallback | ( | const HcalDbRecord & | theRec | ) |
Definition at line 141 of file HcalTPGCoderULUT.cc.
References buildCoder(), fgfile_, edm::FileInPath::fullPath(), edm::eventsetup::EventSetupRecord::get(), read_FGLut_, theCoder_, and HcaluLUTTPGCoder::update().
Referenced by HcalTPGCoderULUT().
{ edm::ESHandle<HcalDbService> conditions; theRec.get(conditions); const HcalTopology* topo=conditions->getTopologyUsed(); if (theCoder_==0) { buildCoder(topo); } theCoder_->update(*conditions); // Temporary update for FG Lut // Will be moved to DB if (read_FGLut_) theCoder_->update(fgfile_.fullPath().c_str(),*topo,true); }
HcalTPGCoderULUT::ReturnType HcalTPGCoderULUT::produce | ( | const HcalTPGRecord & | iRecord | ) |
Definition at line 128 of file HcalTPGCoderULUT.cc.
References buildCoder(), coder_, edm::eventsetup::DependentRecordImplementation< RecordT, ListT >::getRecord(), and theCoder_.
{ if (theCoder_==0) { edm::ESHandle<HcalTopology> htopo; iRecord.getRecord<IdealGeometryRecord>().get(htopo); const HcalTopology* topo=&(*htopo); buildCoder(topo); } return coder_; }
ReturnType HcalTPGCoderULUT::coder_ [private] |
Definition at line 54 of file HcalTPGCoderULUT.cc.
Referenced by buildCoder(), and produce().
edm::FileInPath HcalTPGCoderULUT::fgfile_ [private] |
Definition at line 58 of file HcalTPGCoderULUT.cc.
Referenced by buildCoder(), dbRecordCallback(), and HcalTPGCoderULUT().
edm::FileInPath HcalTPGCoderULUT::ifilename_ [private] |
Definition at line 58 of file HcalTPGCoderULUT.cc.
Referenced by buildCoder(), and HcalTPGCoderULUT().
bool HcalTPGCoderULUT::LUTGenerationMode_ [private] |
Definition at line 56 of file HcalTPGCoderULUT.cc.
Referenced by buildCoder(), and HcalTPGCoderULUT().
int HcalTPGCoderULUT::maskBit_ [private] |
Definition at line 57 of file HcalTPGCoderULUT.cc.
Referenced by buildCoder(), and HcalTPGCoderULUT().
bool HcalTPGCoderULUT::read_Ascii_ [private] |
Definition at line 56 of file HcalTPGCoderULUT.cc.
Referenced by buildCoder(), and HcalTPGCoderULUT().
bool HcalTPGCoderULUT::read_FGLut_ [private] |
Definition at line 56 of file HcalTPGCoderULUT.cc.
Referenced by buildCoder(), dbRecordCallback(), and HcalTPGCoderULUT().
bool HcalTPGCoderULUT::read_XML_ [private] |
Definition at line 56 of file HcalTPGCoderULUT.cc.
Referenced by buildCoder(), and HcalTPGCoderULUT().
HcaluLUTTPGCoder* HcalTPGCoderULUT::theCoder_ [private] |
Definition at line 55 of file HcalTPGCoderULUT.cc.
Referenced by buildCoder(), dbRecordCallback(), HcalTPGCoderULUT(), and produce().