7 #include "DataFormats/TestObjects/interface/OtherThingCollection.h"
8 #include "DataFormats/TestObjects/interface/ThingCollection.h"
11 using namespace tfwliteselectortest;
14 static const char*
kA =
"a";
15 static const char*
kRefA =
"refA";
19 h_a =
new TH1F(
kA,
"a", 100, 0, 20);
27 std::cout <<
"processing event " << std::endl;
29 using namespace edmtest;
33 iEvent.
getByLabel(
"OtherThing",
"testUserTag", hOThings);
35 std::cout <<
">> other things found:" << hOThings->size() << std::endl;
36 for (
size_t i = 0;
i < hOThings->size(); ++
i) {
37 const OtherThing& thing = (*hOThings)[
i];
38 h_refA->Fill(thing.ref->a);
39 std::cout <<
">> ref->a: " << thing.ref->a << std::endl;
44 const ThingCollection&
things = *hThings;
45 std::cout <<
">> things found:" << things.size() << std::endl;
46 for (
size_t i = 0;
i < things.size(); ++
i) {
47 const Thing& thing = things[
i];
49 std::cout <<
">> a: " << thing.a << std::endl;
52 std::cout << std::endl <<
"Failed with cms::Exception: " << std::endl;
56 std::cout << std::endl <<
"Failed with std::exception" << std::endl;
60 std::cout << std::endl <<
"Failed with unknown exception" << std::endl;
71 TCanvas*
canvas =
new TCanvas();
73 TObject*
hist = out.FindObject(
kA);
74 if (
nullptr != hist) {
76 canvas->SaveAs(
"a.jpg");
78 std::cout <<
"no '" <<
kA <<
"' histogram" << std::endl;
84 if (
nullptr != hist) {
86 canvas->SaveAs(
"refA.jpg");
char const * what() const noexceptoverride
void begin(TList *&) override
void terminate(TList &) override
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
void postProcess(TList &)
static const char * kRefA
edm::propagate_const< TH1F * > h_refA
ThingsWorker(const TList *, TList &)
void process(const edm::Event &iEvent)
edm::propagate_const< TH1F * > h_a