21 const TString *detname[] = {
22 "bemc",
"bprs",
"bsmde",
"bsmdp",
23 "eemc",
"eprs",
"esmdv",
"esmdu",
"epst" };
26 Int_t getVolIdEemc(
const Int_t ivid, Int_t §or,Int_t &eta,
27 Int_t &sub, Int_t &detector)
30 static Int_t emcIvid[4]={100000,1000,10,1};
31 Int_t emcChid[4], i, ividw, lowup, phi, dep;
36 emcChid[i] = ividw/emcIvid[i];
37 ividw = ividw%emcIvid[i];
47 printf(
" getVolIdEemc => wrong value of section %i \n",dep);
49 if (dep == 1) detector = EPRS;
51 (dep == 4) detector = EPSTS;
60 printf(
"getVolIdEemc: error decoding EEMC Geant volume Id %i; lowup=%i\n",
66 if (lowup == 1) sector = sector + 3;
80 Int_t getVolIdEsmd(
const Int_t ivid, Int_t §or,Int_t &plane,
81 Int_t &strip, Int_t &detector)
83 static Int_t smdIvid[4]={1000000,10000,1000,1};
84 Int_t smdChid[5], i, ividw, lowup, phi;
88 smdChid[i] = ividw/smdIvid[i];
89 ividw = ividw%smdIvid[i];
98 if (phi == 1 || phi == 4) {
99 if (plane == 3) detector = ESMDV;
100 if (plane == 1) detector = ESMDU;
102 else if (phi == 2 || phi == 5) {
103 if (plane == 1) detector = ESMDV;
104 if (plane == 2) detector = ESMDU;
106 else if (phi == 3 || phi == 6) {
107 if (plane == 2) detector = ESMDV;
108 if (plane == 3) detector = ESMDU;
111 printf(
" getVolIdEsmd -- error decoding ESMD Geant volume Id %i; lowup=%i\n",
120 if (lowup == 1) sector = sector + 3;
124 sector = sector - 12;
135 void eemc(
const Int_t Nevents=2,
136 const Char_t *fzfile =
"pt20y11phi50_0100.fzd")
140 Int_t nhit=0, id,m,e,s, adc;
141 Int_t ivid,sector,eta,plane,strip,sub,det;
144 gROOT->LoadMacro(
"bfc.C");
146 bfc(0,
"fzin sim_T gen_T",fzfile);
148 for (i=1; i<=Nevents; i++ ) {
152 St_g2t_emc_hit *g2t_emc_hit = (St_g2t_emc_hit *) chain->FindObject(
"g2t_eem_hit");
153 if (g2t_emc_hit!=0) {
154 Int_t nhits = g2t_emc_hit->GetNRows();
155 g2t_emc_hit_st *
hit = g2t_emc_hit->GetTable();
156 printf(
"#-# Emc hits :volume_id,energy\n");
157 for(Int_t ihit=0; ihit<nhits; ihit++,hit++) {
158 ivid = hit->volume_id;
160 getVolIdEemc(ivid,sector,eta,sub,det);
161 fprintf(stderr,
"%2i %8i %s %8.6f \n",ihit,ivid,detname[det-1],E);
165 St_g2t_emc_hit *g2t_smd_hit = (St_g2t_emc_hit *) chain->FindObject(
"g2t_esm_hit");
166 if (g2t_smd_hit !=0 ) {
167 Int_t nhits = g2t_smd_hit->GetNRows();
168 g2t_emc_hit_st *hit = g2t_smd_hit->GetTable();
169 printf(
"#-# Smd hits :volume_id,energy\n");
170 for(Int_t ihit=0; ihit<nhits; ihit++,hit++) {
171 ivid = hit->volume_id;
173 getVolIdEsmd(ivid,sector,plane,strip,det);
174 printf(
"%2i %8i %s %8.6f \n",ihit,ivid,detname[det-1],E);
177 printf (
"=========================================== Done with Event no. %d\n",i);
virtual void Clear(Option_t *option="")
User defined functions.