Hall-D Software  alpha
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
DMCThrown_factory_FinalState.cc
Go to the documentation of this file.
1 // $Id$
2 //
3 // File: DMCThrown_factory_FinalState.cc
4 // Created: Thu Dec 3 17:27:55 EST 2009
5 // Creator: pmatt (on Linux ifarml6 2.6.18-128.el5 x86_64)
6 //
7 
9 
10 using namespace jana;
11 
12 //------------------
13 // init
14 //------------------
16 {
17  SetFactoryFlag(NOT_OBJECT_OWNER);
18  return NOERROR;
19 }
20 
21 //------------------
22 // brun
23 //------------------
24 jerror_t DMCThrown_factory_FinalState::brun(jana::JEventLoop *locEventLoop, int32_t runnumber)
25 {
26  locEventLoop->GetSingle(dAnalysisUtilities);
27  return NOERROR;
28 }
29 
30 //------------------
31 // evnt
32 //------------------
33 jerror_t DMCThrown_factory_FinalState::evnt(jana::JEventLoop *locEventLoop, uint64_t eventnumber)
34 {
35  _data.clear();
36 
37  deque<pair<const DMCThrown*, deque<const DMCThrown*> > > locThrownSteps;
38  dAnalysisUtilities->Get_ThrownParticleSteps(locEventLoop, locThrownSteps);
39 
40  if(locThrownSteps.empty())
41  return NOERROR;
42 
43  for(size_t loc_i = 0; loc_i < locThrownSteps.size(); ++loc_i)
44  {
45  deque<const DMCThrown*>& locParticles = locThrownSteps[loc_i].second;
46  for(size_t loc_j = 0; loc_j < locParticles.size(); ++loc_j)
47  {
48  if(Is_FinalStateParticle(locParticles[loc_j]->PID()))
49  _data.push_back(const_cast<DMCThrown*>(locParticles[loc_j]));
50  }
51  }
52 
53  return NOERROR;
54 }
55 
56 
57 //------------------
58 // erun
59 //------------------
61 {
62  return NOERROR;
63 }
64 
65 //------------------
66 // fini
67 //------------------
69 {
70  return NOERROR;
71 }
72 
jerror_t erun(void)
Called everytime run number changes, provided brun has been called.
jerror_t init(void)
Called once at program start.
jerror_t evnt(jana::JEventLoop *locEventLoop, uint64_t eventnumber)
Called every event.
static int Is_FinalStateParticle(Particle_t locPID)
jerror_t brun(jana::JEventLoop *locEventLoop, int32_t runnumber)
Called everytime a new run number is detected.
jerror_t fini(void)
Called after last event of last event source has been processed.