HARPO  5.1.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
mrawnoisemonitor.cxx
Go to the documentation of this file.
1 #include <stdlib.h>
2 #include <stdio.h>
3 #include <iostream>
4 
5 #include "HarpoConfig.h"
6 #include "HarpoFeminosReader.h"
7 #include "HarpoFeminosHeader.h"
9 
10 #include "TROOT.h"
11 #include "TStyle.h"
12 #include "TApplication.h"
13 
14 int main(int argc, char **argv)
15 {
16  Long_t processed = -1; // Processed events counter , negative on error
17  HarpoFeminosHeader *hdr;
18 
19  HarpoConfig::gHReaderType = hDummyReader; //no high level reader
20  HarpoConfig *cfg = new HarpoConfig(argc,argv,XDCC);
21  cfg->print();
22 
23  HarpoFeminosReader *rdr = new HarpoFeminosReader( cfg );
24  rdr->SetDet(cfg->GetDet());
25 
27  // Open dcc file and check header
28  if ( rdr->Init() ) {
29  hdr = rdr->GetDetHeader();
30  hdr->print();
31  }
32  else
33  {
34  printf ("Int ERROR exiting ...\n");
35  return 1;
36  }
37 
38  TApplication *theApp = new TApplication("App", &argc, argv);
39  gROOT->SetStyle("Plain"); gStyle->SetPalette(1);
40 
41  std::cout << "Det = " << cfg->GetDet() << std::endl;
42  // Register analyse
43  rdr->SetAnalyseFunction(myAna);
44 
45  //if ( rdr->NextEvent() ) printf("\n Next Event OK\n");
46  processed = rdr->Loop();
47  // delete cfg;
48 
49  myAna->Save();
50  //rdr->Save();
51 
52  printf("\n Done processed Events %li\n",processed);
53  delete myAna;
54  delete rdr;
55  delete cfg;
56 
57  theApp->Run();
58 
59  return 0;
60 }
61 
62 
63 
Long64_t GetDet()
Get Detector Number for single detector readers.
Definition: HarpoConfig.h:142
void SetAnalyseFunction(HarpoDetAnalyse *func)
A class hold HARPO run iformation.
A virtual class which define intrafece between HARPO Reader and Event Analysis code.
Unknown Detector.
Definition: HarpoDet.h:18
void SetDet(Long_t plane)
Long_t Loop()
Read errors.
void print() const
Read config file in libconfig format.
A class which read HARPO dcc file from one FEMINOS and creant Dcc Events and Dcc Headers for FEMINOS ...
Bool_t Init()
Init method : Open in/out files and check run header signature.
int main(int argc, char **argv)
static hReaderType gHReaderType
Reader Type.
Definition: HarpoConfig.h:179
HarpoFeminosHeader * GetDetHeader()
A class which keeps track of the entire configuration of the analysis.
Definition: HarpoConfig.h:50