CMS 3D CMS Logo

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

#include <SiPixelFakeGenErrorDBObjectESSource.h>

Inheritance diagram for SiPixelFakeGenErrorDBObjectESSource:
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< SiPixelGenErrorDBObjectproduce (const SiPixelGenErrorDBObjectRcd &)
 
 SiPixelFakeGenErrorDBObjectESSource (const edm::ParameterSet &)
 
 ~SiPixelFakeGenErrorDBObjectESSource () 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
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 &)
 
- Protected Member Functions inherited from edm::EventSetupRecordIntervalFinder
template<class T >
void findingRecord ()
 
void findingRecordWithKey (const eventsetup::EventSetupRecordKey &)
 

Private Attributes

vstring GenErrorCalibrations_
 
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 SiPixelFakeGenErrorDBObjectESSource.h.

Member Typedef Documentation

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

Definition at line 18 of file SiPixelFakeGenErrorDBObjectESSource.h.

Constructor & Destructor Documentation

SiPixelFakeGenErrorDBObjectESSource::SiPixelFakeGenErrorDBObjectESSource ( const edm::ParameterSet conf_)

Definition at line 5 of file SiPixelFakeGenErrorDBObjectESSource.cc.

References edm::ESProducer::setWhatProduced().

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

Definition at line 15 of file SiPixelFakeGenErrorDBObjectESSource.cc.

16 {
17 }

Member Function Documentation

std::unique_ptr< SiPixelGenErrorDBObject > SiPixelFakeGenErrorDBObjectESSource::produce ( const SiPixelGenErrorDBObjectRcd )
virtual

Definition at line 19 of file SiPixelFakeGenErrorDBObjectESSource.cc.

References EnergyCorrector::c, SiPixelGenErrorDBObject::char2float::c, SiPixelGenErrorDBObject::char2float::f, FrontierConditions_GlobalTag_cff::file, edm::FileInPath::fullPath(), GenErrorCalibrations_, recoMuon::in, create_public_lumi_plots::in_file, funct::m, SiPixelGenErrorDBObject::maxIndex(), SiPixelGenErrorDBObject::numOfTempl(), GetRecoTauVFromDQM_MC_cff::obj, SiPixelGenErrorDBObject::push_back(), SiPixelGenErrorDBObject::setMaxIndex(), SiPixelGenErrorDBObject::setNumOfTempl(), SiPixelGenErrorDBObject::setVersion(), groupFilesInBlocks::temp, 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/SiPixelGenErrorDBObjectUploader.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 GenErrors to be passed to the dbobject
33 
34  // Set the version of the GenError dbobject - this is an external parameter
35  obj->setVersion(version_);
36 
37  // open the GenError 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("SiPixelFakeGenErrorDBObjectESSource") << "Opened GenError 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  // GenErrors 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("SiPixeFakelGenErrorDBObjectESSource") << "Error opening File" << tempfile << std::endl;
83  }
84  }
85 
86  //std::cout << *obj << std::endl;
87  return std::unique_ptr<SiPixelGenErrorDBObject>(obj);
88 }
void setNumOfTempl(int numOfTempl)
void setVersion(float version)
void SiPixelFakeGenErrorDBObjectESSource::setIntervalFor ( const edm::eventsetup::EventSetupRecordKey ,
const edm::IOVSyncValue iosv,
edm::ValidityInterval oValidity 
)
overrideprotectedvirtual

Implements edm::EventSetupRecordIntervalFinder.

Definition at line 90 of file SiPixelFakeGenErrorDBObjectESSource.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 SiPixelFakeGenErrorDBObjectESSource::GenErrorCalibrations_
private

Definition at line 30 of file SiPixelFakeGenErrorDBObjectESSource.h.

Referenced by produce().

float SiPixelFakeGenErrorDBObjectESSource::version_
private

Definition at line 31 of file SiPixelFakeGenErrorDBObjectESSource.h.

Referenced by produce().