00001 #ifndef JAN_BARREL_EVENT_HH
00002 #define JAN_BARREL_EVENT_HH
00003
00004
00005
00006
00007
00008
00009 class JanBarrelEvent {
00010 public:
00011 JanBarrelEvent() { clear();}
00012 void clear() {
00013 printf("JanBarrelEve:clear()\n");
00014 id=0;
00015 memset(bprsCap,-1,sizeof(bprsCap));
00016 memset(rawAdcTile,0,sizeof(rawAdcTile));
00017 memset(adcTile,0,sizeof(adcTile));
00018 memset(statTile,-1,sizeof(statTile));
00019 memset(tileIn,0,sizeof(tileIn));
00020 }
00021
00022
00023
00024
00025 int id;
00026 int tileIn[mxBTile];
00027 int bprsCap[mxBprsCrate];
00028 float rawAdcTile[mxBTile][mxBtow];
00029 float adcTile[mxBTile][mxBtow];
00030 int statTile[mxBTile][mxBtow];
00031
00032 void print( int flag=0) {
00033 printf("\njanBarelEve ID=%d printFlag=0x%0x",id,flag);
00034 printf(" BPRSin=%d caps:%d:%d:%d:%d:",tileIn[kBPrs], bprsCap[0],bprsCap[1],bprsCap[2],bprsCap[3]);
00035 printf("\n");
00036 if(flag&1) {
00037 for(int i=0;i<120;i++) {
00038 int id=7+i*40;
00039 if(i%10==0) printf("\n softID=%4d adc format BTOW:BPRS= ",id);
00040 printf("%.1f : %.1f, ", rawAdcTile[kBTow][id-1], rawAdcTile[kBPrs][id-1]);
00041 }
00042 printf("\n");
00043 }
00044
00045 if(flag&2) {
00046 for(int i=0;i<120;i++) {
00047 int id=7+i*40;
00048 if(i%5==0) printf("\n BPRS id=%4d {adcRaw,adc,stat}*N=",id);
00049 printf("%.1f, %.1f, %d; ", rawAdcTile[kBPrs][id-1],adcTile[kBPrs][id-1],statTile[kBPrs][id-1]);
00050 }
00051 printf("\n");
00052 }
00053
00054 }
00055
00056
00057 };
00058
00059 #endif
00060
00061
00062
00063 #if 0
00064 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
00065
00066 class BsmdCluster1D {
00067 public:
00068 BsmdCluster1D(char x='?') {clear();plane=x;}
00069 void clear() {memset(this,0,sizeof(BsmdCluster1D )); plane='?';xCell=yCell=-1;}
00070 enum {mxTw=2};
00071 char plane;
00072 int strip0;
00073 float mean0;
00074 int meanId;
00075 float ene;
00076 float rms;
00077 int inTowerId[mxTw];
00078 float towerDist;
00079 int xCell,yCell;
00080 void print(){
00081 if(ene<=0) { printf("bsmd%c Cl empty\n",plane); return;}
00082 printf("bsmd%c CL str0=%d mean0=%.1f meanId=%d rms=%.2f ene/keV=%.2f inTw %d.or.%d dist=%.1f cell(%d,%d)\n",plane,strip0,mean0,meanId,rms,ene*1e6,inTowerId[0],inTowerId[1],towerDist, xCell,yCell);
00083 }
00084 };
00085 #endif