CMS 3D CMS Logo

List of all members | Public Member Functions | Private Member Functions | Private Attributes
BufferedBoostIODBWriter Class Reference
Inheritance diagram for BufferedBoostIODBWriter:
edm::EDAnalyzer edm::EDConsumerBase

Public Member Functions

 BufferedBoostIODBWriter (const edm::ParameterSet &)
 
virtual ~BufferedBoostIODBWriter ()
 
- Public Member Functions inherited from edm::EDAnalyzer
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
 EDAnalyzer ()
 
ModuleDescription const & moduleDescription () const
 
std::string workerType () const
 
virtual ~EDAnalyzer ()
 
- Public Member Functions inherited from edm::EDConsumerBase
std::vector< ConsumesInfoconsumesInfo () const
 
 EDConsumerBase ()
 
 EDConsumerBase (EDConsumerBase const &)=delete
 
 EDConsumerBase (EDConsumerBase &&)=default
 
ProductResolverIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
std::vector< ProductResolverIndexAndSkipBit > const & itemsToGetFromEvent () const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void modulesWhoseProductsAreConsumed (std::vector< ModuleDescription const * > &modules, ProductRegistry const &preg, std::map< std::string, ModuleDescription const * > const &labelsToDesc, std::string const &processName) const
 
EDConsumerBase const & operator= (EDConsumerBase const &)=delete
 
EDConsumerBaseoperator= (EDConsumerBase &&)=default
 
bool registeredToConsume (ProductResolverIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
void updateLookup (BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet)
 
virtual ~EDConsumerBase () noexcept(false)
 

Private Member Functions

virtual void analyze (const edm::Event &, const edm::EventSetup &) override
 
 BufferedBoostIODBWriter ()
 
 BufferedBoostIODBWriter (const BufferedBoostIODBWriter &)
 
BufferedBoostIODBWriteroperator= (const BufferedBoostIODBWriter &)
 

Private Attributes

std::string inputFile
 
std::string record
 

Additional Inherited Members

- Public Types inherited from edm::EDAnalyzer
typedef EDAnalyzer ModuleType
 
- Public Types inherited from edm::EDConsumerBase
typedef ProductLabels Labels
 
- Static Public Member Functions inherited from edm::EDAnalyzer
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &)
 
- Protected Member Functions inherited from edm::EDConsumerBase
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (edm::InputTag const &tag)
 
EDGetToken consumes (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken consumes (TypeToGet const &id, edm::InputTag const &tag)
 
ConsumesCollector consumesCollector ()
 Use a ConsumesCollector to gather consumes information from helper functions. More...
 
template<typename ProductType , BranchType B = InEvent>
void consumesMany ()
 
void consumesMany (const TypeToGet &id)
 
template<BranchType B>
void consumesMany (const TypeToGet &id)
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > mayConsume (edm::InputTag const &tag)
 
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 

Detailed Description

Definition at line 22 of file BufferedBoostIODBWriter.cc.

Constructor & Destructor Documentation

BufferedBoostIODBWriter::BufferedBoostIODBWriter ( const edm::ParameterSet ps)
explicit

Definition at line 39 of file BufferedBoostIODBWriter.cc.

virtual BufferedBoostIODBWriter::~BufferedBoostIODBWriter ( )
inlinevirtual

Definition at line 26 of file BufferedBoostIODBWriter.cc.

References analyze(), BufferedBoostIODBWriter(), and operator=().

26 {}
BufferedBoostIODBWriter::BufferedBoostIODBWriter ( )
private
BufferedBoostIODBWriter::BufferedBoostIODBWriter ( const BufferedBoostIODBWriter )
private

Member Function Documentation

void BufferedBoostIODBWriter::analyze ( const edm::Event iEvent,
const edm::EventSetup iSetup 
)
overrideprivatevirtual

Definition at line 45 of file BufferedBoostIODBWriter.cc.

References cond::service::PoolDBOutputService::currentTime(), DEFINE_FWK_MODULE, Exception, input, inputFile, edm::Service< T >::isAvailable(), record, trackingPlots::stat, and cond::service::PoolDBOutputService::writeOne().

Referenced by ~BufferedBoostIODBWriter().

47 {
48  std::auto_ptr<OOTPileupCorrectionBuffer> fcp;
49 
50  {
51  std::ifstream input(inputFile.c_str(), std::ios_base::binary);
52  if (!input.is_open())
53  throw cms::Exception("InvalidArgument")
54  << "Failed to open file \"" << inputFile << '"' << std::endl;
55 
56  struct stat st;
57  if (stat(inputFile.c_str(), &st))
58  throw cms::Exception("SystemError")
59  << "Failed to stat file \"" << inputFile << '"' << std::endl;
60 
61  const std::size_t len = st.st_size;
62  fcp = std::auto_ptr<OOTPileupCorrectionBuffer>(
63  new OOTPileupCorrectionBuffer(len));
64  assert(fcp->length() == len);
65  if (len)
66  input.read(fcp->getBuffer(), len);
67  if (input.fail())
68  throw cms::Exception("SystemError")
69  << "Input stream failure while reading file \""
70  << inputFile << '"' << std::endl;
71  }
72 
74  if (poolDbService.isAvailable())
75  poolDbService->writeOne(fcp.release(),
76  poolDbService->currentTime(),
77  record);
78  else
79  throw cms::Exception("ConfigurationError")
80  << "PoolDBOutputService is not available, "
81  << "please configure it properly" << std::endl;
82 }
static std::string const input
Definition: EdmProvDump.cc:44
bool isAvailable() const
Definition: Service.h:46
void writeOne(T *payload, Time_t time, const std::string &recordName, bool withlogging=false)
BufferedBoostIODBWriter& BufferedBoostIODBWriter::operator= ( const BufferedBoostIODBWriter )
private

Member Data Documentation

std::string BufferedBoostIODBWriter::inputFile
private

Definition at line 35 of file BufferedBoostIODBWriter.cc.

Referenced by analyze().

std::string BufferedBoostIODBWriter::record
private

Definition at line 36 of file BufferedBoostIODBWriter.cc.

Referenced by analyze().