3 anaEEexample(
int neve=300, TString Tname0=
"/star/u/eemcdb/dataFeb11/run00006.eeTree",
int flag=0,
float Emax=40.){
4 TString Tname0=
"../sim2003/mc_eve2";
5 gSystem->Load(
"StRoot/StEEmcUtil/EEevent/libEEevent.so");
6 gSystem->Load(
"StRoot/StEEmcUtil/anaEE/libanaEE.so");
9 gStyle->SetOptStat(111111);
14 TFile *of=
new TFile(Tname+
"hist.root",
"recreate");
18 printf(
"read upto %d events from file=%s.root\n",neve,Tname.Data());
19 TFile *f =
new TFile(Tname+
".root");
21 TTree *t4 = (TTree*)f->Get(
"EEtree");
28 TBranch *br = t4->GetBranch(
"EEdst");
29 br->SetAddress(&event);
30 Int_t nevent = (Int_t)t4->GetEntries();
33 for (Int_t ie=0;ie<nevent;ie++) {
35 printf(
"\niEve=%d ---------- \n",ie);
42 printf(
"\n\nTotal events in B TTree=%d\n",nevent);
46 TH1F* h0=(TH1F* )of->Get(
"de");
56 TClonesArray *secA=
new TClonesArray(
"EEsectorDst",1000);
57 TBranch *BRsec = t4->GetBranch(
"Sec");
58 BRsec->SetAddress(&secA);
61 TBranch *BRid = t4->GetBranch(
"ID");
62 BRid->SetAddress(&eveID);
64 Int_t nevent = (Int_t)t4->GetEntries();
65 printf(
"Total events in TTree=%d\n",nevent);
70 for (Int_t ie=0;ie<nevent;ie++) {
78 if(ie%1==0) printf(
"\n\iEve=%d nSec=%d with data \n",ie,secA->GetEntries());
81 if(ie%1==0) printf(
"\n\iEve=%d eveID=%d, nSec=%d with data :\n",ie,eveID,secA->GetEntries());
85 for(is=0;is<secA->GetEntries();is++) {
87 if(ie<1) sec->print();
92 TClonesArray *hitAA[]={sec->getPre1Hits(),sec->getPre2Hits(),sec->getTwHits(),sec->getPostHits(),sec->getSmdUHits(),sec->getSmdVHits()};
96 if(ie<1) printf(
" sectorID=%d iz=%d nHit=%d :\n",sec->getID(),iz,hitA->GetEntries());
100 for(iz=4;iz<6;iz++) {
102 if(ie<1) printf(
" sectorID=%d iz=%d nHit=%d :\n",sec->getID(),iz,hitA->GetEntries());
103 for(ih=0;ih<hitA->GetEntries();ih++) {
107 hit2->get(strip,ener);
108 if(ie<1) printf(
" ih=%d strip=%d etaBin=%d ener=%f\n",ih, sec->getID(), strip,ener);