Go to the source code of this file.
◆ ClassImp()
Definition at line 37 of file UnitTestAlg.cxx.
42 testInvariant ()
const
50 UnitTestAlg (
const std::string& branchName)
56 m_hasInitialize (false),
57 m_hasHistInitialize (false)
74 return StatusCode::SUCCESS;
80 changeInput (
bool firstFile)
85 m_branch = wk()->tree()->GetBranch (m_name.c_str());
88 m_branch->SetAddress (&m_value);
90 m_fileName = wk()->inputFile()->GetName();
91 return StatusCode::SUCCESS;
103 book (
TH1F ((m_name +
"2").c_str(), m_name.c_str(), 50, 0, 50));
104 book (
TH1F (
"file_executes",
"file executes", 1, 0, 1));
105 m_hasHistInitialize =
true;
106 return StatusCode::SUCCESS;
122 if (wk()->metaData()->castDouble (
"jobOpt") != 42)
125 if (wk()->metaData()->castString (
"mymeta") !=
"test")
128 wk()->addOutput (
new TH1F (m_name.c_str(), m_name.c_str(),
132 TFile *
file = wk()->getOutputFile (
"out");
133 m_tree =
new TTree (
"tree",
"test output");
134 m_tree->SetDirectory (
file);
135 m_tree->Branch (m_name.c_str(), &m_value, (m_name +
"/I").c_str());
137 m_hasInitialize =
true;
138 return StatusCode::SUCCESS;
149 hist (
"file_executes")->Fill (0);
150 return StatusCode::SUCCESS;
162 m_branch->GetEntry (wk()->treeEntry());
163 hist(m_name)->Fill (m_value);
167 setMsgLevel (MSG::INFO);
171 return StatusCode::SUCCESS;
181 wk()->addOutput (
new TH1F (
"beta/dir/hist",
"directory test", 10, 0, 10));
182 wk()->addOutputList (
"alpha",
new TObjString (
"alpha"));
183 return StatusCode::SUCCESS;
193 wk()->addOutput (
new TH1F (
"beta/dir/hist",
"directory test", 10, 0, 10));
194 wk()->addOutputList (
"alpha",
new TObjString (
"alpha"));
195 return StatusCode::SUCCESS;