15 #include <TLorentzVector.h>
16 #include <g4jets/Jet.h>
17 #include <g4jets/JetMap.h>
20 #include <calobase/RawCluster.h>
21 #include <calobase/RawClusterContainer.h>
22 #include <calobase/RawClusterUtility.h>
23 #include <calobase/RawTower.h>
24 #include <calobase/RawTowerContainer.h>
25 #include <calobase/RawTowerGeom.h>
26 #include <calobase/RawTowerGeomContainer.h>
30 #include <g4vertex/GlobalVertex.h>
31 #include <g4vertex/GlobalVertexMap.h>
36 #include <HepMC/GenEvent.h>
37 #include <HepMC/GenVertex.h>
68 histo =
new TH1F(
"histo",
"histo", 100, -3, 3);
70 tree =
new TTree(
"tree",
"a tree");
82 cout <<
"at event number " <<
nevents << endl;
92 RawClusterContainer *recal_clusters = findNode::getClass<RawClusterContainer>(topnode,
"CLUSTER_POS_COR_CEMC");
97 fclusters = findNode::getClass<RawClusterContainer>(topnode,
"CLUSTER_FEMC");
100 RawClusterContainer *hcalin_clusters = findNode::getClass<RawClusterContainer>(topnode,
"CLUSTER_HCALIN");
102 RawTowerContainer *_towers = findNode::getClass<RawTowerContainer>(topnode,
"TOWER_CALIB_CEMC");
104 GlobalVertexMap *vertexmap = findNode::getClass<GlobalVertexMap>(topnode,
"GlobalVertexMap");
107 cout <<
"Photons::process_event - Fatal Error - GlobalVertexMap node is missing. Please turn on the do_global flag in the main macro in order to reconstruct the global vertex." << endl;
113 if (vertexmap->empty())
115 cout <<
"Photons::process_event - Fatal Error - GlobalVertexMap node is empty. Please turn on the do_global flag in the main macro in order to reconstruct the global vertex." << endl;
120 if (vtx ==
nullptr)
return 0;
124 cout <<
"no recalibrated cemc clusters, bailing" << endl;
130 cout <<
"NO CALIBRATED CEMC TOWERS, BAILING" << endl;
135 cout <<
"not forward cluster info" << endl;
140 cout <<
"no truth track info" << endl;
145 cout <<
"no cluster info" << endl;
149 if (!hcalin_clusters)
151 cout <<
"no hcal in cluster info" << endl;
157 cout <<
"Getting truth particles" << endl;
171 if (this_embed_id != 1 &&
_embed)
204 cout <<
"Getting inner HCal clusters for energy leakage studies" << endl;
207 for (hcaliter = begin_end_hcal.first;
208 hcaliter != begin_end_hcal.second;
215 hcal_eta = E_vec_cluster.pseudoRapidity();
217 hcal_pt = E_vec_cluster.perp();
223 TLorentzVector *clus =
new TLorentzVector();
226 clus->GetXYZT(dumarray);
276 cout <<
"getting forward EMCal clusters" << endl;
282 for (fclusiter = fclus.first;
283 fclusiter != fclus.second;
291 fclus_eta = E_vec_cluster.pseudoRapidity();
304 fiter != range.second;
349 cout <<
"Getting the position recalibrated clusters" << endl;
355 for (rclusiter = rbegin_end.first;
356 rclusiter != rbegin_end.second;
365 rclus_eta = E_vec_cluster.pseudoRapidity();
373 cout<<
"passed recal pt cut"<<endl;
374 TLorentzVector *clus =
new TLorentzVector();
378 clus->GetXYZT(dumarray);
402 if (this_embed_id != 1 &&
_embed)
423 cout<<
"found recal truth photon"<<endl;
428 cout<<
"filling recal cluster tree"<<endl;
448 cout <<
"Get the non-position recalibrated clusters" << endl;
450 for (clusiter = begin_end.first;
451 clusiter != begin_end.second;
460 clus_eta = E_vec_cluster.pseudoRapidity();
462 clus_pt = E_vec_cluster.perp();
473 cout<<
"passed cluster pt cut"<<endl;
475 TLorentzVector *clus =
new TLorentzVector();
479 clus->GetXYZT(dumarray);
497 if (this_embed_id != 1 &&
_embed)
631 cout<<
"Finished event in Photons package"<<endl;
640 std::cout <<
" DONE PROCESSING " << endl;
649 inhcal_tree =
new TTree(
"hcalclustree",
"a tree with inner hcal cluster information");
671 cluster_tree =
new TTree(
"clustertree",
"A tree with EMCal cluster information");
697 recal_cluster_tree =
new TTree(
"recalclustertree",
"A tree with EMCal recalib cluster information");
721 fcluster_tree =
new TTree(
"fclustertree",
"A tree with FEMCal cluster information");
739 truth_g4particles =
new TTree(
"truthtree_g4",
"a tree with all truth g4 particles");