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

Member Typedef Documentation

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

Definition at line 46 of file HcalTPGCoderULUT.cc.

Constructor & Destructor Documentation

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

Definition at line 71 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_.

72 {
73  read_Ascii_ = iConfig.getParameter<bool>("read_Ascii_LUTs");
74  read_XML_ = iConfig.getParameter<bool>("read_XML_LUTs");
75  read_FGLut_ = iConfig.getParameter<bool>("read_FG_LUTs");
76  fgfile_ = iConfig.getParameter<edm::FileInPath>("FGLUTs");
77  //the following line is needed to tell the framework what
78  // data is being produced
79  if (!(read_Ascii_ || read_XML_)) {
81  LUTGenerationMode_ = iConfig.getParameter<bool>("LUTGenerationMode");
82  maskBit_ = iConfig.getParameter<int>("MaskBit");
83  } else {
84  ifilename_=iConfig.getParameter<edm::FileInPath>("inputLUTs");
85  setWhatProduced(this);
86  }
87 
88  theCoder_=0;
89 }
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 113 of file HcalTPGCoderULUT.cc.

114 {
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

void HcalTPGCoderULUT::buildCoder ( const HcalTopology topo)
private

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

92  {
93  using namespace edm::es;
95  if (read_Ascii_ || read_XML_){
96  edm::LogInfo("HCAL") << "Using ASCII/XML LUTs" << ifilename_.fullPath() << " for HcalTPGCoderULUT initialization";
97  if (read_Ascii_) {
98  theCoder_->update(ifilename_.fullPath().c_str(),*topo);
99  } else if (read_XML_) theCoder_->updateXML(ifilename_.fullPath().c_str(),*topo);
100 
101  // Read FG LUT and append to most significant bit 11
102  if (read_FGLut_) {
103  theCoder_->update(fgfile_.fullPath().c_str(), *topo,true);
104  }
105  } else {
108  }
110 }
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:165
void HcalTPGCoderULUT::dbRecordCallback ( const HcalDbRecord theRec)

Definition at line 140 of file HcalTPGCoderULUT.cc.

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

Referenced by HcalTPGCoderULUT().

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

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

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

Member Data Documentation

ReturnType HcalTPGCoderULUT::coder_
private

Definition at line 53 of file HcalTPGCoderULUT.cc.

Referenced by buildCoder(), and produce().

edm::FileInPath HcalTPGCoderULUT::fgfile_
private

Definition at line 57 of file HcalTPGCoderULUT.cc.

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

edm::FileInPath HcalTPGCoderULUT::ifilename_
private

Definition at line 57 of file HcalTPGCoderULUT.cc.

Referenced by buildCoder(), and HcalTPGCoderULUT().

bool HcalTPGCoderULUT::LUTGenerationMode_
private

Definition at line 55 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 55 of file HcalTPGCoderULUT.cc.

Referenced by buildCoder(), and HcalTPGCoderULUT().

bool HcalTPGCoderULUT::read_FGLut_
private

Definition at line 55 of file HcalTPGCoderULUT.cc.

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

bool HcalTPGCoderULUT::read_XML_
private

Definition at line 55 of file HcalTPGCoderULUT.cc.

Referenced by buildCoder(), and HcalTPGCoderULUT().

HcaluLUTTPGCoder* HcalTPGCoderULUT::theCoder_
private

Definition at line 54 of file HcalTPGCoderULUT.cc.

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