7 #include "DataFormats/TestObjects/interface/OtherThingCollection.h" 8 #include "DataFormats/TestObjects/interface/ThingCollection.h" 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;
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;
52 iEvent.getByLabel(
"Thing", hThings);
53 const ThingCollection&
things = *hThings;
55 for (
size_t i = 0;
i <
things.size(); ++
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();
81 if (
nullptr !=
hist) {
85 std::cout <<
"no '" <<
kA <<
"' histogram" << std::endl;
90 if (
nullptr !=
hist) {
92 canvas->SaveAs(
"refA.jpg");
static const char * kRefA
constexpr element_type const * get() const
void begin(TList *&) override
void postProcessing(TList &) override
edm::propagate_const< TH1F * > h_a
histograms
edm::propagate_const< TH1F * > h_refA
void process(const edm::Event &) override
void preProcessing(const TList *, TList &) override
void terminate(TList &) override