# Presentation: 265841

**	**
**	****                  **
**	****     ****Online Calibration of Calorimeter**
**	****	****              ****Mrinmoy Bhattacharjee**
**	****	****	****     ****SUNY, Stony Brook**
**	****      ****Thanks to: D. Schamberger, L. Groer, U. Bassler, **
**	****	****	****  ****B. Olivier, M. Thioye**
**	****         ****Institutions: SUNY, ****LPNHE-Paris, LAL-Orsay, Columbia**
**	****	****	**

## Overview

_**Overview**_

**	**** ****Topics discussed**
**	**
**	**** ****Calibration of the Electronics**
**	****	****-- Procedure**
**	****	****-- Pulser Hardware**
**      ****Online Calibration Software**
**	****	****-- Pulser control software**
**	****	****-- Calibration software**
**	****	****-- Validation software**
**      ****Online Calibration Database**** **
**	****	****-- Table definitions**
**	****Summary**

## Motivation

**Accumulate ‘0’ bias data for each CAL cell with events**
**	****	****— ****empty for Pedestals**
**        — ****pulsed for Pulser runs**
**Goals:**
- Calibrate electronics to better than 1%:
**1. Measure Pedestals due to electronics & Ur noise**
**2. Determine 0 suppression limits**
**3. Study channel to channel response variation**
**4. Study linearity**
- Calorimeter electronics commissioning:
**1. bad channels**
**2. trigger verification**
**3. mapping**

## Calibration System

**Level 3**

## Calibration Pulser System

** ****	****	**
**	****	****(**LAL Orsay, LPNHE Paris)
**                                                 **
**                                                                                                          **
**	**** ****	**12 units for calorimeter + 1 for ICD
- 	 smallest calibration unit = 1 ADC crate** ****	****	****	**

## Pulser Control

**PULSER**

## Pulser Control

** ****     **
**     ****	**Pulsers Configuration to download:
** ****signal height (DAC)**
** ****Enable for each pulser channel (patterns)**
** ****Commands**
** ****Delay**
- 	Calibration loop parameters**:**
** ****linearity/timing**
** ****number of events per step**
** ****step size**
** ****pulser patterns**
**	****	****	****	****	****	****	****	****	****	****	****	**

## Pulser Status

** ****     **
**     ****	****Pulser Status****	**
- 		-- Pulser boxes built, tested and installed
- 		-- One final Pulser supply built
- 	    	   ***(rest to be built in next 2 months)***
- 		-- Fanouts and cables installed for ECN and CC
- 	   	   ***(ECS in Oct.)***
- 		-- Pulser Interface Board (PIB) - prototype tested
-                  ***(Final version being built)******	*****	****	****	****	****	**
**	****Software Controls**
**	****	**-- GUI can talk directly to PIB through EPICS or    		    COMICS
**	****	**-- can talk to Pulser in MCH via COOR by hand
- 		-- working on link between GUI and COOR
**	****	****	****	****	**

## Calibration software for DAQ commissioning 

**   **
**	**** ****Version of Calibration**** ****cal_elec**** ****runs on online HOST **
**(since Feb, 2000 part of commissioning milestone)**
**grabs data from distributor**
** ****calculates ********, ********/channel**
** ****reports running ********, ********/channel**
** ****prints status report**
** ****being used to debug CAL crates ****	**

**Sigma tails from preamp capacitance**

- Pedestal run

## Calibration Tool for Level 3

** **
**	****Online Calibration Code will run at L3**
**	****	****-- will handle data for 12 ADC crates**
**	****	****-- pulser block PIB********timing/control********L3 (VBD ********)**
**	****	****        ****defines DAQ set, Delay, Pls pattern etc.**
**	****	****-- access to raw data from ADC Crates (VBD ********)**
**	****	****-- calculates ******** for each channel for ******** Gains**
**	**
**	****	**
**	****	****	****	****	****	****.**
**	****	****	****	****	****	****.**
**	****	****	****	****	****	****.**
**	****	****	****	****	****	****.**

**L3CalCalib**

**L3CalCalib**

**12 ADC Crates**

**Data from 12**
**ADC crates**

**L3 nodes**

**Crate 1**

**Crate 12**

## Calibration Tool for Level 3

**l3CalCalib is implemented as an L3 Tool**
**	****	**--** **l3CalCalib is an unpacking tool
**	****	**-- will run as a Filter
**L3CalCalib ****contains the L3 tool implementation**
**	****(1) Pseudo-constructor MakeMe()**** **
**	****	****	*****-- initializes containers for data***
**	****(2) DoThisTool() **
**	****	****	*****-- runs L3CalCalib tool***
***	******	******	******-- passes RawData chunk to _RunCalib(rawptr)***
**	****(3) _RunCalib(rawptr)**
**	****	****	*****-- forms running sums and fills contsiners***
**	****(4) Write(L3DebugInfo ** myinfo)**
**	****	****	*****-- calculates ************ for each channel when called by                            ***
***                           ******ScriptRunner****** ***
**Containers for Calibration data**** **
***12 instances of CalCalib_AdcCrate class*****	**** ****          **
_**	**__**	**__**	**_**    *****12 instances of CalCalib_AdcCards***
**	****	****	****	*****384 instances of ADC Channels      ***
***                                           ******(BLS,Tower,Depth,************,************)***

## Calibration as a Filter

**L3CalCalib ****tool needs to be called as a filter at L3****	**
**	*****-- ************  tool needs to be registered                  ***
***	******-- ************  ******needs to be declared in ******tools.rcp***
***     ******-- ************  ******implemented as a filter (******L3FCalCalib******) in ******l3filters***
***	******-- ************ ******needs to be registered as a filter ***
***     ******-- ************  ******needs to be declared in ******filter.rcp***
**Then ScriptRunner can instantiate this filter**
**L3 does not have an end of run **
**	*****So,***** ****when do we calculate the moments (we have running sums -- running moments hard on resources )?????**
**L3DebugInfo can be called from the ScriptRunner**
**every ‘N’ events **
**	****	****invokes ****Write(L3DebugInfo ** myinfo)**** in ****L3CalCalib**
**	****	****copies calibration data into ****L3CalCalibDebugInfo**** class**
**	****	****packs into persistant D0OM object to ship to Host**** **

## Controlling Calibration at L3

**	**_***L3CalCalib***_***, ***_***L3CalCalibDebugInfo***_***, ***_***L3FCalCalib ***_***implemented***
_**	**__**	**_***Being tested as a L3 filter in tsim_l3***

***ScriptRunner***

**L3FCalCalib**

***Write(L3DebugInfo);***

**l3filters**

**L3CalCalibDebugInfo**
***friend class L3CalCalib;***

**L3CalCalib**

***RunCalib();***

***Calibration***
***Data ***
***D0OM object***

**L3 Tool for calorimeter **
**online calibration**

***Data To Host***** **

## Calibration Procedure

**	**
**	****Calib Taker starts Calibration Run**
**	****Through Configuration files**
**	****	****(1) Turn off ‘0’ suppression**
**	****	****(2) Turn off Pulser for Pedestal runs**
**	****	****	*****number of events to trigger***
**	****	****(3)  Set Pulser for Pulser runs**
**	****	****	*****number of events to trigger***
***	******	******	******select DAQ setting***
***	******	******	******select Delay setting***
***	******	******	******Cycle through all patterns***
**	******** ****we end up with one set of calibration constants per run**
**	**** **_**Ramp through**_** all DAQ, Delay settings and cycle through **
**	**** ****all patterns to **_**check linearity of the response**_
** ****	****	*****within the same run or in different runs***
**	******** ****we will end up with Ramp******** sets of calibration constants**
**	****Calibration constants are then sent for validation and data base **
**	****to the host as special events (D0OM).**

## Calibration Procedure

**	**
**	****Contents of calibration data**
**	****Header ******** **
**	****	****(1) Run Number, Run Date**
**	****By Channel ******** **
**	****	****(2) Packed Channel ID (Crate+Card+BLS+Twr+Dpth)**
**	****	****(3) Mean for ********1 and ********8    (for pulser runs only 1 number)**
**	****	****(4) Sigma for ********1 and ********8   (for pulser runs only 1 number)**
**	****	****(5) 16 bit error code**
**	****	****(6) Pulser pattern number**** ****	**
**	****Calibration data committed to Data Base by ADC Crate**
** ****	****Calibration Data validated with valid runs in Data Base****	**
**	****Following Error flags set per channel**
**	****(1) <4******** of previous value Good channel**
**	****(2) 4******** to ~10********  of previous value Flag  warning for channel**
**	****(3) >10******** is Bad channel**
**	****If significant number (>50%) of channels in a crate are bad**
**	****we Flag error for the whole crate and may not commit to Data Base    **

## Summary

**	**
**	****	***** Pulser Hardware Installed**
**	****	***** Communication with Pulser through **
**	****	****   ****COOR being worked out****	**
**	****	***** L3 Calibration TOOL written as a L3 Filter**
**	****	***** Being implemented in L3 framework and tested**
**	****	***** Data Base tables defined**
**	****	****   ****(more to be added)**
**	****	****TO DO ******
**	****	****— ****Complete Pulser communication**
**	****	****— ****Migration of Calib code to NT -- mid October**
**	****	****— ****Integrate Data Base tables -- mid October**