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";
24 h_a =
new TH1F(
kA ,
"a" , 100, 0, 20 );
37 std::cout <<
"processing event " << std::endl;
43 iEvent.
getByLabel(
"OtherThing",
"testUserTag", hOThings);
44 std::cout <<
">> other things found:" << hOThings->size() << std::endl;
46 for (
size_t i = 0;
i < hOThings->size(); ++
i ) {
47 const OtherThing & thing = (*hOThings)[
i ];
48 h_refA ->Fill( thing.ref->a );
49 std::cout <<
">> ref->a: " << thing.ref->a << std::endl;
54 const ThingCollection& things = *hThings;
55 std::cout <<
">> things found:" << things.size() << std::endl;
56 for (
size_t i = 0;
i < things.size(); ++
i ) {
57 const Thing & thing = things[
i ];
58 h_a ->Fill( thing.a );
59 std::cout <<
">> a: " << thing.a << std::endl;
62 std::cout << std::endl <<
"Failed with cms::Exception: " << std::endl;
66 std::cout << std::endl <<
"Failed with std::exception" << std::endl;
70 std::cout << std::endl <<
"Failed with unknown exception" << std::endl;
82 TCanvas *
canvas =
new TCanvas( );
84 TObject*
hist = out.FindObject(
kA);
87 canvas->SaveAs(
"a.jpg" );
96 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