Title: Offline Code for Next Beam Test
1Offline Code forNext Beam Test
2General Programs
MC Simulation Generate tracks, calculate
intersection points on each planes, simulate
charge collection and convert it into ADC counts,
write out in similar format as real data plus the
track information for later study Data
Analysis Read in real data (include MC track),
convert ADC counts into charge, form cluster and
convert into coordinates, form rough track and
perform Kalman filter, write out ntuple and/or
track summary file Auto Alignment Read in track
summary file (local coordinates and resolutions),
go through MINUIT with geometry conversion, for
different geometry calculate chi2 for each track,
minimize the sum of chi2 and write out new
geometry
3Initialization
- Read file names, program control (Simulation,
Data_event, MC_event, Alignment), and other
control information - Read geometry file, derive geometry parameters
(SDMA) - Book histograms (SDMA)
- Read ADC gain curve, dead or noisy cells (SDM)
- Input bias voltage, depletion voltage, noise,
threshold, dispersion, beam parameters, prepare
for simulation (S) - Open data file and prepare for event read in (DM)
- Read in track summary file, prepare for fit (A)
4Simulation
- Simulate a track or several tracks with given
beam condition (P, sP, beam size, beam tilt
spread) - Calculate intersection points in local system
- Charge deposition simulation
- Charge read out simulation (Noise, threshold,
dispersion, ADC curve) - Write out event information ( Cell ID, ADC
counts, track information )
Tracks
Events
Planes
5Data Analysis
- Read in event, convert ADC into charge
- Clustering
- Convert into location in local system
- Apply ? correction
- Form very loose tracks
- Fit tracks (Kalman Filter)
- Fill ntuple
- Write out selected tracks into summary file
(optional)
Planes
Events
Tracks
6Auto Alignment
- Read in track summary file and prepare for the
fit - Convert geometry parameters into MINUIT
parameters and initialize them - Convert MINUIT into geometry parameters
- Fit track with Kalman filter
- Calculate chi2
- Sum up chi2 over all tracks
- Fill histogram and write out new geometry
parameters
MINUIT Calls
Tracks
7Ending the Program
- Output histogram(SDMA)
- Output new geometry parameters (A)
- Close all opened files(SDMA)
8Need to Be Answered
- Data file format
- Event display
- Any other tasks ?
9Possible Event File Format
- RAWD or SIMU
- Version
- Run ID
- Time Tag
- Length of header (N)
- other comments
Header
Data format for a cell 1111 pppp 000c cccc rrrr
rrrr aaaa aaaa
Raw Data
More information Pedestal Run ID ? Event ID ? ??
- Length (N)
- Local X for station 1
- Local Y for station 1
MC Info
? ? ?