Presentation is loading. Please wait.

Presentation is loading. Please wait.

Beam Test Offline Code Jianchun Wang Syracuse University 01/17/02 Outline  Status of the code  Function modules  Discussion topics.

Similar presentations


Presentation on theme: "Beam Test Offline Code Jianchun Wang Syracuse University 01/17/02 Outline  Status of the code  Function modules  Discussion topics."— Presentation transcript:

1 Beam Test Offline Code Jianchun Wang Syracuse University 01/17/02 Outline  Status of the code  Function modules  Discussion topics

2 01/17/02Jianchun (JC) Wang2 Status  All main functions are done, but need more testing and polishing.  The code was tested with Syracuse computers (Alpha with Linux and OSF1) during development.  The code was submitted to CVS this week, we need to decide whether keep it as a new release or a new project (Rob and Lynn will tell us about CVS).  The code was tested on fnsimu1 and fsgi03.  GNUmakefile.standalone are used. We need to work out GNUmakefile.  We need to solve some issues and decide on what else functions should be included.

3 01/17/02Jianchun (JC) Wang3 General Description 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 track summary file for further study MC Simulation Generate tracks, calculate intersection points on each plane, simulate charge collection and convert it into ADC counts, write out in similar format as real data plus the track information 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

4 01/17/02Jianchun (JC) Wang4 Tasks tb_controldata_in_filedata_out_filehbk_filerun_id Raw dataeventrun01234.dat-run01234.hbk- MC dataeventmcd01234.dat-mcd01234.hbk- Raw data + summarysummaryrun01234.dattrk01234.datrun01234.hbk- MC data + summarysummarymcd01234.dattrk01234.datmcd01234.hbk- Alignmentaligntrk01234.dat-aln01234.hbk- MC generationmcgen-mcd01234.datmcg01234.hbk1234 Tasks are selected by tb_control and information inside input data file Names of output data file and histogram file can be defined or with default

5 01/17/02Jianchun (JC) Wang5 Function Modules  Data encode and decode  Geometry manipulation  ADC charge conversion  Cluster formation and conversion into coordinates  Track formation  Track fitting with Kalman filter  MC Simulation  MINUIT alignment ( a.k.a. Auto alignment )  CWN ntuple  Parameter control through name list read

6 01/17/02Jianchun (JC) Wang6 Data File Format A: Header 1.RAWD, SIMU, TRAK 2.Length of the block 3.Version 4.Run ID 5.Number of planes 6.Time Tag 7.… other comments B: Data Hits 1.Length of data block 2.Cell 1 data 3.… 4.Length of data block C: MC Track 1.Length of the block 2.Number of tracks 3.Local X for plane 1 4.Local Y for plane 1 5.… 6.Length of the block Data format for one cell 1111 pppp 000c cccc rrrr rrrr aaaa aaaa D: Track Summary 1.Length of the block 2.Plane ID 3.Local X for plane 1 4.Local Y for plane 1 5.Error on X for plane 1 6.Error on Y for plane 1 7.… 8.Length of the block  Raw data from DAQ (RAWD): ABBBBBB…  MC data generated (SIMU): ABCBCBC…  Selected track summary (TRAK): ADDDDDD…

7 01/17/02Jianchun (JC) Wang7 Sample of Data File 0000000 554d4953000000060000000100000384 “SIMU”Block length = 6VersionRun id: 900 0000020 000000063c388dd200000007f1000b07 6 planesTime tagBlock length = 7Hit (1, 0, 11, 7) 0000040 f2000b01f3000b07f4001105f4001206 Hit (2, 0, 11, 1)Hit (3, 0, 11, 7)Hit (4, 0, 17, 5)Hit (4, 0, 18, 6) 0000060 000000070000000f00000001be76a7a4 Block lengthBlock length = 15Number of tracksLocal coordinate X1 0000100 be5e624dbe790583be7654a5be76e45d Y1X2Y2X3 0000120 be69a4e8be805307be6b1209be76f5bd Y3X4Y4X5 0000140 be761162be76a882be6151c20000000f Y5X6Y6Block length …… With command: od –X mcd00900.dat

8 01/17/02Jianchun (JC) Wang8 Endian on Different Platforms  Within a given 16- or 32-bit word, bytes at lower addresses have higher significance (big_endian)  Most processor use big_endian, some use little_endian, very very few use middle_endian  The machine we used for DAQ, and most of machines that we are going to use for analysis are big_endian  In order that the data can be used for both big_endian and little_endian machine, I add byte swap in data reading and MC data writing  It was tested standalone, not with real code yet. And I need to work on GNUmakefile ( Most functions associated with coding is in testbeam_dio.c )

9 01/17/02Jianchun (JC) Wang9 Geometry Manipulation  The geometry manipulation has very little change.  Initial geometry information is read in from geometry file (tb_geometry.dat).  Parameters are derived for easier conversion between world coordinate (WC), and local coordinate (LC).  In MINUIT fit, fit parameters are connected with selected geometry parameters. Each time the fit parameters changed, the derived parameters recalculated.

10 01/17/02Jianchun (JC) Wang10 ADC Charge Conversion  Testbeam 2000 use curve for FPIX0, and one set of 4 thresholds for all FPIX1 cells.  Testbeam 2002 use calibration for each cell, and directly use threshold value instead of curves.  Each plane has its own sixy_adc_file name.  The ADC information is also used in the MC simulation where charge in pixel cell is converted to ADC value.

11 01/17/02Jianchun (JC) Wang11 Pixel Cluster  Testbeam 2000 uses Penny’s cluster formation initially wrote to work with simulation package we developed at Syracuse. The eta calculation using output from her code in 2-column case is wrong.  Testbeam 2002 imported the one I use for standalone simulation.  Cluster center of gravity is calculated and converted into local coordinate where the orientation of row and column is considered and can be easily controlled.  World coordination is calculated here so track formation can use more precise position. In testbeam 2000, we use local coordinate shift with the center for track formation.

12 01/17/02Jianchun (JC) Wang12 Track Formation  Track formation is kept in same style.  Use hits in two x seed planes to make a path, for other planes choose the closest hit (within a cut).  Y information currently is not used.

13 01/17/02Jianchun (JC) Wang13 Track Fitting  Rob had updated Kalman filter code to work with current version MCFast.  It can treat a pixel hit as two strip hits, and only fit on hits with good resolution.  It performs fit and derives residual with or with out the hit, and also provide the chi2 of the fit.  In MINUIT alignment, strip-equivalent is enforced.  The interface subroutine is kept in same style, modification are done mainly associated with local coordinate.

14 01/17/02Jianchun (JC) Wang14 MC Simulation  One or more tracks are generated (with no multiple scattering at this moment).  Intersection with each plane is calculated.  Charge generation, noise simulation, ADC conversion were imported from standalone simulation with modification.  Hits are encoded and written out.  The electric field, charge mobility, diffusion, effects of magnetic field are calculated at initialization.

15 01/17/02Jianchun (JC) Wang15 MINUIT Alignment  This is to determine the real geometry configuration by minimize the sum of chi2 from many track fit.  CPU is a big issue here since we need to perform Kalman filter many many times.  It deals with summary of pre-selected tracks.  It provides interactive mode although it can also run in batch mode.  Due to CPU limitation, only small portion of all geometry parameters can be FREE at a time. This is controlled in mn_skip.dat file, with very simple format.  The “best” geometry is written in mn_geometry.dat with same format as tb_geometry.dat.

16 01/17/02Jianchun (JC) Wang16 Histogram ID 11100 Geometry parameters 11200 Geometry parameters after alignment 11300 Global parameters and Detector parameters 11400 Simulation parameter maps 11500 Charge simulation parameters 21000 Simulated track and hits 31000 Track summary 32000 MINUIT fit 41000 Hit information 42000 Cluster information 43000 Difference of reconstructed hit position and generated position 51000 Form track 61000 Kalman filter

17 01/17/02Jianchun (JC) Wang17 Column Wised Ntuple  CWN has many advantages over RWN especially when the number of element is uncertain.  With CWN, when we add more pixels or shift to study other plane, we need only small modification on index. Benefit mentioned in Rob’s message a) does not waste disk space on information which is absent for this event ie you can declare very large arrays for hits but it only uses disk space for the ones which are present. b) faster interactive response if you are only referencing a small subset of the ntuple variables. This comes partly from a) but also from a "smarter" layout of how data is stored on disk. c) much easier maintenance when you change the number of detectors

18 01/17/02Jianchun (JC) Wang18 Variables in CWN Track Block ievt, ntrks, n_klm_ok, itrk, klm_ok, x_int, x_slp, y_int, y_slp, chisq, cl, ndof, fixyslp, yclass, nplanes Plane Block (ngeom elements except for ngeom) ngeom, itype, iort_row, nclus, iclus, npix, nrow, ncol, rowb, colb, rowq, colq, eta, sumq, xg, yg, xl, yl, xsig, ysig, xw, yw, zw, rxi, srxi, spxi, ryi, sryi, spyi, rxo, srxo, spxo, ryo, sryo, spyo, xf, yf, rhof, xslp, yslp, infitx, infity Hit Block (nhit elements except for nhit) nhit, ipln, icol, irow, iadc, icls, qval

19 01/17/02Jianchun (JC) Wang19 Name List Variables $CONTROL max_evts = 10000 tb_control = 'event' run_mc = 999 ncycle = 1000 binary_weights = 0 override_seeds = 0 xref1o = 1 xref2o = 2 yref1o = 5 yref2o = 6 dx_cuto = 0.06 y_slp_seed = 0.000055 max_miss_planes = 1 drop_plane(9) = 1 $END $DETECTOR sixy_carrier(1) = 2 sixy_ort_r(1) = 1 sixy_ort_c(1) = 1 sixy_ort_z(1) = 1 sixy_u_app(1) = 140 sixy_u_dep(1) = 105 bfield_x(1) = 0.0 bfield_y(1) = 0.0 bfield_z(1) = 0.0 sixy_thick(1) = 280 sixy_siz_r(1) = 50 sixy_siz_c(1) = 400 sixy_noise_val(1)= 0.0 sixy_gain_err(1) = 0.0 sixy_sig_cpl(1) = 0.0 sixy_thr_val(1) = 0.0 sixy_thr_dsp(1) = 0.0 sixy_thr_err(1) = 0.0 $END $FILES geom_file = 'tb_geometry.dat' data_in_file = ' ' data_out_file = ' ' hbk_out_file = ' ' sixy_adc_file(1) = 'adc_plane1.dat' $END

20 01/17/02Jianchun (JC) Wang20 To Be Discussed  Data format and byte swap  CVS and terminology (Rob and Lynn)  Do we need to include SSD?  Column wised ntuple  ???

21 01/17/02Jianchun (JC) Wang21 Analysis Flow 1. call read_namelist 2. status = open_old_file(data_in_file) 3. status = read_data_header(run_tmp, num_tmp, type_tmp) 4. call histo_init(hbk_out_file) 5. status = read_geometry(0) 6. call fill_derived_geom call sixy_geom_hfill(11100) 7. call sixy_detector_parameter call sixy_dpar_hfill 8. if ( want_summary ) status = open_new_file(data_out_file) 9. if ( want_summary ) status = write_data_header(runId, nPlanes, runType) 10.10 status = read_event(1) 11. if ( status.eq. 0 ) then 12. call sixy_adc2q 13. call form_clusters call hit_hfill 14. call form_tracks 15. call fit_tracks call fit_hfill 16. call fill_ntuple 17. if ( want_summary ) call mn_write_track 18. if ( not_enough ) goto 10 19. endif 20. call plane_eff 21. output histogram

22 01/17/02Jianchun (JC) Wang22 MC Generation Flow 1. call read_namelist 2. call histo_init(hbk_out_file) 3. status = read_geometry(0) 4. call fill_derived_geom call sixy_geom_hfill(11100) 5. call sixy_detector_parameter call sixy_dpar_hfill 6. status = open_new_file(data_out_file) 7. status = write_data_header(run_num, n_pix_planes, type_tmp) 8. call ranecu_init 9. call set_beam_properties 10. call sixy_drift_map call sixy_map_hfill 11. call sixy_charge_parameter 12. do evt_num = 1, max_evts 13. call mc_track 14. call mc_signal 15. call mc_write call mc_hfill 16. enddo 17. output histogram

23 01/17/02Jianchun (JC) Wang23 Alignment Flow 1. call read_namelist 2. status = open_old_file(data_in_file) 3. status = read_data_header(run_tmp, num_tmp, type_tmp) 4. call histo_init(hbk_out_file) 5. status = read_geometry(0) 6. call fill_derived_geom 7. call sixy_geom_hfill(11100) 8. call sixy_detector_parameter 9. call sixy_dpar_hfill 10. call mn_prepare_fit 11. call mn_read_track 12. call mn_fit_geo 13. call sixy_geom_hfill(11200) 14. output histogram


Download ppt "Beam Test Offline Code Jianchun Wang Syracuse University 01/17/02 Outline  Status of the code  Function modules  Discussion topics."

Similar presentations


Ads by Google