# Presentation: 398096

## Update on TOFSIM Status

**Bockjoo Kim**
***Seoul National University***

**21 Nov 2002**
**MC Meeting**

_**Outline**_

**TOFSIM Documentation**
**Data and MC Comparison**
**Time Resolution and Pull Dist.**
**TOF Simulation How-To**
**Summary**

## TOFSIM Documentation

**TOFSIM is documented in CDFNote6120 and what is presented at April MC workshop**
**
**The note focuses on how the parameterization is done**
**(ADC parameterization and twalk)         ****(TofEventdata.cc does the parameterization)**
**USRTUNED parameterization uses calibration files****                       ****(TofSimConfig.cc reads all the parameters from files)**

## Simulation Options

- SIMPLE
**Use the simple parameterization**
**Good for quick test, e.g., material check, synched with rec.**
- MODERATE
**Same as SIMPLE but with an analytic time-walk**
** ****Not well tested**
**USRTUNED**
**Use calibration files and can be used for analysis**
**But it is not in good shape yet, not well synched with rec. yet**
- (DBFILE) In preparation
**DB for time and File for ADC**
**DB reading capability is implemented**

**TOFSIM Documentation...continues**

## Option USRTUNED:Time to TDC

-  **t = t****0offset**** – (t****hit**** - t****light ****– t****walk****)**
**    ****t****hit**** : Bar hit time (Geant)**
**    ****t****0offset**** :measured during calib.**
**    ****t****light ****=**** ****±****z****hit****/****c****barhit****(+ for east – for west)**
**    ****t****walk****=**** ********log(Q(z)/Q****mip****(z))**** –**** ********(log (Q(z)/Q****mip****(z)))****2**** **
**Q****mip**** (z) = ****Q****0E,W**** ****e****- (L/2∓z )/********+**** ****a****z****2**
**Q(z) = Q****Landau**** * Q****mip**** (z)**
** ****t****smeared**** = ****t** **±**** (100 + 0.4*dhit** ) (ps)
-  **TDC** = (1+ e- **t****smeared** /)**t****smeared**

**TOFSIM Documentation...continues**

**From calibration files**

## Underlying concept for ADC Parameterization

- Charged particle

- TOF Bar

- Light

- Landau Dist (no z dependence)

- Charged particle

- Light

- ADC(West)

- ADC(East)

- ADC =

- Electronics

- Landau from light

- Gaussian from electronics

- We measure

- Width in log(ADC(East)/ADC(West)) vs z

- Landau width from Landau fit - Width in log(ADC(East)/ADC(West)) vs z

- Electronics resolution  Width in log(ADC(East)/ADC(West))

## Option USRTUNEDE to ADC

- Effect of photon statistics
**Q****Landau**** = ********E/8*********(********Landau****)**
- ******Landau**** = sqrt( (********Q0E**** ****/****Q****0E****)****2 ****+ (********Q0W**** ****/****Q****0W****)****2 ****–****0.5****(********r****)****2****)/sqrt(2)**
-     **Q****0E,W ****,********Q0E,W** :Peak and width of the⊥MIP’s ADC response
- **********r** : electronics resolution from residual) of **ln(Q****E****/Q****W****) vs z**
*z*-dependence
**Q(z) = Q****Landau**** * ****Q****0E,W**** ****e****- (L/2∓z )/********+**** ****a****z****2**** **
**Q****0E,W ****,******and **a** are channel or bar dependent
- Electronics resolution
-     **ADC = Q(z) ****± (****Q****0E,W**** ********r ****)/sqrt(2)**

**TOFSIM Documentation...continues**

**A fudge factor**

## option DBFILE:Like Reconstruction

- Reconstruction gets TOF from
- TOF = toff – tTOFD – twalk – tlight-(tres)
- (Is this true?)
- In simulation we can put the effects as
- tTOFD = toff - thit– twalk – tlight
- For ADC, we should use USRTUNED parm. because there are no parameters for ADC in DB.
- If everything is perfect, TOF = thit

## Example tcl (simulation part)

**module talk SimulationControlMod**** DetectorMenu****     simulateTof set t ; simulateCot set t**** exit**** add Tof3Pack TofDigi3Pack TofGroup ; add TofBar TofDigiBar   TofGroup**** add CotSuperLayer CotDigitizer CotGroup**** ConfigMenus****    CotGroup_CotSuperLayer****      DriftModel set Garfield****      CreateMCOT set false ; CreateCOTM set true****    exit****    TofGroup_Tof3Pack****      globalChannelCalibFiles set TofSim/test/pmt_channels.dat \****      TofSim/test/pmt_voltage.dat TofSim/test/bad_channels.dat \****      TofSim/test/pmt_parameters.dat TofSim/test/calib_1e41e.dat \****      usrChannelCalibFiles set TofSim/standalone/TofChannels_832x.dat****      level set DBFILE****      tacsimr set 135602 ; tacsimv set 1        ****	****; tacsims set RAW          ; pedsimr set 135602 ****      pedsimv set 1          ; pedsims set RAW          ****	****; spdsimr set 135612      ; spdsimv set 1****      spdsims set RAW   ; attsimr set 135612           ****	****; attsimv set 1                  ; attsims set COMPLETE****      offsimr set 135612  ; offsimv set 1                    ****	****; offsims set COMPLETE; wlksimr set 135612****      wlksimv set 1          ; wlksims set COMPLETE****	****; rsdsimr set 135612        ; rsdsimv set 2 ****      rsdsims set RAW    ; ressimr set 135612   ****	****; ressimv set 2                 ; ressims set RAW****    quit ; quit; quit**

**Databse Specification**

**Files for parameters**

**Simulation OPTION**

**Notes:**
. One can specify SIMPLE, MODERATE, USRTUNED, and DBFILE for level.
. Database specification is necessary only for option DBFILE
. Sim, Rec, and Anal must use same level for MC

## Reconstruction Options

- Simple Pulse Finder
- Track extrapolation : Geometric
- Matching : TLR method
- T0 Calculation : Negative Log Likelihood
- Calibrator Type:
- Dummy SIMPLE (sim-rec-synched )
- Sim        USRTUNED (in preparation)
- Test       DBFILE (in preparation)

## PT distribution

**Blue:J-stream data**
**Red :E-stream data**
**Black: MC**** **

**MC:****	****5000 Pythia B-Bar**
**	****Tracks which hit only single bar**
**	****Basic track cuts, |d0|<1, |Z0|<75, and p****T****>0.35**
**	**

**Notes:**
On susy06, pt_streams.C

## USRTUNED:Time distribution

**Red :Express-stream data**
**Black: MC(option USRTUNED(=calib. from file) )**** **

**T west**
**Walk cor**

**T east**
**Walk cor**

**Notes:**
Data :Test Calibrator and MC :Sim Calibrator
Data :ClosestZ and MC :TLR associator
Data: GeometryModel Aligned and MC : GeometryModel Survey
If I use USRTUNED and ClosestZ associator, the agreement becomes slightly better. 
On susy04, t2002_11_19_mc_data/time.USRTUNED.TLR.C

## USRTUNED:ADC distribution

**Blue :Store832**

**Red :E-stream data**
**Black: MC**** **

**Notes:**
Data :Test Calibrator and MC :Sim Calibrator
Data :ClosestZ and MC :TLR associator
Data: GeometryModel Aligned and MC : GeometryModel Survey

## DBFILE:Time Distribution

**Red :Express-stream data**
**Black: MC(option DBFILE(=calib. from DB+file) )**** **

**This is a work in progress.**

**Notes:**
Data :Test Calibrator and MC :Test Calibrator
Data :TLR and MC :TLR associator
Data: GeometryModel Aligned and MC : GeometryModel Aligned
Also in the TofChannels, envPtr -> monteFlag() is commented out.

## DBFILE:Time Distribution/offset

**With MC time offset –3.2 ns.**
**But the reason is unknown.**

## DBFILE:ADC distribution

**Red :E-stream data**
**Black: MC**** **

## Measured T0 

**This needs to be investigated!**

**Red :E-stream data**
**Black: MC**** ****option USRTUNED**
**Blue:MC option DBFILE**

**Notes:**
On susy04, t0.C is used

## Measured TOF

**This needs to be investigated!**

**Red :E-stream data**
**Black: MC**** ****option USRTUNED**
**Blue:MC option DBFILE**

**Notes:**
On susy04, tof.C is used

## TOFSIM usage webpage

- See TOFSIM webpage
- In the web, I will put the standard tcl files used for this presentation

## Summary

- A very crude version of TOFSIM CDF Note is prepared
- Simulation option DBFILE is added to use consistent parameters between Sim. and Rec.
- Various simulation options show discrepancies between MC and DATA
- T0 and TOF distribution should be understood