35 g4tree =
new TTree(
"mG4EvtTree",
"g4tree");
36 g4tree->SetAutoSave(1000000);
38 cout <<
"Initialize Geant 4 Tree ... << " << endl;
77 PHG4TruthInfoContainer *truthInfoList = findNode::getClass<PHG4TruthInfoContainer>(topNode,
"G4TruthInfo");
80 double px = primRange.first->second->get_px();
81 double py = primRange.first->second->get_py();
82 double pz = primRange.first->second->get_pz();
83 double e = primRange.first->second->get_e();
84 double pt = sqrt(px * px + py * py);
85 double phi = atan2(py, px);
86 double theta = atan2(pt, pz);
97 ostringstream nodename;
98 set<string>::const_iterator iter;
104 nodename <<
"G4HIT_" << *iter;
107 if (!strcmp(
"G4HIT_CEMC", nodename.str().c_str()))
111 else if (!strcmp(
"G4HIT_ABSORBER_CEMC", nodename.str().c_str()))
115 else if (!strcmp(
"G4HIT_HCAL", nodename.str().c_str()))
119 else if (!strcmp(
"G4HIT_ABSORBER_HCAL", nodename.str().c_str()))
151 map<int, double> layer_edep_map;
152 map<int, double>::const_iterator edepiter;
161 layer_edep_map[hit_iter->second->get_layer()] += hit_iter->second->get_edep();
177 for (edepiter = layer_edep_map.begin(); edepiter != layer_edep_map.end(); ++edepiter)
179 nLayers = edepiter->first - 1;
180 if (!strcmp(
"G4HIT_CEMC", dName.c_str()))
182 else if (!strcmp(
"G4HIT_ABSORBER_CEMC", dName.c_str()))
184 else if (!strcmp(
"G4HIT_HCAL", dName.c_str()))
186 else if (!strcmp(
"G4HIT_ABSORBER_HCAL", dName.c_str()))