From ac0679fa5ceaf28e8da47cc93cdf8950a0cecaa4 Mon Sep 17 00:00:00 2001
From: deserevi <deserevi@nptool>
Date: Mon, 7 Feb 2011 13:09:21 +0000
Subject: [PATCH] * Add support for dumping configuration files used during
 analysis in ROOT   output file

---
 NPLib/IORoot/RootOutput.cxx | 5 +++++
 NPLib/IORoot/RootOutput.h   | 2 ++
 2 files changed, 7 insertions(+)

diff --git a/NPLib/IORoot/RootOutput.cxx b/NPLib/IORoot/RootOutput.cxx
index 21e4b531e..d1aa9dc47 100644
--- a/NPLib/IORoot/RootOutput.cxx
+++ b/NPLib/IORoot/RootOutput.cxx
@@ -104,6 +104,9 @@ void RootOutput::InitAsciiFiles()
       TString fileNameCal = OptionManager->GetCalibrationFile();
       pCalibrationFile->SetNameTitle("Calibration", fileNameCal.Data());
    }
+
+   // Analysis configuration files
+   pAnalysisConfigFile = new TAsciiFile();
 }
 
 
@@ -129,6 +132,8 @@ RootOutput::~RootOutput()
       // RunToTreatFile
       TString RTName = pRunToTreatFile->GetName();
       if (!RTName.IsNull()) pRunToTreatFile->Write();
+      // Analysis ConfigFile
+      if (!pAnalysisConfigFile->IsEmpty()) pAnalysisConfigFile->Write();
 
       pRootFile->Close();
    } else {
diff --git a/NPLib/IORoot/RootOutput.h b/NPLib/IORoot/RootOutput.h
index 630f30811..8efc45b5e 100644
--- a/NPLib/IORoot/RootOutput.h
+++ b/NPLib/IORoot/RootOutput.h
@@ -75,6 +75,7 @@ public:
    TAsciiFile* GetAsciiFileDetectorConfiguration() {return pDetectorConfiguration;}
    TAsciiFile* GetAsciiFileCalibration()           {return pCalibrationFile;}
    TAsciiFile* GetAsciiFileRunToTreat()            {return pRunToTreatFile;}
+   TAsciiFile* GetAsciiFileAnlysisConfig()         {return pAnalysisConfigFile;}
 
 private:
    TFile      *pRootFile;
@@ -84,6 +85,7 @@ private:
    TAsciiFile *pDetectorConfiguration;
    TAsciiFile *pCalibrationFile;
    TAsciiFile *pRunToTreatFile;
+   TAsciiFile *pAnalysisConfigFile;
 };
 
 #endif // ROOTOUTPUT_HH
-- 
GitLab