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 Member Functions

virtual std::unique_ptr< SiPixelGenErrorDBObjectproduce (const SiPixelGenErrorDBObjectRcd &)
 
 SiPixelFakeGenErrorDBObjectESSource (const edm::ParameterSet &)
 
 ~SiPixelFakeGenErrorDBObjectESSource () override
 
- Public Member Functions inherited from edm::ESProducer
 ESProducer ()
 
 ESProducer (const ESProducer &)=delete
 
ESProxyIndex const * getTokenIndices (unsigned int iIndex) const
 
ESRecordIndex const * getTokenRecordIndices (unsigned int iIndex) const
 
bool hasMayConsumes () const noexcept
 
size_t numberOfTokenIndices (unsigned int iIndex) const
 
ESProducer const & operator= (const ESProducer &)=delete
 
SerialTaskQueueChainqueue ()
 
template<typename Record >
std::optional< std::vector< ESProxyIndex > > updateFromMayConsumes (unsigned int iIndex, const Record &iRecord) const
 
void updateLookup (eventsetup::ESRecordsToProxyIndices const &) final
 
 ~ESProducer () noexcept(false) override
 
- Public Member Functions inherited from edm::ESProxyFactoryProducer
 ESProxyFactoryProducer ()
 
 ESProxyFactoryProducer (const ESProxyFactoryProducer &)=delete
 
const ESProxyFactoryProduceroperator= (const ESProxyFactoryProducer &)=delete
 
 ~ESProxyFactoryProducer () noexcept(false) override
 
- Public Member Functions inherited from edm::eventsetup::DataProxyProvider
void createKeyedProxies (EventSetupRecordKey const &key, unsigned int nConcurrentIOVs)
 
 DataProxyProvider ()
 
 DataProxyProvider (const DataProxyProvider &)=delete
 
const ComponentDescriptiondescription () const
 
void fillRecordsNotAllowingConcurrentIOVs (std::set< EventSetupRecordKey > &recordsNotAllowingConcurrentIOVs) const
 
virtual void initConcurrentIOVs (EventSetupRecordKey const &key, unsigned int nConcurrentIOVs)
 
bool isUsingRecord (const EventSetupRecordKey &key) const
 
KeyedProxieskeyedProxies (const EventSetupRecordKey &iRecordKey, unsigned int iovIndex=0)
 
const DataProxyProvideroperator= (const DataProxyProvider &)=delete
 
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
bool concurrentFinder () const
 
const eventsetup::ComponentDescriptiondescriptionForFinder () const
 
 EventSetupRecordIntervalFinder ()
 
 EventSetupRecordIntervalFinder (const EventSetupRecordIntervalFinder &)=delete
 
std::set< eventsetup::EventSetupRecordKeyfindingForRecords () const
 
const ValidityIntervalfindIntervalFor (const eventsetup::EventSetupRecordKey &, const IOVSyncValue &)
 
bool nonconcurrentAndIOVNeedsUpdate (const eventsetup::EventSetupRecordKey &key, const IOVSyncValue &syncValue) const
 
const EventSetupRecordIntervalFinderoperator= (const EventSetupRecordIntervalFinder &)=delete
 
void resetInterval (const eventsetup::EventSetupRecordKey &)
 
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 >
auto setWhatProduced (T *iThis, const char *iLabel)
 
template<typename T >
auto setWhatProduced (T *iThis, const es::Label &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 >
ESConsumesCollectorT< TRecord > setWhatProduced (T *iThis, TReturn(T ::*iMethod)(const TRecord &), const TArg &iDec, const es::Label &iLabel={})
 
void usesResources (std::vector< std::string > const &)
 
- 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 EventSetupRecordKey &iRecord, std::unique_ptr< eventsetup::ProxyFactoryBase > iFactory, const std::string &iLabel=std::string())
 
KeyedProxiesVector registerProxies (const EventSetupRecordKey &, unsigned int iovIndex) override
 
- Protected Member Functions inherited from edm::eventsetup::DataProxyProvider
template<class T >
void usingRecord ()
 
void usingRecordWithKey (const EventSetupRecordKey &key)
 
- 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 &)
 
- Protected Types inherited from edm::ESProxyFactoryProducer
using EventSetupRecordKey = eventsetup::EventSetupRecordKey
 
- Protected Types inherited from edm::eventsetup::DataProxyProvider
using KeyedProxiesVector = std::vector< std::pair< DataKey, std::shared_ptr< DataProxy > >>
 

Detailed Description

Definition at line 12 of file SiPixelFakeGenErrorDBObjectESSource.h.

Member Typedef Documentation

◆ vstring

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

Definition at line 17 of file SiPixelFakeGenErrorDBObjectESSource.h.

Constructor & Destructor Documentation

◆ SiPixelFakeGenErrorDBObjectESSource()

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

Definition at line 5 of file SiPixelFakeGenErrorDBObjectESSource.cc.

6  : GenErrorCalibrations_(conf_.getParameter<vstring>("siPixelGenErrorCalibrations")),
7  version_(conf_.getParameter<double>("Version")) {
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 }

References edm::ESProducer::setWhatProduced().

◆ ~SiPixelFakeGenErrorDBObjectESSource()

SiPixelFakeGenErrorDBObjectESSource::~SiPixelFakeGenErrorDBObjectESSource ( )
override

Definition at line 15 of file SiPixelFakeGenErrorDBObjectESSource.cc.

15 {}

Member Function Documentation

◆ produce()

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

Definition at line 17 of file SiPixelFakeGenErrorDBObjectESSource.cc.

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

References c, FrontierConditions_GlobalTag_cff::file, GenErrorCalibrations_, recoMuon::in, runGCPTkAlMap::in_file, dqmiolumiharvest::j, visualization-live-secondInstance_cfg::m, getGTfromDQMFile::obj, groupFilesInBlocks::temp, and version_.

◆ setIntervalFor()

void SiPixelFakeGenErrorDBObjectESSource::setIntervalFor ( const edm::eventsetup::EventSetupRecordKey ,
const edm::IOVSyncValue iosv,
edm::ValidityInterval oValidity 
)
overrideprotectedvirtual

Member Data Documentation

◆ GenErrorCalibrations_

vstring SiPixelFakeGenErrorDBObjectESSource::GenErrorCalibrations_
private

Definition at line 27 of file SiPixelFakeGenErrorDBObjectESSource.h.

Referenced by produce().

◆ version_

float SiPixelFakeGenErrorDBObjectESSource::version_
private

Definition at line 28 of file SiPixelFakeGenErrorDBObjectESSource.h.

Referenced by produce().

edm::ESProducer::setWhatProduced
auto setWhatProduced(T *iThis, const es::Label &iLabel={})
Definition: ESProducer.h:163
edm::ValidityInterval
Definition: ValidityInterval.h:28
SiPixelFakeGenErrorDBObjectESSource::GenErrorCalibrations_
vstring GenErrorCalibrations_
Definition: SiPixelFakeGenErrorDBObjectESSource.h:27
edm::LogInfo
Log< level::Info, false > LogInfo
Definition: MessageLogger.h:125
infinity
const double infinity
Definition: CSCChamberFitter.cc:10
groupFilesInBlocks.temp
list temp
Definition: groupFilesInBlocks.py:142
edm::FileInPath
Definition: FileInPath.h:64
visualization-live-secondInstance_cfg.m
m
Definition: visualization-live-secondInstance_cfg.py:72
getGTfromDQMFile.obj
obj
Definition: getGTfromDQMFile.py:32
SiPixelGenErrorDBObject::char2float
Definition: SiPixelGenErrorDBObject.h:69
runGCPTkAlMap.in_file
in_file
Definition: runGCPTkAlMap.py:74
edm::IOVSyncValue::endOfTime
static const IOVSyncValue & endOfTime()
Definition: IOVSyncValue.cc:82
recoMuon::in
Definition: RecoMuonEnumerators.h:6
FrontierConditions_GlobalTag_cff.file
file
Definition: FrontierConditions_GlobalTag_cff.py:13
edm::LogError
Log< level::Error, false > LogError
Definition: MessageLogger.h:123
SiPixelFakeGenErrorDBObjectESSource::version_
float version_
Definition: SiPixelFakeGenErrorDBObjectESSource.h:28
edm::es
Definition: es_Label.h:33
edm::IOVSyncValue::beginOfTime
static const IOVSyncValue & beginOfTime()
Definition: IOVSyncValue.cc:88
vstring
vector< string > vstring
Definition: ExoticaDQM.cc:8
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
SiPixelGenErrorDBObject
Definition: SiPixelGenErrorDBObject.h:16
c
auto & c
Definition: CAHitNtupletGeneratorKernelsImpl.h:46
dqmiolumiharvest.j
j
Definition: dqmiolumiharvest.py:66