TEveStraightLineSet* make_vertex_cross(const IlcESDVertex* v, Bool_t use_sigma, Float_t fx, Float_t fy, Float_t fz) { Double_t x[3], e[3]; v->GetXYZ(x); v->GetSigmaXYZ(e); TEveStraightLineSet* ls = new TEveStraightLineSet("Cross"); TString title; if (use_sigma) { e[0] *= fx; e[1] *= fy; e[2] *= fz; title += Form("+- %.1f*sigma_x, %.1f*sigma_y, %.1f*sigma_z", fx, fy, fz); } else { e[0] = fx; e[1] = fy; e[2] = fz; title += Form("+- %.1f cm x %.1f cm x %.1f cm", fx, fy, fz); } title += Form("\nx=%.5f, y=%.5f, z=%.5f\nsx=%.5f, sy=%.5f, sz=%.5f", x[0], x[1], x[2], e[0], e[1], e[2]); ls->SetTitle(title); ls->AddLine(e[0], 0, 0, -e[0], 0, 0); ls->AddLine(0, e[1], 0, 0, -e[1], 0); ls->AddLine(0, 0, e[2], 0, 0, -e[2]); ls->RefMainTrans().SetPos(x); return ls; }
TEveStraightLineSet* make_vertex_ellipse(const IlcESDVertex* v, Bool_t use_sigma, Float_t fx, Float_t fy, Float_t fz) { Double_t x[3], e[3]; v->GetXYZ(x); v->GetSigmaXYZ(e); TEveStraightLineSet* ls = new TEveStraightLineSet("Ellipse"); TString title; if (use_sigma) { e[0] *= fx; e[1] *= fy; e[2] *= fz; title += Form("+- %.1f*sigma_x, %.1f*sigma_y, %.1f sigma_z", fx, fy, fz); } else { e[0] = fx; e[1] = fy; e[2] = fz; title += Form("+- %.1f cm x %.1f cm x %.1f cm", fx, fy, fz); } title += Form("\nx=%.5f, y=%.5f, z=%.5f\nsx=%.5f, sy=%.5f, sz=%.5f", x[0], x[1], x[2], e[0], e[1], e[2]); ls->SetTitle(title); const Int_t N = 32; const Float_t S = 2*TMath::Pi()/N; Float_t a = e[0], b = e[1]; for (Int_t i = 0; i<N; i++) ls->AddLine(a*TMath::Cos(i*S) , b*TMath::Sin(i*S) , 0, a*TMath::Cos(i*S+S), b*TMath::Sin(i*S+S), 0); a = e[0]; b = e[2]; for (Int_t i = 0; i<N; i++) ls->AddLine(a*TMath::Cos(i*S) , 0, b*TMath::Sin(i*S), a*TMath::Cos(i*S+S), 0, b*TMath::Sin(i*S+S)); a = e[1]; b = e[2]; for (Int_t i = 0; i<N; i++) ls->AddLine(0, a*TMath::Cos(i*S) , b*TMath::Sin(i*S), 0, a*TMath::Cos(i*S+S), b*TMath::Sin(i*S+S)); ls->RefMainTrans().SetPos(x); return ls; }