CMS 3D CMS Logo

HcalTPGCoderULUT Class Reference

Description: <one line="" class="" summary>="">. More...

Inheritance diagram for HcalTPGCoderULUT:

edm::ESProducer edm::ESProxyFactoryProducer edm::eventsetup::DataProxyProvider

List of all members.

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::FileInPathifilename_
bool read_Ascii
HcaluLUTTPGCodertheCoder


Detailed Description

Description: <one line="" class="" summary>="">.

Implementation: <Notes on="" implementation>="">

Definition at line 40 of file HcalTPGCoderULUT.cc.


Member Typedef Documentation

typedef boost::shared_ptr<HcalTPGCoder> HcalTPGCoderULUT::ReturnType

Definition at line 46 of file HcalTPGCoderULUT.cc.


Constructor & Destructor Documentation

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 }


Member Function Documentation

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 }


Member Data Documentation

ReturnType HcalTPGCoderULUT::coder_ [private]

Definition at line 53 of file HcalTPGCoderULUT.cc.

Referenced by HcalTPGCoderULUT(), and produce().

edm::FileInPath* HcalTPGCoderULUT::ifilename_ [private]

Definition at line 52 of file HcalTPGCoderULUT.cc.

Referenced by HcalTPGCoderULUT(), and ~HcalTPGCoderULUT().

bool HcalTPGCoderULUT::read_Ascii [private]

Definition at line 55 of file HcalTPGCoderULUT.cc.

Referenced by HcalTPGCoderULUT().

HcaluLUTTPGCoder* HcalTPGCoderULUT::theCoder [private]

Definition at line 54 of file HcalTPGCoderULUT.cc.

Referenced by dbRecordCallback(), and HcalTPGCoderULUT().


The documentation for this class was generated from the following file:
Generated on Tue Jun 9 18:24:00 2009 for CMSSW by  doxygen 1.5.4