HARPO  5.1.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
pmm2/pmm2evprop.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 "Pmm2Reader.h"
10 //#include "Pmm2Event.h"
11 #include "Pmm2AnalyseEvProp.h"
12 
13 int main(int argc, char **argv)
14 {
15  Long_t processed = -1; // Processed events counter , negative on error
16 
17  HarpoDetHeader *hdr;
18 
19  HarpoConfig::gHReaderType = hDummyReader; //no high level reader
20  HarpoConfig *cfg = new HarpoConfig(argc,argv,PMM2);
21  cfg->Init(); // read configuration file
22  int verbose = cfg->GetVerbose();
23  if(verbose) cfg->print();
24 
25  cfg->print();
26 
27  Pmm2Reader *rdr = new Pmm2Reader( cfg );
28  rdr->SetReadOutMode(pWIN); // Bin file mode w/o run header and event headers
29 
30  if ( rdr->Init() ) {
31  hdr = rdr->GetDetHeader();
32  hdr->print();
33  }
34  else
35  {
36  printf ("Int ERROR exiting ...\n");
37  return 1;
38  }
39 
41 
42  hana-> Init(); // if errors ???
43 
44  rdr->SetAnalyseFunction(hana);
45 
46  //if ( rdr->NextEvent() ) printf("\n Next Event OK\n");
47  processed = rdr->Loop();
48 
49  hana->Save();
50  delete hana;
51  delete rdr;
52  delete cfg;
53  printf("\n Done processed Events %li\n",processed);
54  return 0;
55 }
56 
57 
58 
A class hold HARPO run iformation.
Dcc Plane Y.
Definition: HarpoDet.h:20
virtual void print()
A simle analyse of base PMM2 event properties.
void Save(char *mode=NULL)
int main(int argc, char **argv)
void Init()
Definition: HarpoConfig.h:63
void SetReadOutMode(Long_t version)
Definition: Pmm2Reader.h:55
Bool_t Init()
Init method : Open in/out files and check run header signature.
Definition: Pmm2Reader.cxx:401
void SetAnalyseFunction(HarpoDetAnalyse *func)
Definition: Pmm2Reader.cxx:119
void print() const
Read config file in libconfig format.
A class which read HARPO raw file from PMM2 and create Raw Events objects.
Definition: Pmm2Reader.h:31
Long_t Loop()
Read errors.
Definition: Pmm2Reader.cxx:478
static hReaderType gHReaderType
Reader Type.
Definition: HarpoConfig.h:179
A class which keeps track of the entire configuration of the analysis.
Definition: HarpoConfig.h:50
TEXT mode (?? csv), UNIMPLEMENTED.
Definition: HarpoConfig.h:44
Pmm2Header * GetDetHeader()
Definition: Pmm2Reader.cxx:392
Long64_t GetVerbose()
Get program verbosity level.
Definition: HarpoConfig.h:115