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.

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 }

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

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.

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 }

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

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().

kRefA
static const char * kRefA
Definition: ThingsTSelector2.cc:15
tfwliteselectortest::ThingsWorker::h_a
edm::propagate_const< TH1F * > h_a
Definition: ThingsTSelector2.h:19
mps_fire.i
i
Definition: mps_fire.py:428
edmtest
Definition: AlignPCLThresholdsReader.cc:11
gather_cfg.cout
cout
Definition: gather_cfg.py:144
edm::Handle
Definition: AssociativeIterator.h:50
CMS_SA_ALLOW
#define CMS_SA_ALLOW
Definition: thread_safety_macros.h:5
dqmdumpme.things
things
Definition: dqmdumpme.py:19
tfwliteselectortest::ThingsWorker::h_refA
edm::propagate_const< TH1F * > h_refA
Definition: ThingsTSelector2.h:20
cppFunctionSkipper.exception
exception
Definition: cppFunctionSkipper.py:10
iEvent
int iEvent
Definition: GenABIO.cc:224
genVertex_cff.x
x
Definition: genVertex_cff.py:12
kA
static const char * kA
Definition: ThingsTSelector2.cc:14
MillePedeFileConverter_cfg.out
out
Definition: MillePedeFileConverter_cfg.py:31
cms::Exception
Definition: Exception.h:70