StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
fzd_decode.C
1 //=======================================================================
2 // owner: Oleg Rogachevsky
3 // revised: Piotr A Zolnierczuk
4 //=======================================================================
5 //
6 #include <iostream.h>
7 
8 class St_geant_Maker;
9 class EEmcMCData;
10 
11 
12 TBrowser *b = 0;
13 St_geant_Maker *geant= 0;
14 
15 // _____________________________________________________________________
16 void fzd_decode(const Int_t Nevents=1, const Char_t *fzfile ="muon.fzd")
17 {
18  Int_t i=0;
19 
20  gSystem->Load("EEmc.so"); //
21 
22  gROOT->LoadMacro("bfc.C");
23  bfc(0,"fzin sim_T gen_T",fzfile);
24 
25  EEmcMCData *ev = new EEmcMCData;
26 
27 
28  char *hitBuf = new char[16384];
29 
30  for (i=1; i<=Nevents; i++ ) {
31 
32 
33  //chain->Clear();
34  //if (chain->Make(i)>=kStEOF) break;
35  //printf("%2d ====================================\n",i);
36  //St_g2t_event *g2t_event = (St_g2t_event *)chain->FindObject("g2t_event");
37  //assert(g2t_event);
38 
39  //St_g2t_ctf_hit *emc_hit = (St_g2t_ctf_hit *) chain->FindObject("g2t_eem_hit");
40 
41  //if (emc_hit!=0) {
42  int nh;
43  if ( (nh = ev->readEventFromChain(chain,i)) >0) {
44  cerr << "actual hits " << nh << endl;
45  ev->print();
46  //EEmcMCData *evcopy = new EEmcMCData(*ev);
47  //int nbw = ev->write(hitBuf,4096);
48  //cerr << "actual writ " << nbw << " bytes " << endl;
49  //int nbr = evcopy->read(hitBuf,nbw);
50  //cerr << "actual read " << nbr << " bytes " << endl;
51  //evcopy->print();
52  } else {
53  cerr << "EEMC/CTF hits not found" << endl;
54  }
55  }
56 }
57