19 #include <log4cpp/CategoryStream.hh>
36 LOG_DEBUG(
"tracking.PHTpcEventExporter.exportEvent") <<
"exporting event, hits + seeds => file " <<
filename;
38 std::stringstream ofs;
42 <<
" \"runid\": " << 0 <<
", \n"
43 <<
" \"evtid\": " << 0 <<
", \n"
44 <<
" \"time\": " << 0 <<
", \n"
45 <<
" \"B\": " << B <<
" \n"
48 ofs <<
"\"META\": { \n"
51 <<
" \"type\": \"3D\", \n"
52 <<
" \"options\": { \n"
54 <<
" \"color\": 16777215 \n"
58 <<
" \"TRACKS\": { \n"
61 <<
" \"r_max\": 800,\n"
63 <<
" \"thickness\": 2 \n"
70 for (
int i = 0, ilen = candidates.size(); i < ilen; i++)
72 std::vector<double> hit = candidates[i]->getPosForHit(0);
73 std::vector<double>
mom = candidates[i]->getMomForHit(0);
74 size_t nhits = candidates[i]->nhits();
75 double pt = candidates[i]->Pt();
76 double sign = candidates[i]->sign();
77 double length = candidates[i]->approxLength();
78 size_t color = kdfinder::get_track_color<double>(
pt);
79 ofs <<
"{ \"color\": " << color <<
", \"pt\": " << pt <<
", \"xyz\":[" << hit[0] <<
"," << hit[1] <<
"," << hit[2]
80 <<
"], \"pxyz\":[" << mom[0] <<
"," << mom[1] <<
"," << mom[2]
81 <<
"],\"l\":" << length <<
",\"nh\":" << nhits <<
",\"q\":" << sign <<
"}";
98 for (
auto hitsetitr = hitsetrange.first;
99 hitsetitr != hitsetrange.second;
102 auto range = cluster_map->
getClusters(hitsetitr->first);
103 for(
auto it = range.first;
it != range.second; ++
it )
106 if ((std::pow((
double) cluster->
getPosition(0), 2) +
108 std::pow((
double) cluster->
getPosition(2), 2)) > (25.0 * 25.0))
118 if (
it != range.second)
135 ofile.open(filename);
144 LOG_DEBUG(
"tracking.PHTpcEventExporter.exportEvent") <<
"exporting event, hits + GenFit tracks => file " <<
filename;
146 std::stringstream ofs;
149 <<
" \"EVENT\": { \n"
150 <<
" \"runid\": " << 0 <<
", \n"
151 <<
" \"evtid\": " << 0 <<
", \n"
152 <<
" \"time\": " << 0 <<
", \n"
153 <<
" \"B\": " << B <<
" \n"
156 ofs <<
"\"META\": { \n"
159 <<
" \"type\": \"3D\", \n"
160 <<
" \"options\": { \n"
161 <<
" \"size\": 2, \n"
162 <<
" \"color\": 16777215 \n"
166 <<
" \"TRACKS\": { \n"
168 <<
" \"r_min\": 0,\n"
169 <<
" \"r_max\": 800,\n"
170 <<
" \"size\": 2, \n"
171 <<
" \"thickness\": 2 \n"
175 <<
" \"TRACKS\": {\n"
182 for (
int i = 0, ilen = gtracks.size(); i < ilen; i++)
187 rc = gtracks[i]->get_track_info(pos, mom, charge, nhits, length);
196 LOG_WARN(
"tracking.PHTpcEventExporter.exportEvent") <<
"got track with broken track info, id: " << i;
200 color = kdfinder::get_track_color<double>(
pt);
201 ofs <<
"{ \"color\": " << color <<
", \"pt\": " << pt <<
", \"xyz\":[" << pos.X() <<
"," << pos.Y() <<
"," << pos.Z()
202 <<
"], \"pxyz\":[" << mom.X() <<
"," << mom.Y() <<
"," << mom.Z() <<
"],\"l\":"
203 << length <<
",\"nh\":" << nhits <<
",\"q\":" << (charge < 0 ? -1 : 1) <<
"}";
219 for (
auto hitsetitr = hitsetrange.first;
220 hitsetitr != hitsetrange.second;
223 auto range = cluster_map->
getClusters(hitsetitr->first);
224 for(
auto it = range.first;
it != range.second; ++
it )
227 if ((std::pow((
double) cluster->
getPosition(0), 2) +
229 std::pow((
double) cluster->
getPosition(2), 2)) > (25.0 * 25.0))
239 if (
it != range.second)
256 ofile.open(filename);
265 LOG_DEBUG(
"tracking.PHTpcEventExporter.exportEvent") <<
"exporting event, just GenFit tracks => file " <<
filename;
267 std::stringstream ofs;
270 <<
" \"EVENT\": { \n"
271 <<
" \"runid\": " << 0 <<
", \n"
272 <<
" \"evtid\": " << 0 <<
", \n"
273 <<
" \"time\": " << 0 <<
", \n"
274 <<
" \"B\": " << B <<
" \n"
277 ofs <<
"\"META\": { \n"
280 <<
" \"type\": \"3D\", \n"
281 <<
" \"options\": { \n"
282 <<
" \"size\": 2, \n"
283 <<
" \"color\": 16777215 \n"
287 <<
" \"TRACKS\": { \n"
289 <<
" \"r_min\": 0,\n"
290 <<
" \"r_max\": 800,\n"
291 <<
" \"size\": 2, \n"
292 <<
" \"thickness\": 2 \n"
296 <<
" \"TRACKS\": {\n"
303 for (
int i = 0, ilen = gtracks.size(); i < ilen; i++)
305 gtracks[i]->get_track_info(pos, mom, charge, nhits, length);
307 color = kdfinder::get_track_color<double>(
pt);
308 ofs <<
"{ \"color\": " << color <<
", \"pt\": " << pt <<
", \"xyz\":[" << pos.X() <<
"," << pos.Y() <<
"," << pos.Z()
309 <<
"], \"pxyz\":[" << mom.X() <<
"," << mom.Y() <<
"," << mom.Z() <<
"],\"l\":"
310 << length <<
",\"nh\":" << nhits <<
",\"q\":" << (charge < 0 ? -1 : 1) <<
"}";
326 ofile.open(filename);