ATLAS Offline Software
Loading...
Searching...
No Matches
DuplicateChecker.h
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
3*/
4
6
7
8#ifndef EVENT_LOOP_ALGS__DUPLICATE_CHECKER_H
9#define EVENT_LOOP_ALGS__DUPLICATE_CHECKER_H
10
12
13#include <EventLoop/Algorithm.h>
15#include <map>
16#include <set>
17
18namespace xAOD
19{
20 class TEvent;
21}
22
23class TObjString;
24class TTree;
25
26namespace EL
27{
29
31 {
32 //
33 // public interface
34 //
35
37 private:
38 typedef uint32_t number_type;
39
40
44 public:
45 void testInvariant () const;
46
47
53 public:
55
56
63 public:
64 const std::string& eventInfoName () const;
65
71 public:
72 void setEventInfoName (const std::string& val_eventInfoName);
73
74
84 public:
85 const std::string& outputTreeName () const;
86
92 public:
93 void setOutputTreeName (const std::string& val_outputTreeName);
94
95
101 public:
102 void addKnownDuplicate (const std::string& sampleName,
103 const std::string& fileName,
104 Long64_t entry, number_type runNumber,
105 number_type eventNumber);
106
113 public:
114 void addKnownDuplicatesFile (const std::string& duplicatesFile);
115
116
129 public:
130 static bool
131 processSummary (const std::string& submitdir, const std::string& treeName);
132
133
140 public:
141 static bool
142 processSummary (const SH::SampleHandler& sh, const std::string& outputFile);
143
144
145
146 //
147 // inherited interface
148 //
149
150 private:
151 virtual StatusCode setupJob (Job& job) override;
152
153 private:
154 virtual StatusCode changeInput (bool firstFile) override;
155
156 private:
157 virtual StatusCode initialize () override;
158
159 private:
160 virtual StatusCode execute () override;
161
162
163
164 //
165 // private interface
166 //
167
169 private:
170 std::string m_eventInfoName;
171
173 private:
174 std::string m_outputTreeName;
175
177 private:
178 std::map<std::pair<std::string,std::string>,std::map<Long64_t,std::pair<number_type,number_type> > > m_duplicates;
179
182 private:
183 std::map<Long64_t,std::pair<number_type,number_type> > *m_currentDuplicates = nullptr;
184
185
187 private:
188 std::set<std::pair<number_type,number_type> > m_processed;
189
191 private:
193
194
196 private:
197 TTree *m_outputTree = nullptr;
198
201 private:
202 std::string m_inputFileName;
203
206 private:
208
211 private:
213
216 private:
218
221 private:
223
225 private:
227
228#pragma GCC diagnostic push
229#pragma GCC diagnostic ignored "-Wpragmas"
230#pragma GCC diagnostic ignored "-Wunknown-pragmas"
231#pragma GCC diagnostic ignored "-Winconsistent-missing-override"
233#pragma GCC diagnostic pop
234 };
235}
236
237#endif
friend class Job
Definition Algorithm.h:292
Algorithm()
effects: standard default constructor guarantee: strong failures: low level errors I
std::string m_outputTreeName
the value returned by outputTreeName
number_type m_runNumber
the run number of the current event (connected to m_outputTree, if present)
number_type m_eventNumber
the event number of the current event (connected to m_outputTree, if present)
static bool processSummary(const SH::SampleHandler &sh, const std::string &outputFile)
process the summary tree from the given submission
void setOutputTreeName(const std::string &val_outputTreeName)
set the value of outputTreeName
const std::string & outputTreeName() const
the name of the output tree to create, or the empty string if none is created
virtual StatusCode changeInput(bool firstFile) override
effects: do all changes to work with a new input file, e.g.
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
void setEventInfoName(const std::string &val_eventInfoName)
set the value of eventInfoName
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)
uint32_t number_type
the integer type to use for run and event numbers
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
const std::string & eventInfoName() const
the name of the EventInfo structure to use
static bool processSummary(const std::string &submitdir, const std::string &treeName)
process the summary tree from the given submission
std::string m_eventInfoName
the value returned by eventInfoName
Long64_t m_inputFileIndex
the index in the input file (connected to m_outputTree, if present)
ClassDef(DuplicateChecker, 1)
xAOD::TEvent * m_event
the event we are reading from
Bool_t m_processEvent
whether the current event is/should be processed (connected to m_outputTree, if present)
void addKnownDuplicatesFile(const std::string &duplicatesFile)
add a file with known duplicates
virtual StatusCode setupJob(Job &job) override
effects: give the algorithm a chance to intialize the job with anything this algorithm needs.
virtual StatusCode initialize() override
effects: do everything that needs to be done before running the algorithm, e.g.
void read_run_event_number()
get the run and event number for the current event
virtual StatusCode execute() override
effects: process the next event guarantee: basic failures: algorithm dependent
TTree * m_outputTree
the output tree, if we are creating one
DuplicateChecker()
standard constructor
void testInvariant() const
test the invariant of this object
void addKnownDuplicate(const std::string &sampleName, const std::string &fileName, Long64_t entry, number_type runNumber, number_type eventNumber)
add a known duplicate event
A class that manages a list of Sample objects.
Tool for accessing xAOD files outside of Athena.
This module defines the arguments passed from the BATCH driver to the BATCH worker.
::StatusCode StatusCode
StatusCode definition for legacy code.
ICaloAffectedTool is abstract interface for tools checking if 4 mom is in calo affected region.