CMS 3D CMS Logo

List of all members | Public Types | Public Member Functions | Private Member Functions | Private Attributes
HcalTPGCoderULUT Class Reference
Inheritance diagram for HcalTPGCoderULUT:
edm::ESProducer edm::ESProxyFactoryProducer edm::eventsetup::DataProxyProvider

Public Types

typedef std::shared_ptr< HcalTPGCoderReturnType
 
- Public Types inherited from edm::eventsetup::DataProxyProvider
typedef std::vector< std::pair< DataKey, edm::propagate_const< std::shared_ptr< DataProxy > > > > KeyedProxies
 
typedef std::vector< EventSetupRecordKeyKeys
 
typedef std::map< EventSetupRecordKey, KeyedProxiesRecordProxies
 

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 ()(false)
 
- Public Member Functions inherited from edm::ESProxyFactoryProducer
 ESProxyFactoryProducer ()
 
virtual void newInterval (const eventsetup::EventSetupRecordKey &iRecordType, const ValidityInterval &iInterval)
 overrides DataProxyProvider method More...
 
virtual ~ESProxyFactoryProducer () noexcept(false)
 
- 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 () noexcept(false)
 

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_
 
HcaluLUTTPGCodertheCoder_
 

Additional Inherited Members

- Static Public Member Functions inherited from edm::eventsetup::DataProxyProvider
static void prevalidate (ConfigurationDescriptions &)
 
- 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::unique_ptr< TFactory > iFactory, const std::string &iLabel=std::string())
 
virtual void registerFactoryWithKey (const eventsetup::EventSetupRecordKey &iRecord, std::unique_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 40 of file HcalTPGCoderULUT.cc.

Member Typedef Documentation

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

Definition at line 45 of file HcalTPGCoderULUT.cc.

Constructor & Destructor Documentation

HcalTPGCoderULUT::HcalTPGCoderULUT ( const edm::ParameterSet iConfig)

Definition at line 70 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_.

71 {
72  read_Ascii_ = iConfig.getParameter<bool>("read_Ascii_LUTs");
73  read_XML_ = iConfig.getParameter<bool>("read_XML_LUTs");
74  read_FGLut_ = iConfig.getParameter<bool>("read_FG_LUTs");
75  fgfile_ = iConfig.getParameter<edm::FileInPath>("FGLUTs");
76  //the following line is needed to tell the framework what
77  // data is being produced
78  if (!(read_Ascii_ || read_XML_)) {
80  LUTGenerationMode_ = iConfig.getParameter<bool>("LUTGenerationMode");
81  maskBit_ = iConfig.getParameter<int>("MaskBit");
82  } else {
83  ifilename_=iConfig.getParameter<edm::FileInPath>("inputLUTs");
84  setWhatProduced(this);
85  }
86 
87  theCoder_=0;
88 }
T getParameter(std::string const &) const
depends_on::OneHolder< T, TDependsOnRecord > dependsOn(void(T::*iT)(const TDependsOnRecord &))
void dbRecordCallback(const HcalDbRecord &)
edm::FileInPath ifilename_
HcaluLUTTPGCoder * theCoder_
void setWhatProduced(T *iThis, const es::Label &iLabel=es::Label())
Definition: ESProducer.h:115
edm::FileInPath fgfile_
HcalTPGCoderULUT::~HcalTPGCoderULUT ( )

Definition at line 113 of file HcalTPGCoderULUT.cc.

113  {
114 
115  // do anything here that needs to be done at desctruction time
116  // (e.g. close files, deallocate resources etc.)
117 }

Member Function Documentation

void HcalTPGCoderULUT::buildCoder ( const HcalTopology topo)
private

Definition at line 91 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().

91  {
92  using namespace edm::es;
93  theCoder_ = new HcaluLUTTPGCoder(topo);
94  if (read_Ascii_ || read_XML_){
95  edm::LogInfo("HCAL") << "Using ASCII/XML LUTs" << ifilename_.fullPath() << " for HcalTPGCoderULUT initialization";
96  if (read_Ascii_) {
97  theCoder_->update(ifilename_.fullPath().c_str());
98  } else if (read_XML_) {
100  }
101  // Read FG LUT and append to most significant bit 11
102  if (read_FGLut_) {
103  theCoder_->update(fgfile_.fullPath().c_str(), true);
104  }
105  } else {
108  }
110 }
edm::FileInPath ifilename_
HcaluLUTTPGCoder * theCoder_
std::shared_ptr< HcalTPGCoder > ReturnType
void update(const HcalDbService &conditions)
void updateXML(const char *filename)
void setLUTGenerationMode(bool gen)
void setMaskBit(int bit)
edm::FileInPath fgfile_
std::string fullPath() const
Definition: FileInPath.cc:184
void HcalTPGCoderULUT::dbRecordCallback ( const HcalDbRecord theRec)

Definition at line 139 of file HcalTPGCoderULUT.cc.

References buildCoder(), DEFINE_FWK_EVENTSETUP_MODULE, fgfile_, edm::FileInPath::fullPath(), edm::eventsetup::EventSetupRecord::get(), edm::eventsetup::DependentRecordImplementation< RecordT, ListT >::getRecord(), read_FGLut_, theCoder_, and HcaluLUTTPGCoder::update().

Referenced by HcalTPGCoderULUT().

139  {
140  edm::ESHandle<HcalDbService> conditions;
141  theRec.get(conditions);
143  theRec.getRecord<HcalRecNumberingRecord>().get(htopo);
144  const HcalTopology* topo=&(*htopo);
145 
146  if (theCoder_==0) {
147  buildCoder(topo);
148  }
149 
150  theCoder_->update(*conditions);
151 
152  // Temporary update for FG Lut
153  // Will be moved to DB
154  if (read_FGLut_) theCoder_->update(fgfile_.fullPath().c_str(),true);
155 }
HcaluLUTTPGCoder * theCoder_
void update(const HcalDbService &conditions)
void get(HolderT &iHolder) const
edm::FileInPath fgfile_
std::string fullPath() const
Definition: FileInPath.cc:184
void buildCoder(const HcalTopology *)
HcalTPGCoderULUT::ReturnType HcalTPGCoderULUT::produce ( const HcalTPGRecord iRecord)

Member Data Documentation

ReturnType HcalTPGCoderULUT::coder_
private

Definition at line 52 of file HcalTPGCoderULUT.cc.

Referenced by buildCoder(), and produce().

edm::FileInPath HcalTPGCoderULUT::fgfile_
private

Definition at line 56 of file HcalTPGCoderULUT.cc.

Referenced by buildCoder(), dbRecordCallback(), and HcalTPGCoderULUT().

edm::FileInPath HcalTPGCoderULUT::ifilename_
private

Definition at line 56 of file HcalTPGCoderULUT.cc.

Referenced by buildCoder(), and HcalTPGCoderULUT().

bool HcalTPGCoderULUT::LUTGenerationMode_
private

Definition at line 54 of file HcalTPGCoderULUT.cc.

Referenced by buildCoder(), and HcalTPGCoderULUT().

int HcalTPGCoderULUT::maskBit_
private

Definition at line 55 of file HcalTPGCoderULUT.cc.

Referenced by buildCoder(), and HcalTPGCoderULUT().

bool HcalTPGCoderULUT::read_Ascii_
private

Definition at line 54 of file HcalTPGCoderULUT.cc.

Referenced by buildCoder(), and HcalTPGCoderULUT().

bool HcalTPGCoderULUT::read_FGLut_
private

Definition at line 54 of file HcalTPGCoderULUT.cc.

Referenced by buildCoder(), dbRecordCallback(), and HcalTPGCoderULUT().

bool HcalTPGCoderULUT::read_XML_
private

Definition at line 54 of file HcalTPGCoderULUT.cc.

Referenced by buildCoder(), and HcalTPGCoderULUT().

HcaluLUTTPGCoder* HcalTPGCoderULUT::theCoder_
private

Definition at line 53 of file HcalTPGCoderULUT.cc.

Referenced by buildCoder(), dbRecordCallback(), HcalTPGCoderULUT(), and produce().