36 testInvariant ()
const
44 UnitTestAlg2 (
const std::string& name,
45 ISvcLocator* pSvcLocator)
46 : AnaAlgorithm (name, pSvcLocator),
51 m_hasInitialize (
false)
53 declareProperty (
"property", m_property,
"test property");
54 declareProperty (
"string_property", m_string_property,
"test string property");
55 declareProperty (
"toolHandle", m_toolHandle,
"ToolHandle property");
67 getCallbacks()->Fill (CB_INITIALIZE);
73 ANA_CHECK (book (TEfficiency (
"efficiency",
"dummy efficiency hist", 50, 0, 50)));
74 (void) hist<TEfficiency> (
"efficiency");
75 (void) histeff (
"efficiency");
77 ANA_CHECK (book (TH1F ((m_name +
"2_2").c_str(), m_name.c_str(), 50, 0, 50)));
78 ANA_CHECK (book (TH1F (
"file_executes_2",
"file executes", 1, 0, 1)));
80 ANA_CHECK (book (TH1F (
"test_property",
"test_property", 1, 0, 1)));
81 hist(
"test_property")->Fill (0.5, m_property);
89 wk()->addOutput (
new TH1F (m_name.c_str(), m_name.c_str(),
93 TFile *
file = wk()->getOutputFile (
"out");
94 m_tree =
new TTree (
"tree2",
"test output");
95 m_tree->SetDirectory (
file);
96 m_tree->Branch (m_name.c_str(), &m_value, (m_name +
"/I").c_str());
98 m_hasInitialize =
true;
99 return ::StatusCode::SUCCESS;
109 getCallbacks()->Fill (CB_EXECUTE);
117 m_branch = wk()->tree()->GetBranch (m_name.c_str());
120 m_branch->SetAddress (&m_value);
124 m_branch->GetEntry (wk()->treeEntry());
125 hist(m_name)->Fill (m_value);
129 msg().setLevel (MSG::INFO);
133 return ::StatusCode::SUCCESS;
143 getCallbacks()->Fill (CB_FINALIZE);
146 wk()->addOutput (
new TH1F (
"beta/dir/hist2",
"directory test", 10, 0, 10));
147 wk()->addOutputList (
"alpha2",
new TObjString (
"alpha2"));
148 return ::StatusCode::SUCCESS;
156 if (m_callbacks ==
nullptr)
158 m_callbacks =
new TH1F (
"callbacks2",
"callbacks", CB_FINALIZE + 1,
160 wk()->addOutput (m_callbacks);