26 #include <phgeom/PHGeomUtility.h>
44 #include <boost/format.hpp>
45 #include <boost/math/special_functions/sign.hpp>
64 , m_trackless_clusters(
true)
222 cout << _event << endl;
224 TrkrClusterContainer *clusterContainer = findNode::getClass<TrkrClusterContainer>(topNode,
"TRKR_CLUSTER");
226 CentralityInfov1 *cent = findNode::getClass<CentralityInfov1>(topNode,
"CentralityInfo");
229 std::cout <<
" ERROR -- can't find CentralityInfo node" << std::endl;
233 int cent_index = cent->
get_centile(CentralityInfo::PROP::bimp);
236 SvtxTrackMap* trackmap = findNode::getClass<SvtxTrackMap>(topNode,
"SvtxTrackMap");
241 std::cout <<
PHWHERE <<
"No Acts geometry on node tree. Can't continue."
245 std::cout<<
"This event has centrality: \t" << cent_index << std::endl;
250 outfile1 <<
"{\n \"EVENT\": {\n \"runid\": 1, \n \"evtid\": 1, \n \"time\": 0, \n \"type\": \"Collision\", \n \"s_nn\": 0, \n \"B\": 3.0,\n \"pv\": [0,0,0] \n },\n" << endl;
252 outfile1 <<
" \"META\": {\n \"HITS\": {\n \"INNERTRACKER\": {\n \"type\": \"3D\",\n \"options\": {\n \"size\": 5,\n \"color\": 16777215\n } \n },\n" << endl;
253 outfile1 <<
" \"TRACKHITS\": {\n \"type\": \"3D\",\n \"options\": {\n \"size\": 5,\n \"transparent\": 0.5,\n \"color\": 16777215\n } \n },\n" << endl;
254 outfile1 <<
" \"JETS\": {\n \"type\": \"JET\",\n \"options\": {\n \"rmin\": 0,\n \"rmax\": 78,\n \"emin\": 0,\n \"emax\": 30,\n \"color\": 16777215,\n \"transparent\": 0.5 \n }\n }\n }\n }\n," << endl;
255 outfile1 <<
" \"HITS\": {\n \"CEMC\":[{\"eta\": 0, \"phi\": 0, \"e\": 0}\n ],\n \"HCALIN\": [{\"eta\": 0, \"phi\": 0, \"e\": 0}\n ],\n \"HCALOUT\": [{\"eta\": 0, \"phi\": 0, \"e\": 0}\n \n ],\n\n" << endl;
256 outfile1 <<
" \"TRACKHITS\": [\n\n ";
258 std::vector<TrkrDefs::cluskey> usedClusters;
265 std::vector<TrkrDefs::cluskey>
clusters;
269 for (
auto iter = siseed->begin_cluster_keys(); iter != siseed->end_cluster_keys(); ++iter)
272 usedClusters.push_back(cluster_key);
279 for (
auto iter = tpcseed->begin_cluster_keys(); iter != tpcseed->end_cluster_keys(); ++iter)
282 usedClusters.push_back(cluster_key);
287 bool firstClus =
true;
292 float x = 0.;
float y = 0.;
float z = 0.;
293 float px = 0.;
float py = 0.;
float pz = 0.;
294 TVector3
pos; TVector3 mom;
301 for(
auto iter = range.first; iter != range.second; ++iter )
303 counter = counter + 1;
305 bool clusFromTrack =
false;
306 for(
unsigned int iclus = 0; iclus < usedClusters.size(); ++iclus)
309 if (trackClusKey == cluster_key)
311 clusFromTrack =
true;
315 if (clusFromTrack)
continue;
317 if(!cluster)
continue;
319 unsigned int clusADC = cluster->
getAdc();
322 Acts::Vector3 globalClusterPosition = geometry->getGlobalPosition(cluster_key, cluster);
323 x = globalClusterPosition(0);
324 y = globalClusterPosition(1);
325 z = globalClusterPosition(2);
326 pos.SetX(x); pos.SetY(y); pos.SetZ(z);
328 if (firstClus) firstClus =
false;
347 outfile1 <<
"],\n \"JETS\": [\n ]\n }," << endl;
349 outfile1 <<
"\"TRACKS\": {" << endl;
350 outfile1 <<
"\""<<
"INNERTRACKER"<<
"\": [";
353 bool firstTrack =
true;
359 x = 0.; y = 0.; z = 0.;
360 px = 0.; py = 0.; pz = 0.;
369 mom.SetX(px); mom.SetY(py); mom.SetZ(pz);
372 std::vector<TrkrDefs::cluskey>
clusters;
376 for (
auto iter = siseed->begin_cluster_keys(); iter != siseed->end_cluster_keys(); ++iter)
379 clusters.push_back(cluster_key);
386 for (
auto iter = tpcseed->begin_cluster_keys(); iter != tpcseed->end_cluster_keys(); ++iter)
389 clusters.push_back(cluster_key);
394 for(
unsigned int iclus = 0; iclus < clusters.size(); ++iclus)
398 if(!cluster)
continue;
400 Acts::Vector3 globalClusterPosition = geometry->getGlobalPosition(cluster_key, cluster);
401 x = globalClusterPosition(0);
402 y = globalClusterPosition(1);
403 z = globalClusterPosition(2);
404 pos.SetX(x); pos.SetY(y); pos.SetZ(z);
428 "{ \"pt\": %1%, \"e\": %2%, \"p\": %3%, \"c\": %4%, \"pdgcode \": %5%, \"centrality \": %6%, \"pts\":[ %7% ]}")
429 % mom.Pt() % mom.PseudoRapidity() % mom.Phi() % c %
_pdgcode % cent_index % spts.str() ) << endl;
438 ",{ \"pt\": %1%, \"e\": %2%, \"p\": %3%, \"c\": %4%, \"pdgcode \": %5%, \"centrality \": %6%, \"pts\":[ %7% ]}")
439 % mom.Pt() % mom.PseudoRapidity() % mom.Phi() % c %
_pdgcode % cent_index % spts.str() ) << endl;
446 outfile1 <<
"]" << endl;
447 outfile1 <<
"}" << endl;
448 outfile1 <<
"}" << endl;
450 usedClusters.clear();