Your procedure cannot work because your ANTLcm::ExecuteEvent is never
called. In DistancetoPrimitive you never set the picked object to this.
I understand from your class that you try do use a "TBrik" like object
to display hits.
We have introduced in version 2.0 a new class TMarker3DBox
for this purpose. One could also introduce a TMarker3DTube.
I provide an example below based on your control macro to illustrate
how to use this new class TMarker3DBox.
Rene Brun
{
gROOT->Reset();
TCanvas *c1 = new TCanvas("Ant","The Ant Program", 200,10,700,780);
TPad *mainpad = new TPad("mainpad","mainpad",0.02,0.02,0.98,0.98,41);
mainpad->Draw();
mainpad->cd();
// Volume definition
TTUBE *mother = new TTUBE("mother","Mother
Volume","void",0.,300.,300.);
TNode *mainnode = new TNode("mainnode","Main node","mother");
mainnode->Draw();
mainpad->Update();
mainnode->cd();
// mainnode->SetVisibility(0);
Int_t nhits = 50;
for (Int_t hit=0;hit<nhits;hit++) {
Float_t dx = 10;
Float_t dy = 10;
Float_t dz = 70*gRandom->Rndm();;
Float_t x = -200+400*gRandom->Rndm();
Float_t y = -200+400*gRandom->Rndm();
Float_t z = -200+400*gRandom->Rndm();
Float_t r = TMath::Sqrt(x*x+y*y);
Float_t theta = 180*TMath::ACos(z/r);
Float_t phi = 180*TMath::Atan2(y,x);
TMarker3DBox *box = new TMarker3DBox(x,y,z,dx,dy,dz,theta,phi);
Int_t color = 0.1*dz;
box->SetLineColor(color);
box->Draw();
}
}