CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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 boost::shared_ptr
< HcalTPGCoder
ReturnType
 
- Public Types inherited from edm::eventsetup::DataProxyProvider
typedef std::vector< std::pair
< DataKey, boost::shared_ptr
< DataProxy > > > 
KeyedProxies
 
typedef std::vector
< EventSetupRecordKey
Keys
 
typedef std::map
< EventSetupRecordKey,
KeyedProxies
RecordProxies
 

Public Member Functions

void dbRecordCallback (const HcalDbRecord &)
 
 HcalTPGCoderULUT (const edm::ParameterSet &)
 
ReturnType produce (const HcalTPGRecord &)
 
 ~HcalTPGCoderULUT ()
 
- Public Member Functions inherited from edm::ESProducer
 ESProducer ()
 
virtual ~ESProducer ()
 
- Public Member Functions inherited from edm::ESProxyFactoryProducer
 ESProxyFactoryProducer ()
 
virtual void newInterval (const eventsetup::EventSetupRecordKey &iRecordType, const ValidityInterval &iInterval)
 overrides DataProxyProvider method More...
 
virtual ~ESProxyFactoryProducer ()
 
- 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 ()
 

Private Member Functions

void buildCoder (const HcalTopology *)
 

Private Attributes

ReturnType coder_
 
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::auto_ptr< TFactory > iFactory, const std::string &iLabel=std::string())
 
virtual void registerFactoryWithKey (const eventsetup::EventSetupRecordKey &iRecord, std::auto_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 42 of file HcalTPGCoderULUT.cc.

Member Typedef Documentation

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

Definition at line 47 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(), fgfile_, edm::ParameterSet::getParameter(), ifilename_, 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  maskBit_ = iConfig.getParameter<int>("MaskBit");
84  } else {
85  ifilename_=iConfig.getParameter<edm::FileInPath>("inputLUTs");
86  setWhatProduced(this);
87  }
88 
89  theCoder_=0;
90 }
T getParameter(std::string const &) const
depends_on::OneHolder< T, TDependsOnRecord > dependsOn(void(T::*iT)(const TDependsOnRecord &))
void dbRecordCallback(const HcalDbRecord &)
edm::FileInPath ifilename_
HcaluLUTTPGCoder * theCoder_
void setWhatProduced(T *iThis, const es::Label &iLabel=es::Label())
Definition: ESProducer.h:115
edm::FileInPath fgfile_
HcalTPGCoderULUT::~HcalTPGCoderULUT ( )

Definition at line 114 of file HcalTPGCoderULUT.cc.

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

Member Function Documentation

void HcalTPGCoderULUT::buildCoder ( const HcalTopology topo)
private

Definition at line 93 of file HcalTPGCoderULUT.cc.

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

Referenced by dbRecordCallback(), and produce().

93  {
94  using namespace edm::es;
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(),*topo);
100  } else if (read_XML_) theCoder_->updateXML(ifilename_.fullPath().c_str(),*topo);
101 
102  // Read FG LUT and append to most significant bit 11
103  if (read_FGLut_) {
104  theCoder_->update(fgfile_.fullPath().c_str(), *topo,true);
105  }
106  } else {
109  }
111 }
edm::FileInPath ifilename_
HcaluLUTTPGCoder * theCoder_
void update(const HcalDbService &conditions)
void setLUTGenerationMode(bool gen)
boost::shared_ptr< HcalTPGCoder > ReturnType
void updateXML(const char *filename, const HcalTopology &)
void setMaskBit(int bit)
edm::FileInPath fgfile_
std::string fullPath() const
Definition: FileInPath.cc:171
void HcalTPGCoderULUT::dbRecordCallback ( const HcalDbRecord theRec)

Definition at line 141 of file HcalTPGCoderULUT.cc.

References buildCoder(), fgfile_, edm::FileInPath::fullPath(), edm::eventsetup::EventSetupRecord::get(), read_FGLut_, theCoder_, and HcaluLUTTPGCoder::update().

Referenced by HcalTPGCoderULUT().

141  {
142  edm::ESHandle<HcalDbService> conditions;
143  theRec.get(conditions);
144  const HcalTopology* topo=conditions->getTopologyUsed();
145 
146  if (theCoder_==0) {
147  buildCoder(topo);
148  }
149 
150  theCoder_->update(*conditions);
151 
152  // Temporary update for FG Lut
153  // Will be moved to DB
154  if (read_FGLut_) theCoder_->update(fgfile_.fullPath().c_str(),*topo,true);
155 }
HcaluLUTTPGCoder * theCoder_
void update(const HcalDbService &conditions)
void get(HolderT &iHolder) const
edm::FileInPath fgfile_
std::string fullPath() const
Definition: FileInPath.cc:171
void buildCoder(const HcalTopology *)
HcalTPGCoderULUT::ReturnType HcalTPGCoderULUT::produce ( const HcalTPGRecord iRecord)

Definition at line 128 of file HcalTPGCoderULUT.cc.

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

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

129 {
130  if (theCoder_==0) {
132  iRecord.getRecord<IdealGeometryRecord>().get(htopo);
133  const HcalTopology* topo=&(*htopo);
134  buildCoder(topo);
135  }
136 
137 
138  return coder_;
139 }
HcaluLUTTPGCoder * theCoder_
void buildCoder(const HcalTopology *)

Member Data Documentation

ReturnType HcalTPGCoderULUT::coder_
private

Definition at line 54 of file HcalTPGCoderULUT.cc.

Referenced by buildCoder(), and produce().

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().

bool HcalTPGCoderULUT::LUTGenerationMode_
private

Definition at line 56 of file HcalTPGCoderULUT.cc.

Referenced by buildCoder(), and HcalTPGCoderULUT().

int HcalTPGCoderULUT::maskBit_
private

Definition at line 57 of file HcalTPGCoderULUT.cc.

Referenced by buildCoder(), and HcalTPGCoderULUT().

bool HcalTPGCoderULUT::read_Ascii_
private

Definition at line 56 of file HcalTPGCoderULUT.cc.

Referenced by buildCoder(), and HcalTPGCoderULUT().

bool HcalTPGCoderULUT::read_FGLut_
private

Definition at line 56 of file HcalTPGCoderULUT.cc.

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

bool HcalTPGCoderULUT::read_XML_
private

Definition at line 56 of file HcalTPGCoderULUT.cc.

Referenced by buildCoder(), and HcalTPGCoderULUT().

HcaluLUTTPGCoder* HcalTPGCoderULUT::theCoder_
private

Definition at line 55 of file HcalTPGCoderULUT.cc.

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