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";
18 h_a =
new TH1F(
kA,
"a", 100, 0, 20);
26 std::cout <<
"processing event " << std::endl;
31 iEvent.
getByLabel(
"OtherThing",
"testUserTag", hOThings);
33 std::cout <<
">> other things found:" << hOThings->size() << std::endl;
34 for (
size_t i = 0;
i < hOThings->size(); ++
i) {
35 const OtherThing& thing = (*hOThings)[
i];
36 h_refA->Fill(thing.ref->a);
37 std::cout <<
">> ref->a: " << thing.ref->a << std::endl;
42 const ThingCollection& things = *hThings;
43 std::cout <<
">> things found:" << things.size() << std::endl;
44 for (
size_t i = 0;
i < things.size(); ++
i) {
45 const Thing& thing = things[
i];
47 std::cout <<
">> a: " << thing.a << std::endl;
50 std::cout << std::endl <<
"Failed with cms::Exception: " << std::endl;
54 std::cout << std::endl <<
"Failed with std::exception" << std::endl;
58 std::cout << std::endl <<
"Failed with unknown exception" << std::endl;
69 TCanvas*
canvas =
new TCanvas();
71 TObject*
hist = out.FindObject(
kA);
72 if (
nullptr != hist) {
74 canvas->SaveAs(
"a.jpg");
76 std::cout <<
"no '" <<
kA <<
"' histogram" << std::endl;
82 if (
nullptr != hist) {
84 canvas->SaveAs(
"refA.jpg");
char const * what() const override
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