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

Private Attributes

ReturnType coder_
 
unsigned int FG_HF_threshold_
 
edm::FileInPath fgfile_
 
edm::FileInPath ifilename_
 
double linearLSB_QIE11_
 
double linearLSB_QIE11Overlap_
 
double linearLSB_QIE8_
 
bool linearLUTs_
 
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())
 
void registerProxies (const eventsetup::EventSetupRecordKey &iRecord, KeyedProxies &aProxyList) override
 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 72 of file HcalTPGCoderULUT.cc.

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

73 {
74  read_Ascii_ = iConfig.getParameter<bool>("read_Ascii_LUTs");
75  read_XML_ = iConfig.getParameter<bool>("read_XML_LUTs");
76  read_FGLut_ = iConfig.getParameter<bool>("read_FG_LUTs");
77  fgfile_ = iConfig.getParameter<edm::FileInPath>("FGLUTs");
78  //the following line is needed to tell the framework what
79  // data is being produced
80  if (!(read_Ascii_ || read_XML_)) {
82  LUTGenerationMode_ = iConfig.getParameter<bool>("LUTGenerationMode");
83  linearLUTs_ = iConfig.getParameter<bool>("linearLUTs");
84  auto scales = iConfig.getParameter<edm::ParameterSet>("tpScales").getParameter<edm::ParameterSet>("HBHE");
85  linearLSB_QIE8_ = scales.getParameter<double>("LSBQIE8");
86  linearLSB_QIE11_ = scales.getParameter<double>("LSBQIE11");
87  linearLSB_QIE11Overlap_ = scales.getParameter<double>("LSBQIE11Overlap");
88  maskBit_ = iConfig.getParameter<int>("MaskBit");
89  FG_HF_threshold_ = iConfig.getParameter<uint32_t>("FG_HF_threshold");
90  } else {
91  ifilename_=iConfig.getParameter<edm::FileInPath>("inputLUTs");
92  setWhatProduced(this);
93  }
94 
95  theCoder_=nullptr;
96 }
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_
double linearLSB_QIE11Overlap_
HcalTPGCoderULUT::~HcalTPGCoderULUT ( )
override

Definition at line 123 of file HcalTPGCoderULUT.cc.

123  {
124 
125  // do anything here that needs to be done at desctruction time
126  // (e.g. close files, deallocate resources etc.)
127 }

Member Function Documentation

void HcalTPGCoderULUT::buildCoder ( const HcalTopology topo,
const edm::ESHandle< HcalTimeSlew > &  delay 
)
private

Definition at line 99 of file HcalTPGCoderULUT.cc.

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

Referenced by dbRecordCallback(), and produce().

99  {
100  using namespace edm::es;
101  theCoder_ = new HcaluLUTTPGCoder(topo, delay);
102  if (read_Ascii_ || read_XML_){
103  edm::LogInfo("HCAL") << "Using ASCII/XML LUTs" << ifilename_.fullPath() << " for HcalTPGCoderULUT initialization";
104  if (read_Ascii_) {
105  theCoder_->update(ifilename_.fullPath().c_str());
106  } else if (read_XML_) {
108  }
109  // Read FG LUT and append to most significant bit 11
110  if (read_FGLut_) {
111  theCoder_->update(fgfile_.fullPath().c_str(), true);
112  }
113  } else {
118  }
120 }
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)
void setAllLinear(bool linear, double lsb8, double lsb11, double lsb11overlap)
edm::FileInPath fgfile_
std::string fullPath() const
Definition: FileInPath.cc:197
double linearLSB_QIE11Overlap_
void HcalTPGCoderULUT::dbRecordCallback ( const HcalDbRecord theRec)

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

153  {
154  edm::ESHandle<HcalDbService> conditions;
155  theRec.get(conditions);
157  theRec.getRecord<HcalRecNumberingRecord>().get(htopo);
158  const HcalTopology* topo=&(*htopo);
159 
161  theRec.getRecord<HcalTimeSlewRecord>().get("HBHE", delay);
162 
163  buildCoder(topo, delay);
164 
165  theCoder_->update(*conditions);
166 
167  // Temporary update for FG Lut
168  // Will be moved to DB
169  if (read_FGLut_) theCoder_->update(fgfile_.fullPath().c_str(),true);
170 }
HcaluLUTTPGCoder * theCoder_
void update(const HcalDbService &conditions)
void get(HolderT &iHolder) const
edm::FileInPath fgfile_
std::string fullPath() const
Definition: FileInPath.cc:197
void buildCoder(const HcalTopology *, const edm::ESHandle< HcalTimeSlew > &)
HcalTPGCoderULUT::ReturnType HcalTPGCoderULUT::produce ( const HcalTPGRecord iRecord)

Definition at line 136 of file HcalTPGCoderULUT.cc.

References buildCoder(), coder_, edm::eventsetup::EventSetupRecord::get(), edm::eventsetup::DependentRecordImplementation< RecordT, ListT >::getRecord(), read_Ascii_, read_XML_, and theCoder_.

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

137 {
138  if (theCoder_==nullptr || (read_Ascii_ || read_XML_)) {// !(read_Ascii_ || read_XML_) goes via dbRecordCallback
140  iRecord.getRecord<HcalRecNumberingRecord>().get(htopo);
141  const HcalTopology* topo=&(*htopo);
142 
144  iRecord.getRecord<HcalDbRecord>().getRecord<HcalTimeSlewRecord>().get("HBHE", delay);
145 
146  buildCoder(topo, delay);
147  }
148 
149 
150  return coder_;
151 }
HcaluLUTTPGCoder * theCoder_
void get(HolderT &iHolder) const
void buildCoder(const HcalTopology *, const edm::ESHandle< HcalTimeSlew > &)

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 57 of file HcalTPGCoderULUT.cc.

Referenced by buildCoder(), and HcalTPGCoderULUT().

edm::FileInPath HcalTPGCoderULUT::fgfile_
private

Definition at line 58 of file HcalTPGCoderULUT.cc.

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

edm::FileInPath HcalTPGCoderULUT::ifilename_
private

Definition at line 58 of file HcalTPGCoderULUT.cc.

Referenced by buildCoder(), and HcalTPGCoderULUT().

double HcalTPGCoderULUT::linearLSB_QIE11_
private

Definition at line 55 of file HcalTPGCoderULUT.cc.

Referenced by buildCoder(), and HcalTPGCoderULUT().

double HcalTPGCoderULUT::linearLSB_QIE11Overlap_
private

Definition at line 55 of file HcalTPGCoderULUT.cc.

Referenced by buildCoder(), and HcalTPGCoderULUT().

double HcalTPGCoderULUT::linearLSB_QIE8_
private

Definition at line 55 of file HcalTPGCoderULUT.cc.

Referenced by buildCoder(), and HcalTPGCoderULUT().

bool HcalTPGCoderULUT::linearLUTs_
private

Definition at line 54 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 56 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(), HcalTPGCoderULUT(), and produce().

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(), HcalTPGCoderULUT(), and produce().

HcaluLUTTPGCoder* HcalTPGCoderULUT::theCoder_
private

Definition at line 53 of file HcalTPGCoderULUT.cc.

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