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::ESProxyFactoryProducer edm::eventsetup::DataProxyProvider

Public Types

typedef std::unique_ptr< CaloTPGTranscoderReturnType
 
- 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

 CaloTPGTranscoderULUTs (const edm::ParameterSet &)
 
ReturnType produce (const CaloTPGRecord &)
 
 ~CaloTPGTranscoderULUTs () 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 Attributes

edm::FileInPath hfilename1_
 
edm::FileInPath hfilename2_
 
std::vector< int > ietah
 
std::vector< int > ietal
 
std::vector< int > LUTfactor
 
int NCTScaleShift
 
double nominal_gain
 
double RCTLSB
 
int RCTScaleShift
 
bool read_Ascii_Compression
 
bool read_Ascii_RCT
 
std::vector< int > ZS
 

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 44 of file CaloTPGTranscoderULUTs.cc.

Member Typedef Documentation

Definition at line 49 of file CaloTPGTranscoderULUTs.cc.

Constructor & Destructor Documentation

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

Definition at line 80 of file CaloTPGTranscoderULUTs.cc.

References edm::ParameterSet::getParameter(), ietah, ietal, LUTfactor, NCTScaleShift, nominal_gain, RCTLSB, RCTScaleShift, read_Ascii_Compression, read_Ascii_RCT, edm::ESProducer::setWhatProduced(), and ZS.

80  :
81  hfilename1_(iConfig.getParameter<edm::FileInPath>("hcalLUT1")),
82  hfilename2_(iConfig.getParameter<edm::FileInPath>("hcalLUT2"))
83 {
84  //the following line is needed to tell the framework what
85  // data is being produced
86  setWhatProduced(this);
87 
88  //now do what ever other initialization is needed
89  read_Ascii_Compression = false;
90  read_Ascii_RCT = false;
91  read_Ascii_Compression=iConfig.getParameter<bool>("read_Ascii_Compression_LUTs");
92  read_Ascii_RCT=iConfig.getParameter<bool>("read_Ascii_RCT_LUTs");
93 
94  ietal = iConfig.getParameter< std::vector<int> >("ietaLowerBound");
95  ietah = iConfig.getParameter< std::vector<int> >("ietaUpperBound");
96  ZS = iConfig.getParameter< std::vector<int> >("ZS");
97  LUTfactor = iConfig.getParameter< std::vector<int> >("LUTfactor");
98  nominal_gain = iConfig.getParameter<double>("nominal_gain");
99  RCTLSB = iConfig.getParameter<double>("RCTLSB");
100 
101  edm::ParameterSet hfSS=iConfig.getParameter<edm::ParameterSet>("HFTPScaleShift");
102  NCTScaleShift = hfSS.getParameter<int>("NCT");
103  RCTScaleShift = hfSS.getParameter<int>("RCT");
104 }
T getParameter(std::string const &) const
void setWhatProduced(T *iThis, const es::Label &iLabel=es::Label())
Definition: ESProducer.h:115
CaloTPGTranscoderULUTs::~CaloTPGTranscoderULUTs ( )
override

Definition at line 107 of file CaloTPGTranscoderULUTs.cc.

108 {
109 
110  // do anything here that needs to be done at desctruction time
111  // (e.g. close files, deallocate resources etc.)
112 
113 }

Member Function Documentation

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

Definition at line 122 of file CaloTPGTranscoderULUTs.cc.

References DEFINE_FWK_EVENTSETUP_MODULE, edmOneToOneComparison::file1, edmOneToOneComparison::file2, edm::FileInPath::fullPath(), edm::eventsetup::EventSetupRecord::get(), edm::eventsetup::DependentRecordImplementation< RecordT, ListT >::getRecord(), hfilename1_, hfilename2_, NCTScaleShift, edm::ESHandle< T >::product(), RCTScaleShift, read_Ascii_Compression, read_Ascii_RCT, and AlCaHLTBitMon_QueryRunRegistry::string.

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

123 {
124  using namespace edm::es;
125  std::string file1="";
126  std::string file2="";
128  edm::LogInfo("Level1") << "Using " << hfilename1_.fullPath() << " & " << hfilename2_.fullPath()
129  << " for CaloTPGTranscoderULUTs HCAL initialization";
130  //std::auto_ptr<CaloTPGTranscoder> pTCoder(new CaloTPGTranscoderULUT(hfilename1_.fullPath(), hfilename2_.fullPath()));
131  //return pTCoder;
132  file1 = hfilename1_.fullPath();
133  file2 = hfilename2_.fullPath();
134  } else if (read_Ascii_RCT && !read_Ascii_Compression) {
135  edm::LogInfo("Level1") << "Using analytical compression and " << hfilename2_.fullPath()
136  << " RCT decompression for CaloTPGTranscoderULUTs HCAL initialization";
137  //std::auto_ptr<CaloTPGTranscoder> pTCoder(new CaloTPGTranscoderULUT("", hfilename2_.fullPath()));
138  //return pTCoder;
139  file2 = hfilename2_.fullPath();
140  } else if (read_Ascii_Compression && !read_Ascii_RCT) {
141  edm::LogInfo("Level1") << "Using ASCII compression tables " << hfilename1_.fullPath()
142  << " and automatic RCT decompression for CaloTPGTranscoderULUTs HCAL initialization";
143  //std::auto_ptr<CaloTPGTranscoder> pTCoder(new CaloTPGTranscoderULUT(hfilename1_.fullPath(),""));
144  //return pTCoder;
145  file1 = hfilename1_.fullPath();
146  } else {
147  edm::LogInfo("Level1") << "Using analytical compression and RCT decompression for CaloTPGTranscoderULUTs HCAL initialization";
148  //std::auto_ptr<CaloTPGTranscoder> pTCoder(new CaloTPGTranscoderULUT());
149  //return pTCoder;
150  }
151  //std::auto_ptr<CaloTPGTranscoder> pTCoder(new CaloTPGTranscoderULUT(ietal, ietah, ZS, LUTfactor, RCTLSB, nominal_gain, file1, file2));
152 
153  edm::ESHandle<HcalLutMetadata> lutMetadata;
154  iRecord.getRecord<HcalLutMetadataRcd>().get(lutMetadata);
155  edm::ESHandle<HcalTrigTowerGeometry> theTrigTowerGeometry;
156  iRecord.getRecord<CaloGeometryRecord>().get(theTrigTowerGeometry);
157 
159  iRecord.getRecord<HcalLutMetadataRcd>().getRecord<HcalRecNumberingRecord>().get(htopo);
160 
161  HcalLutMetadata fullLut{ *lutMetadata };
162  fullLut.setTopo(htopo.product());
163 
164  std::auto_ptr<CaloTPGTranscoderULUT> pTCoder(new CaloTPGTranscoderULUT(file1, file2));
165  pTCoder->setup(fullLut, *theTrigTowerGeometry, NCTScaleShift, RCTScaleShift);
166  return std::auto_ptr<CaloTPGTranscoder>( pTCoder );
167 }
void get(HolderT &iHolder) const
std::string fullPath() const
Definition: FileInPath.cc:184
T const * product() const
Definition: ESHandle.h:86

Member Data Documentation

edm::FileInPath CaloTPGTranscoderULUTs::hfilename1_
private

Definition at line 55 of file CaloTPGTranscoderULUTs.cc.

Referenced by produce().

edm::FileInPath CaloTPGTranscoderULUTs::hfilename2_
private

Definition at line 56 of file CaloTPGTranscoderULUTs.cc.

Referenced by produce().

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

Definition at line 60 of file CaloTPGTranscoderULUTs.cc.

Referenced by CaloTPGTranscoderULUTs().

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

Definition at line 59 of file CaloTPGTranscoderULUTs.cc.

Referenced by CaloTPGTranscoderULUTs().

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

Definition at line 62 of file CaloTPGTranscoderULUTs.cc.

Referenced by CaloTPGTranscoderULUTs().

int CaloTPGTranscoderULUTs::NCTScaleShift
private

Definition at line 65 of file CaloTPGTranscoderULUTs.cc.

Referenced by CaloTPGTranscoderULUTs(), and produce().

double CaloTPGTranscoderULUTs::nominal_gain
private

Definition at line 63 of file CaloTPGTranscoderULUTs.cc.

Referenced by CaloTPGTranscoderULUTs().

double CaloTPGTranscoderULUTs::RCTLSB
private

Definition at line 64 of file CaloTPGTranscoderULUTs.cc.

Referenced by CaloTPGTranscoderULUTs().

int CaloTPGTranscoderULUTs::RCTScaleShift
private

Definition at line 66 of file CaloTPGTranscoderULUTs.cc.

Referenced by CaloTPGTranscoderULUTs(), and produce().

bool CaloTPGTranscoderULUTs::read_Ascii_Compression
private

Definition at line 57 of file CaloTPGTranscoderULUTs.cc.

Referenced by CaloTPGTranscoderULUTs(), and produce().

bool CaloTPGTranscoderULUTs::read_Ascii_RCT
private

Definition at line 58 of file CaloTPGTranscoderULUTs.cc.

Referenced by CaloTPGTranscoderULUTs(), and produce().

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

Definition at line 61 of file CaloTPGTranscoderULUTs.cc.

Referenced by CaloTPGTranscoderULUTs().