|
ATLAS Offline Software
|
Go to the documentation of this file.
47 : m_eventInfoName (
"EventInfo")
106 std::ifstream
file (duplicatesFile);
110 if (!
line.empty() &&
line[0] !=
'#')
129 sh.load (submitdir +
"/hist");
143 std::set<std::pair<number_type,number_type>> known_list;
144 std::set<std::pair<number_type,number_type>> processed_list;
146 std::unique_ptr<TChain>
tree (
sample->makeTChain());
147 std::string *inputFileName =
nullptr;
148 tree->SetBranchAddress (
"fileName", &inputFileName);
149 Long64_t inputFileIndex;
150 tree->SetBranchAddress (
"fileIndex", &inputFileIndex);
156 tree->SetBranchAddress (
"processed", &processed);
164 if (known_list.find (
id) == known_list.end())
165 known_list.insert (
id);
168 file <<
sample->name() <<
" " << *inputFileName <<
" "
169 << inputFileIndex <<
" " <<
runNumber <<
" "
175 if (processed_list.find (
id) == processed_list.end())
176 processed_list.insert (
id);
180 std::cout <<
"ERROR: duplicate event processed: "
186 if (known_list.size() != processed_list.size())
188 RCU_ASSERT (processed_list.size() < known_list.size());
190 for (
auto&
id : known_list)
192 if (processed_list.find (
id) == processed_list.end())
194 std::cout <<
"ERROR: event never processed: "
211 return StatusCode::SUCCESS;
228 return StatusCode::SUCCESS;
251 return StatusCode::SUCCESS;
271 if (
id != iter->second)
273 ATH_MSG_FATAL (
"expected duplicate event at entry " << iter->first
274 <<
" to be run=" << iter->second.first <<
",event="
275 << iter->second.second <<
" but found run="
276 <<
id.first <<
",event=" <<
id.second);
277 return StatusCode::FAILURE;
289 <<
" event=" <<
id.
second <<
" in file "
290 <<
wk()->inputFileName() <<
" at event "
291 <<
wk()->treeEntry());
305 return StatusCode::SUCCESS;
uint32_t number_type
the integer type to use for run and event numbers
void setOutputTreeName(const std::string &val_outputTreeName)
set the value of outputTreeName
ClassImp(EL::DuplicateChecker) namespace EL
const std::string & eventInfoName() const
the name of the EventInfo structure to use
std::set< std::pair< number_type, number_type > > m_processed
the list of run-event numbers already encountered
std::string m_inputFileName
the name of the input file (connected to m_outputTree, if present)
virtual void skipEvent()=0
effects: skip the current event, i.e.
virtual xAOD::TEvent * xaodEvent() const =0
description: the xAOD event and store guarantee: strong failures: out of memory I failures: TEventSvc...
virtual StatusCode changeInput(bool firstFile) override
effects: do all changes to work with a new input file, e.g.
void addKnownDuplicatesFile(const std::string &duplicatesFile)
add a file with known duplicates
virtual void addOutput(TObject *output_swallow)=0
effects: add an object to the output.
number_type m_eventNumber
the event number of the current event (connected to m_outputTree, if present)
virtual StatusCode execute() override
effects: process the next event guarantee: basic failures: algorithm dependent
Long64_t m_inputFileIndex
the index in the input file (connected to m_outputTree, if present)
static bool processSummary(const std::string &submitdir, const std::string &treeName)
process the summary tree from the given submission
number_type m_runNumber
the run number of the current event (connected to m_outputTree, if present)
Bool_t m_processEvent
whether the current event is/should be processed (connected to m_outputTree, if present)
const std::string & outputTreeName() const
the name of the output tree to create, or the empty string if none is created
virtual Long64_t treeEntry() const =0
description: the entry in the tree we are reading guarantee: no-fail
virtual std::string inputFileName() const =0
the name of the file we are reading the current tree from, without the path component
std::map< std::pair< std::string, std::string >, std::map< Long64_t, std::pair< number_type, number_type > > > m_duplicates
the list of known duplicates to skip
::StatusCode StatusCode
StatusCode definition for legacy code.
void testInvariant() const
test the invariant of this object
This module defines the arguments passed from the BATCH driver to the BATCH worker.
IWorker * wk() const
description: the worker that is controlling us guarantee: no-fail
a base class that manages a set of files belonging to a particular data set and the associated meta-d...
TTree * m_outputTree
the output tree, if we are creating one
Class describing the basic event information.
xAOD::TEvent * m_event
the event we are reading from
#define ATH_MSG_WARNING(x)
std::string m_eventInfoName
the value returned by eventInfoName
DuplicateChecker()
standard constructor
StatusCode retrieve(const T *&obj, const std::string &key)
Retrieve either an input or an output object from the event.
void setEventInfoName(const std::string &val_eventInfoName)
set the value of eventInfoName
#define RCU_CHANGE_INVARIANT(x)
A class that manages a list of Sample objects.
std::map< Long64_t, std::pair< number_type, number_type > > * m_currentDuplicates
the list of the duplicates in the current file to skip, or the null pointer if there are none
#define RCU_THROW_MSG(message)
void read_run_event_number()
get the run and event number for the current event
virtual StatusCode initialize() override
effects: do everything that needs to be done before running the algorithm, e.g.
void addKnownDuplicate(const std::string &sampleName, const std::string &fileName, Long64_t entry, number_type runNumber, number_type eventNumber)
add a known duplicate event
std::string m_outputTreeName
the value returned by outputTreeName
#define RCU_READ_INVARIANT(x)
virtual StatusCode setupJob(Job &job) override
effects: give the algorithm a chance to intialize the job with anything this algorithm needs.
#define RCU_NEW_INVARIANT(x)