From 264efe0d95026f7703931f623bde4cf04b66f5d0 Mon Sep 17 00:00:00 2001 From: aburke1605 <52657428+aburke1605@users.noreply.github.com> Date: Thu, 14 Jan 2021 13:27:51 +0000 Subject: [PATCH] Seed recoording functionality Added TNamed object to write the seed which was used to randomly sample the ntuple to the output files (rather than having to remember the seed used to generate). --- src/tuplesampler.cc | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/tuplesampler.cc b/src/tuplesampler.cc index 061e48b..5b96fe9 100644 --- a/src/tuplesampler.cc +++ b/src/tuplesampler.cc @@ -41,6 +41,7 @@ int main(int argc, char *argv[]) { TString soutname1 = argv[5]; TString soutname2 = argv[6]; TRandom3* rndGen = new TRandom3(atoi(argv[4])); + TNamed* seed = new TNamed("seed", argv[4]); TStopwatch sw; cout << "opening " << inname << endl; @@ -58,6 +59,7 @@ int main(int argc, char *argv[]) { ratio=1.0; } sout1 = TFile::Open(soutname1,"RECREATE",0); + seed->Write(); if(name!=tpath){ sout1->mkdir(tpath); sout1->cd(tpath); @@ -67,6 +69,7 @@ int main(int argc, char *argv[]) { TTree *soutTree1 = inTree->CloneTree(0); sout2 = TFile::Open(soutname2,"RECREATE"); + seed->Write(); if(name!=tpath){ sout2->mkdir(tpath); sout2->cd(tpath);