fixing "fixed" AV in the DB for Au+Au 11 GeV dataset

DB fixes for Au+Au 11 GeV were done by Jie and Gene. I have found few cases when decision what to do with problematic entry was not correct.

Please find example log below for timeshifted entry (this log assumes nominal voltage of 1345 V for the run):

-- ___ WORKING ON RUN 11157027 [ 2010-06-06 12:13:58 2010-06-06 12:33:23 ] ( using db03.star.bnl.gov ) ___ 
-- Time shift possible for 11157027 : 24 : 9,10,18 : 1345 : 0 ( 2010-06-04 14:34:59 ) : 1346 ( 2010-06-08 19:53:47 ) 
update tpcAnodeHVavg set entryTime=entryTime,beginTime=
from_unixtime(1275826408) where deactive=0   
and unix_timestamp(beginTime)=
1276026827 and sector=24 and socket in (9,10,18);  
-- XX24512756620991XX 
-- Deactivate possible for 11157027 : 24 : 9,10,18 : 1345 : 0 ( 2010-06-04 14:34:59 ) : 1001 ( 2010-06-04 14:10:18 )  
-- update tpcAnodeHVavg set entryTime=entryTime,deactive=
FFFF where deactive=0  
-- and unix_timestamp(beginTime)=
1275662099 and sector=24 and socket in (9,10,18); 
-- XX24512756620992XX

-- shift corrected///////////////////////

What we see here is the following:

Run 11157027 started at 2010-06-06 12:13:58, ended at 2010-06006 12:33:23,

Voltage 1345V was expected.

Closest entries found in the DB are 0V at 2010-06-04 14:34:59 and 1346V at 2010-06-08 19:53:47

Two solutions were proposed:

  1. Timeshift entry with timestamp 1276026827 corresponding to 2010-06-08 19:53:47 (1346V) to timestamp 1275826408 corresponding to 2010-06-06 12:13:28 (30 seconds before the start of the run).
  2. Deactivate entry with timestamp 1275662099 corresponding to 2010-06-04 14:34:59 (0V), earlier entry dated

    2010-06-04 14:10:18 (1001V) will be used.

The decision was made to make a timeshift (1). Later in the shiftlog Jie found that voltage was set to 1000V for this run/sector/channel, so the right thing was to deactivate entry with timestamp 1275662099 (2).

To fix created problem we now need to make reverse timeshift, and then do 2:

update tpcAnodeHVavg set entryTime=entryTime,beginTime=from_unixtime(1276026827) where deactive=0
and unix_timestamp(beginTime)=
1275826408 and sector=24 and socket in (9,10,18);
-- XX24512756620991XX
update tpcAnodeHVavg set entryTime=entryTime,deactive=
FFFF where deactive=0 and unix_timestamp(beginTime)=1275662099 and sector=24 and socket in (9,10,18);
-- XX24512756620992XX