Compare commits

..

No commits in common. "e9c50331f7b1d3320e318f1d574795af1fb3013e" and "c4557c2b26aea43030d03b324f0c6130cd10fe47" have entirely different histories.

View File

@ -58,7 +58,6 @@ namespace EventBuilder {
m_analyzedDir = m_workspace + "analyzed/";
m_histogramDir = m_workspace + "histograms/";
m_cutDir = m_workspace + "cuts/";
m_mergedDir = m_workspace + "merged/";
//Check all subdirectories. Terminate if any of them are bad
m_isValid = CheckSubDirectory(m_binaryDir);
@ -80,9 +79,6 @@ namespace EventBuilder {
if(!m_isValid)
return;
m_isValid = CheckSubDirectory(m_cutDir);
if(!m_isValid)
return;
m_isValid = CheckSubDirectory(m_mergedDir);
}
std::string EVBWorkspace::GetBinaryRun(int run)
@ -130,11 +126,9 @@ namespace EventBuilder {
std::vector<std::string> list;
std::string temp;
for(int run=runMin; run<=runMax; run++)
{
temp = GetAnalyzedRun(run);
if(!temp.empty())
list.push_back(temp);
}
return list;
}
@ -193,7 +187,7 @@ namespace EventBuilder {
return false;
TFile* output = TFile::Open(outputname.c_str(), "RECREATE");
if(!output || !output->IsOpen())
if(!output->IsOpen())
{
EVB_ERROR("Could not open output file {0} for merge", outputname);
output->Close();
@ -202,15 +196,8 @@ namespace EventBuilder {
TChain* chain = new TChain("SPSTree", "SPSTree");
for(auto& entry : files)
{
EVB_INFO("Merging file: {0}", entry);
chain->Add(entry.c_str());
}
//Note: TChain merge is kinda fucked. It requires a file passed in, which it then implicitly takes ownership of.
//By passing the keep option, we tell TChain we want to keep ownership of the file (otherwise it will automatically close and delete)
//We need ownership because the Merge function does not do a good job of handling errors explicitly.
chain->Merge(output, 0, "fast|keep");
chain->Merge(output, 0, "fast");
output->Close();
return true;
}