# Presentation: 383292

## PhATThe PHOBOS Analysis Toolkit

- Judith Katzy (MIT)
- for
- the PHOBOS Collaboration

## The PHOBOS experiment at RHIC

**150 000 Silicon channels**
**~450 ADC + TDC channels for TOF, **
**            ****plastic scintillator counters...**

- Up and running since 2000
- Several physics analysis accomplished

## The Phobos Analysis Toolkit 

- Based on ROOT version 2.25     (upgrade to 3.01 in process)
- About 400 classes
- About 15 developers
- Makes full use of  ROOT (I/O, Graphics, Containers, auto documentation, inter-process communication,..)
- Used for all PHOBOS data processing & persistent data, online, PhatDAQ
- Interface to Oracle (G.Heintzelman)
- Interface to GEANT (A.Olszewski, A.Trzupek,K.Wozniak)

## Phat Analysis ComponentsP.Decowski, MIT, G.Heintzelman, BNL, G.Roland, MIT, P.Steinberg, BNL 

**TPhObjManager**

**TPhModContext**

**TPhModule**

- StartAnalysis()
- StartRun()
**Process(TPhEvent *e)**
- EndRun()
- EndAnalysis()

- TPhDetector
- Calibration
**TPhObjManager**

- TH1F
- TTree
- ...

## Reconstruction & Analysis Chain

_**Realization:**_
**TPhModule: **          Smallest processing unit
-                                  Example: noise calculation
**TPhSuperModule:** Processing chain = list of modules in specific order to perform
-                                                                 a  comprehensive processing task
-                                  Example: silicon signal processing
**ModuleLibrary:**     Class with a list of Modules and SuperModules
- 	                  Filled by default after compilation using setup-macros
- 		    Versioning via CVS version stamps
**Setup-Macros:**       Set module parameters
-                                 Add modules into supermodules,
-                                 Write (super)modules to module lib
**Implementation:**    152 Modules, 14 Supermodules

_**Design Criteria:**_
-  definition of standard processing chains
- _ _ bookkeeping of module parameters during standard reconstruction
-   change of processing chains and module parameters without   recompilation

## TPhDSTs(P. Decowski, MIT, N.George, ANL , K.Gulbrandsen,MIT,M.Reuter,UIC, P. Steinberg, BNL)

**Tree based TPhDST underneath data file**
** ****Tree stores “SubEvents” = part of event including all pointer dependence              **
**             ****TPhEvent with selected info can be dynamically reconstructed**
** ****Tree stores “TagDB” = basic  types containing relevant physics   **
**   ****information **
**              ****drawable to perform first analysis / data selection**
**   ****about 10 % overhead in data volume**

- TPhDSTs(P. Decowski, MIT, N.George, ANL , K.Gulbrandsen,MIT,M.Reuter,UIC, P. Steinberg, BNL)

- _Design Criteria:_
-  **quickly read in partial events**
** ****selectable tags**
** ****keep original interface (TPhEvents) **

- _Old storage design:_
- Stream TPhEvents into file
- Read back using GetNextEvent()
-             slow with increased
-             data volume

## PHOBOS Online Data Flow

- PHOBOS
- VME/ROC

- RCF

**SLOW CONTROL**

- EventDistributor

- DataValidation

- Oracle

- RAID

- MasterAlarmer

- LabView

- ROOT

- OnlineMonitoring

- Calibration

- EventBuilder
- (PhatDAQ)

- DM

## PHOBOS Data acquisition - PhATDAQ (P.Sarin, MIT, A. Sukhanov,BNL)

**PHOBOS Data acquisition - PhATDAQ **(P.Sarin, MIT, A. Sukhanov,BNL)

- Trigger
- Silicon

- TOF

- VME

- Event
- Builder
- phatdaq

- Data
- mover

**RAID **

- 30 MB/sec

**UDP**

- Gigabit
- network

**TPhSubEventArrays:TObjArray**

- Root
- streamer
- 1CPU,2.25
- ~28 MB/s

- File

- (data transfer)

- 30 MB/sec

- PHOBOS

**memory**

- 1event = 300 kB

- 12ms

** **Currently** **Data transfer rates not limited by ROOT streamer!

- 3kB

- 30MB/s

## Online Monitoring - Design (B.Holzman, BNL, J.Katzy, MIT, G.van Nieuwenhuizen, MIT, P.Steinberg BNL) 

_**Online Monitoring Needs:**_
-  direct access to data from DAQ
-  CPU optimized data reconstruction
-  (fast) data analysis & warning mechanism
-  event display
-  histogram display with easy&fast access

_**Solution:**_
-  all data transfer via unix socket (poll/push)
-  distributed processing
-  separate clients for each controlling task
-  master alarmer for all (LabView&ROOT)
-   process status display
-  master GUI with navigator to access histograms
-   and choose from available event displays

## Online Monitoring – Implementation

- EventBuilder
- (PhatDAQ)

- TPhOnEventDistributor

- TPhOnDistClient
- (raw data)

- TPhSiliconDistClient
-     (silicon hits)

- TPhOnSocketDataFile

- TPhOnSocketDataFile

- Master Alarmer

- DAQ format
- TPhEvent
- Char. string

- TPhMonitorMod

- TPhMonitorMod

- Inherited classes
- Different instances of the same class

- TPhOnSocketDataFile

- TPhEventDisplay

- TPhOnSocketDataFile

- TPhOnlineGUI

## File management based on ROOT Daemon

**                          ****Have one central place where all nodes can find information**
**                          ****about the data file location.**
** ****DB :                **ASCII file, ORACLE
**Hardware:       **IDE disk
-                             $5k / TB  (“distributed IDE”)
-                             compare to >$ 30k / TB (one central RAID)
-  **Data Transfer: **rootd(aemon) transfers data to actual node with 4.5 MB/sec
-                              disk read/write 6-7 MB/sec (cpu bound)
-                              comparable with nfs
**User interface:  **Transparent to the user (TPhDST(“rootd:/....”)
-                              Database (RootDB) knows location of files (ASCII file, Oracle DB)
-  **Experience:**      12-node “pharm” used as production environment for last 12 month
-                              accessing 2.5 TB of files on disk
-                              moving to 80-node farm at RCF with ~ 9TB of disks accessible
-  **Outlook:**           still moving data to CPU – ideal application for PROOF

**File management based on ROOT Daemon**
**P.Decowski**

## Summary

- Phat is a framework build on top of ROOT
- Phobos DAQ and online system based on  ROOT
- Phobos’ DST structures TTree based
- rootd fast & cheap solution for disk management
- Have a look at  www.phobos.bnl.gov and
-     www.rhic.bnl.gov/~phobos/PhatSrc/USER_Index.html

## The Wish List

- PROOF functionality
- Poll/Select functionality in TSocket
- Allowing cross reference pointers
-     across branches in TTrees

## Benchmarking File I/O

- _The test:_   2300 events, read in a event loop, no selection,
-                 file access via rootd

- _The result_:                                                     Real Time(s)       CPU Time(s)
- Files containing TPhEvents:                             202                         133
- Files containing trees with SubEvents
- and SummaryParameters
- all Branches:                                                      305                          157
- Summary+Vertex+Trigger                                 50                            36
- Summary+Vertex+Trigger+Spectrometer        201                            93