31 , chkenergyconservation(0)
50 std::cout <<
PHWHERE <<
"DST Node missing, doing nothing." << std::endl;
57 cout <<
"Could not locate g4 hit node " <<
hitnodename << endl;
86 cout <<
"Could not locate g4 hit node " <<
hitnodename << endl;
92 cout <<
"could not locate cell node " <<
cellnodename << endl;
97 pair<PHG4HitContainer::LayerIter, PHG4HitContainer::LayerIter> layer_begin_end = g4hit->
getLayers();
98 for (layer = layer_begin_end.first; layer != layer_begin_end.second; ++layer)
102 for (hiter = hit_begin_end.first; hiter != hit_begin_end.second; ++hiter)
109 if (hiter->second->get_edep() <= 0)
112 unsigned int key = (hiter->second->get_index_j() << 16) + hiter->second->get_index_k();
117 celllist[key]->set_j_index(hiter->second->get_index_j());
118 celllist[key]->set_k_index(hiter->second->get_index_k());
119 celllist[key]->set_l_index(hiter->second->get_index_l());
122 celllist[key]->add_edep(hiter->first, hiter->second->get_edep(), hiter->second->get_light_yield());
123 celllist[key]->add_shower_edep(hiter->second->get_shower_id(), hiter->second->get_edep());
127 for (map<unsigned int, PHG4CylinderCell *>::const_iterator mapiter =
celllist.begin(); mapiter !=
celllist.end(); ++mapiter)
135 cout <<
Name() <<
": found " << numcells <<
" eta/slat cells with energy deposition" << endl;
155 double sum_energy_g4hit = 0.;
156 double sum_energy_cells = 0.;
159 for (hiter = hit_begin_end.first; hiter != hit_begin_end.second; ++hiter)
161 sum_energy_g4hit += hiter->second->get_edep();
165 for (citer = cell_begin_end.first; citer != cell_begin_end.second; ++citer)
167 sum_energy_cells += citer->second->get_edep();
170 if (fabs(sum_energy_cells - sum_energy_g4hit) / sum_energy_g4hit > 1
e-6)
172 cout <<
"energy mismatch between cells: " << sum_energy_cells
173 <<
" and hits: " << sum_energy_g4hit
174 <<
" diff sum(cells) - sum(hits): " << sum_energy_cells - sum_energy_g4hit
182 cout <<
Name() <<
": total energy for this event: " << sum_energy_g4hit <<
" GeV" << endl;