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";
20 h_a =
new TH1F(
kA ,
"a" , 100, 0, 20 );
31 std::cout <<
"processing event " << std::endl;
36 iEvent.
getByLabel(
"OtherThing",
"testUserTag", hOThings);
38 std::cout <<
">> other things found:" << hOThings->size() << std::endl;
39 for (
size_t i = 0;
i < hOThings->size(); ++
i ) {
40 const OtherThing & thing = (*hOThings)[
i ];
41 h_refA ->Fill( thing.ref->a );
42 std::cout <<
">> ref->a: " << thing.ref->a << std::endl;
47 const ThingCollection& things = *hThings;
48 std::cout <<
">> things found:" << things.size() << std::endl;
49 for (
size_t i = 0;
i < things.size(); ++
i ) {
50 const Thing & thing = things[
i ];
51 h_a ->Fill( thing.a );
52 std::cout <<
">> a: " << thing.a << std::endl;
55 std::cout << std::endl <<
"Failed with cms::Exception: " << std::endl;
59 std::cout << std::endl <<
"Failed with std::exception" << std::endl;
63 std::cout << std::endl <<
"Failed with unknown exception" << std::endl;
81 TCanvas *
canvas =
new TCanvas( );
83 TObject*
hist = out.FindObject(
kA);
86 canvas->SaveAs(
"a.jpg" );
96 canvas->SaveAs(
"refA.jpg" );
char const * what() const override
T x() const
Cartesian x coordinate.
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