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::ThingsWorker ( const TList *  ,
TList &  out 
)

Definition at line 17 of file ThingsTSelector2.cc.

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

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

Member Function Documentation

◆ postProcess()

void ThingsWorker::postProcess ( TList &  )

Definition at line 65 of file ThingsTSelector2.cc.

65 {}

◆ process()

void ThingsWorker::process ( const edm::Event iEvent)

Definition at line 26 of file ThingsTSelector2.cc.

References CMS_SA_ALLOW, gather_cfg::cout, cppFunctionSkipper::exception, h_a, h_refA, mps_fire::i, iEvent, dqmdumpme::things, and x.

26  {
27  std::cout << "processing event " << std::endl;
28  // chain->GetEntry( entry );
29  using namespace edmtest;
31  // In case of an exception prints the message and aborts the process
32  CMS_SA_ALLOW try {
33  iEvent.getByLabel("OtherThing", "testUserTag", hOThings);
34 
35  std::cout << ">> other things found:" << hOThings->size() << std::endl;
36  for (size_t i = 0; i < hOThings->size(); ++i) {
37  const OtherThing& thing = (*hOThings)[i];
38  h_refA->Fill(thing.ref->a);
39  std::cout << ">> ref->a: " << thing.ref->a << std::endl;
40  }
41 
43  iEvent.getByLabel("Thing", hThings);
44  const ThingCollection& things = *hThings;
45  std::cout << ">> things found:" << things.size() << std::endl;
46  for (size_t i = 0; i < things.size(); ++i) {
47  const Thing& thing = things[i];
48  h_a->Fill(thing.a);
49  std::cout << ">> a: " << thing.a << std::endl;
50  }
51  } catch (cms::Exception& x) {
52  std::cout << std::endl << "Failed with cms::Exception: " << std::endl;
53  std::cout << x.what() << std::endl;
54  abort();
55  } catch (std::exception& x) {
56  std::cout << std::endl << "Failed with std::exception" << std::endl;
57  std::cout << x.what() << std::endl;
58  abort();
59  } catch (...) {
60  std::cout << std::endl << "Failed with unknown exception" << std::endl;
61  abort();
62  }
63 }
#define CMS_SA_ALLOW
int iEvent
Definition: GenABIO.cc:224
edm::propagate_const< TH1F * > h_refA
edm::propagate_const< TH1F * > h_a

Member Data Documentation

◆ h_a

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

Definition at line 19 of file ThingsTSelector2.h.

Referenced by process(), and ThingsWorker().

◆ h_refA

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

Definition at line 20 of file ThingsTSelector2.h.

Referenced by process(), and ThingsWorker().