HARPO  5.1.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
mrawprint.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 "HarpoFeminosReader.h"
10 #include "HarpoFeminosHeader.h"
11 #include "HarpoFeminosEvent.h"
12 
13 int main(int argc, char **argv)
14 {
15  Bool_t found = false;
16  HarpoFeminosHeader *hdr;
17 
18  HarpoConfig::gHReaderType = hDummyReader; //no high level reader
19  HarpoConfig *cfg = new HarpoConfig(argc,argv,XDCC);
20  cfg->print();
21 
22  HarpoFeminosReader *rdr = new HarpoFeminosReader( 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) {
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 
Long64_t GetDet()
Get Detector Number for single detector readers.
Definition: HarpoConfig.h:142
int main(int argc, char **argv)
Definition: mrawprint.cxx:13
virtual void print()
Long_t GetReadEvts()
A class store HARPO row FEMINOS event data and header. End provide access metods to the row data...
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
A class hold HARPO run iformation.
Bool_t Find(Long_t eventNo)
Bool_t isError()
EOF reached.
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
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.
HarpoFeminosEvent * GetEvent()
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