EMT SYSTEM DATABASE HELP

 

Contents

* Overview

* Relevant Documentation

* Perl Scripts

* Maps

* Useful sql Commands

 

 

Overview

The LVDS TDC has 96 (0-95) input channels. When the TDC receives a signal on the channel, it looks into its internal mapping and puts into the minibank a number (channel id) that is assigned to that channel. The TDC board stores the mapping permanently in its memory when programmed by pulling the numbers from the database.

The channel ids eventually propagate into the EMTD (or HATD) TDC banks and should uniquely identify the calorimeter tower that generated this hit. It is our responsibility to maintain the mapping in the database that reflects the hardware configuration (where we plug channels into the boards).

Each TDC (or any other board) is assigned a unique number called a module id. Module ids propagate into the bank as well and should uniquely identify the TDC board. The TDC board stores its id into memory when programmed by pulling the number from the database. This page describes only how to work with the database. One should understand that each TDC stores information inside itself and will propagate this into the raw banks. Therefor it must be programmed by downloading numbers like Module ID and Channel IDs from the database into TDC memory. 

 

The TDC boards (total 12) that serve the EMTiming system sit in one crate and have the names TDC_EM_01 … TDC_EM_12. The id of the system is EMT. For more information please refer to the documents in the next section.

 

This page provides links to the script and other information that help managing the information stored in the database.

 

Back to top

 

Relevant Documentation

About EMTiming system you can go to EM Timing Page

More on how the hardware is configured look at Mapping web page

Discover the CDF bank structure at CDF Run II Data Format

Read about the hardware database: Hardware Database (hdwdb)

Dive into the world of sql commands: Oracle Documentation

 

Back to top

 

Perl Scripts

General Instructions:

1.     Make the file executable (“chmod 744 script_name” on Linux”)

2.     Check if the perl location on your machine is the same as specified in the file. Do “which perl” and compare the result with the very first line in the file.

3.     Type “./script_name help” for further instructions.

 

The script to produce TDC maps: build_maps (here is a new script:  EmtdChanIdMod)


* The script is designed to produce an EMTiming TDC maps in the format that is easy for human eye to read.
* The output of this script can be fed into the next sql_build script in order to produce actual sql query.

 

The script to build an sql update: sql_build

* This script will produce an sql query to update the EMTiming TDC maps in the database.

* You have to have a write permission to update the database.

* Dump the result into the file with extension .sql

sqlplus your_name@cdfonprd; Password: xxxxx; SQL>  @yourScript.sql

 

Format:

1.   Each set of channels must be preceded with line “slot= N “, where N is the crate slot number (from 4 to 13).

2.   Each line specifying the channel to be updated must start with “:: “. build_maps script will do that automatically.

 

The script to get the current map from the database: access_emt

* This script accesses the database for EMTiming information.

* Output can be modified and fed into the sql_build script.

 

Back to top

 

 

Maps

 

TDC maps Version1:

These are maps with ordinary mapping

CEM TDC: V1 Sl4  V1 Sl5  V1 Sl6  V1 Sl7  V1 Sl8  V1 Sl9

PEM TDC: V1 Sl10  V1 Sl11  V1 Sl12  V1 Sl13

TDC maps Version2:

These are new maps with cross—mapping. We will use those to get rid of “double-hits” problems.

CEM TDC: V2 Sl4  V2 Sl5  V2 Sl6  V2 Sl7  V2 Sl8  V2 Sl9

PEM TDC: V2 Sl10  V2 Sl11  V2 Sl12  V2 Sl13


New TDC maps:

These are new maps that should be installed after the shutdown, notice that all plug slots are shifted
by 2, and there are 2 new TDCs for the central system

CEM TDC: cem_4  cem_5  cem_6  cem_7  cem_8  cem_9  cem_10  cem_11

PEM TDC:  plug_12  plug_13  plug_14  plug_15


Current TDC maps
Send me e-mail every time we update one of the maps

(before changes of 2004 shutdown; as of 2004-08-31):

CEM TDC:  Slot 4   Slot 5    Slot 6    Slot 7  Slot 8  Slot 9
PEM TDC:  Slot10  Slot 11  Slot 12  Slot 13


 

Back to top

 

Useful sql Commands

If you are trying to update small  number of things, try to use cardEditor utility before turning to sql

 

*   sqlplus cdf_reader/reader@cdfofprd

*   SELECT CARDNAME, COMPONENT, SLOT, SUBADDRESS,CHANNELID, CHANNELS.ONLINEFLAG FROM  CARDS,CHANNELS WHERE CARDS.CARDNAME=CHANNELS.CARD_CARDNAME AND CARDNAME LIKE 'TDC_EM_01';

*   SELECT CARDNAME,SLOT,BASE,COMPONENT FROM CARDS WHERE  CARDNAME LIKE 'TDC_EM_%' ORDER BY CARDNAME;

The previous sql command produces the snapshot of the crate configuration:

                                (before shutdown of 2004)

CARDNAME

SLOT

BASE

COMPONENT

TDC_EM_01

4

0

EMT

TDC_EM_02

5

8

EMT

TDC_EM_03

6

16

EMT

TDC_EM_04

7

32

EMT

TDC_EM_05

8

40

EMT

TDC_EM_06

9

48

EMT

TDC_EM_07

10

71

EMT

TDC_EM_08

11

83

EMT

TDC_EM_09

12

103

EMT

TDC_EM_10

13

115

EMT

                                (after shutdown of 2004)

CARDNAME

SLOT

BASE

COMPONENT

TDC_EM_01

4

0

EMT

TDC_EM_02

5

6

EMT

TDC_EM_03

6

12

EMT

TDC_EM_04

7

18

EMT

TDC_EM_05

8

32

EMT

TDC_EM_06

9

38

EMT

TDC_EM_07

10

44

EMT

TDC_EM_08

11

50

EMT

TDC_EM_09

12

71

EMT

TDC_EM_10

13

83

EMT

TDC_EM_11

14

103

EMT

TDC_EM_12

15

115

EMT




The following query changes the module id and slot number for the TDC_EM_12 module:

*   UPDATE CARDS SET BASE=115,SLOT=15 WHERE CARDNAME='TDC_EM_12';

 

Back to top

 

Send comments to Max Goncharov (mailto:maxi@fnal.gov)

Last revised: 10/11/2002