RunTag is not preserved between different analysis stages

REST version : v2.3.4.
REST commit : 18b689a6

I run my analysis in two steps, so I need to keep the runTag in both and use it in the output file name. In the first step, where I take the original .aqs file to produce a raw analysis .root file, TRestRun looks like this:

	<parameter name="experiment" value="IAXOD0"/>
	<parameter name="runNumber" value="preserve"/>
	<parameter name="runTag" value="preserve"/>
	<parameter name="runType" value="${RUN_TYPE}"/>
	<parameter name="runDescription" value=""/>
	<parameter name="user" value="${USER}"/>
	<parameter name="verboseLevel" value="0"/>
	<parameter name="overwrite" value="off" />
	<parameter name="inputFormat" value="R[fRunNumber]_[fRunTag]_Vm_[Mesh]_Vd_[Drift]_Pr_[Pressure]_Gain_[Gain]_Shape_[Shaping]_Clock_[Clock]-[fParentRunNumber].aqs"/> 
	<parameter name="outputFile" value="R[fRunNumber]_[fParentRunNumber]_[fRunType]_[fRunTag]_[RunUser]_[Version].root" /> 
	<parameter name="readOnly" value="false" />

And the relevant metadata is:

But in the next step, the runTag changes to just the first part of the actual runTag, i.e., Ar2Iso. This is what I do:

	<parameter name="experiment" value="IAXOD0"/>
	<parameter name="runNumber" value="preserve"/>
	<parameter name="runTag" value="preserve"/>
	<parameter name="runType" value="${RUN_TYPE}"/>
	<parameter name="runDescription" value=""/>
	<parameter name="user" value="${USER}"/>
	<parameter name="verboseLevel" value="0"/>
	<parameter name="overwrite" value="off" />
	<parameter name="inputFormat" value="R[fRunNumber]_[fParentRunNumber]_[fRunType]_[fRunTag]_[RunUser]_[Version].root" /> 
	<parameter name="outputFileName" value="R[fRunNumber]_[fParentRunNumber]_${RUN_TYPE}_[fRunTag]_[RunUser]_[Version].root" />
	<parameter name="readOnly" value="false" />

And now the metadata is:

Any idea?

Hi @CMargalejo, it took me sometime to find out. It is related with the inputFormat parameter. If at your second RML you remove the line <parameter name="inputFormat" ...> then the problem will be solved.

Or just leave the inputFormat parameter empty

<parameter name="inputFormat" value="" />

It is interesting that in the case of TREXDM pipeline, we do not experience this problem eventhough we keep the same inputFormat for both RMLs.

Perhaps, since inputFormat is ending in .aqs it is just ignoring to retrieve the run data members from the filename … @nkx?

Perhaps, a way to avoid that would be to check at TRestRun and force that the first process is an external process so that the inputFormat is a valid parameter.

So, in your case, the runTag was not being preserved, and it was being retrieved from the ROOT filename in the same way as it is done for the AQS file.

BTW, @CMargalejo, you must rename the experiment parameter to the new naming convention. It should be now experimentName to match the internal metadata member inside TRestRun::fExperimentName.

1 Like

OK, solved now. Thanks!

It is reasonable to get this result, you can try to match the file name format by eye:

Format:

R[fRunNumber]_[fRunTag]_Vm_[Mesh]_Vd_[Drift]_Pr_[Pressure]_Gain_[Gain]_Shape_[Shaping]_Clock_[Clock]-[fParentRunNumber].aqs

Input file:

R01183_Ar2Iso_CalibWith9VetosFe55_30min_Vm_320_Vd_95_Pr...

fRunTag field would be: Ar2Iso_CalibWith9VetosFe55_30min, since it is the shortest string between the character _ and _Vm_ after the previous field.

Format:

R[fRunNumber]_[fParentRunNumber]_[fRunType]_[fRunTag]_[RunUser]_[Version].root

Input file name:

R01183_0000_RawToSignal_Ar2Iso_CalibWith9VetosFe55_30min...

fRunTag field would be: Ar2Iso. Since it is the shortest string between the character _ and _ after the previous field

To solve the problem we can just remove the definition of inputFormat in the second rml, and make the output TRestRun to inherit from the input file. But for

I think we still need to keep the ability to read file name format from ROOT file.

1 Like