64 {
return s.substr(0, key.length()) == key; }
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(),
101 auto vs =
strvec_t {
"one",
"one-a",
"two",
"two-a",
"three",
"three-a"};
104 auto strings = [&strvec](
auto strs) {
107 strvec.push_back(**
s);
114 for(
auto k=0;
k<6;++
k) {
115 if (strvec[
k] != vs[
k]) {
117 <<
"String #" << k <<
" expected to be '" << vs[
k]
118 <<
"', got '" << strvec[
k] <<
"' instead!\n";
132 auto vs =
strvec_t {
"one",
"one-a",
"two",
"two-a",
"three",
"three-a"};
138 strvec.push_back(*
s);
143 for(
auto k=0;
k<6;++
k) {
144 if (strvec[
k] != vs[
k]) {
146 <<
"String #" << k <<
" expected to be '" << vs[
k]
147 <<
"', got '" << strvec[
k] <<
"' instead!\n";
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;
179 std::cout <<
" - " <<
s <<
" \"" << *
s <<
"\"" <<
std::endl;
180 strvec.emplace_back(*
key, *
s);
185 for(
auto k=0;
k<6;++
k) {
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;
192 if (key != vs[
k].first) {
194 <<
"String #" <<
k <<
" expected to have key '" << vs[
k].first
195 <<
"', got '" << key <<
"' instead!\n";
200 <<
"String #" <<
k <<
" expected to be '" << vs[
k].second
201 <<
"', got '" << s <<
"' instead!\n";
end
while True: pbar.update(maxval-len(onlies[E][S])) #print iS, "/", len(onlies[E][S]) found = False for...
auto associated_groups_with_left(A const &assns)
Helper functions to access associations in order, also with key.
std::vector< std::string > strvec_t
void associated_groups_test(art::Event const &e) const
art::Assns< std::string, int > strintAssns_t
EDAnalyzer(fhicl::ParameterSet const &pset)
AssnAnalyzer & operator=(AssnAnalyzer const &)=delete
std::set< std::string > fEnabledTests
auto associated_groups(A const &assns)
Helper functions to access associations in order.
#define DEFINE_ART_MODULE(klass)
AssnAnalyzer(fhicl::ParameterSet const &p)
T get(std::string const &key) const
QTextStream & flush(QTextStream &s)
ValidHandle< PROD > getValidHandle(InputTag const &tag) const
void associated_groups_with_left_test(art::Event const &e) const
void analyze(art::Event const &e) override
cet::coded_exception< errors::ErrorCodes, ExceptionDetail::translate > Exception
Helper functions to access associations in order.
void for_each_group(art::Assns< A, B, D > const &assns, F func)
Helper functions to access associations in order.
std::vector< int > intvec_t
void for_each_associated_group_test(art::Event const &e) const
art::InputTag fInputLabel
decltype(auto) constexpr begin(T &&obj)
ADL-aware version of std::begin.
auto const & get(AssnsNode< L, R, D > const &r)
second_as<> second
Type of time stored in seconds, in double precision.
QTextStream & endl(QTextStream &s)