Skip to content
Snippets Groups Projects
Commit efa344bc authored by matta's avatar matta
Browse files

* fixing bug in RootOutput

 - Tree was not declared in non proof mode
parent 18defaa0
No related branches found
No related tags found
No related merge requests found
TTreeName
SimulatedTree
S1107Data
RootFileName
../../Outputs/Simulation/myResult.root
/Volumes/S1107/RootData/data2251*.root
......@@ -111,6 +111,8 @@ RootInput::RootInput(string configFileName)
}
}
}
cout << "ROOTInput has loaded " << pRootChain->GetEntries() << " entries in the inout chain " << endl ;
}
if (!CheckRootFileName || !CheckTreeName)
......
......@@ -62,17 +62,17 @@ RootOutput::RootOutput(TString fileNameBase, TString treeNameBase)
TString fileName = GlobalPath + "/Outputs/";
if (fileNameBase.Contains("root")) fileName += fileNameBase;
else fileName += fileNameBase + ".root";
pRootFile = new TFile(fileName, "RECREATE");
pRootFile = new TFile(fileName, "RECREATE");
}
else{ // the file path must be the current directory
// Does not create the Output file at instantiation
pRootFile = 0 ;
pRootTree = new TTree(treeNameBase, "Data created / analyzed with the NPTool package");
pRootList = new TList();
}
pRootTree = new TTree(treeNameBase, "Data created / analyzed with the NPTool package");
pRootList = new TList();
// Init TAsciiFile objects
InitAsciiFiles();
......@@ -130,9 +130,7 @@ RootOutput::~RootOutput()
cout << "Got histograms and Tree !" << endl;
cout << " - Number of entries in the Tree: " << pRootTree->GetEntries() << endl;
cout << " - Number of bites written to file: " << pRootTree->Write() << endl;
gDirectory->Cd(pRootFile->GetName());
// write TAsciiFile if used
// EventGenerator
if (!pEventGenerator->IsEmpty()) pEventGenerator->Write();
......
......@@ -644,6 +644,7 @@ void TSharcPhysics::InitializeRootInputRaw()
inputChain->SetBranchStatus( "Sharc" , true ) ;
inputChain->SetBranchStatus( "fSharc_*" , true ) ;
inputChain->SetBranchAddress( "Sharc" , &m_EventData ) ;
}
///////////////////////////////////////////////////////////////////////////
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment