Definition at line 30 of file AssnAnalyzer_module.cc.
AssnAnalyzer::AssnAnalyzer |
( |
fhicl::ParameterSet const & |
p | ) |
|
|
explicit |
Definition at line 69 of file AssnAnalyzer_module.cc.
74 auto enableTests =
p.get<std::vector<std::string>>(
"enableTests");
75 if (enableTests.empty()) {
77 "forEachAssociatedGroup",
"associatedGroups",
"associatedGroupsWithLeft"
81 std::copy(enableTests.begin(), enableTests.end(),
std::set< std::string > fEnabledTests
art::InputTag fInputLabel
void AssnAnalyzer::analyze |
( |
art::Event const & |
e | ) |
|
|
override |
Definition at line 87 of file AssnAnalyzer_module.cc.
void associated_groups_test(art::Event const &e) const
std::set< std::string > fEnabledTests
void associated_groups_with_left_test(art::Event const &e) const
void for_each_associated_group_test(art::Event const &e) const
void AssnAnalyzer::associated_groups_test |
( |
art::Event const & |
e | ) |
const |
|
private |
Definition at line 125 of file AssnAnalyzer_module.cc.
130 typedef typename art::Assns<int, std::string> istr_assns;
131 auto const & int_to_str_assns = *
e.getValidHandle<istr_assns> (
fInputLabel);
132 auto vs =
strvec_t {
"one",
"one-a",
"two",
"two-a",
"three",
"three-a"};
136 for(art::Ptr<std::string>
const&
s: strs) {
137 std::cout <<
s << std::flush <<
" \"" << *
s <<
"\"" << std::endl;
138 strvec.push_back(*
s);
143 for(
auto k=0;
k<6;++
k) {
144 if (strvec[
k] != vs[
k]) {
145 throw art::Exception(art::errors::LogicError)
146 <<
"String #" << k <<
" expected to be '" << vs[
k]
147 <<
"', got '" << strvec[
k] <<
"' instead!\n";
std::vector< std::string > strvec_t
auto associated_groups(A const &assns)
Helper functions to access associations in order.
then echo File list $list not found else cat $list while read file do echo $file sed s
art::InputTag fInputLabel
BEGIN_PROLOG could also be cout
void AssnAnalyzer::associated_groups_with_left_test |
( |
art::Event const & |
e | ) |
const |
|
private |
Definition at line 154 of file AssnAnalyzer_module.cc.
159 typedef typename art::Assns<int, std::string> istr_assns;
160 auto const & int_to_str_assns = *
e.getValidHandle<istr_assns> (
fInputLabel);
161 std::vector<std::pair<int, std::string>> vs = {
170 std::vector<std::pair<int, std::string>> strvec;
174 auto const& key = std::get<0>(
group);
175 auto const& strs = std::get<1>(
group);
177 std::cout <<
"#" << (*key) <<
" (" << key <<
")" << std::endl;
178 for(art::Ptr<std::string>
const&
s: strs) {
179 std::cout <<
" - " <<
s <<
" \"" << *
s <<
"\"" << std::endl;
180 strvec.emplace_back(*key, *
s);
185 for(
auto k=0;
k<6;++
k) {
186 std::string
const&
s = strvec[
k].second;
188 if (starts_with(s,
"one" )) key = 1;
189 else if (starts_with(s,
"two" )) key = 2;
190 else if (starts_with(s,
"three")) key = 3;
193 throw art::Exception(art::errors::LogicError)
194 <<
"String #" <<
k <<
" expected to have key '" << vs[
k].first
195 <<
"', got '" << key <<
"' instead!\n";
199 throw art::Exception(art::errors::LogicError)
200 <<
"String #" <<
k <<
" expected to be '" << vs[
k].second
201 <<
"', got '" << s <<
"' instead!\n";
auto associated_groups_with_left(A const &assns)
Helper functions to access associations in order, also with key.
then echo File list $list not found else cat $list while read file do echo $file sed s
art::InputTag fInputLabel
BEGIN_PROLOG could also be cout
void AssnAnalyzer::for_each_associated_group_test |
( |
art::Event const & |
e | ) |
const |
|
private |
Definition at line 97 of file AssnAnalyzer_module.cc.
99 typedef typename art::Assns<int, std::string> istr_assns;
100 auto const & int_to_str_assns = *
e.getValidHandle<istr_assns> (
fInputLabel);
101 auto vs =
strvec_t {
"one",
"one-a",
"two",
"two-a",
"three",
"three-a"};
104 auto strings = [&strvec](
auto strs) {
106 std::cout << *
s << std::flush <<
" \"" << **
s <<
"\"" << std::endl;
107 strvec.push_back(**
s);
111 art::for_each_group(int_to_str_assns, strings);
114 for(
auto k=0;
k<6;++
k) {
115 if (strvec[
k] != vs[
k]) {
116 throw art::Exception(art::errors::LogicError)
117 <<
"String #" << k <<
" expected to be '" << vs[
k]
118 <<
"', got '" << strvec[
k] <<
"' instead!\n";
std::vector< std::string > strvec_t
auto end(FixedBins< T, C > const &) noexcept
auto begin(FixedBins< T, C > const &) noexcept
then echo File list $list not found else cat $list while read file do echo $file sed s
art::InputTag fInputLabel
BEGIN_PROLOG could also be cout
std::set<std::string> AssnAnalyzer::fEnabledTests |
|
private |
art::InputTag AssnAnalyzer::fInputLabel |
|
private |
The documentation for this class was generated from the following file: