Main Page
Namespaces
Classes
Package Documentation
CondTools
Hcal
interface
BoostIODBReader.h
Go to the documentation of this file.
1
#ifndef CondTools_Hcal_BoostIODBReader_h
2
#define CondTools_Hcal_BoostIODBReader_h
3
4
// -*- C++ -*-
5
//
6
// Package: CondTools/Hcal
7
// Class: BoostIODBReader
8
//
16
//
17
// Original Author: Igor Volobouev
18
// Created: Fri Apr 25 18:17:13 CDT 2014
19
//
20
//
21
22
#include <string>
23
#include <fstream>
24
#include <cassert>
25
26
#include "CondFormats/Serialization/interface/eos/portable_oarchive.hpp"
27
28
#include "
FWCore/Framework/interface/Frameworkfwd.h
"
29
#include "
FWCore/Framework/interface/EDAnalyzer.h
"
30
#include "
FWCore/Framework/interface/Event.h
"
31
#include "
FWCore/Framework/interface/EventSetup.h
"
32
#include "
FWCore/Framework/interface/ESHandle.h
"
33
34
#include "
FWCore/Utilities/interface/Exception.h
"
35
36
#include "
FWCore/ServiceRegistry/interface/Service.h
"
37
#include "
FWCore/ParameterSet/interface/ParameterSet.h
"
38
39
//
40
// class declaration
41
//
42
template
<
class
DataType,
class
RecordType>
43
class
BoostIODBReader
:
public
edm::EDAnalyzer
44
{
45
public
:
46
typedef
DataType
data_type
;
47
typedef
RecordType
record_type
;
48
49
explicit
BoostIODBReader
(
const
edm::ParameterSet
&);
50
inline
~BoostIODBReader
()
override
{}
51
52
private
:
53
void
analyze
(
const
edm::Event
&,
const
edm::EventSetup
&)
override
;
54
55
std::string
outputFile_
;
56
};
57
58
template
<
class
DataType,
class
RecordType>
59
BoostIODBReader<DataType,RecordType>::BoostIODBReader
(
const
edm::ParameterSet
& ps)
60
:
outputFile_
(ps.getParameter<
std
::
string
>(
"outputFile"
))
61
{
62
}
63
64
template
<
class
DataType,
class
RecordType>
65
void
BoostIODBReader<DataType,RecordType>::analyze
(
const
edm::Event
&
iEvent
,
66
const
edm::EventSetup
& iSetup)
67
{
68
edm::ESHandle<DataType>
p
;
69
iSetup.
get
<RecordType>().
get
(p);
70
71
std::ofstream of(
outputFile_
.c_str(), std::ios_base::binary);
72
if
(!of.is_open())
73
throw
cms::Exception
(
"InvalidArgument"
)
74
<<
"Failed to open file \""
<<
outputFile_
<<
'"'
<< std::endl;
75
76
eos::portable_oarchive ar(of);
77
ar & *
p
;
78
}
79
80
#endif // CondTools_Hcal_BoostIODBReader_h
AlCaHLTBitMon_ParallelJobs.p
p
Definition:
AlCaHLTBitMon_ParallelJobs.py:153
BoostIODBReader
Definition:
BoostIODBReader.h:43
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition:
AlCaHLTBitMon_QueryRunRegistry.py:256
Event.h
EventSetup.h
std
Definition:
JetResolutionObject.h:80
BoostIODBReader::data_type
DataType data_type
Definition:
BoostIODBReader.h:46
Frameworkfwd.h
ParameterSet.h
iEvent
int iEvent
Definition:
GenABIO.cc:230
edm::ESHandle
Definition:
DTSurvey.h:22
BoostIODBReader::analyze
void analyze(const edm::Event &, const edm::EventSetup &) override
Definition:
BoostIODBReader.h:65
ESHandle.h
Service.h
edm::EventSetup
Definition:
EventSetup.h:54
edm::EDAnalyzer
Definition:
EDAnalyzer.h:28
EDAnalyzer.h
BoostIODBReader::record_type
RecordType record_type
Definition:
BoostIODBReader.h:47
Exception.h
cms::Exception
Definition:
Exception.h:67
BoostIODBReader::~BoostIODBReader
~BoostIODBReader() override
Definition:
BoostIODBReader.h:50
PFRecoTauProducer_cfi.DataType
DataType
Definition:
PFRecoTauProducer_cfi.py:80
BoostIODBReader::outputFile_
std::string outputFile_
Definition:
BoostIODBReader.h:55
edm::EventSetup::get
T get() const
Definition:
EventSetup.h:68
edm::ParameterSet
Definition:
ParameterSet.h:36
edm::Event
Definition:
Event.h:70
BoostIODBReader::BoostIODBReader
BoostIODBReader(const edm::ParameterSet &)
Definition:
BoostIODBReader.h:59
Generated for CMSSW Reference Manual by
1.8.11