00001 class StChain;
00002 class StMuEmcCollection;
00003 StChain *chain=0;
00004
00005
00006 int rdMuDst2print(
00007 char* file = "R50530.MuDst.root",
00008 Int_t nFiles = 1,
00009 char* inDir = "./",
00010 int nEve=100)
00011 {
00012
00013
00014 file = "R5015034x.MuDst.root";
00015
00016 inDir = "/star/data05/scratch/balewski/outProd/R5086037/";
00017 file="st_physics_5086037_raw_4040001-1*.MuDst.root";
00018
00019
00020 gROOT->LoadMacro("$STAR/StRoot/StMuDSTMaker/COMMON/macros/loadSharedLibraries.C");
00021 loadSharedLibraries();
00022 cout << " loading done " << endl;
00023
00024
00025
00026 chain = new StChain("StChain");
00027
00028
00029 muMk = new StMuDstMaker(0,0,inDir,file,"MuDst.root",nFiles);
00030
00031 chain->Init();
00032 chain->ls(3);
00033
00034 int eventCounter=0;
00035 int stat=0;
00036
00037
00038 while ( stat==0 ) {
00039 if(eventCounter>=nEve) break;
00040 chain->Clear();
00041 stat = chain->Make();
00042
00043
00044 StMuEvent* muEve = muMk->muDst()->event();
00045 int nPrim = muMk->muDst()->primaryTracks()->GetEntries();
00046 StEventInfo &info=muEve->eventInfo();
00047
00048
00049 printf("\n\n ====================%d processing eventID %d nPrim=%d ==============\n", eventCounter++,info.id(),nPrim);
00050
00051 StMuEmcCollection* emc = muMk->muDst()->muEmcCollection();
00052 if (!emc) {
00053 printf(" No EMC data for this event\n");
00054 return kStOK;
00055 }
00056
00057
00058
00059
00060 }
00061
00062 }
00063
00064
00065
00066 printEEtower( StMuEmcCollection* emc ) {
00067 int sec,eta,sub,adc;
00068 StMuEmcHit *hit;
00069
00070 int i, nh;
00071
00072 printf("\Total %d hits in Tower (only ADC>0)\n",emc->getNEndcapTowerADC());
00073 nh=0;
00074 for (i=0; i< emc->getNEndcapTowerADC(); i++) {
00075 emc->getEndcapTowerADC(i,adc,sec,sub,eta);
00076 if (adc<=0) continue;
00077 nh++;
00078 printf("i=%d Tower %2.2dT%c%2.2d adc=%4d\n",i,sec,sub+'A'-1,eta,adc );
00079
00080 int adcX=1000+ (eta-1) + (sub-1)*12 +(sec-1)*60;
00081
00082 }
00083 printf(" Total %d towers with ADC>0\n",nh);
00084 }
00085
00086
00087
00088
00089 printEEpre( StMuEmcCollection* emc ) {
00090 int sec,eta,sub,pre,adc;
00091 StMuEmcHit *hit;
00092
00093 int i, nh;
00094 nh= emc->getNEndcapPrsHits();
00095 printf("\nTotal %d hits in pre1+2+post\n",nh);
00096 for (i=0; i<nh; i++) {
00097 hit=emc->getEndcapPrsHit(i,sec,sub,eta,pre);
00098 int ss=sub + 5*(pre-1);
00099 adc=hit->getAdc();
00100 printf("i=%d pre/post(%d) %2.2d%c%c%2.2d : energy=%f adc=%d\n",i,pre,sec,pre+'P'-1,sub+'A'-1,eta,hit->getEnergy(),adc);
00101 int adcX= (eta-1) + (sub-1) *12 +(sec-1)*60 + 1000*pre;
00102
00103
00104
00105 }
00106 }
00107
00108
00109
00110
00111 printEEsmd( StMuEmcCollection* emc ) {
00112 int sec,strip,adc;
00113 char uv='U';
00114
00115 for(uv='U'; uv<='V'; uv++) {
00116 int nh= emc->getNEndcapSmdHits(uv);
00117 printf("\nTotal %d hits in SMD-%c\n",nh,uv);
00118 for (int i=0; i<nh; i++) {
00119 hit=emc->getEndcapSmdHit(uv,i,sec,strip);
00120 adc=hit->getAdc();
00121 printf(" SMD-%c %2.2d%c%3.3d : energy=%f adc=%d\n",uv,sec,uv,strip,hit->getEnergy(),adc);
00122 int adcX= 1000 + strip-1 +(sec-1)*300;
00123
00124 }
00125 }
00126 }