37 testInvariant ()
const
42 for (std::size_t form = 0,
end = m_cuts.size(); form !=
end; ++ form)
52 RCU_INVARIANT (m_cuts.size() == std::size_t (m_hist->GetNbinsX()));
60 : m_outputStream (
"output"),
61 m_hist (0), m_formSvc (0), m_skim (0)
69 AlgSelect (
const std::string& val_outputStream,
const std::string&
cut)
70 : m_outputStream (val_outputStream),
71 m_hist (0), m_formSvc (0), m_skim (0)
76 m_cuts.push_back (
cut);
87 return m_outputStream;
102 histName (
const std::string& val_histName)
105 m_histName = val_histName;
111 addCut (
const std::string&
cut)
115 m_cuts.push_back (
cut);
125 return StatusCode::SUCCESS;
138 if (!m_cuts.empty() && !m_histName.empty())
140 m_hist =
new TH1D (m_histName.c_str(), 0, m_cuts.size(), 0, m_cuts.size());
141 wk()->addOutput (m_hist);
143 for (std::size_t form = 0,
end = m_cuts.size(); form !=
end; ++ form)
145 m_index.push_back (m_formSvc->addForm (m_cuts[form]));
146 m_hist->GetXaxis()->SetBinLabel (1 + form, m_cuts[form].c_str());
155 return StatusCode::SUCCESS;
168 for (std::size_t form = 0; form != m_cuts.size() &&
weight != 0; ++ form)
171 if (m_index[form])
switch (m_index[form]->ndim())
177 myweight = m_index[form]->value (0);
183 RCU_THROW_MSG (
"unknown formula dimension: " + m_cuts[form]);
187 if (m_hist &&
weight != 0)
192 m_skim->setFilterPassed ();
193 return StatusCode::SUCCESS;