10 #include <TLorentzVector.h>
11 #include <calobase/RawTower.h>
12 #include <calobase/RawTowerContainer.h>
13 #include <calobase/RawTowerGeom.h>
14 #include <calobase/RawTowerGeomContainer.h>
15 #include <g4jets/Jet.h>
16 #include <g4jets/JetMap.h>
19 #include <calobase/RawCluster.h>
20 #include <calobase/RawClusterContainer.h>
21 #include <calobase/RawClusterUtility.h>
26 #include <g4vertex/GlobalVertex.h>
27 #include <g4vertex/GlobalVertexMap.h>
30 #include <HepMC/GenEvent.h>
31 #include <HepMC/GenVertex.h>
66 histo =
new TH1F(
"histo",
"histo", 100, -3, 3);
68 tree =
new TTree(
"tree",
"a tree");
80 cout <<
"at event number " <<
nevents << endl;
144 fclusters = findNode::getClass<RawClusterContainer>(topnode,
"CLUSTER_FEMC");
148 GlobalVertexMap *vertexmap = findNode::getClass<GlobalVertexMap>(topnode,
"GlobalVertexMap");
151 cout <<
"Forward_pi0s::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;
157 if (vertexmap->
empty())
159 cout <<
"Forward_pi0s::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;
164 if (vtx ==
nullptr)
return 0;
169 cout <<
"not forward cluster info" << endl;
174 cout <<
"no truth track info" << endl;
180 cout <<
"no cluster info" << endl;
223 cout <<
"Truth pi0 energy is :" <<
tpi0e << endl;
225 int firstphotonflag = 0;
226 int firstfirstphotonflag = 0;
227 int secondphotonflag = 0;
228 int secondsecondphotonflag = 0;
235 int dumtruthpid = truth->
get_pid();
240 if (dumparentid == 1 && dumtruthpid == 22 && !firstphotonflag)
260 if (dumparentid == 1 &&
262 firstphotonflag && firstfirstphotonflag)
277 secondphotonflag = 1;
281 if (dumparentid == 1 &&
282 firstphotonflag && secondphotonflag && secondsecondphotonflag)
284 cout <<
"I AM GOING TO SKIP THIS EVENT BECAUSE IT APPEARS TO BE A DALITZ DECAY" << endl;
285 cout <<
"THERE WERE 3 PARTICLES MARKED WITH PARENT ID == 1" << endl;
295 firstfirstphotonflag = 1;
296 if (secondphotonflag)
297 secondsecondphotonflag = 1;
301 cout <<
"truth decay photon 1 energy | phi | eta " <<
tphote1
303 cout <<
"truth decay photon 2 energy | phi | eta " <<
tphote2
323 for (fclusiter = fclus.first; fclusiter != fclus.second; ++fclusiter)
330 fclus_eta = E_vec_cluster.pseudoRapidity();
357 cout<<
"Found one good cluster"<<endl;
364 for (fclusiter2 = fclus2.first; fclusiter2 != fclus2.second; ++fclusiter2)
394 cout <<
"identified reco photon 1 energy | phi | eta: "
396 cout <<
"identified reco photon 2 energy | phi | eta: "
404 TLorentzVector phot1, phot2;
415 cout <<
"pi0 reco invmass is " <<
invmass << endl;
421 cout<<
"Final clusters found and writing to tree"<<endl;
446 for (clusiter = begin_end.first; clusiter != begin_end.second; ++clusiter)
453 clus_eta = E_vec_cluster.pseudoRapidity();
455 clus_pt = E_vec_cluster.perp();
461 TLorentzVector *clus =
new TLorentzVector();
465 clus->GetXYZT(dumarray);
496 for (clusiter2 = begin_end2.first; clusiter2 != begin_end2.second; ++clusiter2)
508 clus_eta2 = E_vec_cluster.pseudoRapidity();
525 cout <<
"CENTRAL ARM ID: "<<endl;
526 cout <<
"identified reco photon 1 energy | phi | eta: "
528 cout <<
"identified reco photon 2 energy | phi | eta: "
537 TLorentzVector phot1, phot2;
548 cout <<
"Central pi0 reco invmass is " <<
cent_invmass << endl;
565 std::cout <<
" DONE PROCESSING " << endl;
574 inhcal_tree =
new TTree(
"hcalclustree",
"a tree with inner hcal cluster information");
596 cluster_tree =
new TTree(
"clustertree",
"A tree with EMCal cluster information");
651 fcluster_tree =
new TTree(
"fclustertree",
"A tree with FEMCal cluster information");
699 truth_g4particles =
new TTree(
"truthtree_g4",
"a tree with all truth g4 particles");