CMS 3D CMS Logo

List of all members | Public Types | Public Member Functions | Private Types | 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 Member Functions

 HcalTPGCoderULUT (const edm::ParameterSet &)
 
ReturnType produce (const HcalTPGRecord &)
 
 ~HcalTPGCoderULUT () override
 
- Public Member Functions inherited from edm::ESProducer
 ESProducer ()
 
 ESProducer (const ESProducer &)=delete
 
 ESProducer (ESProducer &&)=delete
 
ESProxyIndex const * getTokenIndices (unsigned int iIndex) const
 
ESRecordIndex const * getTokenRecordIndices (unsigned int iIndex) const
 
bool hasMayConsumes () const noexcept
 
size_t numberOfTokenIndices (unsigned int iIndex) const
 
ESProduceroperator= (const ESProducer &)=delete
 
ESProduceroperator= (ESProducer &&)=delete
 
SerialTaskQueueChainqueue ()
 
template<typename Record >
std::optional< std::vector< ESProxyIndex > > updateFromMayConsumes (unsigned int iIndex, const Record &iRecord) const
 
void updateLookup (eventsetup::ESRecordsToProxyIndices const &) final
 
 ~ESProducer () noexcept(false) override
 
- Public Member Functions inherited from edm::ESProxyFactoryProducer
 ESProxyFactoryProducer ()
 
 ESProxyFactoryProducer (const ESProxyFactoryProducer &)=delete
 
const ESProxyFactoryProduceroperator= (const ESProxyFactoryProducer &)=delete
 
 ~ESProxyFactoryProducer () noexcept(false) override
 
- Public Member Functions inherited from edm::eventsetup::DataProxyProvider
void createKeyedProxies (EventSetupRecordKey const &key, unsigned int nConcurrentIOVs)
 
 DataProxyProvider ()
 
 DataProxyProvider (const DataProxyProvider &)=delete
 
const ComponentDescriptiondescription () const
 
void fillRecordsNotAllowingConcurrentIOVs (std::set< EventSetupRecordKey > &recordsNotAllowingConcurrentIOVs) const
 
virtual void initConcurrentIOVs (EventSetupRecordKey const &key, unsigned int nConcurrentIOVs)
 
bool isUsingRecord (const EventSetupRecordKey &key) const
 
KeyedProxieskeyedProxies (const EventSetupRecordKey &iRecordKey, unsigned int iovIndex=0)
 
const DataProxyProvideroperator= (const DataProxyProvider &)=delete
 
void setAppendToDataLabel (const edm::ParameterSet &)
 
void setDescription (const ComponentDescription &iDescription)
 
std::set< EventSetupRecordKeyusingRecords () const
 
virtual ~DataProxyProvider () noexcept(false)
 

Private Types

using HostType = edm::ESProductHost< HcaluLUTTPGCoder, HcalDbRecord >
 

Private Member Functions

void buildCoder (const HcalTopology *, const HcalTimeSlew *, HcaluLUTTPGCoder *)
 

Private Attributes

bool applyFixPCC_
 
bool contain1TSHB_
 
bool contain1TSHE_
 
double containPhaseNSHB_
 
double containPhaseNSHE_
 
edm::ESGetToken< HcalTimeSlew, HcalTimeSlewRecorddelayToken_
 
std::vector< uint32_t > FG_HF_thresholds_
 
edm::FileInPath fgfile_
 
edm::ReusableObjectHolder< HostTypeholder_
 
edm::FileInPath ifilename_
 
double linearLSB_QIE11_
 
double linearLSB_QIE11Overlap_
 
double linearLSB_QIE8_
 
bool linearLUTs_
 
bool LUTGenerationMode_
 
int maskBit_
 
bool overrideDBweightsAndFilterHB_
 
bool overrideDBweightsAndFilterHE_
 
bool read_Ascii_
 
bool read_FGLut_
 
bool read_XML_
 
edm::ESGetToken< HcalDbService, HcalDbRecordserviceToken_
 
edm::ESGetToken< HcalTopology, HcalRecNumberingRecordtopoToken_
 

Additional Inherited Members

- Static Public Member Functions inherited from edm::eventsetup::DataProxyProvider
static void prevalidate (ConfigurationDescriptions &)
 
- Protected Types inherited from edm::ESProxyFactoryProducer
using EventSetupRecordKey = eventsetup::EventSetupRecordKey
 
- Protected Types inherited from edm::eventsetup::DataProxyProvider
using KeyedProxiesVector = std::vector< std::pair< DataKey, std::shared_ptr< DataProxy > >>
 
- Protected Member Functions inherited from edm::ESProducer
ESConsumesInfoconsumesInfoPushBackNew ()
 
unsigned int consumesInfoSize () const
 
template<typename CallbackT , typename TList , typename TRecord >
void registerProducts (std::shared_ptr< std::pair< unsigned int, std::shared_ptr< CallbackT >>> iCallback, const TList *, const TRecord *iRecord, const es::Label &iLabel)
 
template<typename CallbackT , typename TRecord >
void registerProducts (std::shared_ptr< std::pair< unsigned int, std::shared_ptr< CallbackT >>>, const eventsetup::produce::Null *, const TRecord *, const es::Label &)
 
template<typename T >
auto setWhatProduced (T *iThis, const es::Label &iLabel={})
 
template<typename T >
auto setWhatProduced (T *iThis, const char *iLabel)
 
template<typename T >
auto setWhatProduced (T *iThis, const std::string &iLabel)
 
template<typename T , typename TDecorator >
auto setWhatProduced (T *iThis, const TDecorator &iDec, const es::Label &iLabel={})
 
template<typename T , typename TReturn , typename TRecord >
auto setWhatProduced (T *iThis, TReturn(T::*iMethod)(const TRecord &), const es::Label &iLabel={})
 
template<typename T , typename TReturn , typename TRecord , typename TDecorator >
auto setWhatProduced (T *iThis, TReturn(T ::*iMethod)(const TRecord &), const TDecorator &iDec, const es::Label &iLabel={})
 
template<typename TFunc >
auto setWhatProduced (TFunc &&func, const es::Label &iLabel={})
 
template<typename TReturn , typename TRecord , typename TFunc , typename TDecorator >
ESConsumesCollectorT< TRecord > setWhatProduced (TFunc &&func, TDecorator &&iDec, const es::Label &iLabel={})
 
void usesResources (std::vector< std::string > const &)
 
- 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 EventSetupRecordKey &iRecord, std::unique_ptr< eventsetup::ProxyFactoryBase > iFactory, const std::string &iLabel=std::string())
 
KeyedProxiesVector registerProxies (const EventSetupRecordKey &, unsigned int iovIndex) override
 
- Protected Member Functions inherited from edm::eventsetup::DataProxyProvider
template<class T >
void usingRecord ()
 
void usingRecordWithKey (const EventSetupRecordKey &key)
 

Detailed Description

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

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

Definition at line 40 of file HcalTPGCoderULUT.cc.

Member Typedef Documentation

◆ HostType

Definition at line 50 of file HcalTPGCoderULUT.cc.

◆ ReturnType

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

Definition at line 45 of file HcalTPGCoderULUT.cc.

Constructor & Destructor Documentation

◆ HcalTPGCoderULUT()

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

Definition at line 81 of file HcalTPGCoderULUT.cc.

References applyFixPCC_, gpuPixelDoublets::cc, contain1TSHB_, contain1TSHE_, containPhaseNSHB_, containPhaseNSHE_, delayToken_, FG_HF_thresholds_, fgfile_, edm::ParameterSet::getParameter(), ifilename_, linearLSB_QIE11_, linearLSB_QIE11Overlap_, linearLSB_QIE8_, linearLUTs_, LUTGenerationMode_, maskBit_, overrideDBweightsAndFilterHB_, overrideDBweightsAndFilterHE_, read_Ascii_, read_FGLut_, read_XML_, serviceToken_, edm::ESProducer::setWhatProduced(), and topoToken_.

81  {
82  read_Ascii_ = iConfig.getParameter<bool>("read_Ascii_LUTs");
83  read_XML_ = iConfig.getParameter<bool>("read_XML_LUTs");
84  read_FGLut_ = iConfig.getParameter<bool>("read_FG_LUTs");
85  fgfile_ = iConfig.getParameter<edm::FileInPath>("FGLUTs");
86  contain1TSHB_ = iConfig.getParameter<bool>("contain1TSHB");
87  contain1TSHE_ = iConfig.getParameter<bool>("contain1TSHE");
88  containPhaseNSHB_ = iConfig.getParameter<double>("containPhaseNSHB");
89  containPhaseNSHE_ = iConfig.getParameter<double>("containPhaseNSHE");
90  overrideDBweightsAndFilterHB_ = iConfig.getParameter<bool>("overrideDBweightsAndFilterHB");
91  overrideDBweightsAndFilterHE_ = iConfig.getParameter<bool>("overrideDBweightsAndFilterHE");
92  applyFixPCC_ = iConfig.getParameter<bool>("applyFixPCC");
93 
94  //the following line is needed to tell the framework what
95  // data is being produced
96  auto cc = setWhatProduced(this);
97  topoToken_ = cc.consumes();
98  delayToken_ = cc.consumes(edm::ESInputTag{"", "HBHE"});
99 
100  if (!(read_Ascii_ || read_XML_)) {
101  LUTGenerationMode_ = iConfig.getParameter<bool>("LUTGenerationMode");
102  linearLUTs_ = iConfig.getParameter<bool>("linearLUTs");
103  auto scales = iConfig.getParameter<edm::ParameterSet>("tpScales").getParameter<edm::ParameterSet>("HBHE");
104  linearLSB_QIE8_ = scales.getParameter<double>("LSBQIE8");
105  linearLSB_QIE11_ = scales.getParameter<double>("LSBQIE11");
106  linearLSB_QIE11Overlap_ = scales.getParameter<double>("LSBQIE11Overlap");
107  maskBit_ = iConfig.getParameter<int>("MaskBit");
108  FG_HF_thresholds_ = iConfig.getParameter<std::vector<uint32_t> >("FG_HF_thresholds");
109  serviceToken_ = cc.consumes();
110  } else {
111  ifilename_ = iConfig.getParameter<edm::FileInPath>("inputLUTs");
112  }
113 }
auto setWhatProduced(T *iThis, const es::Label &iLabel={})
Definition: ESProducer.h:165
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
edm::ESGetToken< HcalTimeSlew, HcalTimeSlewRecord > delayToken_
uint32_t cc[maxCellsPerHit]
Definition: gpuFishbone.h:49
edm::FileInPath ifilename_
bool overrideDBweightsAndFilterHE_
bool overrideDBweightsAndFilterHB_
std::vector< uint32_t > FG_HF_thresholds_
edm::ESGetToken< HcalTopology, HcalRecNumberingRecord > topoToken_
edm::FileInPath fgfile_
edm::ESGetToken< HcalDbService, HcalDbRecord > serviceToken_
double linearLSB_QIE11Overlap_

◆ ~HcalTPGCoderULUT()

HcalTPGCoderULUT::~HcalTPGCoderULUT ( )
override

Definition at line 149 of file HcalTPGCoderULUT.cc.

149  {
150  // do anything here that needs to be done at desctruction time
151  // (e.g. close files, deallocate resources etc.)
152 }

Member Function Documentation

◆ buildCoder()

void HcalTPGCoderULUT::buildCoder ( const HcalTopology topo,
const HcalTimeSlew delay,
HcaluLUTTPGCoder theCoder 
)
private

Definition at line 115 of file HcalTPGCoderULUT.cc.

References applyFixPCC_, contain1TSHB_, contain1TSHE_, containPhaseNSHB_, containPhaseNSHE_, phase2TrackerDigitizer_cfi::delay, FG_HF_thresholds_, fgfile_, edm::FileInPath::fullPath(), ifilename_, HcaluLUTTPGCoder::init(), linearLSB_QIE11_, linearLSB_QIE11Overlap_, linearLSB_QIE8_, linearLUTs_, LUTGenerationMode_, maskBit_, overrideDBweightsAndFilterHB_, overrideDBweightsAndFilterHE_, read_Ascii_, read_FGLut_, read_XML_, HcaluLUTTPGCoder::set1TSContainHB(), HcaluLUTTPGCoder::set1TSContainHE(), HcaluLUTTPGCoder::setAllLinear(), HcaluLUTTPGCoder::setApplyFixPCC(), HcaluLUTTPGCoder::setContainPhaseHB(), HcaluLUTTPGCoder::setContainPhaseHE(), HcaluLUTTPGCoder::setFGHFthresholds(), HcaluLUTTPGCoder::setLUTGenerationMode(), HcaluLUTTPGCoder::setMaskBit(), HcaluLUTTPGCoder::setOverrideDBweightsAndFilterHB(), HcaluLUTTPGCoder::setOverrideDBweightsAndFilterHE(), HcaluLUTTPGCoder::update(), and HcaluLUTTPGCoder::updateXML().

Referenced by produce().

115  {
116  using namespace edm::es;
117  theCoder->init(topo, delay);
118 
121 
122  theCoder->set1TSContainHB(contain1TSHB_);
123  theCoder->set1TSContainHE(contain1TSHE_);
124 
127 
128  theCoder->setApplyFixPCC(applyFixPCC_);
129 
130  if (read_Ascii_ || read_XML_) {
131  edm::LogInfo("HCAL") << "Using ASCII/XML LUTs" << ifilename_.fullPath() << " for HcalTPGCoderULUT initialization";
132  if (read_Ascii_) {
133  theCoder->update(ifilename_.fullPath().c_str());
134  } else if (read_XML_) {
135  theCoder->updateXML(ifilename_.fullPath().c_str());
136  }
137  // Read FG LUT and append to most significant bit 11
138  if (read_FGLut_) {
139  theCoder->update(fgfile_.fullPath().c_str(), true);
140  }
141  } else {
144  theCoder->setMaskBit(maskBit_);
146  }
147 }
std::string fullPath() const
Definition: FileInPath.cc:161
edm::FileInPath ifilename_
void setOverrideDBweightsAndFilterHE(bool overrideDBweightsAndFilterHE)
void init(const HcalTopology *top, const HcalTimeSlew *delay)
void update(const HcalDbService &conditions)
bool overrideDBweightsAndFilterHE_
void updateXML(const char *filename)
void setLUTGenerationMode(bool gen)
void setApplyFixPCC(double applyFixPCC)
void setContainPhaseHE(double containPhaseNSHE)
bool overrideDBweightsAndFilterHB_
Log< level::Info, false > LogInfo
std::vector< uint32_t > FG_HF_thresholds_
void setMaskBit(int bit)
void setContainPhaseHB(double containPhaseNSHB)
void setAllLinear(bool linear, double lsb8, double lsb11, double lsb11overlap)
edm::FileInPath fgfile_
void set1TSContainHB(bool contain1TSHB)
void setFGHFthresholds(const std::vector< uint32_t > &fgthresholds)
void set1TSContainHE(bool contain1TSHE)
void setOverrideDBweightsAndFilterHB(bool overrideDBweightsAndFilterHB)
double linearLSB_QIE11Overlap_

◆ produce()

HcalTPGCoderULUT::ReturnType HcalTPGCoderULUT::produce ( const HcalTPGRecord iRecord)

Definition at line 159 of file HcalTPGCoderULUT.cc.

References buildCoder(), phase2TrackerDigitizer_cfi::delay, delayToken_, fgfile_, edm::FileInPath::fullPath(), edm::eventsetup::DependentRecordImplementation< RecordT, ListT >::get(), edm::eventsetup::DependentRecordImplementation< RecordT, ListT >::getRecord(), h, holder_, query::host, edm::ReusableObjectHolder< T, Deleter >::makeOrGet(), read_Ascii_, read_FGLut_, read_XML_, serviceToken_, and topoToken_.

159  {
160  auto host = holder_.makeOrGet([]() { return new HostType; });
161 
162  const auto& topo = iRecord.get(topoToken_);
163  const auto& delay = iRecord.getRecord<HcalDbRecord>().get(delayToken_);
164  if (read_Ascii_ || read_XML_) {
165  buildCoder(&topo, &delay, host.get());
166  } else {
167  host->ifRecordChanges<HcalDbRecord>(iRecord, [this, &topo, &delay, h = host.get()](auto const& rec) {
168  buildCoder(&topo, &delay, h);
169  h->update(rec.get(serviceToken_));
170  // Temporary update for FG Lut
171  // Will be moved to DB
172  if (read_FGLut_)
173  h->update(fgfile_.fullPath().c_str(), true);
174  });
175  }
176  return host;
177 }
string host
Definition: query.py:115
std::string fullPath() const
Definition: FileInPath.cc:161
edm::ESGetToken< HcalTimeSlew, HcalTimeSlewRecord > delayToken_
edm::ReusableObjectHolder< HostType > holder_
std::shared_ptr< T > makeOrGet(FM &&iMakeFunc)
Takes an object from the queue if one is available, or creates one using iMakeFunc.
edm::ESProductHost< HcaluLUTTPGCoder, HcalDbRecord > HostType
edm::ESGetToken< HcalTopology, HcalRecNumberingRecord > topoToken_
edm::FileInPath fgfile_
void buildCoder(const HcalTopology *, const HcalTimeSlew *, HcaluLUTTPGCoder *)
The Signals That Services Can Subscribe To This is based on ActivityRegistry h
Helper function to determine trigger accepts.
Definition: Activities.doc:4
ProductT const & get(ESGetToken< ProductT, DepRecordT > const &iToken) const
edm::ESGetToken< HcalDbService, HcalDbRecord > serviceToken_

Member Data Documentation

◆ applyFixPCC_

bool HcalTPGCoderULUT::applyFixPCC_
private

Definition at line 62 of file HcalTPGCoderULUT.cc.

Referenced by buildCoder(), and HcalTPGCoderULUT().

◆ contain1TSHB_

bool HcalTPGCoderULUT::contain1TSHB_
private

Definition at line 60 of file HcalTPGCoderULUT.cc.

Referenced by buildCoder(), and HcalTPGCoderULUT().

◆ contain1TSHE_

bool HcalTPGCoderULUT::contain1TSHE_
private

Definition at line 60 of file HcalTPGCoderULUT.cc.

Referenced by buildCoder(), and HcalTPGCoderULUT().

◆ containPhaseNSHB_

double HcalTPGCoderULUT::containPhaseNSHB_
private

Definition at line 61 of file HcalTPGCoderULUT.cc.

Referenced by buildCoder(), and HcalTPGCoderULUT().

◆ containPhaseNSHE_

double HcalTPGCoderULUT::containPhaseNSHE_
private

Definition at line 61 of file HcalTPGCoderULUT.cc.

Referenced by buildCoder(), and HcalTPGCoderULUT().

◆ delayToken_

edm::ESGetToken<HcalTimeSlew, HcalTimeSlewRecord> HcalTPGCoderULUT::delayToken_
private

Definition at line 57 of file HcalTPGCoderULUT.cc.

Referenced by HcalTPGCoderULUT(), and produce().

◆ FG_HF_thresholds_

std::vector<uint32_t> HcalTPGCoderULUT::FG_HF_thresholds_
private

Definition at line 66 of file HcalTPGCoderULUT.cc.

Referenced by buildCoder(), and HcalTPGCoderULUT().

◆ fgfile_

edm::FileInPath HcalTPGCoderULUT::fgfile_
private

Definition at line 67 of file HcalTPGCoderULUT.cc.

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

◆ holder_

edm::ReusableObjectHolder<HostType> HcalTPGCoderULUT::holder_
private

Definition at line 55 of file HcalTPGCoderULUT.cc.

Referenced by produce().

◆ ifilename_

edm::FileInPath HcalTPGCoderULUT::ifilename_
private

Definition at line 67 of file HcalTPGCoderULUT.cc.

Referenced by buildCoder(), and HcalTPGCoderULUT().

◆ linearLSB_QIE11_

double HcalTPGCoderULUT::linearLSB_QIE11_
private

Definition at line 64 of file HcalTPGCoderULUT.cc.

Referenced by buildCoder(), and HcalTPGCoderULUT().

◆ linearLSB_QIE11Overlap_

double HcalTPGCoderULUT::linearLSB_QIE11Overlap_
private

Definition at line 64 of file HcalTPGCoderULUT.cc.

Referenced by buildCoder(), and HcalTPGCoderULUT().

◆ linearLSB_QIE8_

double HcalTPGCoderULUT::linearLSB_QIE8_
private

Definition at line 64 of file HcalTPGCoderULUT.cc.

Referenced by buildCoder(), and HcalTPGCoderULUT().

◆ linearLUTs_

bool HcalTPGCoderULUT::linearLUTs_
private

Definition at line 59 of file HcalTPGCoderULUT.cc.

Referenced by buildCoder(), and HcalTPGCoderULUT().

◆ LUTGenerationMode_

bool HcalTPGCoderULUT::LUTGenerationMode_
private

Definition at line 59 of file HcalTPGCoderULUT.cc.

Referenced by buildCoder(), and HcalTPGCoderULUT().

◆ maskBit_

int HcalTPGCoderULUT::maskBit_
private

Definition at line 65 of file HcalTPGCoderULUT.cc.

Referenced by buildCoder(), and HcalTPGCoderULUT().

◆ overrideDBweightsAndFilterHB_

bool HcalTPGCoderULUT::overrideDBweightsAndFilterHB_
private

Definition at line 63 of file HcalTPGCoderULUT.cc.

Referenced by buildCoder(), and HcalTPGCoderULUT().

◆ overrideDBweightsAndFilterHE_

bool HcalTPGCoderULUT::overrideDBweightsAndFilterHE_
private

Definition at line 63 of file HcalTPGCoderULUT.cc.

Referenced by buildCoder(), and HcalTPGCoderULUT().

◆ read_Ascii_

bool HcalTPGCoderULUT::read_Ascii_
private

Definition at line 59 of file HcalTPGCoderULUT.cc.

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

◆ read_FGLut_

bool HcalTPGCoderULUT::read_FGLut_
private

Definition at line 59 of file HcalTPGCoderULUT.cc.

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

◆ read_XML_

bool HcalTPGCoderULUT::read_XML_
private

Definition at line 59 of file HcalTPGCoderULUT.cc.

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

◆ serviceToken_

edm::ESGetToken<HcalDbService, HcalDbRecord> HcalTPGCoderULUT::serviceToken_
private

Definition at line 58 of file HcalTPGCoderULUT.cc.

Referenced by HcalTPGCoderULUT(), and produce().

◆ topoToken_

edm::ESGetToken<HcalTopology, HcalRecNumberingRecord> HcalTPGCoderULUT::topoToken_
private

Definition at line 56 of file HcalTPGCoderULUT.cc.

Referenced by HcalTPGCoderULUT(), and produce().