Comments about addMetadata in TRestRun to be available during processing

I have noticed that the right way to add external ROOT metadata is to use

<addMetadata name="mdName" file="file.root" />

or

<addMetadata type="TRestReadout" name="mdName" file="file.root" />.

and those should be included inside TRestRun.

I only want to point out, or remark, that I failed on my first guess, as a user, on how metadata should be included.

I tried first using something like:

<TRestReadout name="mdName" file="file.root"/>

That sentence, which is to me somehow reasonable, it is not allowed, and ends up in a seg.fault.

Also, I tried to place that outside TRestRun, should not be also allowed? I.e. to add any metadata structure defined in the <TRestManager> into <TRestRun>. So that I am more free to set where I place my readout, or any other metadata, definitions?

To import metadata from root file, you need to use <addMetadata, on the other hand, if you use <TRestReadout, REST will treat it as a new target to initialize. Then you need to include the rml file.

In short, the following two are allowed:

<addMetadata name="mdName" file="file.root" />
<TRestReadout name="mdName" file="readouts.rml" />

By the way, in “addMetadata”, the “type” attribute is not mandatory.

In your case, the seg.fault should not be in this step. It shall smoothly initialize a blank TRestReadout object. Maybe the seg.fault comes from when using it.

Then, if the following construction is not valid

<TRestReadout name="mdName" file="file.root"/>

when trying to load it should prompt an error, saying an RML file is required but file.root is not an RML.