Run 13 spin database QA -- learning and first glance

This page is to document what I am learning how to do the spin data base QA.  I got start based on the material from Jan and Kevin. Thank them. 

Step 1.  Creating run list by using script loopMainAll.tcl 
For practice, I have selected the pp500_production_2013  data base from run 14074055 to run 14161020. This is the runlist I have generated for the next steps. 

Step 2.  Collecting the spin information by using script spbitSeeker.tcl 

This script can collecting the information of each fill which include the the begin and end time, the spin patterns.  The spin patterns of the first and the last runs of every fill are saved into the V124 files which will be uploaded to the data base.  

Step 3.  Analyzing the spin pattern by using the script begEndComp.tcl 
By comparing the V124 files of the first run and the last run of each fill, this script generates a good fill list and a bad fill list

PS. After discussion with Devika, I have updated the script to fit the spin patterns, P1-P8 and P21-P28. These are the good fill list and bad fill list

Step 4. Examing and fixing bad fills 
In this step, more information need be checked to find out the reason and method to fix.  I am still on this step. 

Some information from the first glance at run13 spin DB
 
1. The spin-4 bit (5,6,9,10)  changed every two bunches instead of every bunch as shown in below, one of the V124 files. 

#rhic/spinV124
0 240
1 1
01010011   1     --> 9   
00000000   2
00000000   3
01010011   4     --> 9
00000000   5
00000000   6
00110101   7     --> 6
00000000   8
00000000   9
00110101  10    --> 6
00000000  11
00000000  12
01010101  13    --> 10
00000000  14
00000000  15
01010101  16    --> 10
00000000  17
00000000  18
00110011  19    --> 5
00000000  20
00000000  21
00110011  22    --> 5
00000000  23
 
2. There are problems of  F17232 to F17250 .  The spin paterns did not repeat every 8 bunches as normally, but repeat every 14 bunches. (Devika fixed it )

As below: 

-1 0 0 -1 0 0 -1 0 0 -1 0 0  
1 0 0 1 0 0 1 0 0 1 0 0  
-1 0 0 -1 0 0 1 0 0 1 0 0  
1 0 0 1 0 0 -1 0 0 -1 0 0  
-1 0 0 -1 0 0 1 0 0 1 0 0  
1 0 0 1 0 0 -1 0 0 -1 0 0  
1 0 0 0 0 0 0 0 0 1 0 0  
1 0 0 1 0 0 -1 0 0 -1 0 0  
-1 0 0 -1 0 0 1 0 0 1 0 0  
1 0 0 1 0 0 -1 0 0 -1 0 0  
1 0 0 1 0 0 1 0 0 1 0 0  
-1 0 0 -1 0 0 -1 0 0 -1 0 0  
1 0 0 1 0 0 1 0 0 1 0 0  
-1 0 0 -1 0 0 1 0 0 1 0 0  
1 0 0 1 0 0 -1 0 0 -1 0 0  
-1 0 0 -1 0 0 1 0 0 1 0 0  
1 0 0 1 0 0 -1 0 0 -1 0 0  
1 0 0 1 0 0 1 0 0 1 0 0  
-1 0 0 -1 0 0 -1 0 0 -1 0 0  
1 0 0 1 0 0 1 0 0 1 0 0  
-1 0 0 -1 0 0 1 0 0 1 0 0  
3. Three bad fill need to be examed and fixed. 

compare files in begin/*.v124 to end/*.v124
F17434 N 14118047 14118064 18 1367171602 1367201916 6885 241 2013-04-28 14:13:22 B111 Y111 B--++++-- Y++--++-- P25 *s
F17580 14153036 14153064 25 1370193698 1370223731 134 72 2013-06-02 13:41:38 B111 Y111 B++----++ Y--++--++ P28
F17600 14158038 14160033 83 1370650178 1370808446 85 166 2013-06-07 20:29:38 B111 Y111 B++----++ Y--++--++ P28

F17434, only different in the begin time. 
F17580, only last run <3mins. different. Maybe we should remove it. 
F17600, long fill ~2 days. spin changed in the last 30%.