CMS 3D CMS Logo

Public Types | Public Member Functions | Private Attributes

HcalTPGCoderULUT Class Reference

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::FileInPath fgfile_
bool read_FGLut_
HcaluLUTTPGCodertheCoder_

Detailed Description

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

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

Definition at line 41 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(), fgfile_, edm::FileInPath::fullPath(), edm::ParameterSet::getParameter(), ExpressReco_HICollisions_FallBack::LUTGenerationMode, 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.)
}

Member Function Documentation

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)

Definition at line 117 of file HcalTPGCoderULUT.cc.

References coder_.

{
  return coder_;
}

Member Data Documentation

Definition at line 52 of file HcalTPGCoderULUT.cc.

Referenced by HcalTPGCoderULUT(), and produce().

Definition at line 55 of file HcalTPGCoderULUT.cc.

Referenced by dbRecordCallback(), and HcalTPGCoderULUT().

Definition at line 54 of file HcalTPGCoderULUT.cc.

Referenced by dbRecordCallback(), and HcalTPGCoderULUT().

Definition at line 53 of file HcalTPGCoderULUT.cc.

Referenced by dbRecordCallback(), and HcalTPGCoderULUT().