7 #include "DataFormats/TestObjects/interface/OtherThingCollection.h" 8 #include "DataFormats/TestObjects/interface/ThingCollection.h" 12 static const char*
kA =
"a";
13 static const char*
kRefA =
"refA";
22 h_a =
new TH1F(
kA,
"a", 100, 0, 20);
35 std::cout <<
"processing event " << std::endl;
41 iEvent.
getByLabel(
"OtherThing",
"testUserTag", hOThings);
42 std::cout <<
">> other things found:" << hOThings->size() << std::endl;
44 for (
size_t i = 0;
i < hOThings->size(); ++
i) {
45 const OtherThing& thing = (*hOThings)[
i];
46 h_refA->Fill(thing.ref->a);
47 std::cout <<
">> ref->a: " << thing.ref->a << std::endl;
52 const ThingCollection& things = *hThings;
53 std::cout <<
">> things found:" << things.size() << std::endl;
54 for (
size_t i = 0;
i < things.size(); ++
i) {
55 const Thing& thing = things[
i];
57 std::cout <<
">> a: " << thing.a << std::endl;
60 std::cout << std::endl <<
"Failed with cms::Exception: " << std::endl;
64 std::cout << std::endl <<
"Failed with std::exception" << std::endl;
68 std::cout << std::endl <<
"Failed with unknown exception" << std::endl;
77 TCanvas*
canvas =
new TCanvas();
79 TObject*
hist = out.FindObject(
kA);
80 if (
nullptr != hist) {
82 canvas->SaveAs(
"a.jpg");
84 std::cout <<
"no '" <<
kA <<
"' histogram" << std::endl;
89 if (
nullptr != hist) {
91 canvas->SaveAs(
"refA.jpg");
static const char * kRefA
char const * what() const override
void begin(TList *&) override
void postProcessing(TList &) override
edm::propagate_const< TH1F * > h_a
histograms
edm::propagate_const< TH1F * > h_refA
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
element_type const * get() const
void process(const edm::Event &) override
void preProcessing(const TList *, TList &) override
void terminate(TList &) override