CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Types | Public Member Functions | Private Attributes
HcalTPGCoderULUT Class Reference
Inheritance diagram for HcalTPGCoderULUT:
edm::ESProducer edm::ESProxyFactoryProducer edm::eventsetup::DataProxyProvider

Public Types

typedef boost::shared_ptr
< HcalTPGCoder
ReturnType
 
- Public Types inherited from edm::eventsetup::DataProxyProvider
typedef std::vector< std::pair
< DataKey, boost::shared_ptr
< DataProxy > > > 
KeyedProxies
 
typedef std::vector
< EventSetupRecordKey
Keys
 
typedef std::map
< EventSetupRecordKey,
KeyedProxies
RecordProxies
 

Public Member Functions

void dbRecordCallback (const HcalDbRecord &)
 
 HcalTPGCoderULUT (const edm::ParameterSet &)
 
ReturnType produce (const HcalTPGRecord &)
 
 ~HcalTPGCoderULUT ()
 
- Public Member Functions inherited from edm::ESProducer
 ESProducer ()
 
virtual ~ESProducer ()
 
- Public Member Functions inherited from edm::ESProxyFactoryProducer
 ESProxyFactoryProducer ()
 
virtual void newInterval (const eventsetup::EventSetupRecordKey &iRecordType, const ValidityInterval &iInterval)
 overrides DataProxyProvider method More...
 
virtual ~ESProxyFactoryProducer ()
 
- Public Member Functions inherited from edm::eventsetup::DataProxyProvider
 DataProxyProvider ()
 
const ComponentDescriptiondescription () const
 
bool isUsingRecord (const EventSetupRecordKey &) const
 
const KeyedProxieskeyedProxies (const EventSetupRecordKey &iRecordKey) const
 
void resetProxies (const EventSetupRecordKey &iRecordType)
 
void resetProxiesIfTransient (const EventSetupRecordKey &iRecordType)
 
void setAppendToDataLabel (const edm::ParameterSet &)
 
void setDescription (const ComponentDescription &iDescription)
 
std::set< EventSetupRecordKeyusingRecords () const
 
virtual ~DataProxyProvider ()
 

Private Attributes

ReturnType coder_
 
edm::FileInPath fgfile_
 
bool read_FGLut_
 
HcaluLUTTPGCodertheCoder_
 

Additional Inherited Members

- Protected Member Functions inherited from edm::ESProducer
template<typename T >
void setWhatProduced (T *iThis, const es::Label &iLabel=es::Label())
 
template<typename T >
void setWhatProduced (T *iThis, const char *iLabel)
 
template<typename T >
void setWhatProduced (T *iThis, const std::string &iLabel)
 
template<typename T , typename TDecorator >
void setWhatProduced (T *iThis, const TDecorator &iDec, const es::Label &iLabel=es::Label())
 
template<typename T , typename TReturn , typename TRecord >
void setWhatProduced (T *iThis, TReturn(T::*iMethod)(const TRecord &), const es::Label &iLabel=es::Label())
 
template<typename T , typename TReturn , typename TRecord , typename TArg >
void setWhatProduced (T *iThis, TReturn(T::*iMethod)(const TRecord &), const TArg &iDec, const es::Label &iLabel=es::Label())
 
- Protected Member Functions inherited from edm::ESProxyFactoryProducer
template<class TFactory >
void registerFactory (std::auto_ptr< TFactory > iFactory, const std::string &iLabel=std::string())
 
virtual void registerFactoryWithKey (const eventsetup::EventSetupRecordKey &iRecord, std::auto_ptr< eventsetup::ProxyFactoryBase > &iFactory, const std::string &iLabel=std::string())
 
virtual void registerProxies (const eventsetup::EventSetupRecordKey &iRecord, KeyedProxies &aProxyList)
 override DataProxyProvider method More...
 
- Protected Member Functions inherited from edm::eventsetup::DataProxyProvider
void eraseAll (const EventSetupRecordKey &iRecordKey)
 deletes all the Proxies in aStream More...
 
void invalidateProxies (const EventSetupRecordKey &iRecordKey)
 
template<class T >
void usingRecord ()
 
void usingRecordWithKey (const EventSetupRecordKey &)
 

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().

70 {
71  bool read_Ascii = iConfig.getParameter<bool>("read_Ascii_LUTs");
72  bool read_XML = iConfig.getParameter<bool>("read_XML_LUTs");
73  read_FGLut_ = iConfig.getParameter<bool>("read_FG_LUTs");
74  fgfile_ = iConfig.getParameter<edm::FileInPath>("FGLUTs");
75 
76  //the following line is needed to tell the framework what
77  // data is being produced
78  if (!(read_Ascii || read_XML)) setWhatProduced(this,(dependsOn(&HcalTPGCoderULUT::dbRecordCallback)));
79  else setWhatProduced(this);
80 
81  //now do what ever other initialization is needed
82  using namespace edm::es;
84  if (read_Ascii || read_XML){
85  edm::FileInPath ifilename(iConfig.getParameter<edm::FileInPath>("inputLUTs"));
86  edm::LogInfo("HCAL") << "Using ASCII/XML LUTs" << ifilename.fullPath() << " for HcalTPGCoderULUT initialization";
87  if (read_Ascii) theCoder_->update(ifilename.fullPath().c_str());
88  else if (read_XML) theCoder_->updateXML(ifilename.fullPath().c_str());
89 
90  // Read FG LUT and append to most significant bit 11
91  if (read_FGLut_) theCoder_->update(fgfile_.fullPath().c_str(), true);
92  }
93  else {
94  bool LUTGenerationMode = iConfig.getParameter<bool>("LUTGenerationMode");
95  int maskBit = iConfig.getParameter<int>("MaskBit");
96  theCoder_->setLUTGenerationMode(LUTGenerationMode);
97  theCoder_->setMaskBit(maskBit);
98  }
100 }
T getParameter(std::string const &) const
depends_on::OneHolder< T, TDependsOnRecord > dependsOn(void(T::*iT)(const TDependsOnRecord &))
void dbRecordCallback(const HcalDbRecord &)
HcaluLUTTPGCoder * theCoder_
void setWhatProduced(T *iThis, const es::Label &iLabel=es::Label())
Definition: ESProducer.h:115
void update(const HcalDbService &conditions)
void updateXML(const char *filename)
void setLUTGenerationMode(bool gen)
boost::shared_ptr< HcalTPGCoder > ReturnType
void setMaskBit(int bit)
edm::FileInPath fgfile_
HcalTPGCoderULUT::~HcalTPGCoderULUT ( )

Definition at line 103 of file HcalTPGCoderULUT.cc.

104 {
105 
106  // do anything here that needs to be done at desctruction time
107  // (e.g. close files, deallocate resources etc.)
108 }

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().

122  {
123  edm::ESHandle<HcalDbService> conditions;
124  theRec.get(conditions);
125  theCoder_->update(*conditions);
126 
127  // Temporary update for FG Lut
128  // Will be moved to DB
129  if (read_FGLut_) theCoder_->update(fgfile_.fullPath().c_str(), true);
130 }
HcaluLUTTPGCoder * theCoder_
void update(const HcalDbService &conditions)
void get(HolderT &iHolder) const
edm::FileInPath fgfile_
std::string fullPath() const
Definition: FileInPath.cc:170
HcalTPGCoderULUT::ReturnType HcalTPGCoderULUT::produce ( const HcalTPGRecord iRecord)

Definition at line 117 of file HcalTPGCoderULUT.cc.

References coder_.

Referenced by python.JSONExport.JsonExport::export(), and python.HTMLExport.HTMLExport::export().

118 {
119  return coder_;
120 }

Member Data Documentation

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().