00001 #ifndef EVENT_LOOP_ALGS__DUPLICATE_CHECKER_H
00002 #define EVENT_LOOP_ALGS__DUPLICATE_CHECKER_H
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014 #include <EventLoopAlgs/Global.h>
00015
00016 #include <EventLoop/Algorithm.h>
00017 #include <SampleHandler/Global.h>
00018 #include <map>
00019 #include <set>
00020
00021 namespace xAOD
00022 {
00023 class TEvent;
00024 }
00025
00026 class TObjString;
00027 class TTree;
00028
00029 namespace EL
00030 {
00032
00033 class DuplicateChecker : public Algorithm
00034 {
00035
00036
00037
00038
00040 private:
00041 typedef uint32_t number_type;
00042
00043
00047 public:
00048 void testInvariant () const;
00049
00050
00056 public:
00057 DuplicateChecker ();
00058
00059
00066 public:
00067 const std::string& eventInfoName () const;
00068
00074 public:
00075 void setEventInfoName (const std::string& val_eventInfoName);
00076
00077
00087 public:
00088 const std::string& outputTreeName () const;
00089
00095 public:
00096 void setOutputTreeName (const std::string& val_outputTreeName);
00097
00098
00104 public:
00105 void addKnownDuplicate (const std::string& sampleName,
00106 const std::string& fileName,
00107 Long64_t entry, number_type runNumber,
00108 number_type eventNumber);
00109
00116 public:
00117 void addKnownDuplicatesFile (const std::string& duplicatesFile);
00118
00119
00132 public:
00133 static bool
00134 processSummary (const std::string& submitdir, const std::string& treeName);
00135
00136
00143 public:
00144 static bool
00145 processSummary (const SH::SampleHandler& sh, const std::string& outputFile);
00146
00147
00148
00149
00150
00151
00152
00153 private:
00154 virtual StatusCode setupJob (Job& job) override;
00155
00156 private:
00157 virtual StatusCode changeInput (bool firstFile) override;
00158
00159 private:
00160 virtual StatusCode initialize () override;
00161
00162 private:
00163 virtual StatusCode execute () override;
00164
00165
00166
00167
00168
00169
00170
00172 private:
00173 std::string m_eventInfoName;
00174
00176 private:
00177 std::string m_outputTreeName;
00178
00180 private:
00181 std::map<std::pair<std::string,std::string>,std::map<Long64_t,std::pair<number_type,number_type> > > m_duplicates;
00182
00185 private:
00186 std::map<Long64_t,std::pair<number_type,number_type> > *m_currentDuplicates = nullptr;
00187
00188
00190 private:
00191 std::set<std::pair<number_type,number_type> > m_processed;
00192
00194 private:
00195 xAOD::TEvent *m_event = nullptr;
00196
00197
00199 private:
00200 TTree *m_outputTree = nullptr;
00201
00204 private:
00205 std::string m_inputFileName;
00206
00209 private:
00210 Long64_t m_inputFileIndex;
00211
00214 private:
00215 number_type m_runNumber;
00216
00219 private:
00220 number_type m_eventNumber;
00221
00224 private:
00225 Bool_t m_processEvent;
00226
00228 private:
00229 void read_run_event_number ();
00230
00231 #pragma GCC diagnostic push
00232 #pragma GCC diagnostic ignored "-Wpragmas"
00233 #pragma GCC diagnostic ignored "-Wunknown-pragmas"
00234 #pragma GCC diagnostic ignored "-Winconsistent-missing-override"
00235 ClassDef(DuplicateChecker, 1);
00236 #pragma GCC diagnostic pop
00237 };
00238 }
00239
00240 #endif