7 #include <TClonesArray.h>
13 #include "StMuDSTMaker/EZTREE/EztEmcRawData.h"
15 #include "StEEmcUtil/EEfeeRaw/EEname2Index.h"
16 #include "StEEmcUtil/EEfeeRaw/EEdims.h"
18 #include "StEEmcUtil/database/EEmcDbItem.h"
19 #include "StEEmcUtil/database/StEEmcDb.h"
21 #include "RawPixels.h"
25 RawPixels::RawPixels(TObjArray*L,
StEEmcDb*dbx) {
28 HList=L; assert(HList);
29 hPix=
new TH1F * [EEindexMax];
30 memset(hPix,0,
sizeof(
void*)*EEindexMax);
32 hSmd=
new TH2F * [MaxSmdPlains*MaxSectors];
33 memset(hSmd,0,
sizeof(
void*)*MaxSmdPlains*MaxSectors);
42 void RawPixels::initHisto() {
50 case kRawAdc: mode=
"rawAdc";
break;
51 case kPedSub: mode=
"pedSub";
break;
52 case kPedAndGain: mode=
"pedAndGain";
break;
58 for(i=0;i<EEindexMax;i++) {
63 char tt1[100],tt2[200];
64 sprintf(tt1,
"a%s",x->
name);
65 sprintf(tt2,
"ADC for %s, cr/chan=%3.3d/%3.3d, tube=%s; ADC (mode=%s)",x->
name,
66 x->crate,x->
chan,x->
tube,mode.Data());
67 TH1F* h=
new TH1F(tt1,tt2,c_x2-c_x1+1,c_x1-0.5,c_x2+0.5);
74 int sec1=eeDb->getFirstSecID();
75 int sec2=eeDb->getLastSecID();
77 for(secID=sec1; secID<=sec2; secID++) {
79 for(iuv=0;iuv<MaxSmdPlains;iuv++) {
80 char tt1[100], tt2[100];
81 sprintf(tt1,
"a%2.2d%c",secID,iuv+
'U');
82 sprintf(tt2,
"%2.2d%c-SMD strip vs. raw ADC",secID,iuv+
'U');
83 TH2F* h2=
new TH2F(tt1,tt2,200,0,4000,MaxSmdStrips,0.5,MaxSmdStrips+0.5);
84 int key1=secID-1+iuv*MaxSectors;
94 sprintf(tt2,
" stat info ");
96 hInfo=
new TH1F(
"info",tt2,20,-0.5,19.5);
100 printf(
"RawPixels: Initialized histos for %d pixels\n",k);
113 for(icr=0;icr<eRaw->getNBlocks();icr++) {
114 if(eRaw->isCrateVoid(icr))
continue;
115 const UShort_t*
data=eRaw->data(icr);
116 int crateID=eRaw->getCrateID(icr);
117 hInfo->Fill(crateID);
118 int nd=eRaw->sizeData(icr);
122 for(chan=0;chan<nd;chan++) {
123 const EEmcDbItem *x=eeDb->getByCrate(crateID,chan);
127 float value=data[chan];
131 value-=x->ped;
break;
141 hPix[x->key]->Fill(value);
145 int key=(x->plane-
'U')*MaxSectors + x->sec-1;
149 if(key<=0 || key>=MaxSmdPlains*MaxSectors) {
150 printf(
"cr=%2d ch=%3d val=%.1f ped=%4.1f '%s' \n",crateID,chan,value,x->ped,x->
name);
152 printf(
"key=%d\n",key);
156 assert(key>=0 && key<MaxSmdPlains*MaxSectors);
158 hSmd[key]->Fill(value,x->strip);
const EEmcDbItem * getByIndex(int ikey) const
returns full DB info for one pixel
char name[StEEmcNameLen]
ASCII name of the channel, see Readme.
char tube[StEEmcNameLen]
name of PMT or MAPMT pixel