CMS 3D CMS Logo

List of all members | Public Types | Public Member Functions | Private Attributes
CaloTPGTranscoderULUTs Class Reference
Inheritance diagram for CaloTPGTranscoderULUTs:
edm::ESProducer edm::ESProductResolverFactoryProducer edm::eventsetup::ESProductResolverProvider

Public Types

typedef std::unique_ptr< CaloTPGTranscoderReturnType
 

Public Member Functions

 CaloTPGTranscoderULUTs (const edm::ParameterSet &)
 
ReturnType produce (const CaloTPGRecord &)
 
 ~CaloTPGTranscoderULUTs () override
 
- Public Member Functions inherited from edm::ESProducer
 ESProducer ()
 
 ESProducer (const ESProducer &)=delete
 
 ESProducer (ESProducer &&)=delete
 
ESResolverIndex 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< ESResolverIndex > > updateFromMayConsumes (unsigned int iIndex, const Record &iRecord) const
 
void updateLookup (eventsetup::ESRecordsToProductResolverIndices const &) final
 
 ~ESProducer () noexcept(false) override
 
- Public Member Functions inherited from edm::ESProductResolverFactoryProducer
 ESProductResolverFactoryProducer ()
 
 ESProductResolverFactoryProducer (const ESProductResolverFactoryProducer &)=delete
 
const ESProductResolverFactoryProduceroperator= (const ESProductResolverFactoryProducer &)=delete
 
 ~ESProductResolverFactoryProducer () noexcept(false) override
 
- Public Member Functions inherited from edm::eventsetup::ESProductResolverProvider
void createKeyedResolvers (EventSetupRecordKey const &key, unsigned int nConcurrentIOVs)
 
const ComponentDescriptiondescription () const
 
 ESProductResolverProvider ()
 
 ESProductResolverProvider (const ESProductResolverProvider &)=delete
 
void fillRecordsNotAllowingConcurrentIOVs (std::set< EventSetupRecordKey > &recordsNotAllowingConcurrentIOVs) const
 
virtual void initConcurrentIOVs (EventSetupRecordKey const &key, unsigned int nConcurrentIOVs)
 
bool isUsingRecord (const EventSetupRecordKey &key) const
 
KeyedResolverskeyedResolvers (const EventSetupRecordKey &iRecordKey, unsigned int iovIndex=0)
 
const ESProductResolverProvideroperator= (const ESProductResolverProvider &)=delete
 
void setAppendToDataLabel (const edm::ParameterSet &)
 
void setDescription (const ComponentDescription &iDescription)
 
std::set< EventSetupRecordKeyusingRecords () const
 
virtual ~ESProductResolverProvider () noexcept(false)
 

Private Attributes

const edm::FileInPath hfilename1_
 
const edm::FileInPath hfilename2_
 
const std::vector< int > ietah
 
const std::vector< int > ietal
 
const bool linearLUTs_
 
const double lsbQIE11
 
const double lsbQIE8
 
const std::vector< int > LUTfactor
 
edm::ESGetToken< HcalLutMetadata, HcalLutMetadataRcdlutMetadataToken
 
const int NCTScaleShift
 
const double nominal_gain
 
const double RCTLSB
 
const int RCTScaleShift
 
const bool read_Ascii_Compression
 
const bool read_Ascii_RCT
 
edm::ESGetToken< HcalTrigTowerGeometry, CaloGeometryRecordtheTrigTowerGeometryToken
 
edm::ESGetToken< HcalTopology, HcalRecNumberingRecordtopoToken
 
const std::vector< int > ZS
 

Additional Inherited Members

- Static Public Member Functions inherited from edm::eventsetup::ESProductResolverProvider
static void prevalidate (ConfigurationDescriptions &)
 
- Protected Types inherited from edm::ESProductResolverFactoryProducer
using EventSetupRecordKey = eventsetup::EventSetupRecordKey
 
- Protected Types inherited from edm::eventsetup::ESProductResolverProvider
using KeyedResolversVector = std::vector< std::pair< DataKey, std::shared_ptr< ESProductResolver > >>
 
- 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::ESProductResolverFactoryProducer
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::ESProductResolverFactoryBase > iFactory, const std::string &iLabel=std::string())
 
KeyedResolversVector registerResolvers (const EventSetupRecordKey &, unsigned int iovIndex) override
 
- Protected Member Functions inherited from edm::eventsetup::ESProductResolverProvider
template<class T >
void usingRecord ()
 
void usingRecordWithKey (const EventSetupRecordKey &key)
 

Detailed Description

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

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

Definition at line 43 of file CaloTPGTranscoderULUTs.cc.

Member Typedef Documentation

◆ ReturnType

Definition at line 48 of file CaloTPGTranscoderULUTs.cc.

Constructor & Destructor Documentation

◆ CaloTPGTranscoderULUTs()

CaloTPGTranscoderULUTs::CaloTPGTranscoderULUTs ( const edm::ParameterSet iConfig)

Definition at line 85 of file CaloTPGTranscoderULUTs.cc.

References gpuPixelDoublets::cc, lutMetadataToken, edm::ESProducer::setWhatProduced(), theTrigTowerGeometryToken, and topoToken.

86  : hfilename1_(iConfig.getParameter<edm::FileInPath>("hcalLUT1")),
87  hfilename2_(iConfig.getParameter<edm::FileInPath>("hcalLUT2")),
88  read_Ascii_Compression(iConfig.getParameter<bool>("read_Ascii_Compression_LUTs")),
89  read_Ascii_RCT(iConfig.getParameter<bool>("read_Ascii_RCT_LUTs")),
90  ietal(iConfig.getParameter<std::vector<int>>("ietaLowerBound")),
91  ietah(iConfig.getParameter<std::vector<int>>("ietaUpperBound")),
92  ZS(iConfig.getParameter<std::vector<int>>("ZS")),
93  LUTfactor(iConfig.getParameter<std::vector<int>>("LUTfactor")),
94  linearLUTs_(iConfig.getParameter<bool>("linearLUTs")),
95  nominal_gain(iConfig.getParameter<double>("nominal_gain")),
96  RCTLSB(iConfig.getParameter<double>("RCTLSB")),
97  NCTScaleShift(iConfig.getParameter<edm::ParameterSet>("tpScales")
99  .getParameter<int>("NCTShift")),
100  RCTScaleShift(iConfig.getParameter<edm::ParameterSet>("tpScales")
102  .getParameter<int>("RCTShift")),
103  lsbQIE8(iConfig.getParameter<edm::ParameterSet>("tpScales")
105  .getParameter<double>("LSBQIE8")),
106  lsbQIE11(iConfig.getParameter<edm::ParameterSet>("tpScales")
108  .getParameter<double>("LSBQIE11")) {
109  auto cc = setWhatProduced(this);
110  lutMetadataToken = cc.consumes();
111  theTrigTowerGeometryToken = cc.consumes();
112  topoToken = cc.consumes();
113 }
auto setWhatProduced(T *iThis, const es::Label &iLabel={})
Definition: ESProducer.h:166
T getParameter(std::string const &) const
Definition: ParameterSet.h:307
uint32_t cc[maxCellsPerHit]
Definition: gpuFishbone.h:49
edm::ESGetToken< HcalTrigTowerGeometry, CaloGeometryRecord > theTrigTowerGeometryToken
const std::vector< int > LUTfactor
const std::vector< int > ietal
const edm::FileInPath hfilename1_
const std::vector< int > ZS
const std::vector< int > ietah
edm::ESGetToken< HcalTopology, HcalRecNumberingRecord > topoToken
edm::ESGetToken< HcalLutMetadata, HcalLutMetadataRcd > lutMetadataToken
const edm::FileInPath hfilename2_

◆ ~CaloTPGTranscoderULUTs()

CaloTPGTranscoderULUTs::~CaloTPGTranscoderULUTs ( )
override

Definition at line 115 of file CaloTPGTranscoderULUTs.cc.

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

Member Function Documentation

◆ produce()

CaloTPGTranscoderULUTs::ReturnType CaloTPGTranscoderULUTs::produce ( const CaloTPGRecord iRecord)

Definition at line 125 of file CaloTPGTranscoderULUTs.cc.

References timingPdfMaker::file1, edmOneToOneComparison::file2, edm::FileInPath::fullPath(), edm::eventsetup::DependentRecordImplementation< RecordT, ListT >::get(), edm::eventsetup::DependentRecordImplementation< RecordT, ListT >::getRecord(), hfilename1_, hfilename2_, linearLUTs_, lsbQIE11, lsbQIE8, lutMetadataToken, NCTScaleShift, RCTScaleShift, read_Ascii_Compression, read_Ascii_RCT, HcalCondObjectContainerBase::setTopo(), AlCaHLTBitMon_QueryRunRegistry::string, theTrigTowerGeometryToken, and topoToken.

125  {
126  using namespace edm::es;
127  std::string file1 = "";
128  std::string file2 = "";
130  edm::LogInfo("Level1") << "Using " << hfilename1_.fullPath() << " & " << hfilename2_.fullPath()
131  << " for CaloTPGTranscoderULUTs HCAL initialization";
132  //std::unique_ptr<CaloTPGTranscoder> pTCoder(new CaloTPGTranscoderULUT(hfilename1_.fullPath(), hfilename2_.fullPath()));
133  //return pTCoder;
136  } else if (read_Ascii_RCT && !read_Ascii_Compression) {
137  edm::LogInfo("Level1") << "Using analytical compression and " << hfilename2_.fullPath()
138  << " RCT decompression for CaloTPGTranscoderULUTs HCAL initialization";
139  //std::unique_ptr<CaloTPGTranscoder> pTCoder(new CaloTPGTranscoderULUT("", hfilename2_.fullPath()));
140  //return pTCoder;
142  } else if (read_Ascii_Compression && !read_Ascii_RCT) {
143  edm::LogInfo("Level1") << "Using ASCII compression tables " << hfilename1_.fullPath()
144  << " and automatic RCT decompression for CaloTPGTranscoderULUTs HCAL initialization";
145  //std::unique_ptr<CaloTPGTranscoder> pTCoder(new CaloTPGTranscoderULUT(hfilename1_.fullPath(),""));
146  //return pTCoder;
148  } else {
149  edm::LogInfo("Level1")
150  << "Using analytical compression and RCT decompression for CaloTPGTranscoderULUTs HCAL initialization";
151  //std::unique_ptr<CaloTPGTranscoder> pTCoder(new CaloTPGTranscoderULUT());
152  //return pTCoder;
153  }
154  //std::unique_ptr<CaloTPGTranscoder> pTCoder(new CaloTPGTranscoderULUT(ietal, ietah, ZS, LUTfactor, RCTLSB, nominal_gain, file1, file2));
155 
156  const auto& lutMetadata = iRecord.get(lutMetadataToken);
157  const auto& theTrigTowerGeometry = iRecord.get(theTrigTowerGeometryToken);
158  const auto& topo = iRecord.getRecord<HcalLutMetadataRcd>().get(topoToken);
159 
160  HcalLutMetadata fullLut{lutMetadata};
161  fullLut.setTopo(&topo);
162 
163  auto pTCoder = std::make_unique<CaloTPGTranscoderULUT>(file1, file2);
164  pTCoder->setup(fullLut, theTrigTowerGeometry, NCTScaleShift, RCTScaleShift, lsbQIE8, lsbQIE11, linearLUTs_);
165  return pTCoder;
166 }
std::string fullPath() const
Definition: FileInPath.cc:161
edm::ESGetToken< HcalTrigTowerGeometry, CaloGeometryRecord > theTrigTowerGeometryToken
const edm::FileInPath hfilename1_
Log< level::Info, false > LogInfo
ProductT const & get(ESGetToken< ProductT, DepRecordT > const &iToken) const
edm::ESGetToken< HcalTopology, HcalRecNumberingRecord > topoToken
edm::ESGetToken< HcalLutMetadata, HcalLutMetadataRcd > lutMetadataToken
void setTopo(const HcalTopology *topo)
const edm::FileInPath hfilename2_

Member Data Documentation

◆ hfilename1_

const edm::FileInPath CaloTPGTranscoderULUTs::hfilename1_
private

Definition at line 54 of file CaloTPGTranscoderULUTs.cc.

Referenced by produce().

◆ hfilename2_

const edm::FileInPath CaloTPGTranscoderULUTs::hfilename2_
private

Definition at line 55 of file CaloTPGTranscoderULUTs.cc.

Referenced by produce().

◆ ietah

const std::vector<int> CaloTPGTranscoderULUTs::ietah
private

Definition at line 59 of file CaloTPGTranscoderULUTs.cc.

◆ ietal

const std::vector<int> CaloTPGTranscoderULUTs::ietal
private

Definition at line 58 of file CaloTPGTranscoderULUTs.cc.

◆ linearLUTs_

const bool CaloTPGTranscoderULUTs::linearLUTs_
private

Definition at line 62 of file CaloTPGTranscoderULUTs.cc.

Referenced by produce().

◆ lsbQIE11

const double CaloTPGTranscoderULUTs::lsbQIE11
private

Definition at line 68 of file CaloTPGTranscoderULUTs.cc.

Referenced by produce().

◆ lsbQIE8

const double CaloTPGTranscoderULUTs::lsbQIE8
private

Definition at line 67 of file CaloTPGTranscoderULUTs.cc.

Referenced by produce().

◆ LUTfactor

const std::vector<int> CaloTPGTranscoderULUTs::LUTfactor
private

Definition at line 61 of file CaloTPGTranscoderULUTs.cc.

◆ lutMetadataToken

edm::ESGetToken<HcalLutMetadata, HcalLutMetadataRcd> CaloTPGTranscoderULUTs::lutMetadataToken
private

Definition at line 69 of file CaloTPGTranscoderULUTs.cc.

Referenced by CaloTPGTranscoderULUTs(), and produce().

◆ NCTScaleShift

const int CaloTPGTranscoderULUTs::NCTScaleShift
private

Definition at line 65 of file CaloTPGTranscoderULUTs.cc.

Referenced by produce().

◆ nominal_gain

const double CaloTPGTranscoderULUTs::nominal_gain
private

Definition at line 63 of file CaloTPGTranscoderULUTs.cc.

◆ RCTLSB

const double CaloTPGTranscoderULUTs::RCTLSB
private

Definition at line 64 of file CaloTPGTranscoderULUTs.cc.

◆ RCTScaleShift

const int CaloTPGTranscoderULUTs::RCTScaleShift
private

Definition at line 66 of file CaloTPGTranscoderULUTs.cc.

Referenced by produce().

◆ read_Ascii_Compression

const bool CaloTPGTranscoderULUTs::read_Ascii_Compression
private

Definition at line 56 of file CaloTPGTranscoderULUTs.cc.

Referenced by produce().

◆ read_Ascii_RCT

const bool CaloTPGTranscoderULUTs::read_Ascii_RCT
private

Definition at line 57 of file CaloTPGTranscoderULUTs.cc.

Referenced by produce().

◆ theTrigTowerGeometryToken

edm::ESGetToken<HcalTrigTowerGeometry, CaloGeometryRecord> CaloTPGTranscoderULUTs::theTrigTowerGeometryToken
private

Definition at line 70 of file CaloTPGTranscoderULUTs.cc.

Referenced by CaloTPGTranscoderULUTs(), and produce().

◆ topoToken

edm::ESGetToken<HcalTopology, HcalRecNumberingRecord> CaloTPGTranscoderULUTs::topoToken
private

Definition at line 71 of file CaloTPGTranscoderULUTs.cc.

Referenced by CaloTPGTranscoderULUTs(), and produce().

◆ ZS

const std::vector<int> CaloTPGTranscoderULUTs::ZS
private

Definition at line 60 of file CaloTPGTranscoderULUTs.cc.