HARPO  5.1.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
hrootnoise.cxx
Go to the documentation of this file.
1 //
2 // Demo code for harpo analyse framework in C++ and Root
3 //
4 
5 #include <stdlib.h>
6 #include <stdio.h>
7 
8 #include "HarpoConfig.h"
9 #include "HarpoReader.h"
10 #include "HarpoRunHeader.h"
12 
13 #include "TROOT.h"
14 #include "TStyle.h"
15 #include "TApplication.h"
16 
17 int main(int argc, char **argv)
18 {
19  Long_t processed = -1; // Processed events counter , negative on error
20 
21  HarpoRunHeader *hdr;
22  //HarpoEvent *hevent;
23  // gDebug = 1;
24  HarpoConfig *cfg = new HarpoConfig(argc,argv);
25  cfg->Init();
26 
27  cfg->print();
28 
29  HarpoReader *rdr = new HarpoReader( cfg );
30 
31  if ( rdr->Init() ) {
32  hdr = rdr->GetRunHeader();
33  hdr->print();
34  }
35  else
36  {
37  printf ("Int ERROR exiting ...\n");
38  return 1;
39  }
40 
41  TApplication *theApp = new TApplication("App", &argc, argv);
42  gROOT->SetStyle("Plain"); gStyle->SetPalette(1);
43 
44  // theApp->Run();
45 
47 
48  hana-> Init(); // if errors ???
49 
50  rdr->SetAnalyseFunction(hana);
51 
52  //if ( rdr->NextEvent() ) printf("\n Next Event OK\n");
53  processed = rdr->LoopAll();
54 
55  hana->Save();
56  delete hana;
57  delete rdr;
58  delete cfg;
59  printf("\n Done processed Events %li\n",processed);
60 
61  theApp->Run();
62 
63  return 0;
64 }
65 
66 
67 
int main(int argc, char **argv)
Definition: hrootnoise.cxx:17
Monitor noise in non-zerosuppressed data.
Bool_t Init(hReadMode mode=hSyncTime)
Definition: HarpoReader.h:73
A class hold HARPO run iformation.
A class which instantiate the real top level reader.
Definition: HarpoReader.h:33
Long_t LoopAll()
Read errors.
Definition: HarpoReader.h:79
void Init()
Definition: HarpoConfig.h:63
void SetAnalyseFunction(HarpoAnalyse *func, Int_t i=0)
Definition: HarpoReader.h:51
void print() const
Read config file in libconfig format.
HarpoRunHeader * GetRunHeader()
Definition: HarpoReader.h:70
A class which keeps track of the entire configuration of the analysis.
Definition: HarpoConfig.h:50