13 : moduleLabel_(cfg.getParameter<
std::
string>(
"@module_label"))
16 for (edm::VParameterSet::const_iterator cfgJob = cfgJobs.begin(); cfgJob != cfgJobs.end(); ++cfgJob) {
24 for (std::vector<jobEntryType*>::iterator it =
jobs_.begin(); it !=
jobs_.end(); ++it) {
32 for (std::vector<jobEntryType*>::iterator job =
jobs_.begin(); job !=
jobs_.end(); ++job) {
33 std::map<std::string, const GBRForest*> gbrForests;
34 for (std::vector<categoryEntryType*>::iterator
category = (*job)->categories_.begin();
40 TFile*
inputFile =
new TFile((*category)->inputFileName_.data());
43 gbrForest = (
GBRForest*)inputFile->Get((*category)->gbrForestName_.data());
48 <<
" Failed to load GBRForest = " << (*category)->gbrForestName_.data()
49 <<
" from file = " << (*category)->inputFileName_ <<
" !!\n";
50 gbrForests[(*category)->gbrForestName_] = gbrForest;
53 TFile*
outputFile =
new TFile((*job)->outputFileName_.data(),
"RECREATE");
55 for (std::map<std::string, const GBRForest*>::iterator gbrForest = gbrForests.begin();
56 gbrForest != gbrForests.end(); ++gbrForest) {
57 outputFile->WriteObject(gbrForest->second, gbrForest->first.data());
63 throw cms::Exception(
"GBRForestWriter") <<
" Failed to access PoolDBOutputService !!\n";
65 for (std::map<std::string, const GBRForest*>::iterator gbrForest = gbrForests.begin();
66 gbrForest != gbrForests.end(); ++gbrForest) {
68 if (gbrForests.size() > 1)
69 outputRecord.append(
"_").append(gbrForest->first);
75 for (std::map<std::string, const GBRForest*>::iterator gbrForest = gbrForests.begin();
76 gbrForest != gbrForests.end(); ++gbrForest) {
77 delete gbrForest->second;
T getParameter(std::string const &) const
#define DEFINE_FWK_MODULE(type)
std::vector< ParameterSet > VParameterSet
GBRForestWriter(const edm::ParameterSet &)
cond::Time_t beginOfTime() const
void writeOne(T *payload, Time_t time, const std::string &recordName, bool withlogging=false)
~GBRForestWriter() override
void analyze(const edm::Event &, const edm::EventSetup &) override
std::vector< jobEntryType * > jobs_