67 {
68
69
70
71 MsgStream msglog(messageService(), name());
72 msglog << MSG::INFO << ">>> TruthDemo from execute" << endreq;
73
74
75
76 float totenergy = 0.;
77 float pxbalance = 0.;
78 float pybalance = 0.;
79
81 std::vector<const HepMC::GenParticle*> particles;
82 StatusCode stat = m_tesIO->
getMC(particles, &ifs);
83 for (std::vector<const HepMC::GenParticle*>::iterator pitr = particles.begin();
84 pitr != particles.end(); pitr++) {
85 pxbalance += (*pitr)->momentum().x();
86 pybalance += (*pitr)->momentum().y();
87 totenergy += (*pitr)->momentum().e();
88 }
89 m_pxBalance->fill(pxbalance, 1.);
90 m_pyBalance->fill(pybalance, 1.);
91 m_totEnergy->fill(totenergy, 1.);
92
93 return StatusCode::SUCCESS;
94}
StatusCode getMC(MCparticleCollection &) const