42 testInvariant ()
const
50 UnitTestAlg1 (
const std::string& branchName)
56 m_hasInitialize (false),
57 m_hasHistInitialize (false)
78 return StatusCode::SUCCESS;
84 changeInput (
bool firstFile)
89 getCallbacks()->Fill (CB_CHANGE_INPUT_FIRST);
91 getCallbacks()->Fill (CB_CHANGE_INPUT_OTHER);
94 m_branch = wk()->tree()->GetBranch (m_name.c_str());
97 m_branch->SetAddress (&m_value);
99 m_fileName = wk()->inputFile()->GetName();
100 return StatusCode::SUCCESS;
110 getCallbacks()->Fill (CB_HIST_INITIALIZE);
114 book (
TH1F ((m_name +
"2").c_str(), m_name.c_str(), 50, 0, 50));
115 book (
TH1F (
"file_executes",
"file executes", 1, 0, 1));
116 m_hasHistInitialize =
true;
117 return StatusCode::SUCCESS;
127 getCallbacks()->Fill (CB_INITIALIZE);
141 wk()->addOutput (
new TH1F (m_name.c_str(), m_name.c_str(),
145 TFile *
file = wk()->getOutputFile (
"out");
146 m_tree =
new TTree (
"tree",
"test output");
147 m_tree->SetDirectory (
file);
148 m_tree->Branch (m_name.c_str(), &m_value, (m_name +
"/I").c_str());
150 m_hasInitialize =
true;
151 return StatusCode::SUCCESS;
161 getCallbacks()->Fill (CB_FILE_EXECUTE);
164 hist (
"file_executes")->Fill (0);
165 return StatusCode::SUCCESS;
175 getCallbacks()->Fill (CB_EXECUTE);
179 m_branch->GetEntry (wk()->treeEntry());
180 hist(m_name)->Fill (m_value);
184 setMsgLevel (MSG::INFO);
188 return StatusCode::SUCCESS;
198 getCallbacks()->Fill (CB_FINALIZE);
201 wk()->addOutput (
new TH1F (
"beta/dir/hist",
"directory test", 10, 0, 10));
202 wk()->addOutputList (
"alpha",
new TObjString (
"alpha"));
203 return StatusCode::SUCCESS;
213 getCallbacks()->Fill (CB_HIST_FINALIZE);
216 wk()->addOutput (
new TH1F (
"beta/dir/hist",
"directory test", 10, 0, 10));
217 wk()->addOutputList (
"alpha",
new TObjString (
"alpha"));
218 return StatusCode::SUCCESS;
226 if (m_callbacks ==
nullptr)
228 m_callbacks =
new TH1F (
"callbacks",
"callbacks", CB_HIST_FINALIZE + 1,
229 0, CB_HIST_FINALIZE + 1);
230 wk()->addOutput (m_callbacks);