7 #include "DataFormats/TestObjects/interface/OtherThingCollection.h"
8 #include "DataFormats/TestObjects/interface/ThingCollection.h"
10 using namespace tfwliteselectortest;
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;
39 using namespace edmtest;
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" );
virtual char const * what() const
void postProcessing(TList &)
static const char * kRefA
void process(const edm::Event &)
void preProcessing(const TList *, TList &)
T x() const
Cartesian x coordinate.
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