CMS 3D CMS Logo

List of all members | Public Member Functions | Public Attributes
tfwliteselectortest::ThingsWorker Struct Reference

#include <ThingsTSelector2.h>

Public Member Functions

void postProcess (TList &)
 
void process (const edm::Event &iEvent)
 
 ThingsWorker (const TList *, TList &)
 

Public Attributes

edm::propagate_const< TH1F * > h_a
 
edm::propagate_const< TH1F * > h_refA
 

Detailed Description

Definition at line 15 of file ThingsTSelector2.h.

Constructor & Destructor Documentation

ThingsWorker::ThingsWorker ( const TList *  ,
TList &  out 
)

Definition at line 16 of file ThingsTSelector2.cc.

References gather_cfg::cout, h_a, h_refA, kA, and kRefA.

16  {
17  std::cout << "begin" << std::endl;
18  h_a = new TH1F(kA, "a", 100, 0, 20);
19  out.Add(h_a);
20 
21  h_refA = new TH1F(kRefA, "refA", 100, 0, 20);
22  out.Add(h_refA);
23 }
static const char * kA
static const char * kRefA
edm::propagate_const< TH1F * > h_refA
edm::propagate_const< TH1F * > h_a

Member Function Documentation

void ThingsWorker::postProcess ( TList &  )

Definition at line 63 of file ThingsTSelector2.cc.

63 {}
void ThingsWorker::process ( const edm::Event iEvent)

Definition at line 25 of file ThingsTSelector2.cc.

References gather_cfg::cout, cppFunctionSkipper::exception, edm::Event::getByLabel(), h_a, h_refA, mps_fire::i, and cms::Exception::what().

25  {
26  std::cout << "processing event " << std::endl;
27  // chain->GetEntry( entry );
28  using namespace edmtest;
30  try {
31  iEvent.getByLabel("OtherThing", "testUserTag", hOThings);
32 
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;
38  }
39 
41  iEvent.getByLabel("Thing", hThings);
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];
46  h_a->Fill(thing.a);
47  std::cout << ">> a: " << thing.a << std::endl;
48  }
49  } catch (cms::Exception& x) {
50  std::cout << std::endl << "Failed with cms::Exception: " << std::endl;
51  std::cout << x.what() << std::endl;
52  abort();
53  } catch (std::exception& x) {
54  std::cout << std::endl << "Failed with std::exception" << std::endl;
55  std::cout << x.what() << std::endl;
56  abort();
57  } catch (...) {
58  std::cout << std::endl << "Failed with unknown exception" << std::endl;
59  abort();
60  }
61 }
char const * what() const override
Definition: Exception.cc:103
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
Definition: Event.h:480
edm::propagate_const< TH1F * > h_refA
edm::propagate_const< TH1F * > h_a

Member Data Documentation

edm::propagate_const<TH1F*> tfwliteselectortest::ThingsWorker::h_a

Definition at line 19 of file ThingsTSelector2.h.

Referenced by process(), and ThingsWorker().

edm::propagate_const<TH1F*> tfwliteselectortest::ThingsWorker::h_refA

Definition at line 20 of file ThingsTSelector2.h.

Referenced by process(), and ThingsWorker().