test
Main Page
Namespaces
Classes
Package Documentation
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Properties
Friends
Macros
Pages
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
();
36
static
void
fillDescriptions
(
edm::ConfigurationDescriptions
& descriptions);
37
38
private
:
39
virtual
void
beginLuminosityBlock
(
const
edm::LuminosityBlock
&,
40
const
edm::EventSetup
&)
override
{}
41
virtual
void
endLuminosityBlock
(
const
edm::LuminosityBlock
&,
42
const
edm::EventSetup
&)
override
;
43
virtual
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::~MillePedeFileExtractor
~MillePedeFileExtractor()
Definition:
MillePedeFileExtractor.cc:27
MillePedeFileExtractor::outputFileName_
const std::string outputFileName_
Definition:
MillePedeFileExtractor.h:52
DEFINE_FWK_MODULE
#define DEFINE_FWK_MODULE(type)
Definition:
MakerMacros.h:17
Event.h
edm::LuminosityBlock
Definition:
LuminosityBlock.h:45
MillePedeFileExtractor::MillePedeFileExtractor
MillePedeFileExtractor(const edm::ParameterSet &)
Definition:
MillePedeFileExtractor.cc:13
MakerMacros.h
FileBlobCollection.h
MillePedeFileExtractor::analyze
virtual void analyze(const edm::Event &, const edm::EventSetup &) override
Definition:
MillePedeFileExtractor.h:43
MillePedeFileExtractor::maxNumberOfBinaries_
const int maxNumberOfBinaries_
Definition:
MillePedeFileExtractor.h:56
edm::EDGetTokenT< FileBlobCollection >
Frameworkfwd.h
AlCaHLTBitMon_QueryRunRegistry.string
string string
Definition:
AlCaHLTBitMon_QueryRunRegistry.py:255
ParameterSet.h
MillePedeFileExtractor::endLuminosityBlock
virtual void endLuminosityBlock(const edm::LuminosityBlock &, const edm::EventSetup &) override
Definition:
MillePedeFileExtractor.cc:29
MillePedeFileExtractor::nBinaries_
int nBinaries_
Definition:
MillePedeFileExtractor.h:57
FileBlob
Definition:
FileBlob.h:10
MillePedeFileExtractor::fillDescriptions
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
Definition:
MillePedeFileExtractor.cc:94
edm::EventSetup
Definition:
EventSetup.h:45
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:66
edm::one::EDAnalyzer
Definition:
EDAnalyzer.h:30
MillePedeFileExtractor::beginLuminosityBlock
virtual void beginLuminosityBlock(const edm::LuminosityBlock &, const edm::EventSetup &) override
Definition:
MillePedeFileExtractor.h:39
MillePedeFileExtractor::hasBinaryNumberLimit
bool hasBinaryNumberLimit()
Definition:
MillePedeFileExtractor.h:47
MillePedeFileExtractor
Definition:
MillePedeFileExtractor.h:31
edm::ConfigurationDescriptions
Definition:
ConfigurationDescriptions.h:27
MillePedeFileExtractor::writeGzipped
static void writeGzipped(const FileBlob &, const std::string &)
Definition:
MillePedeFileExtractor.cc:68
Generated for CMSSW Reference Manual by
1.8.5