44 ntup =
new TNtuple(
"snglntup",
"G4Sngls",
"phi:theta:e:detid:layer:x0:y0:z0:x1:y1:z1:edep");
45 ntup_e =
new TNtuple(
"sngl_e",
"G4SnglEdeps",
"phi:theta:e:detid:layer:edep");
47 TH1 *
h1 =
new TH1F(
"edep1GeV",
"edep 0-1GeV", 1000, 0, 1);
49 h1 =
new TH1F(
"edep100GeV",
"edep 0-100GeV", 1000, 0, 100);
57 PHG4TruthInfoContainer *truthInfoList = findNode::getClass<PHG4TruthInfoContainer>(topNode,
"G4TruthInfo");
68 px = primRange.first->second->get_px();
69 py = primRange.first->second->get_py();
70 pz = primRange.first->second->get_pz();
71 e = primRange.first->second->get_e();
72 pt = sqrt(px * px + py * py);
74 theta = atan2(pt, pz);
76 ostringstream nodename;
77 set<string>::const_iterator iter;
78 vector<TH1 *>::const_iterator eiter;
80 map<int, double> layer_edep_map;
81 map<int, double>::const_iterator edepiter;
85 layer_edep_map.clear();
88 nodename <<
"G4HIT_" << *iter;
96 layer_edep_map[hit_iter->second->get_layer()] += hit_iter->second->get_edep();
97 esum += hit_iter->second->get_edep();
98 ntup->Fill(phi, theta, e, detid,
99 hit_iter->second->get_detid(),
100 hit_iter->second->get_x(0),
101 hit_iter->second->get_y(0),
102 hit_iter->second->get_z(0),
103 hit_iter->second->get_x(1),
104 hit_iter->second->get_y(1),
105 hit_iter->second->get_z(1),
106 hit_iter->second->get_edep());
108 for (edepiter = layer_edep_map.begin(); edepiter != layer_edep_map.end(); ++edepiter)
110 ntup_e->Fill(phi, theta, e, detid, edepiter->first, edepiter->second);
112 ntup_e->Fill(phi, theta, e, detid, -1, esum);
114 for (eiter =
eloss.begin(); eiter !=
eloss.end(); ++eiter)
116 (*eiter)->Fill(esum);