How to find a TRestMesh object inside the TFile object?

REST version : v2.2.18.
REST commit : e73dbcb6.

Hi,

My question is related to the already existing problem in this topic:

I am lost and not sure how should I retrieve from the TFile a TRestMesh object where I can find (and cout afterwards) protected variables such as fNetOrigin, fNetSize and fNodesX.
Whether the TRestMesh object is stored inside the TRestMetadata object?

I have found that I can find more precise references for the REST environment classes on the
doxygen website, however, I do not have access there.

Thank you in advance.

The doxygen documentation is available at REST-for-Physics: The REST Framework. Googling TRestMesh will lead you to that pages :slight_smile:, at least it does in my browser.

The TRestMesh object is not directly stored as a metadata member inside the TRestFastHitsToTrackProcess.

If you look inside the header file you will see that the members your are looking for are registered there.

Then, if you have a ROOT processed data file using that process, and load it using restRoot file.root, a corresponding metadata class will be instantiated as md0_xxx.

Then use, md0_xxx->PrintMetadata() to print the corresponding information.

When you load the file using restRoot file.root there is also the possibility to access the information using:

run0->GetMetadataMember("TRestFastHitsToTrackProcess->fCellResolution");

This will always return a string, so in case you need, you must cast it to the corresponding type:

Double_t dbl = StringToDouble(run0->GetMetadataMember("TRestFastHitsToTrackProcess->fCellResolution"));
TVector3 v = StringTo3DVector(run0->GetMetadataMember("TRestFastHitsToTrackProcess->fNetOrigin"));

I see now that there are no existing methods at that particular process, but if you miss them we could add them quickly, do not hesitate to add them if you wish too.

It is that what you were looking for?

Cheers,
J

There is always the option to use .ls inside a ROOT session to see what are the contents of the most recent open file.

Thank you very much for the detailed explanation!

That is exactly what I was looking for.