00001 #ifndef EVENT_LOOP_UNIT_TEST_ALG1_H
00002 #define EVENT_LOOP_UNIT_TEST_ALG1_H
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00016
00017
00018
00019 #include <EventLoop/Global.h>
00020
00021 #include <EventLoop/Algorithm.h>
00022 #include <RootCore/Packages.h>
00023
00024 class TBranch;
00025 class TH1;
00026 class TTree;
00027
00028 namespace D3PDReader
00029 {
00030 class Event;
00031 }
00032
00033 namespace EL
00034 {
00035 class UnitTestAlg1 : public Algorithm
00036 {
00037
00038
00039
00040
00043 public:
00044 void testInvariant () const;
00045
00046
00051 public:
00052 UnitTestAlg1 (const std::string& branchName = "el_n");
00053
00054
00056 public:
00057 bool makeOutput;
00058
00059
00061 public:
00062 enum CallBack
00063 {
00064 CB_CHANGE_INPUT_FIRST,
00065 CB_CHANGE_INPUT_OTHER,
00066 CB_INITIALIZE,
00067 CB_HIST_INITIALIZE,
00068 CB_EXECUTE,
00069 CB_FILE_EXECUTE,
00070 CB_FINALIZE,
00071 CB_HIST_FINALIZE
00072 };
00073
00074
00075
00076
00077
00078
00079
00088 private:
00089 virtual StatusCode setupJob (Job& job) override;
00090
00091
00097 private:
00098 virtual StatusCode changeInput (bool firstFile) override;
00099
00100
00111 private:
00112 virtual StatusCode initialize () override;
00113
00114 private:
00115 virtual StatusCode histInitialize () override;
00116
00117
00122 private:
00123 virtual StatusCode execute () override;
00124
00125
00132 private:
00133 virtual StatusCode fileExecute () override;
00134
00135
00143 private:
00144 virtual StatusCode finalize () override;
00145
00146
00153 private:
00154 virtual StatusCode histFinalize () override;
00155
00156
00157
00158
00159
00160
00161
00163 private:
00164 std::string m_name;
00165
00166 #ifdef ROOTCORE_PACKAGE_D3PDReader
00168 private:
00169 D3PDReader::Event *m_event;
00170 #else
00172 private:
00173 TBranch *m_branch;
00174 #endif
00175
00177 private:
00178 Int_t m_value;
00179
00181 private:
00182
00183
00185 private:
00186 TTree *m_tree;
00187
00189 private:
00190 std::string m_fileName;
00191
00193 private:
00194 bool m_hasInitialize;
00195
00197 private:
00198 bool m_hasHistInitialize;
00199
00200 private:
00201 unsigned m_calls = 0;
00202
00203 private:
00204 TH1 *m_callbacks = nullptr;
00205
00206 private:
00207 TH1 *getCallbacks ();
00208
00209 #pragma GCC diagnostic push
00210 #pragma GCC diagnostic ignored "-Wpragmas"
00211 #pragma GCC diagnostic ignored "-Wunknown-pragmas"
00212 #pragma GCC diagnostic ignored "-Winconsistent-missing-override"
00213 ClassDef(UnitTestAlg1, 1);
00214 #pragma GCC diagnostic pop
00215 };
00216 }
00217
00218 #endif