31 testInvariant ()
const
36 for (std::size_t form = 0, end = m_cuts.size(); form != end; ++ form)
46 RCU_INVARIANT (m_cuts.size() == std::size_t (m_hist->GetNbinsX()));
54 : m_outputStream (
"output"),
55 m_hist (0), m_formSvc (0), m_skim (0)
63 AlgSelect (
const std::string& val_outputStream,
const std::string& cut)
64 : m_outputStream (val_outputStream),
65 m_hist (0), m_formSvc (0), m_skim (0)
70 m_cuts.push_back (cut);
77 const std::string& AlgSelect ::
81 return m_outputStream;
86 const std::string& AlgSelect ::
96 histName (
const std::string& val_histName)
99 m_histName = val_histName;
105 addCut (
const std::string& cut)
109 m_cuts.push_back (cut);
119 return StatusCode::SUCCESS;
132 if (!m_cuts.empty() && !m_histName.empty())
134 m_hist =
new TH1D (m_histName.c_str(), 0, m_cuts.size(), 0, m_cuts.size());
135 wk()->addOutput (m_hist);
137 for (std::size_t form = 0, end = m_cuts.size(); form != end; ++ form)
139 m_index.push_back (m_formSvc->addForm (m_cuts[form]));
140 m_hist->GetXaxis()->SetBinLabel (1 + form, m_cuts[form].c_str());
149 return StatusCode::SUCCESS;
162 for (std::size_t form = 0; form != m_cuts.size() && weight != 0; ++ form)
165 if (m_index[form])
switch (m_index[form]->ndim())
171 myweight = m_index[form]->value (0);
177 RCU_THROW_MSG (
"unknown formula dimension: " + m_cuts[form]);
181 if (m_hist && weight != 0)
186 m_skim->setFilterPassed ();
187 return StatusCode::SUCCESS;
NTupleSvc * getNTupleSvc(IWorker *worker, const std::string &outputStream, const std::string &treeName="")
effects: get the skimming algorithm for the given output for this worker guarantee: strong failures: ...