18 TEvePointSet* pointset(Int_t npoints = 512, TEveElement* parent=0)
20 TEveManager::Create();
22 if (!gRandom) gRandom =
new TRandom(0);
27 auto ps =
new TEvePointSet();
30 for(Int_t i = 0; i<npoints; i++)
32 ps->SetNextPoint(r.Uniform(-s,s), r.Uniform(-s,s), r.Uniform(-s,s));
33 ps->SetPointId(
new TNamed(Form(
"Point %d", i),
""));
36 ps->SetMarkerColor(TMath::Nint(r.Uniform(2, 9)));
37 ps->SetMarkerSize(r.Uniform(1, 2));
38 ps->SetMarkerStyle(4);
41 parent->AddElement(ps);
50 TEvePointSet* pointset_hierarchy(Int_t level=3, Int_t nps=1, Int_t fac=2,
51 Int_t npoints=512, TEveElement* parent=0)
57 for (Int_t i=0; i<nps; ++i) {
58 printf(
"level=%d nps=%d i=%d\n", level, nps, i);
59 ps = pointset(npoints, parent);
61 pointset_hierarchy(level, nps*fac, fac, npoints/fac, ps);
67 TEvePointSetArray* pointsetarray()
69 TEveManager::Create();
73 auto l =
new TEvePointSetArray(
"TPC hits - Charge Slices",
"");
74 l->SetSourceCS(TEvePointSelectorConsumer::kTVT_RPhiZ);
77 l->SetMarkerSize(0.8);
80 l->InitBins(
"Charge", 9, 10, 100);
82 TColor::SetPalette(1, 0);
83 const Int_t nCol = TColor::GetNumberOfColors();
84 for (Int_t i = 1; i <= 9; ++i)
85 l->GetBin(i)->SetMainColor(TColor::GetColorPalette(i * nCol / 10));
87 l->GetBin(0) ->SetMainColor(kGray);
88 l->GetBin(10)->SetMainColor(kWhite);
91 for (Int_t i = 0; i < 10000; ++i) {
92 rad = r.Uniform(60, 180);
93 phi = r.Uniform(0, TMath::TwoPi());
94 z = r.Uniform(-250, 250);
95 l->Fill(rad*TMath::Cos(phi), rad*TMath::Sin(phi), z, r.Uniform(0, 110));