# RDataframe stopre result of VariationsFor() in root file

**URL:** <https://root-forum.cern.ch/t/rdataframe-stopre-result-of-variationsfor-in-root-file/53289>\
**Category:** Newbie\
**Tags:** root\
**Created:** [January 26, 2023, 2:03pm UTC](https://root-forum.cern.ch/t/rdataframe-stopre-result-of-variationsfor-in-root-file/53289 "2023-01-26T14:03:16Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![tancredi](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/tancredi/32/20395_2.png) [@tancredi](https://root-forum.cern.ch/u/tancredi)\
**Post date:** [January 26, 2023, 2:03pm UTC](https://root-forum.cern.ch/t/rdataframe-stopre-result-of-variationsfor-in-root-file/53289/1 "2023-01-26T14:03:17Z")

</div>

Hello,  
is there an easy way to store the result of  
[ROOT::RDF::Experimental::RResultMap](https://root.cern/doc/master/classROOT_1_1RDF_1_1Experimental_1_1RResultMap.html) hx = [ROOT::RDF::Experimental::VariationsFor](https://root.cern/doc/master/namespaceROOT_1_1RDF_1_1Experimental.html#a7d05367066e89878601cc4dfdeb6f022)(nominal\_hx);  
(see manual [ROOT: ROOT::RDataFrame Class Reference](https://root.cern/doc/master/classROOT_1_1RDataFrame.html))  
to a root file ?  
I see the solution to loop over the map and explicitly write the histograms. I thought this could be more elegant…  
Regards,  
Tancredi

---

<div class="post-metadata">

**Author:** ![couet](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/couet/32/12037_2.png) [@couet](https://root-forum.cern.ch/u/couet)\
**Post date:** [January 26, 2023, 3:06pm UTC](https://root-forum.cern.ch/t/rdataframe-stopre-result-of-variationsfor-in-root-file/53289/2 "2023-01-26T15:06:08Z")

</div>

I guess @vpadulan can help.

---

<div class="post-metadata">

**Author:** ![eguiraud](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/eguiraud/32/32217_2.png) [@eguiraud](https://root-forum.cern.ch/u/eguiraud)\
**Post date:** [January 30, 2023, 3:14pm UTC](https://root-forum.cern.ch/t/rdataframe-stopre-result-of-variationsfor-in-root-file/53289/3 "2023-01-30T15:14:17Z")

</div>

Hi @tancredi ,

> [@tancredi](#):
>
> I see the solution to loop over the map and explicitly write the histograms. I thought this could be more elegant…

Indeed that’s the current way to do it. Then again I think yours is a very reasonable feature request 🙂 Feel free to open a pull request so we do not forget – we’ll see whether we can do anything to improve the situation.

Cheers,  
Enrico
