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
00023 class TBranch;
00024 class TH1;
00025 class TTree;
00026
00027 namespace EL
00028 {
00029 class UnitTestAlg1 : public Algorithm
00030 {
00031
00032
00033
00034
00037 public:
00038 void testInvariant () const;
00039
00040
00045 public:
00046 UnitTestAlg1 (const std::string& branchName = "el_n");
00047
00048
00050 public:
00051 bool makeOutput;
00052
00053
00055 public:
00056 enum CallBack
00057 {
00058 CB_CHANGE_INPUT_FIRST,
00059 CB_CHANGE_INPUT_OTHER,
00060 CB_INITIALIZE,
00061 CB_HIST_INITIALIZE,
00062 CB_EXECUTE,
00063 CB_FILE_EXECUTE,
00064 CB_FINALIZE,
00065 CB_HIST_FINALIZE
00066 };
00067
00068
00069
00070
00071
00072
00073
00082 private:
00083 virtual StatusCode setupJob (Job& job) override;
00084
00085
00091 private:
00092 virtual StatusCode changeInput (bool firstFile) override;
00093
00094
00105 private:
00106 virtual StatusCode initialize () override;
00107
00108 private:
00109 virtual StatusCode histInitialize () override;
00110
00111
00116 private:
00117 virtual StatusCode execute () override;
00118
00119
00126 private:
00127 virtual StatusCode fileExecute () override;
00128
00129
00137 private:
00138 virtual StatusCode finalize () override;
00139
00140
00147 private:
00148 virtual StatusCode histFinalize () override;
00149
00150
00151
00152
00153
00154
00155
00157 private:
00158 std::string m_name;
00159
00161 private:
00162 TBranch *m_branch;
00163
00165 private:
00166 Int_t m_value;
00167
00169 private:
00170
00171
00173 private:
00174 TTree *m_tree;
00175
00177 private:
00178 std::string m_fileName;
00179
00181 private:
00182 bool m_hasInitialize;
00183
00185 private:
00186 bool m_hasHistInitialize;
00187
00188 private:
00189 unsigned m_calls = 0;
00190
00191 private:
00192 TH1 *m_callbacks = nullptr;
00193
00194 private:
00195 TH1 *getCallbacks ();
00196
00197 #pragma GCC diagnostic push
00198 #pragma GCC diagnostic ignored "-Wpragmas"
00199 #pragma GCC diagnostic ignored "-Wunknown-pragmas"
00200 #pragma GCC diagnostic ignored "-Winconsistent-missing-override"
00201 ClassDef(UnitTestAlg1, 1);
00202 #pragma GCC diagnostic pop
00203 };
00204 }
00205
00206 #endif