HARPO  5.1.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
raw2root.cxx
Go to the documentation of this file.
1 #include <stdlib.h>
2 #include <stdio.h>
3 
4 #include "HarpoConfig.h"
5 #include "HarpoDccReader.h"
6 #include "HarpoDccHeader.h"
7 #include "HarpoDccAnalyse.h"
8 
9 int main(int argc, char **argv)
10 {
11  Long_t processed = -1; // Processed events counter , negative on error
12  HarpoDccHeader *hdr;
13 
14  HarpoConfig::gHReaderType = hDummyReader; //no high level reader
15  HarpoConfig *cfg = new HarpoConfig(argc,argv,XDCC);
16  cfg->print();
17 
18  HarpoDccReader *rdr = new HarpoDccReader( cfg );
19 
20  HarpoDccAnalyse *myAna = new HarpoDccAnalyse();
21  // Open dcc file and check header
22  if ( rdr->Init() ) {
23  hdr = rdr->GetDetHeader();
24  hdr->print();
25  }
26  else
27  {
28  printf ("Int ERROR exiting ...\n");
29  return 1;
30  }
31 
32  rdr->SetDet(cfg->GetDet());
33  // Register analyse
34  rdr->SetAnalyseFunction(myAna);
35 
36  //if ( rdr->NextEvent() ) printf("\n Next Event OK\n");
37  processed = rdr->Loop();
38  // delete cfg;
39 
40  rdr->Save();
41 
42  printf("\n Done processed Events %li\n",processed);
43  delete myAna;
44  delete rdr;
45  delete cfg;
46  return 0;
47 }
48 
49 
50 
A class which read HARPO dcc file from one DCC and creant Dcc Events and Dcc Headers for DCC Events o...
Long_t Loop()
Read errors.
A class hold HARPO run iformation.
Bool_t Init()
Init method : Open in/out files and check run header signature.
Long64_t GetDet()
Get Detector Number for single detector readers.
Definition: HarpoConfig.h:142
HarpoDccHeader * GetDetHeader()
void SetAnalyseFunction(HarpoDccAnalyse *func)
int main(int argc, char **argv)
Definition: raw2root.cxx:9
A virtual class which define intrafece between HARPO Reader and Event Analysis code.
Unknown Detector.
Definition: HarpoDet.h:18
void SetDet(Long_t plane)
void print() const
Read config file in libconfig format.
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