01/30/05 05:58:01 pm

Calculating pedestals and coding trees for compression of Silicon data

Make pedestal file and histogram
Make coding tree
Copy files to DAQ

1. Make pedestal file and histogram

.x $PHAT2HOME/macros/daq/pro/ezpedcalc.C("$SCR/rawdata/PhoRaw016814s000.pdaq")
It will produce two files pedfile.pdaq and signal-pedestal.root.
The typical output:

Endianness = 1
Opening /phobos/scratch/rawdata/PhoRaw016814s000.pdaq
File generated by StreamStore
fNeedByteSwap=0, fFormat=66
Creating TPhRun(16814,0,0)be 0 0 8 from the first event
TPhRun Run: 16814 (sequence 0)
 First event: 0 Last event 0 Date: 20050127 50558

Parameters:

 DAQ         RunType    0  ALLBEAM 

Pedestals have been read succesfully
Huffman tree found in 1 event
#Error in <TPhDAQFile::Process_EvHeader rec=5>: Event number jumped up from 0 to 8 @781326
FEC1[6144]
FEC2[4096]
FEC3[3072]
FEC4[3584]
FEC5[3328]
FEC6[3328]
FEC7[3072]
FEC8[3328]
FEC9[6144]
FEC10[4096]
FEC11[4096]
FEC12[3840]
FEC13[3584]
FEC14[3328]
FEC15[3072]
FEC16[3328]
FEC17[3840]
FEC18[4096]
FEC19[2048]
FEC20[3840]
FEC21[4096]
FEC22[2048]
FEC23[1024]
FEC24[1024]
FEC25[1024]
FEC26[1024]
FEC27[6144]
FEC28[3072]
FEC29[4096]
FEC36[3840]
FEC37[3584]
FEC38[3328]
FEC39[3072]
FEC40[3328]
FEC41[6144]
FEC42[4096]
FEC43[4096]
FEC44[3584]
FEC45[3328]
FEC46[3328]
FEC47[3072]
FEC48[3328]
Total FECs 48, total channels 146944, bytes=1469660
Event 10, # of big rms = 949
Warning! FEC3[1817] pedestal shifted from 566.1 to 524.6
Warning! FEC5[1385] pedestal shifted from 433.8 to 484.5
Warning! FEC6[2578] pedestal shifted from 284.3 to 230.4
Warning! FEC9[1789] pedestal shifted from 941.5 to 879.2
Warning! FEC12[3503] pedestal shifted from 403.9 to 363.6
Warning! FEC14[2401] pedestal shifted from 590 to 549
Warning! FEC14[3290] pedestal shifted from 409.6 to 344.9
Warning! FEC14[3294] pedestal shifted from 498.4 to 409.8
Warning! FEC17[1752] pedestal shifted from 750.5 to 684
Warning! FEC19[1521] pedestal shifted from 599.7 to 550.3
Event 20, # of big rms = 104
Warning! FEC17[1575] pedestal shifted from 642.5 to 551.2
Warning! FEC21[1044] pedestal shifted from 451.7 to 371.6
Warning! FEC21[1079] pedestal shifted from 261.4 to 206.5
Event 30, # of big rms = 16
Event 40, # of big rms = 4
Event 50, # of big rms = 2
#Error in <TPhRawHitFB::UnPack>: FASTBUS slot 22 size = 65 > 64, data=0xb80001c1, slot discarded
#Error in <TPhDAQFile::Process_Fastbus rec=65>: @713386. 1 Errors in building FB object
Event 60, # of big rms = 2
Event 70, # of big rms = 2
Event 80, # of big rms = 2
Event 90, # of big rms = 2
Event 100, # of big rms = 2
Event 110, # of big rms = 2
Event 120, # of big rms = 2
Event 130, # of big rms = 2
Event 140, # of big rms = 2
Event 150, # of big rms = 2
Event 160, # of big rms = 2
Event 170, # of big rms = 2
Event 180, # of big rms = 2
Event 190, # of big rms = 2
Event 200, # of big rms = 2
Event 210, # of big rms = 2
Event 220, # of big rms = 2
Event 230, # of big rms = 2
Event 240, # of big rms = 2
Event 250, # of big rms = 2
Event 260, # of big rms = 2
Event 270, # of big rms = 2
Event 280, # of big rms = 2
Event 290, # of big rms = 2
Event 300, # of big rms = 2
Event 310, # of big rms = 2
Event 320, # of big rms = 2
Event 330, # of big rms = 2
Event 340, # of big rms = 2
Event 350, # of big rms = 2
Warning! FEC5[1365] pedestal shifted from 342.9 to 292
Event 360, # of big rms = 2
Event 370, # of big rms = 2
Event 380, # of big rms = 2
Event 390, # of big rms = 2
Event 400, # of big rms = 2
Warning! FEC45[3258] pedestal shifted from 430.2 to 407.4
Event 410, # of big rms = 2
Event 420, # of big rms = 2
Event 430, # of big rms = 2
Event 440, # of big rms = 2
Event 450, # of big rms = 2
Event 460, # of big rms = 1
Event 470, # of big rms = 1
Event 480, # of big rms = 1
Event 490, # of big rms = 1
Event 500, # of big rms = 1
500 Events analyzed
Still have 1 noisy channels
Pedfile is written succesfully
hmean
FillPedHists
<TCanvas::MakeDefCanvas>: created default TCanvas with name c1
ExtractPedHist
Means and rms for FEC1[6144] extracted
1:1151.8,2.08806 2:948.8,1.93907 3:891.8,1.77764 4:977.1,2.2561 5:945,1.89737 6:1201.7,1.67631 7:1123,2.40832 8:843.3,2.72213 9:939.9,1.57797 
Accumulating signal-pedestal histogram
Endianness = 1
Opening /phobos/scratch/rawdata/PhoRaw016814s000.pdaq
File generated by StreamStore
fNeedByteSwap=0, fFormat=66
Creating TPhRun(16814,0,0)be 0 0 8 from the first event
TPhRun Run: 16814 (sequence 0)
 First event: 0 Last event 0 Date: 20050127 50558

Parameters:

 DAQ         RunType    0  ALLBEAM 

Warning! Pedestals already exist and will be rewritten
You know what you are doing?!
Using old pedestal storage for new pedestals
Pedestals have been read succesfully
Huffman tree found in 1 event
#Error in <TPhDAQFile::Process_EvHeader rec=5>: Event number jumped up from 0 to 8 @781326
Events processed 0
#Error in <TPhRawHitFB::UnPack>: FASTBUS slot 22 size = 65 > 64, data=0xb80001c1, slot discarded
#Error in <TPhDAQFile::Process_Fastbus rec=65>: @713386. 1 Errors in building FB object
Events processed 100
Events processed 200
...

2. Make coding tree

.x $PHAT2HOME/macros/daq/pro/entropy.C
Sum = 1.39399e+09, Max[513]=2.15423e+08 Entropy = 3.91723 fTree->nch = 4096 all allocated nused=4096 nprob[0]=0,1,1,1 nprob[4094]=1,1,1,0 [515]=0.3 Huffman tree created, longest code 0, 16 bits, shortest: 512,3 Entropy of the code = 4.02945 Tree file tree.pdaq is open Written 6 bytes. Writing 45072 bytes File tree.pdaq, 45072 bytes have been written succesfully

It reports that the entropy of the pedestal distribution is 3.92 and the entropy of the generated code is 4.03. In another words using this coding tree the average number of bits per data word will be 4.03 and we should expect the silicon data size = 137000*4.03/8 = 69 kB.

3. Copy files to DAQ

chmod 644 pedfile.pdaq
chmod 644 tree.pdaq
scp *.pdaq mcclient@vmesparc.phobos.bnl.gov:/export/home/phobos/DAQ/2004/Mercury/bin

mcclient@vmesparc.phobos.bnl.gov's password: 
pedfile.pdaq                                       100%  287KB 287.2KB/s   00:00    
tree.pdaq                                          100%   44KB  44.0KB/s   00:00