% ------------------
S&C, Calo CCWG Mtgs
Digitization Notes
03.19.2025
% ------------------

# ePIC S&C Meeting
==================

## Electronics & Digitization, Jeff
-----------------------------------
- Digitization levels (moving roughly from most abstract/idealistic
  to most concrete/realistic)
  0. Start w/ electronics channels (CellID, local position, energy, etc.)
  1. Remove event ID, group into timeframes
  2. Discretize, apply thresholds (dynamic range, summing, etc.)
  3. Translate into local coordinates, find T0, etc.
  4. Apply charge sharing
  5. Convert to ASIC format (TOA, TOT, etc.)
  6. Apply preamp, shaping, mapping, etc.
  7. Aggregate signals
  8. Apply sensor response
- Slide 5: nice table of detector vs. ASIC and mapping out
  similarities/differences b/n detectors

Wouter
- Goal of meeting: identify where systems share hardware and make
  sure they're talking to each other, developing algorithms into
  common
Jeff
- Firmly agrees

## Software & Digitization, Dima
---------------------------------
- Our software stack
  - Built around intential DATA MODEL + modular algorithms
    - Big goal: reusability of algorithms! (Saves effort)
    - MUST be able to operate on BOTH simulation and data
  - Data model --> EDM4eic (and EDM4hep)
  - Algorithms --> EICrecon
- Need to be able support beam tests
  - Necessary to also build/maintain knowledge base
- Slide 2: nice flow charts of various digitization routines
  currently in EICrecon

Markus
- We want to emphasize here final few points of slides
  a. Ongoing efforts
  b. Needed models
  c. Commonality b/n systems
Elke
- Important thing to consider: aging of SiPMs (esp. for HCals)
  - Impacts thresholds, etc. --> crucial for test beam comparisons
  - How would this be implemented in digitization model?
Dima
- We could implement it as a sort of parameter, and set it
  to experimentally verified values
Markus
- dRICH team is looking into this
- Won't talk about it here, but want to provide an example
  of how to include noise model in simulation
Martin
- Slide 2: this has been discussed several times, but how do we 
  develop the API/Interface for getting data into these
  models?
Markus
- So question is "how to get raw data into model?"
  - Won't be focus here, but will be an important discussion
Jeff
- The raw hits need to make sure that they have the same content
  that the actual electronics will provide
- So will there be different types for different ASICS?
Dima
- Yes, currently all calos have the same type, but eventually
  will have differences
Martin
- Exactly, this is what I was wondering about
Jeff
- Will the raw hits have simulation information?
Sylvester
- No: that's the cutoff.
Wouter
- Raw hits should match the data exactly. No truth info!
Jeff
- So there's not a 1-to-1 mapping between rec-to-raw hits?
Sylvester
- Correct
Dima
- That's why readout channels are not the same as Cell IDs 

## Digitization Studies in the BIC, Minho
-----------------------------------------
- EIC simulation currently only records deposit of energy
  - We know how to convert this to No. of photoelectrons (Npes),
    though (w/ attenuation effect, etc.)
  - In each SiPM, Npes summed and Poisson smeared
    --> Reproduce binomial of SiPM surface
  - Then translate Npe into pulse
    --> Account for travel time to BIC
  - And extract ADC, TOA, TOT, etc.
- Plan
  - Utilize edm4hep::RawTimeSeries for measurement and
    true variables 

Jeff
- This time series has similar features to the actual
  CALOROC chip
Sylvester
- Yes, and there can be 5 samples of TOT
Norbert
- You'll have one TOA value, but the no. of TOT samples
  can be configured (up to 10 in CALOROC, up to 30 in
  HGCROC)
Sylvester
-  Is this event-by-event or run-by-run?
Norbert
- run-by-run
Sylvester
- And does it have phase information? We need that
  for time reconstruction
- Will the output time have the phase accounted for?
Norbert
- Yes
Sylvester
- So it will be the difference b/m the TOA value and
  the 1st ADC value
Norbert
- Confirms

- Now studying true vs. simulated pulses
  - Much better agreement of true vs. reco pulse height
    when TOA is accounted for
  - Using TOT value, true pulse height can be recreated
    exactly
- Attenuation correction derived by looking at e-going
  vs. p-going side of SiPM

Gerard
- When you don't have TOA, you can use the position from the
  AstroPix, right?
- That can be used in the reconstruction?
Minho
- For the attenuation correction? Yes,
- And yes on reconstruction
Gerard
- This is a nice simulation of the HGCROC. But shouldn't 
  we simulate the CALOROC 1B or 1A?
Sylvester
- Note we can use the AstroPix, but it's more complicated
  so we're waiting
Norbert
- As for type of ASIC to simulate, depends on length of
  signal (which needs to be studied)