Mapping EPD 12/03/2022

Executive Summary
The EPD mapping check is finally successful after the installation of the 4th crate.  This requires running in starnew, with copying over some of Akio's files to compile locally.  The EPD largely looks ok, though there seems to be 3 connectors on the west side that are disconnected, and a few channels that may be dead.  This can be investiated next week while we are at BNL.

Analysis Results
A pdf of each channel of the pedAsPhys files from the mapping check (created by running over the *.dat files) can be found at: drupal.star.bnl.gov/STAR/system/files/ComparePed12032022.pdf
The mapping pdfs (in order of pattern number, can be found at: drupal.star.bnl.gov/STAR/system/files/Mapping12062022.pdf

Dead Tiles
The following channels seem to be dead: (ew, pp, tt, color, adc)
There are 20 tiles
-1    2    3    0    0
-1    7    6    0    0
-1    7    13    0    0
-1    7    24    0    0
-1    12    6    0    0
-1    12    7    0    0
1    2    4    0    0
1    2    12    0    0
1    2    13    0    0
1    2    14    0    0
1    2    15    0    0
1    3    10    0    0
1    3    11    0    0
1    3    12    0    0
1    3    13    0    0
1    6    1    0    0
1    7    6    0    0
1    7    7    0    0
1    7    8    0    0
1    7    9    0    0

Problem tiles
Pattern1
MISMATCH!!! ew/pp/tt = -1/1/14
MISMATCH!!! ew/pp/tt = -1/1/22
MISMATCH!!! ew/pp/tt = -1/2/3
MISMATCH!!! ew/pp/tt = -1/5/28
MISMATCH!!! ew/pp/tt = -1/7/6
MISMATCH!!! ew/pp/tt = -1/7/13
MISMATCH!!! ew/pp/tt = -1/7/24
MISMATCH!!! ew/pp/tt = -1/9/23
MISMATCH!!! ew/pp/tt = -1/10/21
MISMATCH!!! ew/pp/tt = -1/12/6
MISMATCH!!! ew/pp/tt = -1/12/7
MISMATCH!!! ew/pp/tt = 1/2/4
MISMATCH!!! ew/pp/tt = 1/2/12
MISMATCH!!! ew/pp/tt = 1/2/13
MISMATCH!!! ew/pp/tt = 1/2/14
MISMATCH!!! ew/pp/tt = 1/2/15
MISMATCH!!! ew/pp/tt = 1/3/10
MISMATCH!!! ew/pp/tt = 1/3/11
MISMATCH!!! ew/pp/tt = 1/3/12
MISMATCH!!! ew/pp/tt = 1/3/13
MISMATCH!!! ew/pp/tt = 1/6/1
MISMATCH!!! ew/pp/tt = 1/7/6
MISMATCH!!! ew/pp/tt = 1/7/7
MISMATCH!!! ew/pp/tt = 1/7/8
MISMATCH!!! ew/pp/tt = 1/7/9

Pattern2
MISMATCH!!! ew/pp/tt = -1/5/28
MISMATCH!!! ew/pp/tt = -1/7/6
MISMATCH!!! ew/pp/tt = -1/7/13
MISMATCH!!! ew/pp/tt = -1/7/24
MISMATCH!!! ew/pp/tt = -1/12/6
MISMATCH!!! ew/pp/tt = -1/12/7
MISMATCH!!! ew/pp/tt = 1/5/14
MISMATCH!!! ew/pp/tt = 1/5/20
MISMATCH!!! ew/pp/tt = 1/5/22
MISMATCH!!! ew/pp/tt = 1/6/1
MISMATCH!!! ew/pp/tt = 1/6/2
MISMATCH!!! ew/pp/tt = 1/6/20
MISMATCH!!! ew/pp/tt = 1/6/22
MISMATCH!!! ew/pp/tt = 1/7/6
MISMATCH!!! ew/pp/tt = 1/7/7
MISMATCH!!! ew/pp/tt = 1/7/8
MISMATCH!!! ew/pp/tt = 1/7/9
MISMATCH!!! ew/pp/tt = 1/7/23
MISMATCH!!! ew/pp/tt = 1/8/2
MISMATCH!!! ew/pp/tt = 1/8/3
MISMATCH!!! ew/pp/tt = 1/8/4
MISMATCH!!! ew/pp/tt = 1/8/5
MISMATCH!!! ew/pp/tt = 1/12/2
MISMATCH!!! ew/pp/tt = 1/12/3
MISMATCH!!! ew/pp/tt = 1/12/4
MISMATCH!!! ew/pp/tt = 1/12/5

Pattern3
MISMATCH!!! ew/pp/tt = -1/2/3
MISMATCH!!! ew/pp/tt = -1/5/28
MISMATCH!!! ew/pp/tt = -1/7/13
MISMATCH!!! ew/pp/tt = -1/10/21
MISMATCH!!! ew/pp/tt = -1/12/6
MISMATCH!!! ew/pp/tt = -1/12/7
MISMATCH!!! ew/pp/tt = 1/2/4
MISMATCH!!! ew/pp/tt = 1/2/8
MISMATCH!!! ew/pp/tt = 1/2/12
MISMATCH!!! ew/pp/tt = 1/2/13
MISMATCH!!! ew/pp/tt = 1/2/14
MISMATCH!!! ew/pp/tt = 1/2/15
MISMATCH!!! ew/pp/tt = 1/3/10
MISMATCH!!! ew/pp/tt = 1/3/11
MISMATCH!!! ew/pp/tt = 1/3/12
MISMATCH!!! ew/pp/tt = 1/3/13
MISMATCH!!! ew/pp/tt = 1/5/20
MISMATCH!!! ew/pp/tt = 1/5/22
MISMATCH!!! ew/pp/tt = 1/6/1
MISMATCH!!! ew/pp/tt = 1/6/20
MISMATCH!!! ew/pp/tt = 1/6/22
MISMATCH!!! ew/pp/tt = 1/7/6
MISMATCH!!! ew/pp/tt = 1/7/7
MISMATCH!!! ew/pp/tt = 1/7/8
MISMATCH!!! ew/pp/tt = 1/7/9
MISMATCH!!! ew/pp/tt = 1/7/23
MISMATCH!!! ew/pp/tt = 1/8/2
MISMATCH!!! ew/pp/tt = 1/8/3
MISMATCH!!! ew/pp/tt = 1/8/4
MISMATCH!!! ew/pp/tt = 1/8/5
MISMATCH!!! ew/pp/tt = 1/9/2
MISMATCH!!! ew/pp/tt = 1/9/3
MISMATCH!!! ew/pp/tt = 1/9/4
MISMATCH!!! ew/pp/tt = 1/9/5
MISMATCH!!! ew/pp/tt = 1/10/2
MISMATCH!!! ew/pp/tt = 1/10/4
MISMATCH!!! ew/pp/tt = 1/11/3
MISMATCH!!! ew/pp/tt = 1/11/5

Pattern4
MISMATCH!!! ew/pp/tt = -1/1/14
MISMATCH!!! ew/pp/tt = -1/1/22
MISMATCH!!! ew/pp/tt = -1/5/28
MISMATCH!!! ew/pp/tt = -1/7/13
MISMATCH!!! ew/pp/tt = -1/12/6
MISMATCH!!! ew/pp/tt = -1/12/7
MISMATCH!!! ew/pp/tt = 1/2/4
MISMATCH!!! ew/pp/tt = 1/2/8
MISMATCH!!! ew/pp/tt = 1/2/12
MISMATCH!!! ew/pp/tt = 1/2/14
MISMATCH!!! ew/pp/tt = 1/3/11
MISMATCH!!! ew/pp/tt = 1/3/13
MISMATCH!!! ew/pp/tt = 1/5/14
MISMATCH!!! ew/pp/tt = 1/5/20
MISMATCH!!! ew/pp/tt = 1/5/22
MISMATCH!!! ew/pp/tt = 1/6/2
MISMATCH!!! ew/pp/tt = 1/6/20
MISMATCH!!! ew/pp/tt = 1/6/22
MISMATCH!!! ew/pp/tt = 1/7/7
MISMATCH!!! ew/pp/tt = 1/7/9
MISMATCH!!! ew/pp/tt = 1/8/2
MISMATCH!!! ew/pp/tt = 1/8/3
MISMATCH!!! ew/pp/tt = 1/8/4
MISMATCH!!! ew/pp/tt = 1/8/5
MISMATCH!!! ew/pp/tt = 1/10/2
MISMATCH!!! ew/pp/tt = 1/10/3
MISMATCH!!! ew/pp/tt = 1/10/4
MISMATCH!!! ew/pp/tt = 1/10/5
MISMATCH!!! ew/pp/tt = 1/11/2
MISMATCH!!! ew/pp/tt = 1/11/3
MISMATCH!!! ew/pp/tt = 1/11/4
MISMATCH!!! ew/pp/tt = 1/11/5

Pattern5
MISMATCH!!! ew/pp/tt = -1/1/14
MISMATCH!!! ew/pp/tt = -1/7/13
MISMATCH!!! ew/pp/tt = -1/10/21
MISMATCH!!! ew/pp/tt = 1/2/12
MISMATCH!!! ew/pp/tt = 1/2/13
MISMATCH!!! ew/pp/tt = 1/2/14
MISMATCH!!! ew/pp/tt = 1/2/15
MISMATCH!!! ew/pp/tt = 1/3/12
MISMATCH!!! ew/pp/tt = 1/3/13
MISMATCH!!! ew/pp/tt = 1/5/14
MISMATCH!!! ew/pp/tt = 1/5/20
MISMATCH!!! ew/pp/tt = 1/6/20

Pattern6
MISMATCH!!! ew/pp/tt = -1/5/28
MISMATCH!!! ew/pp/tt = -1/7/6
MISMATCH!!! ew/pp/tt = -1/10/22
MISMATCH!!! ew/pp/tt = -1/12/6
MISMATCH!!! ew/pp/tt = -1/12/7
MISMATCH!!! ew/pp/tt = 1/2/8
MISMATCH!!! ew/pp/tt = 1/3/10
MISMATCH!!! ew/pp/tt = 1/3/11
MISMATCH!!! ew/pp/tt = 1/7/6
MISMATCH!!! ew/pp/tt = 1/7/7
MISMATCH!!! ew/pp/tt = 1/7/8
MISMATCH!!! ew/pp/tt = 1/7/9

Pattern7
MISMATCH!!! ew/pp/tt = -1/1/14
MISMATCH!!! ew/pp/tt = -1/2/3
MISMATCH!!! ew/pp/tt = -1/5/28
MISMATCH!!! ew/pp/tt = -1/7/24
MISMATCH!!! ew/pp/tt = -1/12/7
MISMATCH!!! ew/pp/tt = 1/2/4
MISMATCH!!! ew/pp/tt = 1/2/8
MISMATCH!!! ew/pp/tt = 1/2/14
MISMATCH!!! ew/pp/tt = 1/2/15
MISMATCH!!! ew/pp/tt = 1/3/10
MISMATCH!!! ew/pp/tt = 1/3/11
MISMATCH!!! ew/pp/tt = 1/5/14
MISMATCH!!! ew/pp/tt = 1/7/7
MISMATCH!!! ew/pp/tt = 1/7/8

Background
The EPD has gone from 3 crates to 4.  Additionally we are splitting each crate between east and west, which means that we had to move all of the boards around AND recable everything.  In addition to this there have been many changes made to the STAR system itself.  The final configuration of the crates can be found at: drupal.star.bnl.gov/STAR/system/files/userfiles/1108/VME_09112022.png

Crate Timing Calcuation

It's 399 ticks to read out a crate with no boards, an additional 177 ticks for the readout code with a single board, and then about 35 ticks per board.  Each hit adds about 8 ticks to the read-out time.  To read out at 5 kHz, the whole crate needs to be read out in under 2000 ticks, so if we have 4 boards with 32 hits each (i.e full occupancy) , that would be:

399+177+35*4+128*8 = 1740 ticks, under 2k

If we had to read out all 8 boards in this circumstance, it would be:
399+177+35*8+256*8 = 2904, too high

Occupancy may very well be ~50%, which with 8 boards would give us:
399+177+35*8+128*8 = 1880

So it may even be that we can run without removing any boards...

Analysis Details
The original mapping test instructions can be found at: drupal.star.bnl.gov/STAR/blog/lisa/how-check-mapping-vped-patterns-step-step
We have now gained the ability to run STAR remotely, the instructions for which can be found at: drupal.star.bnl.gov/STAR/blog/rjreed/Running-EPD-Remotely
Now with various changes that have been made, I log into daqman via:
ssh -A -Y rjreed@ssh.sdcc.bnl.gov
ssh -A -Y stargw.starp.bnl.gov
ssh evpops@daqman
cd /RTS/conf/epd

Due to the high current from the bias voltages on the East Side (West side is not connected) we have changed the mapping files so that the voltages are all set to zero for the checks.  These can be found in:
/RTS/conf/epd/MappingPatterns2023

Due to this change, we can not see the pattern on the GUI as there are no bias voltages being set.

Requesting files from hpss
For some reason, hsi ls no longer works for checking the path of files in HPSS.  At least for me. :-(  The file format, however is unchanged, so one knows that the *.daq files produced in the mapping check are at locations such as:
/home/starsink/raw/daq/2022/336/23336009/st_physics_23336009_raw_0000001.daq
where the year, day, run number can be changed.  This does mean that one has to verify that the files are in hpss prior to requesting them.

Pedestal Files
While waiting, one can look at the pedestals.  These are produced in ascii files that list the mean and sigma by board and channel.  Note that the boards are numbered by their order, regardless of their physical address.  (i.e. if the first board is in slot 0, and the second is in slot 3, the trigger will list them as board 0 and board 1.)

To look at the pedestals:
ssh -A -Y rjreed@ssh.sdcc.bnl.gov
ssh -A -Y stargw.starp.bnl.gov
ssh -A -Y trg@startrg.starp.bnl.gov
ssh l2ana01.trg.bnl.local
cd online_l2/ped

Files have the form eq*.runnumber

To copy:
scp eq*.mean.run startrg.trg.bnl.local:~/
exit
scp eq*.mean.run rjreed@onl04.starp.bnl.gov:~/
cp eq* RosiPed
exit

It is no longer all that easy to move files from the stargw to rcf!!  (We have moved to sftp, and thus scp no longer works.)  I move them directly to my laptop by email with commands such as:
echo "mail text" | mailx -s "mail title" -a filename rjr215@lehigh.edu

Note: You can not use the * command here, I recommend zipping them.

Once you have them, you can create root files using drupal.star.bnl.gov/STAR/system/files/ReadPed.C.txt and then draw them using drupal.star.bnl.gov/STAR/system/files/DrawPed.C.txt.  The first macro requires a txt file of crate and boards of the QT32C, this can be found at: drupal.star.bnl.gov/STAR/system/files/QT32C.txt.  Since you likely don't want to mess around with all this, a handy script that will do this for all eq files in a given folder can be found at: drupal.star.bnl.gov/STAR/system/files/run_pedeq.sh_.txt

Probably you are still waiting for the HPSS files.  So now you can run over the *.dat files.  (The EQ files are only created for pedestal_rhicclock_clean, the *.dat files are only created for pedAsPhy.  Note - there should be pedestal subtraction for pesAsPhys!!)

Running over *.dat files
This is something one also wants to do for the various scans that happen during the run.  I have modified my existing code to account for the 4th crate.  I should have written it in a better way, but honestly it was simply easier to modify the arrays a little.  (Maybe with infinite time I could do this in a better way.)

Currently the code lives at: /ldaphome/rjreed/EpdReader2023

But I also copy it here just in case.

The first files are the makers, these can be found at: drupal.star.bnl.gov/STAR/system/files/StEpdHistMaker.h.txt and Bdrupal.star.bnl.gov/STAR/system/files/StEpdHistMaker.cxx_.txt

These need to go into an StRoot folder, then one can compile in starnew using cons.
The macro to run this maker is at: drupal.star.bnl.gov/STAR/system/files/EPDreader.C.txt

I've written a script that runs it, given the day, run # and the number of files.  (For mapping there is only ever 1 file so not as necessary, but will be useful for commissioning work.)  The script is at: drupal.star.bnl.gov/STAR/system/files/runEpdTrgHist2023.sh_.txt

Then to map the files so that the pp, tile, etc appear in the title as before, one can run this macro on them using root4star: drupal.star.bnl.gov/STAR/system/files/map_EpdHistos.C.txt

If you want to draw and compare a bunch of these files together, you can use this macro: drupal.star.bnl.gov/STAR/system/files/AnalyzeManyOnlFile.C.txt

Running the Mapping Code
Normally one can simply run the analysis code, but for some reason I could not get the bfc to run over the *.daq files in starnew (which was necessary to incorporate the changes that Akio made).  So in this case, I copied them from afs.

First:
cp /afs/rhic.bnl.gov/star/packages/DEV/StRoot/StDaqLib/  StRoot
cp /afs/rhic.bnl.gov/star/packages/DEV/StRoot/StEvent/  StRoot

If you need an afs token, you get that by typing:
kinit
then you need to type
aklog

Next type:
starnew
cons

This will compile the code. Then one can run the AnalyzePedAsPhysRun.C and CheckPattern.C files as before.

Whew....  Though I will note that I changed the output from png to pdf, so I can combine the pdfs on my mac using:
pdfunite st_physics_2333*pdf combinemap.pdf
 

Run List

Run 233336008 - pedestal_rhicclock_clean trg+daq
L0,L1,TCD,BBC,STP2,L1_DSM2,BBC_DSM2,EVP,EVB, EQ1-4, EQ1-4_QTD
Zeros files

Run 233336009 - pedAsPhys trg+daq
Zeros files

Run 233336010 - pedAsPhys trg+daq
Pattern 1

Run 233336011 - pedAsPhys trg+daq
Pattern 2

Run 233336012 - pedAsPhys trg+daq
Pattern 3

Run 233336013 - pedAsPhys trg+daq
Pattern 4

Run 233336014 - pedAsPhys trg+daq
Pattern 5

Run 233336015 - pedAsPhys trg+daq
Patttern 6

Run 233336016 - pedAsPhys trg+daq
Pattern 7

Run 233336017 - pedestal_rhicclock_clean trg+daq
Default