CMS 3D CMS Logo

List of all members | Public Types | Public Member Functions | Protected Member Functions | Private Attributes
SiPixelFakeTemplateDBObjectESSource Class Reference

#include <SiPixelFakeTemplateDBObjectESSource.h>

Inheritance diagram for SiPixelFakeTemplateDBObjectESSource:
edm::ESProducer edm::EventSetupRecordIntervalFinder edm::ESProxyFactoryProducer edm::eventsetup::DataProxyProvider

Public Types

typedef std::vector< std::string > vstring
 
- 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

virtual std::unique_ptr< SiPixelTemplateDBObjectproduce (const SiPixelTemplateDBObjectRcd &)
 
 SiPixelFakeTemplateDBObjectESSource (const edm::ParameterSet &)
 
 ~SiPixelFakeTemplateDBObjectESSource () 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)
 
- Public Member Functions inherited from edm::EventSetupRecordIntervalFinder
const eventsetup::ComponentDescriptiondescriptionForFinder () const
 
 EventSetupRecordIntervalFinder ()
 
std::set< eventsetup::EventSetupRecordKeyfindingForRecords () const
 
const ValidityIntervalfindIntervalFor (const eventsetup::EventSetupRecordKey &, const IOVSyncValue &)
 
void setDescriptionForFinder (const eventsetup::ComponentDescription &iDescription)
 
virtual ~EventSetupRecordIntervalFinder () noexcept(false)
 

Protected Member Functions

void setIntervalFor (const edm::eventsetup::EventSetupRecordKey &, const edm::IOVSyncValue &, edm::ValidityInterval &) override
 
- Protected Member Functions inherited from edm::ESProducer
 ESProducer (const ESProducer &)=delete
 
ESProducer const & operator= (const ESProducer &)=delete
 
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 TArg >
ESConsumesCollector setWhatProduced (T *iThis, TReturn(T::*iMethod)(const TRecord &), const TArg &iDec, const es::Label &iLabel={})
 
- 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 &)
 
- Protected Member Functions inherited from edm::EventSetupRecordIntervalFinder
template<class T >
void findingRecord ()
 
void findingRecordWithKey (const eventsetup::EventSetupRecordKey &)
 

Private Attributes

vstring templateCalibrations_
 
float version_
 

Additional Inherited Members

- Static Public Member Functions inherited from edm::eventsetup::DataProxyProvider
static void prevalidate (ConfigurationDescriptions &)
 

Detailed Description

Definition at line 12 of file SiPixelFakeTemplateDBObjectESSource.h.

Member Typedef Documentation

typedef std::vector<std::string> SiPixelFakeTemplateDBObjectESSource::vstring

Definition at line 18 of file SiPixelFakeTemplateDBObjectESSource.h.

Constructor & Destructor Documentation

SiPixelFakeTemplateDBObjectESSource::SiPixelFakeTemplateDBObjectESSource ( const edm::ParameterSet conf_)

Definition at line 5 of file SiPixelFakeTemplateDBObjectESSource.cc.

References edm::ESProducer::setWhatProduced().

5  : templateCalibrations_(conf_.getParameter<vstring>("siPixelTemplateCalibrations")),
6  version_(conf_.getParameter<double>("Version"))
7 {
8  edm::LogInfo("SiPixelFakeTemplateDBObjectESSource::SiPixelFakeTemplateDBObjectESSource");
9  //the following line is needed to tell the framework what
10  // data is being produced
11  setWhatProduced(this);
12  findingRecord<SiPixelTemplateDBObjectRcd>();
13 }
T getParameter(std::string const &) const
auto setWhatProduced(T *iThis, const es::Label &iLabel={})
Definition: ESProducer.h:116
vector< string > vstring
Definition: ExoticaDQM.cc:8
SiPixelFakeTemplateDBObjectESSource::~SiPixelFakeTemplateDBObjectESSource ( )
override

Definition at line 15 of file SiPixelFakeTemplateDBObjectESSource.cc.

16 {
17 }

Member Function Documentation

std::unique_ptr< SiPixelTemplateDBObject > SiPixelFakeTemplateDBObjectESSource::produce ( const SiPixelTemplateDBObjectRcd )
virtual

Definition at line 19 of file SiPixelFakeTemplateDBObjectESSource.cc.

References EnergyCorrector::c, SiPixelTemplateDBObject::char2float::c, SiPixelTemplateDBObject::char2float::f, FrontierConditions_GlobalTag_cff::file, edm::FileInPath::fullPath(), recoMuon::in, create_public_lumi_plots::in_file, funct::m, SiPixelTemplateDBObject::maxIndex(), SiPixelTemplateDBObject::numOfTempl(), GetRecoTauVFromDQM_MC_cff::obj, SiPixelTemplateDBObject::push_back(), SiPixelTemplateDBObject::setMaxIndex(), SiPixelTemplateDBObject::setNumOfTempl(), SiPixelTemplateDBObject::setVersion(), groupFilesInBlocks::temp, templateCalibrations_, and version_.

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

20 {
21  using namespace edm::es;
22 
23  //Mostly copied from CondTools/SiPixel/test/SiPixelTemplateDBObjectUploader.cc
24  //--- Make the POOL-ORA object to store the database object
26 
27  // Local variables
28  const char *tempfile;
29  int m;
30 
31  // Set the number of templates to be passed to the dbobject
33 
34  // Set the version of the template dbobject - this is an external parameter
35  obj->setVersion(version_);
36 
37  // open the template file(s)
38  for(m=0; m< obj->numOfTempl(); ++m){
39 
41  tempfile = (file.fullPath()).c_str();
42 
43  std::ifstream in_file(tempfile, std::ios::in);
44 
45  if(in_file.is_open()){
46  edm::LogInfo("SiPixelFakeTemplateDBObjectESSource") << "Opened Template File: " << file.fullPath().c_str() << std::endl;
47 
48  // Local variables
49  char title_char[80], c;
51  float tempstore;
52  int iter,j;
53 
54  // Templates contain a header char - we must be clever about storing this
55  for (iter = 0; (c=in_file.get()) != '\n'; ++iter) {
56  if(iter < 79) {title_char[iter] = c;}
57  }
58  if(iter > 78) {iter=78;}
59  title_char[iter+1] ='\n';
60 
61  for(j=0; j<80; j+=4) {
62  temp.c[0] = title_char[j];
63  temp.c[1] = title_char[j+1];
64  temp.c[2] = title_char[j+2];
65  temp.c[3] = title_char[j+3];
66  obj->push_back(temp.f);
67  obj->setMaxIndex(obj->maxIndex()+1);
68  }
69 
70  // Fill the dbobject
71  in_file >> tempstore;
72  while(!in_file.eof()) {
73  obj->setMaxIndex(obj->maxIndex()+1);
74  obj->push_back(tempstore);
75  in_file >> tempstore;
76  }
77 
78  in_file.close();
79  }
80  else {
81  // If file didn't open, report this
82  edm::LogError("SiPixeFakelTemplateDBObjectESSource") << "Error opening File" << tempfile << std::endl;
83  }
84  }
85 
86  //std::cout << *obj << std::endl;
87  return std::unique_ptr<SiPixelTemplateDBObject>(obj);
88 }
void setNumOfTempl(int numOfTempl)
void SiPixelFakeTemplateDBObjectESSource::setIntervalFor ( const edm::eventsetup::EventSetupRecordKey ,
const edm::IOVSyncValue iosv,
edm::ValidityInterval oValidity 
)
overrideprotectedvirtual

Implements edm::EventSetupRecordIntervalFinder.

Definition at line 90 of file SiPixelFakeTemplateDBObjectESSource.cc.

References edm::IOVSyncValue::beginOfTime(), edm::IOVSyncValue::endOfTime(), and infinity.

92  {
94  oValidity = infinity;
95 }
static const IOVSyncValue & endOfTime()
Definition: IOVSyncValue.cc:97
static const IOVSyncValue & beginOfTime()
const double infinity

Member Data Documentation

vstring SiPixelFakeTemplateDBObjectESSource::templateCalibrations_
private

Definition at line 30 of file SiPixelFakeTemplateDBObjectESSource.h.

Referenced by produce().

float SiPixelFakeTemplateDBObjectESSource::version_
private

Definition at line 31 of file SiPixelFakeTemplateDBObjectESSource.h.

Referenced by produce().