JSROOT Geometry Item

I have two data ,one is detecotr,another is event data, if i want show the data in one canvas in 3D(the detector show by geometry,and the event show by 3D line) how can i do.

Hi,

Detector drawing should be straightforward to do - see examples here:

https://root.cern/js/latest/examples.htm#tgeo_eve

Geometry can be stored as TGeoManager or TEveGeoShapeExtract instance.
And geometry drawing can be used as place to draw objects like TEvePointSet and TEveTrack

https://root.cern/js/latest/examples.htm#tgeo_tracks+hits

But question - in which form your event data are stored?
If you have TTree, you have to extract your data and convert into object like TEveTrack.
This can be done with plain C++ ROOT code, but also there is example how data from TTree
can be read directly by JSROOT:

https://root.cern/js/latest/api.htm#ttree_extract_tracks

There is small JavaScript loaded which performs such transformation:

Regards,
Sergey

I think, but I not sure,my file is TTree data,
because I get the gui like this4T%7DWQ7AF%5BS(I(S.png)
if i extract the data to TTEvetrack i want to merge into 3D Detector(this i have completed),i shoud put the data in jsroot? or i need to more,

Attachment is missing in your post.

Do you have geometry and data in ROOT files?
Can you post them here?
Of course if size is not too large.

sorry,the previous link have some problem, the detector i have achieved,like this detector,but this is so ugly i change the light , color opacity, and Effect processing after rendering(i have some knowladge of threejs) ,but i still get a bad result (I used Threejs to draw a model of the probe) your demo are so beautiful, do you have some experience?
the event file gui is this ,and the file on here the file is ttree? and if is,i need convert to TTeveTrack and add to threejs.scene or JSROOT has other function?

Yes, your events data stored as TTree.
One can browse it like this:

https://root.cern/js/latest/?file=https://raw.githubusercontent.com/ED-97/picture/main/FullSim.root+

And one can extract (dump) data:

https://root.cern/js/latest/?file=https://raw.githubusercontent.com/ED-97/picture/main/FullSim.root+&item=events&opt=SCDHitCol>>dump

Do you have geometry model of your detector?

yes i have,(I drew the probe in Threejs with some XML files ) so if i want to draw the evnet in detector,i need to extract the data to TTeveTrack and then draw them in scene or add them into item?
and Do you have a way to beautify my geometry?

Here how your geometry drawing looks like:

https://root.cern/js/latest/?file=https://raw.githubusercontent.com/ED-97/picture/main/HERD.root+&item=Default

If you have code where you can easily access data from FullSim.root file - then just use it to convert into TEveTrack or TGeoTrack objects. And store them as TList in other ROOT file. This is how following example works:

https://root.cern/js/latest/examples.htm#tgeo_tracks

Or you can implement JavaScript code which extract tracks directly from ROOT TTree.
This is how other example is working:

ok,i think i konw how i should do next,thanks for your help.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.