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 | 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
< EventSetupRecordKey
Keys
 
typedef std::map
< EventSetupRecordKey,
KeyedProxies
RecordProxies
 

Public Member Functions

virtual std::auto_ptr
< SiPixelTemplateDBObject
produce (const SiPixelTemplateDBObjectRcd &)
 
 SiPixelFakeTemplateDBObjectESSource (const edm::ParameterSet &)
 
 ~SiPixelFakeTemplateDBObjectESSource ()
 
- 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 ()
 
- Public Member Functions inherited from edm::EventSetupRecordIntervalFinder
const
eventsetup::ComponentDescription
descriptionForFinder () const
 
 EventSetupRecordIntervalFinder ()
 
std::set
< eventsetup::EventSetupRecordKey
findingForRecords () const
 
const ValidityIntervalfindIntervalFor (const eventsetup::EventSetupRecordKey &, const IOVSyncValue &)
 
void setDescriptionForFinder (const eventsetup::ComponentDescription &iDescription)
 
virtual ~EventSetupRecordIntervalFinder ()
 

Protected Member Functions

virtual void setIntervalFor (const edm::eventsetup::EventSetupRecordKey &, const edm::IOVSyncValue &, edm::ValidityInterval &)
 
- 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 &)
 
- 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 13 of file SiPixelFakeTemplateDBObjectESSource.h.

Member Typedef Documentation

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

Definition at line 19 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
vector< string > vstring
Definition: ExoticaDQM.cc:86
void setWhatProduced(T *iThis, const es::Label &iLabel=es::Label())
Definition: ESProducer.h:115
SiPixelFakeTemplateDBObjectESSource::~SiPixelFakeTemplateDBObjectESSource ( )

Definition at line 15 of file SiPixelFakeTemplateDBObjectESSource.cc.

16 {
17 }

Member Function Documentation

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

Definition at line 19 of file SiPixelFakeTemplateDBObjectESSource.cc.

References EnergyCorrector::c, SiPixelTemplateDBObject::char2float::c, SiPixelTemplateDBObject::char2float::f, mergeVDriftHistosByStation::file, edm::FileInPath::fullPath(), recoMuon::in, create_public_lumi_plots::in_file, j, visualization-live-secondInstance_cfg::m, getGTfromDQMFile::obj, 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
32  obj->setNumOfTempl(templateCalibrations_.size());
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::auto_ptr<SiPixelTemplateDBObject>(obj);
88 }
int j
Definition: DBlmapReader.cc:9
void SiPixelFakeTemplateDBObjectESSource::setIntervalFor ( const edm::eventsetup::EventSetupRecordKey ,
const edm::IOVSyncValue iosv,
edm::ValidityInterval oValidity 
)
protectedvirtual

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 31 of file SiPixelFakeTemplateDBObjectESSource.h.

Referenced by produce().

float SiPixelFakeTemplateDBObjectESSource::version_
private

Definition at line 32 of file SiPixelFakeTemplateDBObjectESSource.h.

Referenced by produce().