Commit f39f550e authored by Yakov Kulinich's avatar Yakov Kulinich
Browse files

Changed DataReader to include Run method

parent cac49d33
......@@ -37,12 +37,14 @@ class DataReader{
void AddAnalysis ( Analysis* );
void ReadListOfFiles(std::string listname);
void ReadListOfFiles( std::string listname );
void Run();
void Initialize ( );
void ProcessEvents( );
void Finalize ( );
private:
// output file
TFile* m_fOut;
......
......@@ -103,6 +103,20 @@ void DataReader::ReadListOfFiles( std::string listname ){
}
/** @brief Run method for DataReader
*
* Call Initialize, ProcessEvents, and Finalize
* Made so the driver class only has to call one method.
*
* @return none
*/
void DataReader::Run(){
Initialize();
ProcessEvents();
Finalize();
}
/** @brief Initialization method for DataReader
*
* Select which file(s) to read. For now just a single
......
......@@ -20,15 +20,17 @@ int main(int argc, char *argv[]){
int runNum = 54; // !! Change for your test !!
string fNameIn = "TreeZDCBeamTestRun54.root"; // !! Change for your test !!
// DataReader is the main class. It reads data and also
// has analysis classes in it. User should only have to
// modify the analysis classes and add output in them.
// User has to add their analysis to DataReader.
DataReader* r = new DataReader( nCh, nSamp, fNameIn, runNum );
r->AddAnalysis( new WFAnalysis() );
r->Initialize();
r->ProcessEvents();
r->Finalize();
r->Run();
delete r;
return 0;
......
/** @file AnalysisExample.cpp
* @brief example of a simple analysis: read and plot all the w
* @brief Example of a simple analysis: read and plot all the w
*
* This contains the prototypes and members
* for DataReader
*
* @author Yakov Kulinich
* @author Yakov Kulinich, Riccardo Longo
* @bug No known bugs.
*/
#include "DataReader.h"
#include "WFAnalysis.h"
using namespace std;
......@@ -18,15 +17,21 @@ int main(int argc, char *argv[]){
int nCh = 20; // 5 DRS4 x 4 ch/board - 16 RPD channels
int nSamp = 1024; // Default number of samples?
int runNum = 54; // !! Change !!
int runNum = 54; // !! Change for your test !!
string fNameIn = "TreeZDCBeamTestRun54.root";
string fNameIn = "TreeZDCBeamTestRun54.root"; // !! Change for your test !!
// DataReader is the main class. It reads data and also
// has analysis classes in it. User should only have to
// modify the analysis classes and add output in them.
// User has to add their analysis to DataReader.
DataReader* r = new DataReader( nCh, nSamp, fNameIn, runNum );
r->Initialize();
r->ProcessEvents();
r->Finalize();
r->AddAnalysis( new WFAnalysis() );
r->Run();
delete r;
return 0;
}
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment