19 #include <boost/foreach.hpp>
44 ostringstream hname, htit;
48 ntupt =
new TNtuple(
"tnt",
"G4Hits",
"ID:t:dtotal");
51 TH1 *
h1 =
new TH1F(
"edep1GeV",
"edep 0-1GeV",1000,0,1);
53 h1 =
new TH1F(
"edep100GeV",
"edep 0-100GeV",1000,0,100);
61 ostringstream nodename;
63 map<int, PHG4Particle*>::const_iterator particle_iter;
64 PHG4TruthInfoContainer *_truth_container = findNode::getClass<PHG4TruthInfoContainer>(topNode,
"G4TruthInfo");
68 float ntvars[5] = {0};
70 particle_iter != primary_range.second; ++particle_iter)
73 ntvars[0] = atan2(particle->
get_py(), particle->
get_px());
74 ntvars[1] = atan(sqrt(particle->
get_py()*particle->
get_py() +
81 ntvars[2] = 0.5*log((particle->
get_e()+particle->
get_pz())/
83 ntvars[3] = particle->
get_e();
84 ntvars[4] = particle->
get_pz();
87 set<string>::const_iterator iter;
88 vector<TH1 *>::const_iterator eiter;
92 hits = findNode::getClass<PHG4HitContainer>(topNode,
"G4HIT_CEMC");
102 double dtotal =
get_dtotal(hit_iter->second, ntvars[0],ntvars[1]);
103 ntupt->Fill(0,hit_iter->second->get_avg_t(),dtotal);
108 hits = findNode::getClass<PHG4HitContainer>(topNode,
"G4HIT_HCALIN");
118 double dtotal =
get_dtotal(hit_iter->second, ntvars[0],ntvars[1]);
119 ntupt->Fill(1,hit_iter->second->get_avg_t(),dtotal);
123 hits = findNode::getClass<PHG4HitContainer>(topNode,
"G4HIT_HCALOUT");
133 double dtotal =
get_dtotal(hit_iter->second, ntvars[0],ntvars[1]);
134 ntupt->Fill(2,hit_iter->second->get_avg_t(),dtotal);
169 double diffphi = phi_hit -
phi;
174 else if (diffphi < - M_PI)
182 double difftheta = theta_hit-
theta;
183 double deltasqrt = sqrt(diffphi*diffphi+difftheta*difftheta);