2009 pp run

  •  pre-run 2009 L2 code release , January 15, 2009, by Ross 
  • L2 mapping used in 2009 data taking, 56 BTOW towers were swapped (attachment 1)

 

0) lastDSM masks

In order to accommodate the larger number of desired triggers in the old TCU, the following algorithms can now read in masks to be checked against the 128 lastDSM input bits before decision() is called:

L2btowGamma

L2etowGamma

L2jet

L2jetHigh

L2upsilon

L2btowW

 

The masks are located in ~developer/emc_setup on the l2 machine, and must be named %s.lastDSM_mask , where %s is the name of the algorithm (subtract the 'L2' from the list above).  These files contain 8 integersthat correspond to the 8 unsigned shorts in lastDSM[] in the trigger data.

If TCU_type!=2 we are assumed to be using the old TCU, and at the start of each run the code that initializes each l2 algorithm will attempt to read these files.  If they can't be found, then the mask is assumed to be not used for that particular algorithm.

Each time decision() is about to be called for one of the above algorithms, we first pass in the lastDSM array to be checked against these 8 unsigned shorts.  Each ushort in the array is byte-swapped so that the endian-ness of the two sets agrees.  Note that lastDSM[0] does not seem to correspond to input channel 0 in Eleanor's LD301 documentation.

At latest look (Feb 27), the values in the array seem to be swapped in the same fashion as they are in the barrel code that looks at layer 2 of the DSM:

lastDSM[0] corresponds to input channel 3

lastDSM[1] corresponds to input channel 2

lastDSM[2] corresponds to input channel 1

lastDSM[3] corresponds to input channel 0

lastDSM[4] corresponds to input channel 7

lastDSM[5] corresponds to input channel 6

lastDSM[6] corresponds to input channel 5

lastDSM[7] corresponds to input channel 4

 

 

01 changes to L2 algos from last year

 * verify every aborting algo is using random accept prescale based on prescale method and is randomly initialize upon start. I know L2-jet & L2-http-barrel are using rnd(), I suspect L2-http-endcap is not randomly initialized.  Check them all. 

* L2-jet needs change of jet size to 1x1.

* experiment with L2-Wbos algo in the barrel, needs TOF unpacking

* consider converting L2-http in to L2-eta , for EMC calibration purposes, Jason may have working prototype, but slow version due to memset

Jan

 

1) L2Result Offsets

Every algorithm has the opportunity to write out a small report into the L2Result array after each decision().  The sizes of these results are fixed within a year so that they don't overwrite others unexpectedly.  They should not be changed without talking to the L2 algorithm maintainer.  The starting position for each is defined in terms of the offset from the start of the L2Array.  The values during the run were as follows:

Algorith Offset
(EMC_CHECK) 1
EMC_PED 2
Barrel Gamma 3
Endcap Gamma 6
Dijet 9
Upsilon 17
Barrel W 20
Dijet (Higher Et) 25
Endcap Hien 0
Barrel Calib 0
Endcap Calib 0
Barrel Hien 0 (C2Result)

 

a) L2emulL0_2009 (L0 hardware emulation)

This algorithm is intended to provide access to the 16 lastDSM output bits, and should only be needed when the old TCU is being used.

This algorithm reads in 5 ints from run control:

[0] onbits0

[1] offbits0

[2] onbits1

[3] offbits1

[4] number of  onbits+offbits pairs

The logic used is as follows:

  if((lastDSM & p->onbits[0]) != p->onbits[0]) return 0;
  if((~lastDSM & p->offbits[0]) != p->offbits[0]) return 0;
 

repeated for [1] if the number of pairs is > 1.  A byte swap occurs before this logic is reached, so that both ushorts should have the same endian-ness.  If none of the 'if's fire, the algorithm returns 1.

b) L2btowGammaAlgo (barrel gamma algorithm)

This algorithm searches for localized energy distributions in the barrel calorimeter, and will not run if the BTOW is not in the run.

This algorithm reads in 2 ints and 2 floats from run control:

[i0] debug

[i1] Random Accept Prescale

[f0] Et threshold for seed

[f1] Et threshold for cluster

 

The logic used is as follows:

Every tower with Et>f0 is added to a list.  The list is then checked in order, summing the cluster around it and returning Accept if sumEt>f1

The Random Accept Prescale value sets the prescale for random accept, described elsewhere.

If debug>0 debug messages are printed.

c) L2etowGammaAlgo (endcap gamma algorithm)

This algorithm searches for localized energy distributions in the endcap calorimeter, and will not run if the ETOW is not in the run.

This algorithm reads in 2 ints and 3 floats from run control:

[i0] debug

[i1] Random Accept Prescale

[f0] Et threshold for seed

[f1] Et threshold for cluster

[f2] Et threshold for event

 

The logic used is similar to L2btowGamma, but etowGamma saves more information about each event.  All possible clusters per event are made (save for those that overlap other clusters) and added to a list if clusterEt>f1.  If at least one cluster has clusterEt>f2, the event is accepted.

The Random Accept Prescale value sets the prescale for random accept, described elsewhere.

If debug>0 debug messages are printed.

 


The mapping is defined thusly

>> tow = EtowGeom::mxEtaBin *phi + eta;

tow = 0    ==>    01TA01
tow = 1    ==>    01TA02
..
tow   718  ==>    12TE11
tow = 719  ==>    12TE12

12 consecutive towers are in the same slice in phi.

d) L2hienAlgo (passive barrel and endcap high tower filter)

This algorithm packages tower ADC values and soft IDs for use outside of L2.  It always accepts, and in the current configuration is cannot be attached to a particular trigger, but rather runs for each event.

This algorithm reads in 3 ints, which are hard-coded in algo_handler.c:

[i0] debug=0

[i1] ADC threshold=60

[i2] max L2hienList size=120

 

The logic used is as follows:

A switch is set in the constructor so that one instance of the L2hienAlgo reads barrel towers and the other endcap towers.

For each calibrated tower, if ADC>i1 it is added to L2hienList (up to i2 towers total).  The barrel version then adds the first (up to) 40 towers (whether above i1 or not) to the L2hienResult, which is written to C2Result in l2new.

If debug>0 debug messages are printed.

e) L2jetAlgo (barrel and endcap combined jet algorithm)

This algorithm searches for jet-like energy distributions in the barrel and endcap calorimeters, and will run even if one or the other is not in the run.

This algorithm reads in 1 int from run control:

[i0] setup version, which controls which of ~developer/emc_setup/algoJet2009.setup* is used to set the parameters for the algorithm

This algorithm reads in 5 ints and 9 floats from the selected file:

[i0] What parts of the BEMC to use (1=East, 2=West, 3=both)

[i1] Whether to use the EEMC (>0 = yes)

[i2] par_adcThr (unused?)

[i3] debug

[i4] Random Accept Prescale

[f0] Et threshold for single jet

[f1] par_diJetThrHigh

[f2] par_diJetThrLow

[f3] par_diJetThr_2

[f4] par_diJetThr_3

[f5] par_diJetThr_4

[f6] par_diJetThr_5

[f7] par_diJetEtaHigh

[f8] par_diJetEtaLow

 

The logic is fairly complex.  Brian Page is the maintainer of the jet code, so questions should be directed to him.

The Random Accept Prescale value sets the prescale for random accept, described elsewhere.

If debug>0 debug messages are printed.

f) L2pedAlgo (barrel and endcap pedestal monitor)

This algorithm records the ADC values from the ETOW and BTOW for pedestal studies.

This algorithm reads in 5 ints from run control:

[i0] ped subtraction flag

[i1] speed factor

[i2] 'save binary' flag

[i3] debug

[i4] prescale for accept

 

The logic used is as follows:

Each event, ADCs from 1/i1 (where i1 is rounded off to be 1,2,4,8,16,32,64, or 192) of the barrel and endcap are histogrammed by rdo.  The selected regions roll, so that [0,1/i1] is histogrammed the first event, [1/i1,2/i1] the next, etc.

If i0>0, instead of histogramming the raw ADC, the pedestal is subtracted first, allowing the residual to be seen.

if i2>0 the entire histogram is saved at the end of the run rather than just keeping [-10,100] ADC.

If the prescale for accept is set greater than zero, then the algorithm no longer fills histograms, and simply does the following for every event:

    if((rand()>>4) % par_prescAccept ) return false;

    return true;

This is NOT the same as the procedure for the Random Accept Prescale.
 

If debug>0 debug messages are printed.

g) L2upsilonAlgo (barrel upsilon algorithm)

This algorithm searches for upsilons in the barrel, and will not run if BTOW is not in the run.

This algorithm reads in 1 int from run control:

[i0] setup version, which controls which of ~developer/emc_setup/algoUpsilon2009.setup* is used to set the parameters for the algorithm

This algorithm reads in 4 ints and 9 floats from the selected file:

[i0] prescale

[i1] Whether to mask hot towers dynamically

[i2] how many events to take between updates to the dynamic mask

[i3] Random Accept Prescale

[f0] fL0SeedThreshold

[f1] fL2SeedThreshold

[f2] fMinL0ClusterEnergy

[f3] fMinL2ClusterEnergy

[f4] fMinInvMass

[f5] fMaxInvMass

[f6] fMaxCosTheta

[f7] fHotTowerTheshold

[f8] fThresholdRatioOfHotTower

 

The logic is fairly complex.  Haidong Liu is the maintainer of the upsilon code, so questions should be directed to him.

The Random Accept Prescale value sets the prescale for random accept, described elsewhere.

h) W-algo BTOW

L2 W-algo for BTOW, p+p 500 GeV , 2009 run

 

This algorithm searches for energy depositions in the barrel, and will not run if BTOW is not in the run.

This algorithm reads in 2 ints and 2 floats from run control:

[i0] debug

[i1] Random Accept Prescale

[f0] Et threshold for seed

[f1] Et threshold for cluster

The logic is as follows:

For each tower with Et>f0, each 2x2 tower patch around it is summed.  As soon as one of these 2x2 patches has Et>f1, we accept the event.

The Random Accept Prescale value sets the prescale for random accept, described elsewhere.

if debug>0, various debug information will be printed.

 

Run time params
2 int    dbg, randomAcceptPrescale 
2 float  seedEtThres, clusterEtThres  (GeV)

This algo works only with BTOW ADCs

======== L2 W ALGO =======

1. Get list of towers w/ energy provided by the common L2 calib algo
2. Form smaller list of seed towers above seedTH
3. Loop over seed towers
   a. Find the highest cluster ET out of 4 groups of 2x2 towers containing the seed tower
   b. if Et > clusterET accept event, set trgBit=2, do not try any other cluster

4. try random accept 
   - set event counter at random start
   - increment by 1 for every input event
   - issue random accept if (eventCounter %  randomAcceptPrescale == 0)
   - if accepted set trgBit=1
5. Accept event if trgBit is 1 or 2 6. Store information in the L2wResult[.] array - seed eta-bin - seed phi-bin - seed ET - cluster ET - trgBits

 Access to L2W results in muDst, also to oflTrigIds

  StMuEvent* muEve = mMuDstMaker->muDst()->event();

  TArrayI& l2Array = muEve->L2Result();
  unsigned int *l2res=(unsigned int *)l2Array.GetArray();
  printf(" L2-jet online results below:\n");
  int k;  for (k=0;k<32;k++) printf("k=%2d  val=0x%04x\n",k,l2res[k]);
  const int BEMCW_off=20; // valid only for 2009 run
  L2wResult2009 *out1= ( L2wResult2009 *) &l2res[BEMCW_off];   
  L2wResult2009_print(out1);

  StMuTriggerIdCollection *tic=&(muEve->triggerIdCollection());
  assert(tic);
  const StTriggerId &l1=tic->l1();
  vector idL=l1.triggerIds();   printf("nTrig=%d, trigID: ",idL.size());   for(unsigned int i=0;i

Simulation of L2-W-Algo for Filtered QCD & W events , LT=~10 /pb.

Used thresholds: seedET>9 GeV, clusterET>14 GeV


Fig 1. LT=10/pb. Left: W events, right: QCD events

 

Fig 2. Uniformity of L2-W trigger for accepted QCD events, LT=10/pb.
It is lower only at the physical edges of barrel at eta=+/-1 due to energy leak and smaller tower size.


Below you will find full set of L2 monitoring plots for both sets of events


 

xxxxxxx old xxxxxx

SPARE PAGE