Package: servicex-for-trexfitter
ServiceX for TRExFitterFor GitHub and PyPI release v1.1.0OverviewServiceX, a component of the IRIS-HEP DOMA group's iDDS, is an experiment-agnostic service to enable on-demand data delivery from data lakes in different data formats, including Apache Arrow and ROOT ntuple.TRExFitteris a popular framework to perform profile likelihood fits in ATLAS experiment. It takes ROOT histograms or ntuples as input. Long turnaround time of ntuple reading for large and/or remote data would slow down the whole analysis.servicex-for-trexfitteris a Python package to integrateServiceXinto theTRExFitterframework.
It provides an alternative workflow if you useROOTntuples as inputs.
The package analyzes yourTRExFitterconfiguration file, and delivers only necessary branches and entries to produce all histograms defined in yourTRExFitterconfiguration file.The default workflow requires to download allROOTntuples to your local machine or CERN EOS area from the grid.
The workflow usingservicex-for-trexfitter, on the the other hand, delivers only a subset ofROOTntuples.
It practically replaces the step to downloadROOTntuples from the grid usingRucio.The main advantages are:Disk space: No need to store allROOTntuples locally.
A reduction on the deliveredROOTntuples byservicex-for-trexfittervaries accoring to the setting in yourTRExFitterconfiguration file.Faster turnaround: Download ofROOTntuples can be faster forservicex-for-trexfitteras it parallelizes your job up to eachTTreeof each file and delivers smallerROOTntuples over WAN.
Processing time ofTRExFitteroptionnis naturally faster for the workflow usingservicex-for-trexfitteras it runs over smallerROOTntuples.Simplicity: A singleTRExFitterconfiguration file to getROOTntuples from the grid usingservicex-for-trexfitterand all otherTRExFittersteps. No separate script needed to download allROOTntuples from the grid.PrerequisitesPython 3.6, 3.7, or 3.8Access to anUprootServiceX endpoint. More information about ServiceX can be found atServiceX documentationUsageInstallationThe library is published at PyPI:servicex-for-trexfitterPrepare TRExFitter configurationThe followings are the settings needed for the workflow usingservicex-for-trexfitter:Jobblock settingsNtuplePaths: <PATH>The path where input root files are stored.Write permission is required as ServiceX delivers root ntuples to the subdirectoryservicexof this path.Sampleblock settingsGridDID: <Rucio DID>Add optionGridDIDfor theSampleusing ServiceX for delivery.Both scope and name forGridDID, e.g.,user.kchoi:user.kchoi.WZana_WZ.Sample can have multiple DIDs: e.g.,user.kchoi:user.kchoi.WZana_WZ_mc16a, user.kchoi:user.kchoi.WZana_WZ_mc16d, user.kchoi:user.kchoi.WZana_WZ_mc16eSamplewithout an optionGridDIDis treated as a typical Sample, which reads ntuple files from local path.NtupleFile: servicex/<SAMPLE NAME>servicex-for-trexfitterdelivers oneROOTfile perSamplewith the same name as theSamplename.This option is required only for the Samples with optionGridDID. Other Samples can use any option valid for option NTUP.Here is a side-by-side comparsion of example configuration files:servicex-for-trexfitterDefaultCaveatOnly scalar-type of TBranch is supported.Most of standard TCut expressions are supported forSelection,but special functions likeSum$(formula)are not supported yet. Please find more about the supported TCut expressionhere.DeliverROOTntuplesfromservicex_for_trexfitterimportServiceXTRExFittersx_trex=ServiceXTRExFitter("<TRExFitter configuration file>")sx_trex.get_ntuples()Once you load the package, you can define an instance with an argument ofTRExFitterconfiguration file.
You can then ask for delivery ofROOTntuples.
It will initiateServiceXtransformation(s) based on yourTRExFitterconfiguration, and deliverROOTntuples to the path you specified atNtuplePaths/servicex.Local data cacheServiceXprovides the feature that caches your queries and data into a local temporary directory.
Therefore, whenever you make further changes to theTRExFitterconfiguration file,servicex-for-trexfittercreates data delivery requests only for the updated parts.Compatible TRExFitter frameworkTo run the subsequent steps ofTRExFitterwith theROOTntuples thatservicex-for-trexfitterdelivered, you need to checkout the branchfeat/servicex-integrationofTRExFitterframework.
Otherwise,TRExFitterwill complain about the unknown options.
The feature branch will be merged into master in the near future.AcknowledgementsSupport for this work was provided by the the U.S. Department of Energy, Office of High Energy Physics under Grant No. DE-SC0007890