Common BEMC, EEMC calibration algos (do not abort)
int par_dbg; // use 0 for real event processing int par_gainType; enum {kGainZero=0, kGainIdeal=1, kGainOffline=2}; int par_nSigPed; // ADC, filters towers float par_twEneThres; // GeV, filters towers float par_hotEtThres; // GeV, only monitoring histos
------- tower threshold definition------ float adcThres=x- > ped+par_nSigPed* fabs(x- > sigPed); float otherThr=x-> ped+par_twEneThres*x-> gain; if(adcThres < otherThr) adcThres=otherThr; -------- computing ideal gains ------- for(i=0;i<BtowGeom::mxEtaBin;i++ ){ float avrEta=-0.975 +i*0.05; /* assume BTOW has fixed eta bin size */ if(i==0) avrEta=-0.970;// first & lost towers are smaller if(i==39) avrEta=0.970; btow.cosh[i]=cosh(avrEta); btow.idealGain2Ene[i]=par_maxADC/par_maxET/btow.cosh[i]; } ---------- peds,gains, masking bad towers by threshold -------- if (par_gainType!=kGainIdeal) return -102; geom->btow.gain2Ene_rdo[x->rdo]=geom->btow.idealGain2Ene[ietaTw]; geom->btow.gain2ET_rdo[x->rdo]=geom->getIdealAdc2ET(); geom->btow.thr_rdo[x->rdo]=(int) (adcThres); geom->btow.ped_rdo[x->rdo]=(int) (x->ped); geom->btow.ped_shifted_rdo[x->rdo]=(unsigned short)(par_pedOff - x->ped); -------- event loop------- for(rdo=0; rdo < BtowGeom::mxRdo; rdo++){ if(rawAdc[rdo] < thr[rdo])continue; if(nTower > =mxListSize) break; // overflow protection adc=rawAdc[rdo]-ped[rdo]; //do NOT correct for common pedestal noise et=adc/gain2ET[rdo]; hit-> rdo=rdo; hit-> adc=adc; hit-> et=et; hit-> ene=adc/gain2Ene[rdo]; hit++; nTower++; } btowCalibData.hitSize=nTower;
L2-btowCal08 Compute CPU/eve MPV 42 kTicks, FWHM=6 Reference: L2:jet06-algo CPU/eve MPV 57 kTicks, FWHM=11
#BTOW_hot tower _candidate_ (bHotSum=67 of 50000 eve) :, softID 1397 , crate 21 , chan 156 , name 07tj37 #BTOW_token_QA: _candidate_ hot token=2 used 13 for 50000 events, token range [1, 4095], used 4095 tokens