How to check mapping via Vped patterns - Step by step

 The idea behind setting Vped values to check mapping from "TUFF space" to "StEvent space" was discussed here: drupal.star.bnl.gov/STAR/blog/lisa/checking-mapping-all-way-tuff-box-stevent-and-mudst

The Seven Patterns that we use to unambiguously check mapping of all 744 tiles is discussed here: drupal.star.bnl.gov/STAR/blog/lisa/seven-pattern-files-can-resolve-all-ambiguity

This blog lays out the step-by-step procedure of how to do this.  The first 10 steps were transcribed by Mike as dictated by Rosi.  Often it is good to have a "neophyte" (Mike) write up the instructions.

Two notes written 28 Jan 2019:
  • use STAR level 'stardev' when you compile root4star Use an older STAR level; I tried SL19a and it worked (otherwise you will have problems if data was taken without the magnetic field on); e.g. with $starver SL19a
  • Be sure that the StEpdGeom class has the ClassDef and ClassImp preprocessor directives in StEpdGeom.h and StEpdGeom.cxx files, respectively.
    • this is not a big deal, but it matters for when you make the pictures
    • these preprocessor directives may already be in the files.  Sometimes, for other reasons, they are commented out or removed
    • in case you are not familiar with these directives, all they do is allow you to instantiate an object of type StEpdGeom at the macro level



Some useful info:


Step-by-step

1) Log onto daqman as evpops on the STAR network, and 'cd /RTS/conf/epd'
  • If you don't know how to do this, are having issues, or don't have an account, see here.
  • When going to PHYSICS state  (e.g. through the GUI), the system picks up Vped and Vset, etc, from the text file /RTS/conf/epd/EPD_TUFFmap.txt
  • The Seven Patterns files (and a "Zero bias" file) are found in the subdirectory /RTS/conf/epd/MappingPatterns2018/
2) Copy EPD_TUFFmap.txt to EPD_TUFFmap_<date>.txt, for safe keeping.  You'll copy/mv it back in step 8 below.

3) Ask the shift crew to end a run (at a natural point).  STAR Control Room 631-344-4242

4) Set voltages to zero:
  • i.e. on daqman:  cp /RTS/conf/epd/MappingPatterns2018/Zeros_02262018.txt  /RTS/conf/epd/EPD_TUFFmap.txt
  • at the GUI, press 'PHYSICS'
    • it is when changing state to PHYSICS that the values in /RTS/conf/epd/EPD_TUFFmap.txt are actually uploaded.
    • you will need 'DetectorOperator' or 'Expert' access, for this to work.  Click on upper right of GUI to change permission.
    • If the system is already in PHYSICS, that's fine.  Just click PHYSICS anyway.  The system can go 'from PHYSICS to PHYSICS' and upload the .txt file
5) Have the crew take a pedestal_RhicClockClean run with 1K events. Be sure to include the following subsystems: L0, L1, TCD, BBC, eq1, eq2, eq3, stp2, l1_dsm2, bbc_dsm2, eq1_qtd, eq2_qtd, eq3_qtd, eq4_qtd, eq4, L2[1], EVP, EVB[1] (from the "Show Component Tree..." button on run control)

6) Do a "Pattern 0".  - This is good simply to make sure the pedestal subtraction is working -- good idea Rosi.
  • Have the shift crew take a PedAsPhys run with 1K events.  Read more details under Step 8 below.

7) Set Pattern 1:
  • on daqman:  cp /RTS/conf/epd/MappingPatterns2018/Pattern1.txt  /RTS/conf/epd/EPD_TUFFmap.txt
    • In later years, you will find the latest patterns in a directory labeled, say, 2023, etc...
  • at the GUI, press 'PHYSICS'
8) Have the shift crew take a PedAsPhys run with 1K events.  (Write down the number of the run, and the pattern number.)
  • Also have the shift crew enter into the shift log "EPD Seven Patterns test #" and mark EPD in subsystems menu
  • If runs are getting trigger data corruption in EQ crates (with messages like "Corrupt Trigger Data Event : Token 262, Crate EQ2 (Event Ctr 0x035cc68b, Readout Ctr 0x035dcfd3"), you need to reduce the rate. Have the shift crew do: "Edit Configuration" -> (for "Trigger Configuration" click "detail" -> (for idx 0, click "Expected...") -> "Set Desired Rate Program" -> (change "Fixed Rate" from 4000 to 1000). Don't forget to change this rate back!

Repeat steps (7) and (8) for the seven pattern files

9) Return the system to the state you found it
  • "undo" what you did in step (2) above.  On daqman:  cp EPD_TUFFmap_<date>.txt  EPD_TUFFmap.txt
  • at the GUI, press 'PHYSICS'
  • If you changed the trigger rate in step 7, make sure you've changed it back.
10) Have the shift crew do another pedestal_RhicClockClean run

Finished with shift crew - goodbye!  Steps (3)-(9) above take like 20 minutes.

11) Get the daq files from HPSS:
  • From a regular RCF note, type 'hsi ls /home/starsink/raw/daq/2018/' and find the ones you want.  (Because you wrote down the run numbers in step (7), right?)
  • make an ascii file called listoffiles.list  where each line is:    filename_and_path_on_hpss   filename_and_path_on_RCF
    • for the latter, put the files at the "standard area" which is currently /star/data03/daq/......
  • issue command 'hpss_user.pl -f listoffiles.list'
  • to check the status of the transfer, issue command 'hpss_user.pl -p'
12) Analyze the .daq files
  • On RCF issue command 'cvs co StRoot/StEpdUtil'.  The macros you'll need are in StRoot/StEpdUtil/Operations/PatternMapping/
  • root4star AnalyzePedAsPhysRun.C
    • input = .daq filename
    • output = ascii file BlahBlah_Levels.txt
    • also output: a .png file of the extracted pattern
    • also output: a whole lot of .root and prs*.txt files and all sorts of stuff you can delete.  Sorry about that.
  • root CheckPattern.C
    • input = the name of the *_Levels.txt file
    • input = the pattern number (1-7) that you think is the right one
    • output = it tells you the number of tiles that disagree with the pattern.