Main Page
Namespaces
Classes
Package Documentation
Alignment
MillePedeAlignmentAlgorithm
plugins
MillePedeFileExtractor.h
Go to the documentation of this file.
1
#ifndef MillePedeFileExtractor_h
2
#define MillePedeFileExtractor_h
3
4
// Original Author: Broen van Besien
5
// Created: Mon, 23 Mar 2015 14:56:15 GMT
6
7
/*
8
* This analyzer will extract all fileblobs in the input edm/root file and
9
* write them as files to the file system.
10
*
11
* It searches for the files in the vector of fileblobs that should exist on
12
* the level of the run. Unique filenames for each file are generated based
13
* on a formating directive in the output filename parameter.
14
*
15
* The operation is performed during the endRun phase.
16
*
17
* The original embedding of the (binary) files in the edm/root files can be
18
* done with the corresponding module MillePedeFileConverer.
19
*
20
* For more info about the possible parameters, type:
21
* edmPluginHelp -p MillePedeFileExtractor
22
*/
23
24
#include "
FWCore/Framework/interface/Frameworkfwd.h
"
25
#include "
FWCore/Framework/interface/one/EDAnalyzer.h
"
26
#include "
FWCore/Framework/interface/Event.h
"
27
#include "
FWCore/Framework/interface/MakerMacros.h
"
28
#include "
FWCore/ParameterSet/interface/ParameterSet.h
"
29
#include "
CondFormats/Common/interface/FileBlobCollection.h
"
30
31
class
MillePedeFileExtractor
:
32
public
edm::one::EDAnalyzer
<edm::one::WatchLuminosityBlocks> {
33
public
:
34
explicit
MillePedeFileExtractor
(
const
edm::ParameterSet
&);
35
~MillePedeFileExtractor
()
override
;
36
static
void
fillDescriptions
(
edm::ConfigurationDescriptions
& descriptions);
37
38
private
:
39
void
beginLuminosityBlock
(
const
edm::LuminosityBlock
&,
40
const
edm::EventSetup
&)
override
{}
41
void
endLuminosityBlock
(
const
edm::LuminosityBlock
&,
42
const
edm::EventSetup
&)
override
;
43
void
analyze
(
const
edm::Event
&,
const
edm::EventSetup
&)
override
{}
44
45
bool
enoughBinaries
() {
46
return
(
nBinaries_
>=
maxNumberOfBinaries_
) &&
hasBinaryNumberLimit
(); }
47
bool
hasBinaryNumberLimit
() {
return
maxNumberOfBinaries_
> -1; }
48
49
static
void
writeGzipped
(
const
FileBlob
&,
const
std::string
&);
50
51
const
std::string
outputDir_
;
52
const
std::string
outputFileName_
;
53
54
edm::EDGetTokenT<FileBlobCollection>
fileBlobToken_
;
55
56
const
int
maxNumberOfBinaries_
;
57
int
nBinaries_
{0};
58
};
59
60
// define this as a plug-in
61
DEFINE_FWK_MODULE
(
MillePedeFileExtractor
);
62
63
#endif
MillePedeFileExtractor::fileBlobToken_
edm::EDGetTokenT< FileBlobCollection > fileBlobToken_
Definition:
MillePedeFileExtractor.h:54
MillePedeFileExtractor::outputFileName_
const std::string outputFileName_
Definition:
MillePedeFileExtractor.h:52
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition:
AlCaHLTBitMon_QueryRunRegistry.py:256
DEFINE_FWK_MODULE
#define DEFINE_FWK_MODULE(type)
Definition:
MakerMacros.h:17
Event.h
edm::LuminosityBlock
Definition:
LuminosityBlock.h:47
MillePedeFileExtractor::MillePedeFileExtractor
MillePedeFileExtractor(const edm::ParameterSet &)
Definition:
MillePedeFileExtractor.cc:14
MakerMacros.h
FileBlobCollection.h
MillePedeFileExtractor::maxNumberOfBinaries_
const int maxNumberOfBinaries_
Definition:
MillePedeFileExtractor.h:56
edm::EDGetTokenT< FileBlobCollection >
Frameworkfwd.h
ParameterSet.h
MillePedeFileExtractor::beginLuminosityBlock
void beginLuminosityBlock(const edm::LuminosityBlock &, const edm::EventSetup &) override
Definition:
MillePedeFileExtractor.h:39
MillePedeFileExtractor::endLuminosityBlock
void endLuminosityBlock(const edm::LuminosityBlock &, const edm::EventSetup &) override
Definition:
MillePedeFileExtractor.cc:30
MillePedeFileExtractor::nBinaries_
int nBinaries_
Definition:
MillePedeFileExtractor.h:57
FileBlob
Definition:
FileBlob.h:10
MillePedeFileExtractor::~MillePedeFileExtractor
~MillePedeFileExtractor() override
Definition:
MillePedeFileExtractor.cc:28
MillePedeFileExtractor::fillDescriptions
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
Definition:
MillePedeFileExtractor.cc:95
edm::EventSetup
Definition:
EventSetup.h:54
MillePedeFileExtractor::outputDir_
const std::string outputDir_
Definition:
MillePedeFileExtractor.h:51
EDAnalyzer.h
MillePedeFileExtractor::enoughBinaries
bool enoughBinaries()
Definition:
MillePedeFileExtractor.h:45
edm::ParameterSet
Definition:
ParameterSet.h:36
edm::Event
Definition:
Event.h:70
edm::one::EDAnalyzer
Definition:
EDAnalyzer.h:30
MillePedeFileExtractor::hasBinaryNumberLimit
bool hasBinaryNumberLimit()
Definition:
MillePedeFileExtractor.h:47
MillePedeFileExtractor::analyze
void analyze(const edm::Event &, const edm::EventSetup &) override
Definition:
MillePedeFileExtractor.h:43
MillePedeFileExtractor
Definition:
MillePedeFileExtractor.h:31
edm::ConfigurationDescriptions
Definition:
ConfigurationDescriptions.h:28
MillePedeFileExtractor::writeGzipped
static void writeGzipped(const FileBlob &, const std::string &)
Definition:
MillePedeFileExtractor.cc:69
Generated for CMSSW Reference Manual by
1.8.11