IOPool
Input
src
DuplicateChecker.h
Go to the documentation of this file.
1
#ifndef DataFormats_Provenance_DuplicateChecker_h
2
#define DataFormats_Provenance_DuplicateChecker_h
3
4
/*----------------------------------------------------------------------
5
6
IOPool/Input/src/DuplicateChecker.h
7
8
Used by PoolSource to detect events with
9
the same process history, run, lumi, and event number.
10
It is configurable whether it checks for duplicates
11
within the scope of each single input file or all input
12
files or does not check for duplicates at all.
13
14
----------------------------------------------------------------------*/
15
16
#include "
DataFormats/Provenance/interface/EventID.h
"
17
#include "
DataFormats/Provenance/interface/RunID.h
"
18
#include "
DataFormats/Provenance/interface/IndexIntoFile.h
"
19
20
#include <memory>
21
#include <set>
22
#include <string>
23
#include <vector>
24
25
namespace
edm
{
26
27
class
ParameterSet
;
28
class
ParameterSetDescription
;
29
30
class
DuplicateChecker
{
31
public
:
32
DuplicateChecker
(
ParameterSet
const
&
pset
);
33
34
void
disable
();
35
36
void
inputFileOpened
(
bool
realData,
37
IndexIntoFile
const
& indexIntoFile,
38
std::vector<std::shared_ptr<IndexIntoFile> >
const
& indexesIntoFiles,
39
std::vector<std::shared_ptr<IndexIntoFile> >::
size_type
currentIndexIntoFile);
40
41
void
inputFileClosed
();
42
43
bool
noDuplicatesInFile
()
const
{
return
itIsKnownTheFileHasNoDuplicates_
; }
44
45
bool
checkDisabled
()
const
{
46
return
duplicateCheckMode_
==
noDuplicateCheck
||
47
(
duplicateCheckMode_
==
checkEachRealDataFile
&&
dataType_
==
isSimulation
) ||
disabled_
;
48
}
49
50
// Note that all references to the ProcessHistoryID in this class are to
51
// the "reduced" process history, including the index argument to this function.
52
bool
isDuplicateAndCheckActive
(
53
int
index
,
RunNumber_t
run
,
LuminosityBlockNumber_t
lumi
,
EventNumber_t
event
,
std::string
const
&
fileName
);
54
55
bool
checkingAllFiles
()
const
{
return
checkAllFilesOpened
==
duplicateCheckMode_
; }
56
57
static
void
fillDescription
(
ParameterSetDescription
& desc);
58
59
private
:
60
enum
DuplicateCheckMode
{
noDuplicateCheck
,
checkEachFile
,
checkEachRealDataFile
,
checkAllFilesOpened
};
61
62
DuplicateCheckMode
duplicateCheckMode_
;
63
64
enum
DataType
{
isRealData
,
isSimulation
,
unknown
};
65
66
DataType
dataType_
;
67
68
// If checking the entire input for duplicates, then this holds
69
// events from previous files that duplicate events in the
70
// the current file. Plus it holds events that have been already
71
// processed in the current file. It is not used if there are
72
// no duplicates or duplicate checking has been disabled.
73
std::set<IndexIntoFile::IndexRunLumiEventKey>
relevantPreviousEvents_
;
74
75
bool
itIsKnownTheFileHasNoDuplicates_
;
76
77
bool
disabled_
;
78
};
79
}
// namespace edm
80
#endif
edm::RunNumber_t
unsigned int RunNumber_t
Definition:
RunLumiEventNumber.h:14
edm::DuplicateChecker::disable
void disable()
Definition:
DuplicateChecker.cc:41
edm::DuplicateChecker::inputFileClosed
void inputFileClosed()
Definition:
DuplicateChecker.cc:75
edm::DuplicateChecker::duplicateCheckMode_
DuplicateCheckMode duplicateCheckMode_
Definition:
DuplicateChecker.h:62
edm::DuplicateChecker::itIsKnownTheFileHasNoDuplicates_
bool itIsKnownTheFileHasNoDuplicates_
Definition:
DuplicateChecker.h:75
edm::DuplicateChecker::isDuplicateAndCheckActive
bool isDuplicateAndCheckActive(int index, RunNumber_t run, LuminosityBlockNumber_t lumi, EventNumber_t event, std::string const &fileName)
Definition:
DuplicateChecker.cc:81
edm::DuplicateChecker::isRealData
Definition:
DuplicateChecker.h:64
edm
HLT enums.
Definition:
AlignableModifier.h:19
edm::DuplicateChecker::checkEachRealDataFile
Definition:
DuplicateChecker.h:60
edm::ParameterSetDescription
Definition:
ParameterSetDescription.h:52
edm::DuplicateChecker::checkingAllFiles
bool checkingAllFiles() const
Definition:
DuplicateChecker.h:55
edm::IndexIntoFile
Definition:
IndexIntoFile.h:225
edm::DuplicateChecker::fillDescription
static void fillDescription(ParameterSetDescription &desc)
Definition:
DuplicateChecker.cc:109
IndexIntoFile.h
edm::DuplicateChecker::DuplicateCheckMode
DuplicateCheckMode
Definition:
DuplicateChecker.h:60
MillePedeFileConverter_cfg.fileName
fileName
Definition:
MillePedeFileConverter_cfg.py:32
edm::DuplicateChecker::checkEachFile
Definition:
DuplicateChecker.h:60
edm::LuminosityBlockNumber_t
unsigned int LuminosityBlockNumber_t
Definition:
RunLumiEventNumber.h:13
edm::DuplicateChecker::disabled_
bool disabled_
Definition:
DuplicateChecker.h:77
edm::DuplicateChecker::noDuplicatesInFile
bool noDuplicatesInFile() const
Definition:
DuplicateChecker.h:43
trigger::size_type
uint16_t size_type
Definition:
TriggerTypeDefs.h:18
edm::DuplicateChecker::checkDisabled
bool checkDisabled() const
Definition:
DuplicateChecker.h:45
edm::DuplicateChecker::checkAllFilesOpened
Definition:
DuplicateChecker.h:60
EventID.h
edm::DuplicateChecker::dataType_
DataType dataType_
Definition:
DuplicateChecker.h:66
edm::EventNumber_t
unsigned long long EventNumber_t
Definition:
RunLumiEventNumber.h:12
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition:
AlCaHLTBitMon_QueryRunRegistry.py:256
edm::ParameterSet
Definition:
ParameterSet.h:36
ParameterSet
Definition:
Functions.h:16
edm::DuplicateChecker
Definition:
DuplicateChecker.h:30
edm::DuplicateChecker::DataType
DataType
Definition:
DuplicateChecker.h:64
writedatasetfile.run
run
Definition:
writedatasetfile.py:27
edm::DuplicateChecker::unknown
Definition:
DuplicateChecker.h:64
edm::DuplicateChecker::isSimulation
Definition:
DuplicateChecker.h:64
edm::DuplicateChecker::inputFileOpened
void inputFileOpened(bool realData, IndexIntoFile const &indexIntoFile, std::vector< std::shared_ptr< IndexIntoFile > > const &indexesIntoFiles, std::vector< std::shared_ptr< IndexIntoFile > >::size_type currentIndexIntoFile)
Definition:
DuplicateChecker.cc:48
ParameterSetDescription
AlignmentPI::index
index
Definition:
AlignmentPayloadInspectorHelper.h:46
edm::DuplicateChecker::relevantPreviousEvents_
std::set< IndexIntoFile::IndexRunLumiEventKey > relevantPreviousEvents_
Definition:
DuplicateChecker.h:73
event
Definition:
event.py:1
lumi
Definition:
LumiSectionData.h:20
RunID.h
edm::DuplicateChecker::noDuplicateCheck
Definition:
DuplicateChecker.h:60
edm::DuplicateChecker::DuplicateChecker
DuplicateChecker(ParameterSet const &pset)
Definition:
DuplicateChecker.cc:13
muonDTDigis_cfi.pset
pset
Definition:
muonDTDigis_cfi.py:27
Generated for CMSSW Reference Manual by
1.8.16