17 #include <calobase/RawTowerv2.h>
18 #include <calobase/RawTowerGeom.h>
19 #include <calobase/RawTowerContainer.h>
20 #include <calobase/RawCluster.h>
21 #include <calobase/RawClusterContainer.h>
24 #include "TLorentzVector.h"
105 blackhole = findNode::getClass<PHG4HitContainer>(topNode,
"G4HIT_BH_1");
106 if (!
blackhole) std::cout <<
"No blackhole" << std::endl;
108 if (
_debug) std::cout<<
"GettingNodes..."<<std::endl;
109 _geomOH = findNode::getClass<RawTowerGeomContainer>(topNode,
"TOWERGEOM_HCALOUT");
110 if(!
_geomOH) std::cout<<
"No TOWERGeOM_HCALOUT"<<std::endl;
112 _geomIH = findNode::getClass<RawTowerGeomContainer>(topNode,
"TOWERGEOM_HCALIN");
113 if(!
_geomIH) std::cout<<
"No TOWERGeOM_HCALIN"<<std::endl;
115 _geomEM = findNode::getClass<RawTowerGeomContainer>(topNode,
"TOWERGEOM_CEMC");
116 if(!
_geomEM) std::cout<<
"No TOWERGeOM_CEMC"<<std::endl;
119 if (!
_towersSimOH) std::cout<<
"No TOWER_SIM_HCALOUT Node"<<std::endl;
122 if (!
_towersSimIH) std::cout<<
"No TOWER_SIM_HCALIN Node"<<std::endl;
125 if (!
_towersSimEM) std::cout<<
"No TOWER_SIM_CEMC Node"<<std::endl;
127 truthinfo = findNode::getClass<PHG4TruthInfoContainer>(topNode,
"G4TruthInfo");
128 if (!
truthinfo) std::cout <<
"PHG4TruthInfoContainer node is missing, can't collect G4 truth particles"<< std::endl;
137 if (
_debug) std::cout<<
"Initiating..."<<std::endl;
143 _tree =
new TTree(
"T",
"keep on giving tree");
145 _tree->Branch(
"n_truth",&
_b_n_truth,
"n_truth/I");
146 _tree->Branch(
"truthenergy",
_b_truthenergy,
"truthenergy[n_truth]/F");
147 _tree->Branch(
"trutheta",
_b_trutheta,
"trutheta[n_truth]/F");
148 _tree->Branch(
"truthphi",
_b_truthphi,
"truthphi[n_truth]/F");
149 _tree->Branch(
"truthpt",
_b_truthpt,
"truthpt[n_truth]/F");
150 _tree->Branch(
"truthp",
_b_truthp,
"truthp[n_truth]/F");
151 _tree->Branch(
"truthpid",
_b_truthpid,
"truthpid[n_truth]/I");
152 _tree->Branch(
"truth_track_id",
_b_truth_trackid,
"truth_track_id[n_truth]/I");
155 _tree->Branch(
"EMcal_sim_E",
_b_EMcal_sim_E,
"EMcal_sim_E[EMcal_sim_n]/F");
156 _tree->Branch(
"EMcal_sim_eta",
_b_EMcal_sim_eta,
"EMcal_sim_eta[EMcal_sim_n]/F");
157 _tree->Branch(
"EMcal_sim_phi",
_b_EMcal_sim_phi,
"EMcal_sim_phi[EMcal_sim_n]/F");
158 _tree->Branch(
"EMcal_sim_iphi",
_b_EMcal_sim_iphi,
"EMcal_sim_iphi[EMcal_sim_n]/I");
159 _tree->Branch(
"EMcal_sim_ieta",
_b_EMcal_sim_ieta,
"EMcal_sim_ieta[EMcal_sim_n]/I");
162 _tree->Branch(
"hcalIN_sim_E",
_b_hcalIN_sim_E,
"hcalIN_sim_E[hcalIN_sim_n]/F");
163 _tree->Branch(
"hcalIN_sim_eta",
_b_hcalIN_sim_eta,
"hcalIN_sim_eta[hcalIN_sim_n]/F");
164 _tree->Branch(
"hcalIN_sim_phi",
_b_hcalIN_sim_phi,
"hcalIN_sim_phi[hcalIN_sim_n]/F");
165 _tree->Branch(
"hcalIN_sim_iphi",
_b_hcalIN_sim_iphi,
"hcalIN_sim_iphi[hcalIN_sim_n]/I");
166 _tree->Branch(
"hcalIN_sim_ieta",
_b_hcalIN_sim_ieta,
"hcalIN_sim_ieta[hcalIN_sim_n]/I");
169 _tree->Branch(
"tower_sim_E",
_b_tower_sim_E,
"tower_sim_E[tower_sim_n]/F");
170 _tree->Branch(
"tower_sim_eta",
_b_tower_sim_eta,
"tower_sim_eta[tower_sim_n]/F");
171 _tree->Branch(
"tower_sim_phi",
_b_tower_sim_phi,
"tower_sim_phi[tower_sim_n]/F");
172 _tree->Branch(
"tower_sim_ieta",
_b_tower_sim_ieta,
"tower_sim_ieta[tower_sim_n]/I");
173 _tree->Branch(
"tower_sim_iphi",
_b_tower_sim_iphi,
"tower_sim_iphi[tower_sim_n]/I");
175 _tree->Branch(
"n_vertex",&
n_vertex,
"n_vertex/I");
176 _tree->Branch(
"vertex_id",
vertex_id,
"vertex_id[n_vertex]/I");
177 _tree->Branch(
"vertex_x",
vertex_x,
"vertex_x[n_vertex]/F");
178 _tree->Branch(
"vertex_y",
vertex_y,
"vertex_y[n_vertex]/F");
179 _tree->Branch(
"vertex_z",
vertex_z,
"vertex_z[n_vertex]/F");
181 _tree->Branch(
"n_child",&
n_child,
"n_child/I");
182 _tree->Branch(
"child_vertex_id",
child_vertex_id,
"child_vertex_id[n_child]/I");
183 _tree->Branch(
"child_parent_id",
child_parent_id,
"child_parent_id[n_child]/I");
184 _tree->Branch(
"child_pid",
child_pid,
"child_pid[n_child]/I");
185 _tree->Branch(
"child_px",
child_px,
"child_px[n_child]/F");
186 _tree->Branch(
"child_py",
child_py,
"child_py[n_child]/F");
187 _tree->Branch(
"child_pz",
child_pz,
"child_pz[n_child]/F");
188 _tree->Branch(
"child_energy",
child_energy,
"child_energy[n_child]/F");
190 _tree->Branch(
"BH_n",&
_nBH,
"BH_n/I");
191 _tree->Branch(
"BH_px",
_BH_px,
"BH_px[BH_n]/F");
192 _tree->Branch(
"BH_py",
_BH_py,
"BH_py[BH_n]/F");
193 _tree->Branch(
"BH_pz",
_BH_pz,
"BH_pz[BH_n]/F");
194 _tree->Branch(
"BH_track_id",
_BH_track_id,
"BH_track_id[BH_n]/I");
195 _tree->Branch(
"BH_e",
_BH_e,
"BH_e[BH_n]/F");
209 if (
_debug) std::cout<<
"Processing Event: "<<
_b_event<<std::endl;
210 if (
_debug) std::cout <<
"hello";
219 hit_iter != bh_hit_range.second; hit_iter++)
221 PHG4Hit *this_hit = hit_iter->second;
238 if (
_debug) std::cout<<
"Got the iterator"<<std::endl;
252 std::cout << __FILE__ <<
" ERROR: _b_tower_sim_n has hit cap of " <<
nTowers <<
"!!!" << std::endl;
301 if (!vertex.empty()) vertex.clear();
305 iter != range.second; ++iter) {
325 if (_b_n_truth >= 50000)
break;
359 if (parent->
get_e() > 2.0) {
378 if (vertex.find(vtx->
get_id()) != vertex.end()) {
396 if (
_debug) std::cout<<
"Writing File"<<std::endl;