00001 #ifndef DataFormats_Provenance_DuplicateChecker_h 00002 #define DataFormats_Provenance_DuplicateChecker_h 00003 00004 00005 /*---------------------------------------------------------------------- 00006 00007 IOPool/Input/src/DuplicateChecker.h 00008 00009 Used by PoolSource to detect events with 00010 the same run and event number. It is configurable 00011 whether it checks for duplicates within the scope 00012 of each single input file or all input files or 00013 not at all. 00014 00015 ----------------------------------------------------------------------*/ 00016 00017 #include "DataFormats/Provenance/interface/EventID.h" 00018 #include "DataFormats/Provenance/interface/LuminosityBlockID.h" 00019 00020 #include <set> 00021 #include <string> 00022 00023 namespace edm { 00024 00025 class ParameterSet; 00026 class FileIndex; 00027 00028 class DuplicateChecker { 00029 public: 00030 00031 DuplicateChecker(ParameterSet const& pset); 00032 00033 void init(bool realData, 00034 FileIndex const& fileIndex); 00035 00036 void inputFileClosed(); 00037 00038 void rewind(); 00039 00040 bool isDuplicateAndCheckActive(EventID const& eventID, 00041 LuminosityBlockNumber_t const& lumi, 00042 std::string const& fileName); 00043 00044 private: 00045 00046 enum DuplicateCheckMode { noDuplicateCheck, checkEachFile, checkEachRealDataFile, checkAllFilesOpened }; 00047 00048 DuplicateCheckMode duplicateCheckMode_; 00049 00050 enum DataType { isRealData, isSimulation, unknown }; 00051 00052 DataType dataType_; 00053 00054 std::set<EventID> eventIDs_; 00055 00056 bool itIsKnownTheFileHasNoDuplicates_; 00057 }; 00058 } 00059 #endif