template<typename Object, typename Collection = std::vector<Object>>
class StringBranchHelper< Object, Collection >
Definition at line 124 of file StringBasedNTupler.h.
template<typename Object , typename Collection = std::vector<Object>>
Definition at line 129 of file StringBasedNTupler.h.
References TreeBranch::className(), TreeBranch::expr(), edm::HandleBase::failedToGet(), edm::Event::getByLabel(), mps_fire::i, edm::EventBase::isRealData(), LogDebug, TreeBranch::order(), TreeBranch::selection(), corrVsCorr::selection, TreeBranch::src(), parallelization::uint(), and StringBranchHelper< Object, Collection >::value_.
130 const float defaultValue = 0.;
141 value_ = std::make_unique<std::vector<float>>();
146 value_ = std::make_unique<std::vector<float>>();
147 value_->reserve(oH->size());
155 uint i_end = oH->size();
157 if (!B.
order().empty()) {
160 std::vector<const Object*> copyToSort(oH->size());
161 for (
uint i = 0;
i != i_end; ++
i)
162 copyToSort[
i] = &(*oH)[
i];
165 for (
uint i = 0;
i != i_end; ++
i) {
168 if (selection && !((*selection)(*(copyToSort)[
i])))
170 value_->push_back((expr)(*(copyToSort)[i]));
173 <<
"with sorting. could not evaluate expression: " << B.
expr() <<
" on class: " << B.
className();
174 value_->push_back(defaultValue);
179 for (
uint i = 0; i != i_end; ++
i) {
182 if (selection && !((*selection)((*oH)[i])))
184 value_->push_back((expr)((*oH)[i]));
187 <<
"could not evaluate expression: " << B.
expr() <<
" on class: " << B.
className();
188 value_->push_back(defaultValue);
const std::string & selection() const
Log< level::Error, false > LogError
const std::string & order() const
const edm::InputTag & src() const
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
const std::string & className() const
const std::string & expr() const