AutoCalibration service work

[Page was moved to a Blog from an orphan book page]

Below is a write-up for the different scripts used for the autocalibration service work:

AutoCalib_webInterface_display.pl:
 

The purpose of this script is to display the full chain of the auto calibration which is comprised of :

1- baseChain : based on what collision system is selected by the user ,the most recent entry (with respect to the date and time specified by the user) a base chain is displayed.

2- qaChain : based on the most recent entry of the qaChain state (with respect to the date and time specified by the user) a QA chain is displayed.

3- tpcChain: based on the most recent entry of the tpcChain state (with respect to the date and time specified by the user) a tpcChain is displayed.

4- emcChain : based on the most recent entry of the emcChain state (with respect to the date and time specified by the user) an emcChain is displayed.

 

--- If the user doesn't specify the time a default NOW() time is specified.

 

AutoCalib_webInterface_insert.pl:

 

The user can either :

1**specify the new chain that needs to be inserted for either of the following :

-baseChain: "Validity Time",Collision system, chain.

-qaChain:"Validity Time",Subsystem state ,Subsystem chain.

-tpcChain: "Validity Time". Subsystem state , Subsystem chain.

-emcChain: "Validity Time" , Subsystem state, Subsystem chain.

 

 2**Change the already declared state for either of the  subsystems (QA , tpc or emc) .

 

AutoCalibDB.pm :

 

 This is the supporting Perl module used by other scripts.And it has the following functionalities:

Connect_AutoCalibDB: connects to the DB.

fetch_AutoCalibDB : It querys the most recent state of the subsystem specified (either QA ,tpc or emc)

fetch_DetChain_AutoCalibDB :Based on the state passed to it ,it retrieves the corresponding chain (the most recent one) for any of the subsystems (QA,tpc or emc)

fetch_BaseChain_AutoCalibDB:Based on the collision system (AuAu,pp or PbPb) passed to it ,it retrieves the corresponding base chain (the most recent one) .

 

insert_AutoCalibDB: Inserts into a user specified table .

insert_BaseChain_AutoCalibDB :Inserts into the baseChain table.

insert_DetChain_AutoCalibDB: Inserts into a user specified table .

 

and some other REGEXP checking functions:

cleanStrict_DB ,cleanStrictChar_DB,cleanInt_DB

 

 

Example  of the DB structure:

mysql> select * from baseChain
    ->
    -> ;
+---------------------+---------------------+-----------+-------------------------+
| entryTime           | beginTime           | collision | chain                   |
+---------------------+---------------------+-----------+-------------------------+
| 2006-01-01 00:00:00 | 2006-01-01 00:00:00 | PPPP      | pp2006a,ittf,ezTree     |
| 2006-03-01 00:00:00 | 2006-01-01 00:00:00 | PPPP      | pp2006b,ittf,ezTree     |
| 2007-01-01 00:00:00 | 2007-01-01 00:00:00 | AuAu      | p2007a,ittf,ezTree      |
| 2007-04-26 17:51:28 | 2007-01-01 00:00:00 | AuAu      | p2007b,ittf,ezTree      |
 

 

 

 

mysql> select * from emcChain
    -> ;
+---------------------+---------------------+----------+-------------+
| entryTime           | beginTime           | emcState | chain       |
+---------------------+---------------------+----------+-------------+
| 2007-11-25 00:00:00 | 2007-11-25 00:00:00 |        0 |             |
| 2007-11-25 00:00:00 | 2007-11-25 00:00:00 |        1 | BEmcChkStat |
| 2007-11-25 00:00:00 | 2007-11-25 00:00:00 |        2 |             |
| 2008-08-29 16:25:25 | 2008-08-17 02:00:00 |        1 | BEmcChkStat |
 

 

 

 

mysql> select * from qaChain
    -> ;
+---------------------+---------------------+---------+------------+
| entryTime           | beginTime           | qaState | chain      |
+---------------------+---------------------+---------+------------+
| 2007-01-01 00:00:00 | 2007-01-01 00:00:00 |       0 | QAAlltrigs |
| 2007-01-01 00:00:00 | 2007-01-01 00:00:00 |       1 |            |
| 2008-08-29 16:25:09 | 2008-08-17 02:00:00 |       0 | QAAlltrigs |
 

 

mysql> select * from state
    -> ;
+---------------------+------+------+------+
| entryTime           | QA   | TPC  | EMC  |
+---------------------+------+------+------+
| 2008-08-13 15:13:59 |    0 |    1 |    0 |
| 2008-07-15 15:00:00 |    1 |    1 |    0 |
| 2008-08-29 16:36:59 |    1 |    0 |    1 |
 

 

 

 

mysql> select * from tpcChain
    -> ;
+---------------------+---------------------+----------+----------------------------+
| entryTime           | beginTime           | tpcState | chain                      |
+---------------------+---------------------+----------+----------------------------+
| 2006-01-01 00:00:00 | 2006-01-01 00:00:00 |        0 |                            |
| 2006-01-01 00:00:00 | 2006-01-01 00:00:00 |        1 | Corr2                      |
| 2006-01-01 00:00:00 | 2006-01-01 00:00:00 |        2 | Corr3                      |
| 2006-01-01 00:00:00 | 2006-01-01 00:00:00 |        3 | Corr4                      |