HARPO  5.1.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
rawprint.cxx
Go to the documentation of this file.
1 /*
2  * Look for Dcc Event by number and print event map if found
3  */
4 #include <cstdlib>
5 #include <cstdio>
6 #include <iostream>
7 
8 #include "HarpoConfig.h"
9 #include "HarpoDccReader.h"
10 #include "HarpoDccHeader.h"
11 #include "HarpoDccEvent.h"
12 
13 int main(int argc, char **argv)
14 {
15  Bool_t found = false;
16  HarpoDccHeader *hdr;
17 
18  HarpoConfig::gHReaderType = hDummyReader; //no high level reader
19  HarpoConfig *cfg = new HarpoConfig(argc,argv,XDCC);
20  cfg->print();
21 
22  HarpoDccReader *rdr = new HarpoDccReader( cfg );
23  rdr->SetDet(cfg->GetDet());
24 
25  if ( rdr->Init() ) {
26  hdr = rdr->GetDetHeader();
27  hdr->print();
28  }
29  else
30  {
31  printf ("Int ERROR exiting ...\n");
32  return 1;
33  }
34 
35  //if ( rdr->NextEvent() ) printf("\n Next Event OK\n");
36  found = rdr->Find(cfg->GetNEvent());
37  if (found) {
38  HarpoDccEvent *evt = (HarpoDccEvent*)rdr->GetEvent();
39  evt->print();
40  HarpoDccMap * m = evt-> GetMap();
41  if ( m != NULL ) {
42  m->print();
43  } else {
44  std::cout << "No Data Map for this event " << std::endl;
45  }
46  }
47  else
48  {
49  std::cout << "Event " << cfg->GetNEvent() << " no found." << std::endl;
50  }
51 
52  std::cout << " Done after event " << rdr->GetReadEvts()
53  << " ( EOF ) : " << rdr->isDone()
54  << " Err " << rdr->isError() << std::endl;
55  return 0;
56 }
57 
58 
59 
int main(int argc, char **argv)
Definition: rawprint.cxx:13
A class which read HARPO dcc file from one DCC and creant Dcc Events and Dcc Headers for DCC Events o...
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
void print() const
HarpoDccHeader * GetDetHeader()
virtual void print()
Long_t GetReadEvts()
Bool_t isError()
EOF reached.
unpacked dcc data The class contains the data map for DCC or Feminos The data is stored as a 2D TMatr...
Definition: HarpoDccMap.h:29
Unknown Detector.
Definition: HarpoDet.h:18
void SetDet(Long_t plane)
Long64_t GetNEvent()
Get Event number with we looking for.
Definition: HarpoConfig.h:124
HarpoDccEvent * GetEvent()
void print() const
Read config file in libconfig format.
Bool_t Find(Long_t eventNo)
Init method : Open in/out files and check run header signature.
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
A class store HARPO EVENT : header and row data. Its provide also the methods for access to this data...
Definition: HarpoDccEvent.h:22