Details of L2-algos (triggers) as implemented for pp run in February of 2008
Mapping used during data taking is in attachment 1)
Graph illustrates the key changes in L2 processing scheme allowing for fast event abortion. Jan
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
L2-high-energy-Algo ( 100% accept)
L2-high-ene-algo (does not abort)
int par_dbg; // use 0 for real event processing int par_maxList; // can't exceed hardcoded value of 150 int par_adcThres; // in ADC counts above peds
int hiSize=getListSize(token); const unsigned int *value=getListData(token); printf("pr2-%s: dump %d acceted towers for token=%d\n softID ADC-ped\n",getName(),hiSize, token); for(int ic=0;ic < hiSize;ic++,value++) { int adc=(*value) > > 16; int softID=(*value)&0xffff; printf("%4d %d, \n",softID,adc); }
-------- event loop------- for(i=0;i< hitSize;i++,hit++) { if(hit->adc< par_adcThres) continue; if(hiTwEve-> size>=par_maxList) break; // overflow protection int softID=mRdo2towerID[hit->rdo]; (*value)= ((hit-> adc) <<16 )+ softID; // store composite value hiTwEve-> size++; value++; // increment index }
Descripion: this algo selects high-energy towers from BTOW & ETOW data and take advantage of common calibration to be deployed at L2 in February of 2008. The common (for B & E) ADC threshold is defined in units of adc above ped i.e. in ET. The output of this algo _one_ lists of pairs {adc,softID}. You need 2 instances of this ago to cover E & B-EMC. Saving of those lists to disk is beyond the scope of this algo. SoftID is defined as follows: *BTOW : traditional softID [1-4800] used since 20th centry. *ETOW: range [0..719], eta index changes slower int ieta= (x-> eta-1); int iphi= (x-> sec-1)*EtowGeom::mxSubs + x-> sub-'A' ; int softId= iphi+EtowGeom::mxPhiBin*ieta; There is a hardcoded limit on the max list length at 256 towers. In case of an overflow a random (not realy) selection of towers will be added to the list until the software limit is reached.
L2:hienBtow08 Compute CPU/eve MPV 1 kTicks, FWHM=2 L2:hienBtow08 Decision CPU/eve MPV 0 kTicks L2:hienBtow08 Deci+Comp CPU/eve MPV 2 kTicks, FWHM=3
L2-pedestal monitor-Algo ( 100% accept)
par_pedSubtr =rc_ints[0]!=0; par_speedFact =rc_ints[1]; par_saveBinary=rc_ints[2]!=0; par_dbg =rc_ints[3]; par_prescAccept=rc_ints[4];
time spent in L2-ped is proportional to # of towers processed per event. speed=1 means for every event process all 4800+720 towers, takes 1mSec speed=2 means for the first event process tower 1,2, 5,6, 9,10,...., takes 500 uSec for the second event process tower 3,4, 7,8, 11,12,...., takes 500 uSec repeat So L2ped runs 2x faster but effectively you get 1/2 of stats for all towers. speed=4 means : 1st eve works with towers: 1,2,3,4, 17,18,19,20,... takes 250 uSec 2nd eve works with towers: 5,6,7,8, 21,22,23,24,... 3rd ... 4th eve ... repeat You got the pattern. Allowed 'speeds' are common divider of 4800 & 768. Allowed speed values: 1,2,4,8,16,32,64,192 But even if you type sth absurd L2ped will correct it to the closest correct value.
RTS params
2 int dbg, prescaleAccept 4 float seedEtThres, clusterEtThres, eventEtThres,solationEtThres two sets for B & E. ======== ALGO ======= 1. Get list of towers provided by the L2 main shell 2. Sort the list in descending E_T 3. Loop over list until tower below seed threshold is found a. Find the highest group of 2x2 clusters adjacent to seed tower b. Form a cluster c. Save to list of clusters d. Mark all towers in 2x2 cluster as "used" 4. Repeat loop until all seed towers are exhausted 5. Loop over all clusters a. Find highest E_T cluster b. If ( cluster E_T > cluster threshold ) i. Accept event ii. Store information in the L2Result array - mean eta-bin - mean phi-bin - tower ID for seed tower - a relative ID specifying which of the 4 possible tower clusters was chosen - ET of cluster - number of nonzero towers in cluster - an isolation E_T sum (placeholder for later, set = 0).
Params:
// unpack params from run control GUI par_cutTag = rc_ints[0]; par_useBtowEast= (rc_ints[1]&1 )>0; par_useBtowWest= (rc_ints[1]&2)>0; par_useEndcap = rc_ints[2]&1; int par_adcThr = rc_ints[3]; // needed only in initRun() par_minPhiBinDiff=rc_ints[4]; par_oneJetThr = rc_floats[0]; par_diJetThrHigh= rc_floats[1]; par_diJetThrLow = rc_floats[2]; par_rndAccProb = rc_floats[3]; par_dbg =(int)rc_floats[4];