00001 #include <iostream.h>
00002
00003 class St_geant_Maker;
00004 class EEmcMCData;
00005
00006
00007 TBrowser *b = 0;
00008 St_geant_Maker *geant= 0;
00009
00010
00011
00012 void fzd2EEevent(const Int_t Nevents=10000, TString fzFile ="../sim2003/mc_eve2.fzd") {
00013 fzFile ="pid6.fzd";
00014 fzFile ="dAu83.fzd";
00015
00016
00017 Int_t i=0;
00018 gSystem->Load("St_base");
00019 gSystem->Load("StChain");
00020 gSystem->Load("StarClassLibrary");
00021
00022 gROOT->LoadMacro("$STAR/StRoot/macros/bfc.C");
00023 gSystem->Load("StEEmcUtil.so");
00024 bfc(0,"fzin sim_T gen_T",fzFile);
00025
00026 TString outFile=fzFile.ReplaceAll(".fzd",".root");
00027 TFile f(outFile,"RECREATE");
00028 TTree t4("EEtree","A Tree with Events");
00029
00030 EEeventDst eveR;
00031 EEeventDst *eve=new EEeventDst();
00032 t4.Branch("EEdst", "EEeventDst", &eve,16000,99);
00033 EEmcMCData *evIN = new EEmcMCData;
00034
00035 for (i=1; i<=Nevents; i++ ) {
00036 chain->Clear();
00037 if (chain->Make(i)>=kStEOF) break;
00038 printf("%2d ====================================\n",i);
00039 int nh=-1;
00040 nh = evIN->readEventFromChain(chain);
00041
00042 if(nh<=0) {
00043 printf("EEMC/CTF hits not found");
00044 continue;
00045 }
00046
00047 if(i==1) {
00048 printf(" actual RAW geant EEMC hits =%d nh\n",nh);
00049 evIN->print();
00050 }
00051
00052
00053 evIN->write(&eveR);
00054
00055
00056 eveR.sumRawMC(eve);
00057
00058
00059 t4.Fill();
00060 }
00061
00062 Int_t nevent = (Int_t)t4->GetEntries();
00063 printf("Total events in TTree=%d file=%s\n",nevent,outFile.Data());
00064 t4->Print();
00065
00066 f.Write() ;
00067
00068
00069 }
00070