7 #include "DataFormats/TestObjects/interface/OtherThingCollection.h"
8 #include "DataFormats/TestObjects/interface/ThingCollection.h"
11 using namespace tfwliteselectortest;
13 static const char*
kA =
"a";
14 static const char*
kRefA =
"refA";
23 h_a =
new TH1F(
kA,
"a", 100, 0, 20);
36 std::cout <<
"processing event " << std::endl;
38 using namespace edmtest;
42 iEvent.
getByLabel(
"OtherThing",
"testUserTag", hOThings);
43 std::cout <<
">> other things found:" << hOThings->size() << std::endl;
45 for (
size_t i = 0;
i < hOThings->size(); ++
i) {
46 const OtherThing& thing = (*hOThings)[
i];
47 h_refA->Fill(thing.ref->a);
48 std::cout <<
">> ref->a: " << thing.ref->a << std::endl;
53 const ThingCollection&
things = *hThings;
54 std::cout <<
">> things found:" << things.size() << std::endl;
55 for (
size_t i = 0;
i < things.size(); ++
i) {
56 const Thing& thing = things[
i];
58 std::cout <<
">> a: " << thing.a << std::endl;
61 std::cout << std::endl <<
"Failed with cms::Exception: " << std::endl;
65 std::cout << std::endl <<
"Failed with std::exception" << std::endl;
69 std::cout << std::endl <<
"Failed with unknown exception" << std::endl;
78 TCanvas*
canvas =
new TCanvas();
80 TObject*
hist = out.FindObject(
kA);
81 if (
nullptr != hist) {
83 canvas->SaveAs(
"a.jpg");
85 std::cout <<
"no '" <<
kA <<
"' histogram" << std::endl;
90 if (
nullptr != hist) {
92 canvas->SaveAs(
"refA.jpg");
static const char * kRefA
void begin(TList *&) override
void postProcessing(TList &) override
edm::propagate_const< TH1F * > h_a
histograms
char const * what() const noexceptoverride
edm::propagate_const< TH1F * > h_refA
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
void process(const edm::Event &) override
constexpr element_type const * get() const
void preProcessing(const TList *, TList &) override
void terminate(TList &) override