Classes | Public Member Functions | Private Types | Private Attributes | List of all members
art::DuplicateChecker Class Reference

#include <DuplicateChecker.h>

Classes

struct  Config
 

Public Member Functions

 DuplicateChecker (fhicl::TableFragment< Config > const &config)
 
void init (bool realData, FileIndex const &fileIndex)
 
void inputFileClosed ()
 
void rewind ()
 
bool isDuplicateAndCheckActive (EventID const &eventID, std::string const &fileName)
 

Private Types

enum  DuplicateCheckMode { noDuplicateCheck, checkEachFile, checkEachRealDataFile, checkAllFilesOpened }
 
enum  DataType { isRealData, isSimulation, unknown }
 

Private Attributes

DuplicateCheckMode duplicateCheckMode_
 
DataType dataType_
 
std::set< EventIDeventIDs_
 
bool itIsKnownTheFileHasNoDuplicates_
 

Detailed Description

Definition at line 29 of file DuplicateChecker.h.

Member Enumeration Documentation

Constructor & Destructor Documentation

art::DuplicateChecker::DuplicateChecker ( fhicl::TableFragment< Config > const &  config)

Definition at line 12 of file DuplicateChecker.cc.

14  :
15 
18  , eventIDs_()
20  {
21  std::string const& duplicateCheckMode = config().duplicateCheckMode();
22 
23  if (duplicateCheckMode == std::string("noDuplicateCheck"))
25  else if (duplicateCheckMode == std::string("checkEachFile"))
27  else if (duplicateCheckMode == std::string("checkEachRealDataFile"))
29  else if (duplicateCheckMode == std::string("checkAllFilesOpened"))
31  else {
32  throw cet::exception("Configuration")
33  << "Illegal configuration parameter value passed to RootInput for\n"
34  << "the \"duplicateCheckMode\" parameter, legal values are:\n"
35  << "\"noDuplicateCheck\", \"checkEachFile\", "
36  "\"checkEachRealDataFile\", \"checkAllFilesOpened\"\n";
37  }
38  }
DuplicateCheckMode duplicateCheckMode_
std::string string
Definition: nybbler.cc:12
std::set< EventID > eventIDs_
cet::coded_exception< error, detail::translate > exception
Definition: exception.h:33

Member Function Documentation

void art::DuplicateChecker::init ( bool  realData,
FileIndex const &  fileIndex 
)
void art::DuplicateChecker::inputFileClosed ( )
bool art::DuplicateChecker::isDuplicateAndCheckActive ( EventID const &  eventID,
std::string const &  fileName 
)

Definition at line 78 of file DuplicateChecker.cc.

80  {
82  return false;
85  return false;
86 
89  assert(dataType_ != unknown);
91  return false;
92  }
93 
94  bool duplicate = !eventIDs_.insert(eventID).second;
95 
96  if (duplicate) {
98  LogWarning("DuplicateEvent")
99  << "Duplicate Events found in entire set of input files.\n"
100  << "Both events were from " << eventID << ".\n"
101  << "The duplicate was from file " << fileName << ".\n"
102  << "The duplicate will be skipped.\n";
103  } else {
104  LogWarning("DuplicateEvent")
105  << "Duplicate Events found in file " << fileName << ".\n"
106  << "Both events were " << eventID << ".\n"
107  << "The duplicate will be skipped.\n";
108  }
109  return true;
110  }
111  return false;
112  }
DuplicateCheckMode duplicateCheckMode_
MaybeLogger_< ELseverityLevel::ELsev_warning, false > LogWarning
std::set< EventID > eventIDs_
void art::DuplicateChecker::rewind ( )

Definition at line 72 of file DuplicateChecker.cc.

73  {
74  eventIDs_.clear();
75  }
std::set< EventID > eventIDs_

Member Data Documentation

DataType art::DuplicateChecker::dataType_
private

Definition at line 60 of file DuplicateChecker.h.

DuplicateCheckMode art::DuplicateChecker::duplicateCheckMode_
private

Definition at line 56 of file DuplicateChecker.h.

std::set<EventID> art::DuplicateChecker::eventIDs_
private

Definition at line 62 of file DuplicateChecker.h.

bool art::DuplicateChecker::itIsKnownTheFileHasNoDuplicates_
private

Definition at line 64 of file DuplicateChecker.h.


The documentation for this class was generated from the following files: