#include "TFile.h" #include "TTree.h" #include "TBrowser.h" #include "TH2.h" #include "TRandom.h" #include "TClassTable.h" #include "TSystem.h" #include "TROOT.h" #include using namespace std; void plot3DScatter(); void plot3DScatter() { // don't bother resetting since it sometimes causes crashes. // gROOT->Reset(); double x[28]= {-4656748.577, -4656747.895, -4656747.212, -4656746.53, -4656745.848, -4656745.165, -4656744.483, -4656743.8, -4656743.118, -4656742.436, -4656741.655, -4656741.606, -4656741.556, -4656741.507, -4656741.458, -4656741.409, -4656741.36, -4656741.31, -4656741.261, -4656740.579, -4656739.896, -4656739.214, -4656738.531, -4656737.849, -4656737.167, -4656736.484, -4656735.802,-4656735.119 }; double y[28]={3669658.529, 3669659.106, 3669659.683, 3669660.26, 3669660.836, 3669661.413, 3669661.99, 3669662.566, 3669663.143, 3669663.72, 3669665.45, 3669666.027, 3669666.604, 3669667.18, 3669667.757, 3669668.334, 3669668.91, 3669669.487, 3669670.064, 3669670.641, 3669671.217, 3669671.794, 3669672.371, 3669672.947, 3669673.524, 3669674.101, 3669674.678, 3669675.254}; double z[28]={84, 84, 84, 84, 84, 84, 84, 84, 84, 84, 103, 103, 103, 103, 103, 103, 103, 103, 124, 124, 124, 124, 124, 124, 124, 124, 124, 124}; TGraph2D *tg = new TGraph2D(28, x, y, z); unsigned int fusedNodeID=151; double time = 123.0; tg->SetMarkerStyle(8); char title[200]; snprintf(title,sizeof(title), "SrcTrkNodes(w/DataPts) assoc w/Fused NodeID=%u at frame time=%.2f sec", fusedNodeID,time); tg->SetTitle(title); tg->Draw("PCOL LINE"); #if 0 // comment out below and the plot won't be corrupted. tg->GetXaxis()->SetLabelSize(0.02); tg->GetYaxis()->SetLabelSize(0.02); tg->GetZaxis()->SetLabelSize(0.02); tg->GetXaxis()->SetTitleSize(0.02); tg->GetXaxis()->SetTitle("X in meters"); tg->GetXaxis()->SetTitleOffset(3); tg->GetYaxis()->SetTitle("Y in meters"); tg->GetYaxis()->SetTitleSize(0.02); tg->GetZaxis()->SetTitle("Source trk NodeID"); #endif return; }