production of binary events for L2 algos

 Here is prescription how to convert any muDst to the binary event format, needed to run L2-algos stand alone (by multiTest.C)

Let me start with a warning - this procedure requires execution of some additional code not relevant for this task ( being production of binary event files), but I wanted to reuse existing offline trigger simu code and there was no consensus how to rearrange it.

The goal is to produce events consisting of 2 data blocks : BTOW & ETOW - equivalent to raw data saved in the daq file.

  1. Prescription to produce R9067013.eve.bin from muDst from  run9067013 :
    mkdir aaa
    cd aaa
    mkdir out2
    stardev
    cp $STAR/StRoot/StTriggerUtilities/macros/rdMu2binL2eve.C .
    cp /star/institutions/mit/balewski/2008-L2events/R9067013.lis .
    root4star -b -q rdMu2binL2eve.C >& L1 &  
    
    You need no private code, just the .C macro, setup to read the run-list, muDst must still exist on the disk (fix it if needed).
  2. Inspect the .C macro to find out how to change # of processed events, # muDst to read in. If you use muDst from M-C you need to activate useMC-switch in the macro and decide on the time stamp - this is on of this irrelevant things I have warned you. Current default is reasonable. 
  3. Output: the binary event file (R9067013.eve.bin) will show up in the 'aaa/' directory. The content of binary events is different for real data vs. M-C. This can be fixed later (by Ross?), but for now you must take it in to account while reading such events by multiTest.C
    • binary events for real data contain raw BTOW & ETOW data blocks. This is certainly true for the Endcap, I'm less sure for the barrel, since I'm forced to use  StEmcADCtoEMaker and I do not if it removes ADC for masked towers. You need to figure it out. The main point is for real data you will see 4800+720 non-zero ADCs before pedestal subtraction. This is exactly what L2-algo receive on-line.
      Note, your L2-algo will receive data after ped subtraction.
    • binary events for M-C contain only fired towers, peds are not added, nor smeared. Therefore, you must use different L2-pedestal files while reading such events, with ped set to 0 - otherwise the common L2-calib algo will subtract peds anyhow.

      This could be changed if one activates properly slow simu for BTOW & ETOW - talk to Ross. The advantage would be identical L2-peds & status tables could be used for M-C events and for real data. The disadvantage of using slow simu is now you must set DB time stamp during production of binary events  and have L2-peds for exactly the same time stamp - or you will end up residual energies seen by L2-algos.

       

  4.  QA output: look at the file: aaa/out2/run9067013.l2ped.out it will show pedestal residua using online L2 peds as R9067013. This is one of those confusing steps. While producing binary events  the rdMu2binL2eve.C runs also L2-ped algo (I can't turn it off due to code dependencies), but L2-ped does NOT affect content of the output binary event file. But you can use L2-ped output to monitor if reasonable ADC have been found in muDst.
    This is an ASCII file, on the top there are 720 Endcap pedestals residua:
    #L2-ped algorithm finishRun(9067013), compiled: Jan 30 2008 , 23:25:07
    #params: pedSubtr=1 speedFact=8 saveBin=0 debug=0 prescAccept=0
    #L2H10,6,total event counter; x=cases,100,13,13,0,0,0,
    #L2ped  CPU/eve MPV 27 kTicks,  FWHM=2, seen eve=100
    # L2ped-Adc spectra, run=9067013, Z-scale is ln(yield), only first digit shown;  maxPedDev=5  table format:
    # name, ped, sigPed, crate, chan, softID-m-s-e, RDO_ID;
    #                                   ADC spectrum: [-20 ...  <=-10 ... *=0  ...  >=+10 ... :=+20 ... 100],  Xaxis=ADC - ped + 20
     01TA01   0  1.3 0x01 0x38         P01TA01  336 :.........<.........2211......>.........:.........:.........:.........:.........:.........:.........:.........:......... qa=0
     01TA02   1  0.9 0x01 0x39         P01TA02  342 :.........<........1121..1....>.........:.........:.........:.........:.........:.........:.........:.........:......... qa=0
     01TA03   2  0.9 0x01 0x3a         P01TA03  348 :.........<.........2121.1....>.........:.........:.........:.........:.........:.........:.........:.........:......... qa=0
     01TA04   0  0.9 0x01 0x6d         P01TA04  654 :.........<.......112121......>.........:.........:.........:.........:.........:.........:.........:.........:......... qa=0
     01TA05   0  0.9 0x01 0x6c         P01TA05  648 :.........<........1211.......>......1..:.........:.........:.........:.........:.........:.........:.........:......... qa=0
     01TA06   0  1.3 0x01 0x6e         P01TA06  660 :.........<........122........>.........:.........:.........:.........:.........:.........:.........:.........:......... qa=0
     01TA07   0  0.9 0x01 0x6f         P01TA07  666 :.........<........1311...1...>.........:.........:.........:.........:.........:.........:.........:.........:......... qa=0
     01TA08  -1  1.3 0x01 0x3b         P01TA08  354 :.........<........221........>.........:.........:.........:.........:.........:.........:.........:.........:......... qa=0
     01TA09   0  1.3 0x01 0x3c         P01TA09  360 :.........<........1221.......>.........:.........:.........:.........:.........:.........:.........:.........:......... qa=0
     01TA10   0  0.9 0x01 0x3d         P01TA10  366 :.........<........222........>.........:.........:.........:.........:.........:.........:.........:.........:......... qa=0
     01TA11   1  0.9 0x01 0x3e         P01TA11  372 :.........<.........231.......>.........:.........:.........:.........:.........:.........:.........:.........:......... qa=0
     01TA12   0  0.9 0x01 0x3f         P01TA12  378 :.........<........1311.......>.........:...1.....:.........:.........:.........:.........:.........:.........:......... qa=0
     01TB01   0  1.7 0x01 0x40         P01TB01  384 :.........<.......1121111.....>.........:.........:.........:.........:.........:.........:.........:.........:......... qa=0
     01TB02   0  0.9 0x01 0x41         P01TB02  390 :.........<.......1121111.....>.........:.........:.........:.........:.........:.........:.........:.........:......... qa=0
     01TB03   0  1.7 0x01 0x42         P01TB03  396 :.........<........222........>.........:.........:.........:.........:.........:.........:.........:.........:......... qa=0
     01TB04  -1  0.9 0x01 0x70         P01TB04  672 :.........<.......1221........>.........:.........:.........:.........:.........:.........:.........:.........:......... qa=0
     01TB05   0  0.9 0x01 0x71         P01TB05  678 :.........<.......112.1....1..>.........:.........:.........:.........:.........:.........:.........:.........:......... qa=0
    
    
    Once you scroll about 1000 lines, you will see 4800 barrel pedestal residua:
     01tg22   0  1.3 0x1d 0x19 id0122-004-1-02  754 :.........<.........221.......>.........:.........:.........:.........:.........:.........:.........:.........:......... qa=0
     01tg23   0  1.7 0x1d 0x1a id0123-004-1-03  784 :.........<........1222.......>.........:.........:.........:.........:.........:.........:.........:.........:......... qa=0
     01tg24   1  0.9 0x1d 0x1b id0124-004-1-04  814 :.........<........2121.......>.........:.........:.........:.........:.........:.........:.........:.........:......... qa=0
     01tg25   2  0.9 0x1d 0x38 id0125-004-1-05 1684 :.........<.......121121......>.........:.........:.........:.........:.........:.........:.........:.........:......... qa=0
     01tg26   0  1.3 0x1d 0x39 id0126-004-1-06 1714 :.........<........1221.......>.........:.........:.........:.........:.........:.........:.........:.........:......... qa=0
     01tg27   1  0.9 0x1d 0x3a id0127-004-1-07 1744 :.........<........1231.......>.........:.........:.........:.........:.........:.........:.........:.........:......... qa=0
     01tg28   0  1.3 0x1d 0x3b id0128-004-1-08 1774 :.........<......1..221.......>.........:.........:.........:.........:.........:.........:.........:.........:......... qa=0
     01tg29   1  1.3 0x1d 0x58 id0129-004-1-09 2644 :.........<.......1122.1......>.........:.........:.........:.........:.........:.........:.........:.........:......... qa=0
     01tg30   1  1.3 0x1d 0x59 id0130-004-1-10 2674 :.........<.......11221.......>.........:.........:.........:.........:.........:.........:.........:.........:......... qa=0
     01tg31  -1  0.9 0x1d 0x5a id0131-004-1-11 2704 :.........<........21111......>.........:.........:.........:.........:.........:.........:.........:.........:......... qa=0
     01tg32  -1  1.7 0x1d 0x5b id0132-004-1-12 2734 :.........<.......2221..1.....>.........:.........:.........:.........:.........:.........:.........:.........:......... qa=0
     01tg33   1  1.3 0x1d 0x78 id0133-004-1-13 3604 :.........<........1221.......>.........:.........:.........:.........:.........:.........:.........:.........:......... qa=0
     01tg34  -1  1.3 0x1d 0x79 id0134-004-1-14 3634 :.........<.......122.........>.........:.........:.........:.........:.........:.........:.........:.........:......... qa=0
     01tg35  -1  1.7 0x1d 0x7a id0135-004-1-15 3664 :.........<........222........>.........:..1......:.........:.........:.........:.........:.........:.........:......... qa=0
     01tg36   0  1.3 0x1d 0x7b id0136-004-1-16 3694 :.........<........2211.......>.........:.........:.........:.........:.........:.........:.........:.........:......... qa=0
     01tg37   1  1.3 0x1d 0x98 id0137-004-1-17 4564 :.........<........1221.......>.........:.........:.........:.........:.........:.........:.........:.........:......... qa=0
     01tg38   0  0.9 0x1d 0x99 id0138-004-1-18 4594 :.........<........1221.......>.........:.........:.........:.........:.........:.........:.........:.........:......... qa=0
     01tg39 -20 -0.4 0x1d 0x9a id0139-004-1-19 4624 :.........<.........*.........>.........:.........:.........:.........:.........:.........:.........:.........:......... qa=?
     01tg40   0  1.3 0x1d 0x9b id0140-004-1-20 4654 :.........<.......1221........>.........:.........:.........:.........:.........:.........:.........:.........:......... qa=0
     01th01   0  1.3 0x0e 0x8b id4460-112-1-20 4187 :.........<........122.1......>.........:.........:.........:.........:.........:.........:.........:.........:......... qa=0
     01th02 -20 -0.4 0x0e 0x8a id4459-112-1-19 4157 3.........<.........*.........>.........:.........:.........:.........:.........:.........:.........:.........:......... qa=?
     01th03  -2  2.2 0x0e 0x89 id4458-112-1-18 4127 :.........<......12221........>.........:.........:.........:.........:.........:.........:.........:.........:......... qa=0
     01th04  -1  1.3 0x0e 0x88 id4457-112-1-17 4097 :.........<......112211.......>.........:.........:.........:.........:.........:.........:.........:.........:......... qa=0
     01th05   0  2.2 0x0e 0x6b id4456-112-1-16 3227 :.........<.......112211......>.........:.........:.........:.........:.........:.........:.........:.........:......... qa=0
    
    The above files are for real data, when peds seen by L2-ped algo match the real pedestals.

    If you display the same file for M-C events, you will see just high-energy ends of ADC spectra, because at this moment binary events for M-C do not include pedestals.

    #                                   ADC spectrum: [-20 ...  <=-10 ... *=0  ...  >=+10 ... :=+20 ... 100],  Xaxis=ADC - ped + 20
     01TA01 -17  0.9 0x01 0x38         P01TA01  336 :..3......<.........*.........>.........:.........:.........:.........:.........:.........:.........:.........:......... qa=0
     01TA02 -12  0.9 0x01 0x39         P01TA02  342 :.......3.1.........*.........>.........:.........:.........:.........:.........:.........:.........:.........:......... qa=0
     01TA03 -20 -0.4 0x01 0x3a         P01TA03  348 :.........<.........*.........>.........:.........:.........:.........:.........:.........:.........:.........:......... qa=?
     01TA04 -20 -0.4 0x01 0x6d         P01TA04  654 :.........<.........*.........>.........:.........:.........:.........:.........:.........:.........:.........:......... qa=?
     01TA05 -20 -0.4 0x01 0x6c         P01TA05  648 31........<........1*.........>.........:.........:.........:.........:.........:.........:.........:.........:......... qa=?
     01TA06 -20 -0.4 0x01 0x6e         P01TA06  660 31........<.........*.........>.........:.........:.........:.........:.........:.........:.........:.........:......... qa=?
     01TA07 -20 -0.4 0x01 0x6f         P01TA07  666 :.........<.........*.........>.........:.........:.........:.........:.........:.........:.........:.........:......... qa=?
     01TA08 -20 -0.4 0x01 0x3b         P01TA08  354 3.........<.........*.........>.........:.........:.........:.........:.........:.........:.........:.........:......... qa=?
     01TA09 -12  0.9 0x01 0x3c         P01TA09  360 :.......3.<.........*.........>.........:.........:.........:.........:.........:.........:.........:.........:......... qa=0
     01TA10 -20 -0.4 0x01 0x3d         P01TA10  366 31........<.........*.........>.........:.........:.........:.........:.........:.........:.........:.........:......... qa=?
     01TA11  -4  0.9 0x01 0x3e         P01TA11  372 :.........<.....1...*.........>.........:.........:.........:.........:.........:.........:.........:.........:......... qa=0
     01TA12 -17  0.9 0x01 0x3f         P01TA12  378 :..3......<.........*.........>.........:.........:.........:.........:.........:.........:.........:.........:......... qa=0
     01TB01 -20 -0.4 0x01 0x40         P01TB01  384 :.........<.........*.........>.........:.........:.........:.........:.........:.........:.........:.........:......... qa=?
     01TB02 -15  0.9 0x01 0x41         P01TB02  390 :....1....<.........*.........>.........:.........:.........:.........:.........:.........:.........:.........:......... qa=0
     01TB03 -20 -0.4 0x01 0x42         P01TB03  396 :.........<.........*.........>.........:.........:.........:.........:.........:.........:.........:.........:......... qa=?
     01TB04 -16  0.9 0x01 0x70         P01TB04  672 :...3.....<1........*.........>.........:.........:.........:.........:.........:.........:.........:.........:......... qa=0
     01TB05 -20 -0.4 0x01 0x71         P01TB05  678 :.........<.........*.........>.........:.........:.........:.........:.........:.........:.........:.........:......... qa=?
     01TB06 -20 -0.4 0x01 0x72         P01TB06  684 :.........<.........*.........>.........:.........:.........:.........:.........:.........:.........:.........:......... qa=?