44 ostringstream hname, htit;
47 ntups =
new TNtuple(
"sz",
" Shower size",
"rad:em:hi:ho:mag:bh");
48 ntupe =
new TNtuple(
"truth",
"The Absolute Truth",
"phi:theta:eta:e:p");
49 ntup =
new TNtuple(
"de",
"Change in Angles",
"ID:dphi:dtheta:dtotal:edep");
56 map<int, PHG4Particle*>::const_iterator particle_iter;
57 PHG4TruthInfoContainer *_truth_container = findNode::getClass<PHG4TruthInfoContainer>(topNode,
"G4TruthInfo");
61 float ntvars[5] = {0};
63 particle_iter != primary_range.second; ++particle_iter)
66 ntvars[0] = atan2(particle->
get_py(), particle->
get_px());
67 ntvars[1] = atan(sqrt(particle->
get_py()*particle->
get_py() +
74 ntvars[2] = 0.5*log((particle->
get_e()+particle->
get_pz())/
76 ntvars[3] = particle->
get_e();
77 ntvars[4] = particle->
get_pz();
88 string nodename[2] = {
"G4HIT_CEMC",
"G4HIT_ABSORBER_CEMC"};
89 for (
int j=0;
j<2;
j++)
91 hits = findNode::getClass<PHG4HitContainer>(topNode,nodename[
j]);
100 double phi = atan2(hit_iter->second->get_avg_y(),hit_iter->second->get_avg_x());
101 double theta = atan(sqrt(hit_iter->second->get_avg_x() * hit_iter->second->get_avg_x() +
102 hit_iter->second->get_avg_y() * hit_iter->second->get_avg_y()) /
103 hit_iter->second->get_avg_z());
106 double diffphi = phi-ntvars[0];
111 else if (diffphi < - M_PI)
120 double difftheta = theta-ntvars[1];
122 double deltasqrt = sqrt(diffphi*diffphi+difftheta*difftheta);
123 double edep = hit_iter->second->get_edep();
127 detid[2] = theta-ntvars[1];
128 detid[3] = deltasqrt;
131 for (
int i=0;
i<10;
i++)
133 if (deltasqrt < (
i+1)*0.025)
141 nodename[0] = {
"G4HIT_HCALIN"};
142 nodename[1] = {
"G4HIT_ABSORBER_HCALIN"};
143 for (
int j=0;
j<2;
j++)
145 hits = findNode::getClass<PHG4HitContainer>(topNode,nodename[
j]);
154 double phi = atan2(hit_iter->second->get_avg_y(),hit_iter->second->get_avg_x());
155 double theta = atan(sqrt(hit_iter->second->get_avg_x() * hit_iter->second->get_avg_x() +
156 hit_iter->second->get_avg_y() * hit_iter->second->get_avg_y()) /
157 hit_iter->second->get_avg_z());
159 double diffphi = phi-ntvars[0];
164 else if (diffphi < - M_PI)
173 double difftheta = theta-ntvars[1];
175 double deltasqrt = sqrt(diffphi*diffphi+difftheta*difftheta);
176 double edep = hit_iter->second->get_edep();
180 detid[2] = theta-ntvars[1];
181 detid[3] = deltasqrt;
184 for (
int i=0;
i<10;
i++)
186 if (deltasqrt < (
i+1)*0.025)
194 nodename[0] = {
"G4HIT_HCALOUT"};
195 nodename[1] = {
"G4HIT_ABSORBER_HCALOUT"};
196 for (
int j=0;
j<2;
j++)
198 hits = findNode::getClass<PHG4HitContainer>(topNode,nodename[
j]);
207 double phi = atan2(hit_iter->second->get_avg_y(),hit_iter->second->get_avg_x());
208 double theta = atan(sqrt(hit_iter->second->get_avg_x() * hit_iter->second->get_avg_x() +
209 hit_iter->second->get_avg_y() * hit_iter->second->get_avg_y()) /
210 hit_iter->second->get_avg_z());
212 double diffphi = phi-ntvars[0];
217 else if (diffphi < - M_PI)
226 double difftheta = theta-ntvars[1];
228 double deltasqrt = sqrt(diffphi*diffphi+difftheta*difftheta);
229 double edep = hit_iter->second->get_edep();
233 detid[2] = theta-ntvars[1];
234 detid[3] = deltasqrt;
237 for (
int i=0;
i<10;
i++)
239 if (deltasqrt < (
i+1)*0.025)
247 hits = findNode::getClass<PHG4HitContainer>(topNode,
"G4HIT_MAGNET");
256 double phi = atan2(hit_iter->second->get_avg_y(),hit_iter->second->get_avg_x());
257 double theta = atan(sqrt(hit_iter->second->get_avg_x() * hit_iter->second->get_avg_x() +
258 hit_iter->second->get_avg_y() * hit_iter->second->get_avg_y()) /
259 hit_iter->second->get_avg_z());
261 double diffphi = phi-ntvars[0];
266 else if (diffphi < - M_PI)
275 double difftheta = theta-ntvars[1];
277 double deltasqrt = sqrt(diffphi*diffphi+difftheta*difftheta);
278 double edep = hit_iter->second->get_edep();
282 detid[2] = theta-ntvars[1];
283 detid[3] = deltasqrt;
286 for (
int i=0;
i<10;
i++)
288 if (deltasqrt < (
i+1)*0.025)
295 hits = findNode::getClass<PHG4HitContainer>(topNode,
"G4HIT_BH_1");
304 double phi = atan2(hit_iter->second->get_avg_y(),hit_iter->second->get_avg_x());
305 double theta = atan(sqrt(hit_iter->second->get_avg_x() * hit_iter->second->get_avg_x() +
306 hit_iter->second->get_avg_y() * hit_iter->second->get_avg_y()) /
307 hit_iter->second->get_avg_z());
309 double diffphi = phi-ntvars[0];
314 else if (diffphi < - M_PI)
323 double difftheta = theta-ntvars[1];
325 double deltasqrt = sqrt(diffphi*diffphi+difftheta*difftheta);
326 double edep = hit_iter->second->get_edep();
330 detid[2] = theta-ntvars[1];
331 detid[3] = deltasqrt;
334 for (
int i=0;
i<10;
i++)
336 if (deltasqrt < (
i+1)*0.025)
343 for (
int i=0;
i<10;
i++)