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 * | ifilename_ |
bool | read_Ascii |
HcaluLUTTPGCoder * | theCoder |
Implementation: <Notes on="" implementation>="">
Definition at line 40 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(), edm::FileInPath::fullPath(), edm::ParameterSet::getParameter(), ifilename_, read_Ascii, edm::ESProducer::setWhatProduced(), and theCoder.
00070 { 00071 /* 00072 ifilename_=0; 00073 try { 00074 ofilename_=new edm::FileInPath(iConfig.getParameter<edm::FileInPath>("outputLUTs")); 00075 } catch (...) { 00076 ifilename_=new edm::FileInPath(iConfig.getParameter<edm::FileInPath>("filename")); 00077 ofilename_=0; 00078 } 00079 */ 00080 read_Ascii=false; 00081 read_Ascii=iConfig.getParameter<bool>("read_Ascii_LUTs"); 00082 if (read_Ascii==true) ifilename_=new edm::FileInPath(iConfig.getParameter<edm::FileInPath>("inputLUTs")); 00083 else ifilename_=new edm::FileInPath(iConfig.getParameter<edm::FileInPath>("filename")); 00084 00085 00086 //the following line is needed to tell the framework what 00087 // data is being produced 00088 if (read_Ascii==false) setWhatProduced(this,(dependsOn(&HcalTPGCoderULUT::dbRecordCallback))); 00089 else setWhatProduced(this); 00090 00091 00092 //now do what ever other initialization is needed 00093 using namespace edm::es; 00094 if (read_Ascii==true){ 00095 edm::LogInfo("HCAL") << "Using ASCII LUTs" << ifilename_->fullPath() << " for HcalTPGCoderULUT initialization"; 00096 theCoder=new HcaluLUTTPGCoder(ifilename_->fullPath().c_str(),read_Ascii); 00097 coder_=ReturnType(theCoder); 00098 } 00099 else { 00100 edm::LogInfo("HCAL") << "Using " << ifilename_->fullPath() << " for HcalTPGCoderULUT initialization"; 00101 theCoder=new HcaluLUTTPGCoder(ifilename_->fullPath().c_str(),read_Ascii); 00102 coder_=ReturnType(theCoder); 00103 } 00104 }
HcalTPGCoderULUT::~HcalTPGCoderULUT | ( | ) |
Definition at line 107 of file HcalTPGCoderULUT.cc.
References ifilename_.
00108 { 00109 00110 // do anything here that needs to be done at desctruction time 00111 // (e.g. close files, deallocate resources etc.) 00112 00113 00114 if (ifilename_!=0) delete ifilename_; 00115 }
void HcalTPGCoderULUT::dbRecordCallback | ( | const HcalDbRecord & | theRec | ) |
Definition at line 129 of file HcalTPGCoderULUT.cc.
References edm::eventsetup::EventSetupRecordImplementation< T >::get(), theCoder, and HcaluLUTTPGCoder::update().
Referenced by HcalTPGCoderULUT().
00129 { 00130 edm::ESHandle<HcalDbService> conditions; 00131 theRec.get(conditions); 00132 theCoder->update(*conditions); 00133 }
HcalTPGCoderULUT::ReturnType HcalTPGCoderULUT::produce | ( | const HcalTPGRecord & | iRecord | ) |
Definition at line 124 of file HcalTPGCoderULUT.cc.
References coder_.
00125 { 00126 return coder_; 00127 }
ReturnType HcalTPGCoderULUT::coder_ [private] |
edm::FileInPath* HcalTPGCoderULUT::ifilename_ [private] |
Definition at line 52 of file HcalTPGCoderULUT.cc.
Referenced by HcalTPGCoderULUT(), and ~HcalTPGCoderULUT().
bool HcalTPGCoderULUT::read_Ascii [private] |
HcaluLUTTPGCoder* HcalTPGCoderULUT::theCoder [private] |
Definition at line 54 of file HcalTPGCoderULUT.cc.
Referenced by dbRecordCallback(), and HcalTPGCoderULUT().