11 #include<calobase/RawCluster.h>
12 #include<calobase/RawClusterContainer.h>
13 #include <calobase/RawClusterUtility.h>
15 #include <g4vertex/GlobalVertexMap.h>
16 #include <g4vertex/GlobalVertex.h>
18 #include <g4hough/SvtxTrackMap.h>
19 #include <g4hough/SvtxTrack.h>
24 #include<fun4all/getClass.h>
72 cout <<
"------PJTranslator::Init(PHCompositeNode*)------" << endl;
103 cout <<
"------PJTranslator::process_event(PHCompositeNode*)------" << endl;
108 cerr <<
" This should never happen." << endl;
113 GlobalVertexMap* vertexmap = findNode::getClass<GlobalVertexMap>(topNode,
"GlobalVertexMap");
116 cout <<
"PJTranslator::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;
122 if (vertexmap->
empty()) {
123 cout <<
"PJTranslator::process_event - Fatal Error - GlobalVertexMap node is empty. Please turn on the do_bbc or tracking reco flags in the main macro in order to reconstruct the global vertex."<<endl;
128 CLHEP::Hep3Vector
vertex ;
139 RawClusterContainer *emc_clusters = findNode::getClass<RawClusterContainer>(topNode,
"CLUSTER_CEMC");
140 for(
unsigned int i=0;
i<emc_clusters->
size();
i++) {
149 E_vec_cluster = E_vec_cluster/
sfEMCAL;
150 double eT = E_vec_cluster.perp();
151 double pz = E_vec_cluster.z();
157 energy = sqrt(eT*eT + pz*pz);
168 RawClusterContainer *hci_clusters = findNode::getClass<RawClusterContainer>(topNode,
"CLUSTER_HCALIN");
169 for(
unsigned int i=0;
i<hci_clusters->
size();
i++) {
178 E_vec_cluster = E_vec_cluster/
sfHCALIN;
179 double eT = E_vec_cluster.perp();
180 double pz = E_vec_cluster.z();
185 energy = sqrt(eT*eT + pz*pz);
195 RawClusterContainer *hco_clusters = findNode::getClass<RawClusterContainer>(topNode,
"CLUSTER_HCALOUT");
196 for(
unsigned int i=0;
i<hco_clusters->
size();
i++) {
206 double eT = E_vec_cluster.perp();
207 double pz = E_vec_cluster.z();
212 energy = sqrt(eT*eT + pz*pz);
225 SvtxTrackMap* reco_tracks = findNode::getClass<SvtxTrackMap>(topNode,
"SvtxTrackMap");
228 double px = trk->get3Momentum(0);
229 double py = trk->get3Momentum(1);
230 double pz = trk->get3Momentum(2);
232 double p = sqrt(px*px + py*py + pz*pz);
233 double track_energy = sqrt(p*p + M*M);
234 double phi = atan2(py,px);
235 double eta = -log(tan(acos(pz/p)/2.0));
236 double et = track_energy/cosh(eta);
239 while( phi < 0 ) { phi += 2.0*M_PI; }
240 while( phi >= 2*M_PI ) { phi -= 2.0*M_PI; }
243 if(trk->getQuality() > 3.0)
continue;
327 particles->
data.push_back( fastjet::PseudoJet (et*cos(phi),et*sin(phi),pz,track_energy) );
331 cout <<
"EMC: " << emc_clusters->
size() << endl;
332 cout <<
"HCO: " << hco_clusters->
size() << endl;
333 cout <<
"HCI: " << hci_clusters->
size() << endl;
334 cout <<
"Tracker: " << reco_tracks->
size() << endl;
351 if(clus_energy < limLo)
356 else if(clus_energy > limHi)