Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches

Detailed Description

using namespace ROOT::Experimental;
void makeTracks(int N_Tracks, REveElement *trackHolder, float *pos)
{
auto prop = new REveTrackPropagator();
prop->SetMagFieldObj(new REveMagFieldDuo(5, 3.5, -2.0));
prop->SetMaxR(9);
prop->SetMaxZ(15);
double v = 0.1;
double m = 5;
for (int i = 0; i < N_Tracks; i++) {
auto p = new TParticle();
int pdg = 11 * (r.Integer(2) > 0 ? 1 : -1);
p->SetPdgCode(pdg);
p->SetProductionVertex(r.Uniform(-v, v) + pos[0], r.Uniform(-v, v) + pos[1], r.Uniform(-v, v) + pos[2], 1);
p->SetMomentum(r.Uniform(-m, m), r.Uniform(-m, m), r.Uniform(-m, m) * r.Uniform(1, 3), 1);
auto track = new REveTrack(p, 1, prop);
track->MakeTrack();
track->SetMainColor(kBlue);
track->SetName(Form("Track_%d", i));
trackHolder->AddElement(track);
}
}
{
auto eventScene = eveMng->SpawnNewScene(Form("%s Event Data", pname), pname);
auto mng = new REveProjectionManager();
mng->SetProjection(t);
mng->ImportElements(el, eventScene);
auto view = eveMng->SpawnNewViewer(pname);
view->SetCameraType(REveViewer::kCameraOrthoXOY);
view->AddScene(eventScene);
}
{
auto eveMng = REveManager::Create();
float pos[3] = {1.46589e-06, -1.30522e-05, -1.98267e-05};
// symnetric matrix
double a[16] = {1.46589e-01,
-1.30522e-02,
-1.98267e-02,
0,
-1.30522e-02,
4.22955e-02,
-5.86628e-03,
0,
-1.98267e-02,
-5.86628e-03,
2.12836e-01,
0,
0,
0,
0,
1};
t.SetFrom(a);
for (int i = 0; i < 3; i++)
for (int j = 0; j < 3; j++) {
xxx(i, j) = t(i + 1, j + 1);
}
TVectorD xxxEig(eig.GetEigenValues());
xxxEig = xxxEig.Sqrt();
TMatrixD vecEig = eig.GetEigenVectors();
int ei = 0;
for (int i = 0; i < 3; ++i) {
v[i].Set(vecEig(0, i), vecEig(1, i), vecEig(2, i));
v[i] *= xxxEig(i);
}
REveElement *event = eveMng->GetEventScene();
REveEllipsoid *ellipse = new REveEllipsoid("VertexError");
ellipse->InitMainTrans();
ellipse->SetMainColor(kGreen + 10);
ellipse->SetLineWidth(2);
ellipse->SetBaseVectors(v[0], v[1], v[2]);
ellipse->Outline();
event->AddElement(ellipse);
// add TGeoSphere
auto sph = new REveGeoShape("Sphere");
sph->SetShape(new TGeoSphere(0.99f, 1.f));
sph->SetMainColor(kGreen);
sph->SetMainTransparency(80);
sph->SetNSegments(80);
float m0 = v[0].Mag();
v[0].Normalize();
float m1 = v[1].Mag();
v[1].Normalize();
float m2 = v[2].Mag();
v[2].Normalize();
sph->InitMainTrans();
sph->RefMainTrans().SetBaseVec(1, v[0].fX, v[0].fY, v[0].fZ);
sph->RefMainTrans().SetBaseVec(2, v[1].fX, v[1].fY, v[1].fZ);
sph->RefMainTrans().SetBaseVec(3, v[2].fX, v[2].fY, v[2].fZ);
sph->RefMainTrans().SetScale(m0, m1, m2);
event->AddElement(sph);
auto ps = new REvePointSet("Vertices");
ps->SetMainColor(kYellow);
ps->SetNextPoint(pos[0], pos[1], pos[2]);
ps->SetMarkerStyle(4);
ps->SetMarkerSize(4);
float rng = 1;
for (int i = 0; i < 6; ++i)
ps->SetNextPoint(i * (rng / 3) - rng, 0, 0);
event->AddElement(ps);
auto trackHolder = new REveElement("Tracks");
eveMng->GetEventScene()->AddElement(trackHolder);
makeProjected(eveMng->GetEventScene(), "RPhi", REveProjection::kPT_RPhi);
makeProjected(eveMng->GetEventScene(), "RhoZ", REveProjection::kPT_RhoZ);
eveMng->Show();
}
#define a(i)
Definition RSha256.hxx:99
@ kGreen
Definition Rtypes.h:67
@ kBlue
Definition Rtypes.h:67
@ kYellow
Definition Rtypes.h:67
ROOT::Detail::TRangeCast< T, true > TRangeDynCast
TRangeDynCast is an adapter class that allows the typed iteration through a TCollection.
winID h TVirtualViewer3D TVirtualGLPainter p
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t r
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t Int_t Int_t Window_t TString Int_t GCValues_t GetPrimarySelectionOwner GetDisplay GetScreen GetColormap GetNativeEvent const char const char dpyName wid window const char font_name cursor keysym reg const char only_if_exist regb h Point_t winding char text const char depth char const char Int_t count const char ColorStruct_t color const char Pixmap_t Pixmap_t PictureAttributes_t attr const char char ret_data h unsigned char height h prop
R__EXTERN TRandom * gRandom
Definition TRandom.h:73
char * Form(const char *fmt,...)
Formats a string in a circular formatting buffer.
Definition TString.cxx:2570
Base class for REveUtil visualization elements, providing hierarchy management, rendering control and...
Wrapper for TGeoShape with absolute positioning and color attributes allowing display of extracted TG...
Implements constant magnetic filed that switches on given axial radius fR2 from vector fBIn to fBOut.
REvePointSet is a render-element holding a collection of 3D points with optional per-point TRef and a...
Manager class for steering of projections and managing projected objects.
Holding structure for a number of track rendering parameters.
Visual representation of a track.
REveTrans is a 4x4 transformation matrix for homogeneous coordinates stored internally in a column-ma...
TGeoSphere are not just balls having internal and external radii, but sectors of a sphere having defi...
Definition TGeoSphere.h:17
TMatrixDEigen.
Description of the dynamic properties of a particle.
Definition TParticle.h:26
This is the base class for the ROOT Random number generators.
Definition TRandom.h:28
Namespace for ROOT features in testing.
Definition TROOT.h:100
R__EXTERN REveManager * gEve
TMarker m
Definition textangle.C:8
Author
Alja Mrak-Tadel

Definition in file error_ellipse.C.