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 () override
 
- 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_
 
unsigned int FG_HF_threshold_
 
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 71 of file HcalTPGCoderULUT.cc.

References dbRecordCallback(), edm::eventsetup::dependsOn(), FG_HF_threshold_, fgfile_, edm::ParameterSet::getParameter(), ifilename_, LUTGenerationMode_, maskBit_, read_Ascii_, read_FGLut_, read_XML_, edm::ESProducer::setWhatProduced(), and theCoder_.

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

Definition at line 116 of file HcalTPGCoderULUT.cc.

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

Member Function Documentation

void HcalTPGCoderULUT::buildCoder ( const HcalTopology topo)
private

Definition at line 93 of file HcalTPGCoderULUT.cc.

References coder_, FG_HF_threshold_, fgfile_, edm::FileInPath::fullPath(), ifilename_, LUTGenerationMode_, maskBit_, read_Ascii_, read_FGLut_, read_XML_, HcaluLUTTPGCoder::setFGHFthreshold(), HcaluLUTTPGCoder::setLUTGenerationMode(), HcaluLUTTPGCoder::setMaskBit(), theCoder_, HcaluLUTTPGCoder::update(), and HcaluLUTTPGCoder::updateXML().

Referenced by dbRecordCallback(), and produce().

93  {
94  using namespace edm::es;
95  theCoder_ = new HcaluLUTTPGCoder(topo);
96  if (read_Ascii_ || read_XML_){
97  edm::LogInfo("HCAL") << "Using ASCII/XML LUTs" << ifilename_.fullPath() << " for HcalTPGCoderULUT initialization";
98  if (read_Ascii_) {
99  theCoder_->update(ifilename_.fullPath().c_str());
100  } else if (read_XML_) {
102  }
103  // Read FG LUT and append to most significant bit 11
104  if (read_FGLut_) {
105  theCoder_->update(fgfile_.fullPath().c_str(), true);
106  }
107  } else {
111  }
113 }
unsigned int FG_HF_threshold_
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 setFGHFthreshold(unsigned int fgthreshold)
void setMaskBit(int bit)
edm::FileInPath fgfile_
std::string fullPath() const
Definition: FileInPath.cc:184
void HcalTPGCoderULUT::dbRecordCallback ( const HcalDbRecord theRec)

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

142  {
143  edm::ESHandle<HcalDbService> conditions;
144  theRec.get(conditions);
146  theRec.getRecord<HcalRecNumberingRecord>().get(htopo);
147  const HcalTopology* topo=&(*htopo);
148 
149  if (theCoder_==nullptr) {
150  buildCoder(topo);
151  }
152 
153  theCoder_->update(*conditions);
154 
155  // Temporary update for FG Lut
156  // Will be moved to DB
157  if (read_FGLut_) theCoder_->update(fgfile_.fullPath().c_str(),true);
158 }
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().

unsigned int HcalTPGCoderULUT::FG_HF_threshold_
private

Definition at line 56 of file HcalTPGCoderULUT.cc.

Referenced by buildCoder(), and HcalTPGCoderULUT().

edm::FileInPath HcalTPGCoderULUT::fgfile_
private

Definition at line 57 of file HcalTPGCoderULUT.cc.

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

edm::FileInPath HcalTPGCoderULUT::ifilename_
private

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