void draw_ell(Double_t dx=20.) { gSystem->Load("libGeom"); TGeoManager *geom = new TGeoManager("myGlobe", "Globe"); TGeoMaterial *mat = new TGeoMaterial("vacuum",0,0,0); TGeoMedium *med = new TGeoMedium("vacuum", 1, mat); // Create the top volume of your geometry TGeoVolume *top = geom->MakeBox("TOP",med,200,100,100); geom->SetTopVolume(top); // Now make just some spheres TGeoSphere *sphere1 = new TGeoSphere(0.,20.); TGeoSphere *sphere2 = new TGeoSphere(0.,40.); // Define some scale transformations on the desired axes TGeoScale *scale1 = new TGeoScale(1.,1.,2.5); TGeoScale *scale2 = new TGeoScale(1.,1.,0.2); // Apply it to your speres to make ellipsoids TGeoScaledShape *scsph1 = new TGeoScaledShape(sphere1, scale1); TGeoScaledShape *scsph2 = new TGeoScaledShape(sphere2, scale2); // Make some real objects out of them and give some colors TGeoVolume *sph1 = new TGeoVolume("GLOBE1",scsph1,med); TGeoVolume *sph2 = new TGeoVolume("GLOBE2",scsph2,med); sph1->SetLineColor(kRed); sph2->SetLineColor(kBlue); // Position the 2 ellipsoids so that they intersect top->AddNode(sph1,1); top->AddNode(sph2,1,new TGeoTranslation(dx,0.,0.)); // Close the geometry geom->CloseGeometry(); // Set the precision of the mesh // geom->SetNsegments(40); // Draw the top volume; note that just the sphere is visible top->Draw(); gPad->GetView()->ShowAxis(); top->Raytrace(); }