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 TTreeName
SimulatedTree S1107Data
RootFileName RootFileName
../../Outputs/Simulation/myResult.root /Volumes/S1107/RootData/data2251*.root
...@@ -111,6 +111,8 @@ RootInput::RootInput(string configFileName) ...@@ -111,6 +111,8 @@ RootInput::RootInput(string configFileName)
} }
} }
} }
cout << "ROOTInput has loaded " << pRootChain->GetEntries() << " entries in the inout chain " << endl ;
} }
if (!CheckRootFileName || !CheckTreeName) if (!CheckRootFileName || !CheckTreeName)
......
...@@ -62,17 +62,17 @@ RootOutput::RootOutput(TString fileNameBase, TString treeNameBase) ...@@ -62,17 +62,17 @@ RootOutput::RootOutput(TString fileNameBase, TString treeNameBase)
TString fileName = GlobalPath + "/Outputs/"; TString fileName = GlobalPath + "/Outputs/";
if (fileNameBase.Contains("root")) fileName += fileNameBase; if (fileNameBase.Contains("root")) fileName += fileNameBase;
else fileName += fileNameBase + ".root"; else fileName += fileNameBase + ".root";
pRootFile = new TFile(fileName, "RECREATE");
pRootFile = new TFile(fileName, "RECREATE");
} }
else{ // the file path must be the current directory else{ // the file path must be the current directory
// Does not create the Output file at instantiation // Does not create the Output file at instantiation
pRootFile = 0 ; 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 // Init TAsciiFile objects
InitAsciiFiles(); InitAsciiFiles();
...@@ -130,9 +130,7 @@ RootOutput::~RootOutput() ...@@ -130,9 +130,7 @@ RootOutput::~RootOutput()
cout << "Got histograms and Tree !" << endl; cout << "Got histograms and Tree !" << endl;
cout << " - Number of entries in the Tree: " << pRootTree->GetEntries() << endl; cout << " - Number of entries in the Tree: " << pRootTree->GetEntries() << endl;
cout << " - Number of bites written to file: " << pRootTree->Write() << endl; cout << " - Number of bites written to file: " << pRootTree->Write() << endl;
gDirectory->Cd(pRootFile->GetName());
// write TAsciiFile if used // write TAsciiFile if used
// EventGenerator // EventGenerator
if (!pEventGenerator->IsEmpty()) pEventGenerator->Write(); if (!pEventGenerator->IsEmpty()) pEventGenerator->Write();
......
...@@ -644,6 +644,7 @@ void TSharcPhysics::InitializeRootInputRaw() ...@@ -644,6 +644,7 @@ void TSharcPhysics::InitializeRootInputRaw()
inputChain->SetBranchStatus( "Sharc" , true ) ; inputChain->SetBranchStatus( "Sharc" , true ) ;
inputChain->SetBranchStatus( "fSharc_*" , true ) ; inputChain->SetBranchStatus( "fSharc_*" , true ) ;
inputChain->SetBranchAddress( "Sharc" , &m_EventData ) ; 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