AnalysisExample.cpp 1.06 KB
Newer Older
1
2
3
4
5
6
7
8
9
/** @file AnalysisExample.cpp
 *  @brief Example of a simple analysis: read and plot all the w
 *
 *
 *  @author Yakov Kulinich, Riccardo Longo
 *  @bug No known bugs.
 */

#include "DataReader.h"
Yakov Kulinich's avatar
Yakov Kulinich committed
10
#include "WFAnalysis.h"
11
12
13
14
15
16
17
18
19

using namespace std;

int main(int argc, char *argv[]){

  // can put arguments here, for now I will just do defaults.

  int nCh    = 20;   // 5 DRS4 x 4 ch/board - 16 RPD channels
  int nSamp  = 1024; // Default number of samples?
Yakov Kulinich's avatar
Yakov Kulinich committed
20
  int runNum = 54;   // !! Change for your test !!
21

Yakov Kulinich's avatar
Yakov Kulinich committed
22
  string fNameIn = "TreeZDCBeamTestRun54.root"; // !! Change for your test !!
23
24
25
26
27

  // 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.
28
  DataReader* r = new DataReader( nCh, nSamp, fNameIn, runNum );
Yakov Kulinich's avatar
Yakov Kulinich committed
29
30
31

  r->AddAnalysis( new WFAnalysis() );

Riccardo Longo's avatar
Riccardo Longo committed
32
  r->LoadConfigurationFile("${JCaPA}/Utils/ConfigFile2018.xml");
33
  r->LoadAlignmentFile("${JCaPA}/Utils/Alignment_2018.xml");
Riccardo Longo's avatar
Riccardo Longo committed
34

35
36
  r->Run();
  
Yakov Kulinich's avatar
Yakov Kulinich committed
37
  delete r;
38
39
40
41
  
  return 0;
}