# Presentation: 439245

## TrigSim Data Flow

- L1/L2
- Collector

- L1 Processors

- L2 Pre-
- Processors

- L2 Global

- Raw Data
- Chunk

- Raw Data
- Chunk (Copy)

**Copy and**
**Add to**
**Raw Data**
**Chunk**

**MBT Channels**

- UDC/Direct access

**Raw data**

**Level 3**

- R. Moore

## Inputs to L1

**L1 inputs from Raw Data Chunk**
**Possibly use Unpacked Data Chunks but not required**
**Alternative route:**** read Raw Data Chunk directly (I/Ogen)**
**L1 framework inputs are specific L1 internal format**
**L2 workers will all use I/Ogen to access data**
**Only used in emulation mode w/o L1 running**
**One basic package can work for all “simply” stored inputs**

- R. Moore

## L1 Outputs to L2

**ALL L2 inputs are MBT channels**
**L1 processors are **_**REQUIRED**_** to fill MBT channels to send to L2**
**Format must be same as online L2 inputs**
**i.e. L1 processors fulfill their full online functionality**
**SLICs/STT very similar to L1 processors**
**Input via Raw/Unpacked DC**
**Output via MBT channel**

- R. Moore

## L1 Example

**// Example MBT Filler**
**Result MyClass::ready(****DataStore &ds****) {**
** ****// Create an MBT channel which can**
** ****// be filled with up to 40 Electrons**
** ****FillableMBTChannel<****Electron,40****> eleMBT;**
** ****Electron *myele=****new**** Electron;**
** ****// Fill myele with some data**
** ****myele->setPhi(****0.1****);**
** ****myele->setET(****100.****);**
** ...**
** ****// Add myele to the MBT channel**
** ****eleMBT.addObject(****myele****);**
** ****// Create a data broadcast class**
** ****DataBroadcast *output=**
**                     ****new**** DataBroadcast;**
** ****// Pack the MBT channel into the class**
** ****output.store(****eleMBT****);**
** ****// Add output to data store**
** ****produceItem(****ds,output,”l2output”****);**
** ****// Return successfully**
** ****return SUCCESS;**
**}**

- R. Moore

## L1/L2 Outputs to L3

- All L1/L2 framework packages produce an “L3Output” object
- Contains packed, raw data output written to VRB/VBD
- Generated either by
- I/Ogen (recommended)
- all L2 uses this method
- Hand-coded routines
- for those really strange formats I/Ogen can’t handle
- Packing routine should be coded to I/Ogen interface
- Will make UDC interface easy

- R. Moore

## L1/L2 Collector

- Configured by a crate readout list from COORsim
- Each incoming raw data packets assigned to a L3 crate
- Crates for new Raw Data Chunk extracted from following sources _(in order)_
- L1/L2 Raw Data packets
- Old Raw Data Chunk
- New, dynamically allocated, empty crate

- R. Moore

## L1/L2 Collector

- Has to copy Raw Data Chunk
- “chunks are immutable”
- Does no packing
- All input data comes in pre-packed form
- Copying only done when Chunk added to event
- Chunk built from a system of L3 crate objects
- Each L3 crate needs a block or raw data (pointer)
- Automatically handles VBD/VRB headers
- Thank you Gordon!

- R. Moore

## L1/L2 Collector

**L1/L2 Collector**

- Crate 1

- Crate 2

- Crate 3

- Crate 4

- Crate 5

- Crate 1

- Crate 3

- Crate 4

- Crate 2

- Crate 4

- Crate 5

- New Raw Data Chunk

- Old Raw Data Chunk

- Create new, empty crate

- L1/L2 Outputs to L3

- Crate 1

- Crate 2

- Crate 3

- Crate 4

- Crate 5

- COORsim Crate List

- R. Moore

## Current Status

**Few days away from working L1/L2 framework**
**Basic functionality only**
**Uses Data Flow framework thanks to Jim Kowalkowski**
**Next steps (after release)**
**Insert L1Cal, L2Cal & Global**
**Add L3 output mechanism**
**Add L2Parser Interface to allow fully functional Global**

- R. Moore

## How I/Ogen Works

**I/Ogen Data**
**Class**

***Loose***
***Memory Map***

**Defined**
**Memory Map**

- (Normal C++ class)

**I/Ogen IO**
**Class**

**Un/pack**

**Configuration**
**File**** [l2io.iogen]**

**Python Script**

**Compiled**

**Not compiled**

- R. Moore

## Offline Design

**Event**

- L2 Global

- L1/L2
- Collector

- L1 Processor

- L2 Pre-Proc

- SLIC

- L1 Processor

- L2 Pre-Proc

- L2 Pre-Proc

- Level1
- Framework

- R. Moore

## Data Flow Types

**Event**

- L2 Global

- L1 Processor

- L2 Pre-Proc

- SLIC

- L1 Processor

- L2 Pre-Proc

- L2 Pre-Proc

- Level1
- Framework

**Data**
**Access**

**MBT**
**Channel**

**L1**
**Framework**
**Data**

- R. Moore