********************************************************************** * * 13 oct 2000. HOW TO CREATE NTUPLES FROM THE OODB * 17 oct 2000 * ********************************************************************** Code must be run in some machine at CERN, where the DB is accessible, e.g. cmslx.cern.ch Code and documents are in /afs/cern.ch/user/p/paolocms/public/tb2000/scripts The content of the directory is: README.txt recompile.csh update.csh install.csh run.csh Four scripts are provided to install, execute, and recompile. In the file README.txt the instructions are given. 1) to install the code and create the environment: source ~paolocms/public/tb2000/scripts/install.csh dir_name To be done only the first time. 2) to run the code and create the file with ntupla for run nnn: (optional: the instruction setenv TBCARF_MAXEVENTS number_of_events sets the number of events to be processed. Already set at number_of_events = 1000000) setenv TBCARF_RUNNUMBER nnn $AREA_BIN/Linux__2.2/h2btibch 3) after a logout, to recreate the environment execute source ~paolocms/public/tb2000/scripts/run.csh dir_name Then goto point 2) 4) to recompile the code if you have changed it: source ....../update.csh or ( after logout-login ) source ....../recompile.csh dir_name For any problem, questions, details etc. don't hesitate to contact Paolo Ronchese (paolo.ronchese@pd.infn.it, phone +39 049 8277050). The output is the file h2bti.ntup which contains a ntuple with idh=2. The events are alredy corrected, when possible, for the bug which affects the TDC data. The flag tdcflag identifies the events which have been corrected. The description of the ntuple content is given below. ----------------------- file README.txt ------------------------------------- PROGRAM FOR ANALYSIS OF MUON TB 2000 DATA The system has been tested on Linux. Four scripts are provided, they are to be "sourced" and not simply run : install.csh dir_name to be run first time to create a directory where code will be copied and compiled and set up all needed environment variables. The directory will be named according to the given parameter ( dir_name ) , but only relative paths are accepted. So before running the user must cd to some area with enough disk space and run the script from there. Of course it may be run more times to create several directories, but it's advisable to logout-login before re-running it. run.csh dir_name to be run to recover from a previous session all environment variables needed to run. The parameter is the name of the previously created directory ( absolute path may here be used ) It shouldn't be run more than once in a session ( or after running install.csh ), as env. variables are appended again and again, possibly causing troubles. recompile.csh dir_name to be run to recompile after any code change. All previous compilations are cleaned up. Same advice as before about dir. name and logout-login before running. update.csh to be run to recompile without logging out-in. No cleanup is done. To actually run the executable the commands setenv TBCARF_RUNNUMBER nnn $AREA_BIN/Linux__2.2/h2btibch are to be used; a ntuple file h2bti.ntup will be created in the current directory. ---------------------------------------------------------------------------- paw> nt/print 2 ****************************************************************** * Ntuple ID = 2 Entries = 51238 TestBeam-BTI-ntuple ****************************************************************** * Var numb * Type * Packing * Range * Block * Name * ****************************************************************** * 1 * I*4 * * * GENERAL * Run * 2 * I*4 * * * GENERAL * Spill * 3 * I*4 * * * GENERAL * Event * 1 * U*4 * 16 * [0,65535] * TRTIME * trigT * 1 * I*4 * * [0,127] * DTBX * Nhits * 2 * U*4 * 3 * [0,4] * DTBX * hlay(Nhits) * 3 * U*4 * 6 * [0,63] * DTBX * htube(Nhits) * 4 * U*4 * 16 * [0,65535] * DTBX * htime(Nhits) * 5 * U*4 * 1 * [0,1] * DTBX * hflag(Nhits) * 1 * I*4 * * [0,15] * BTI * Nbti * 2 * U*4 * 3 * [0,7] * BTI * bqual(Nbti) * 3 * U*4 * 4 * [0,15] * BTI * bnum(Nbti) * 4 * U*4 * 1 * [0,1] * BTI * bcod(Nbti) * 5 * U*4 * 8 * [0,255] * BTI * bslot1(Nbti) * 6 * U*4 * 8 * [0,255] * BTI * bslot2(Nbti) * 7 * I*4 * 8 * [-63,64] * BTI * bk(Nbti) * 8 * U*4 * 7 * [0,64] * BTI * bx(Nbti) * 1 * U*4 * 16 * [0,65535] * SCTIME * scintT * 1 * I*4 * * [0,200] * BCH * Nbch * 2 * I*4 * * * BCH * chtime(Nbch) * 3 * I*4 * * * BCH * chamber(Nbch) * 1 * U*4 * 2 * [0,2] * FLAGS * tdcflag * 2 * U*4 * 2 * [0,3] * FLAGS * btiflag ****************************************************************** * Block * Entries * Unpacked * Packed * Packing Factor * ****************************************************************** * GENERAL * 51238 * 12 * 12 * 1.000 * * TRTIME * 51238 * 4 * 2 * 2.000 * * DTBX * 51238 * 2036 * Var. * Variable * * BTI * 51238 * 424 * Var. * Variable * * SCTIME * 51238 * 4 * 2 * 2.000 * * BCH * 51238 * 1604 * Var. * Variable * * FLAGS * 51238 * 8 * 1 * 8.000 * * Total * --- * 4092 * Var. * Variable * ****************************************************************** * Blocks = 7 Variables = 23 Max. Columns = 1023 * ****************************************************************** ------------------------- GENERAL -------------------------------- Run = run number Spill = spill number as it is written on the DB. It DOES NOT start from 1. However it is in sequence. Some spills are missing in the OODB. Event = number of event in the spill. It starts from 0 at the beginning of each spill. ------------------------- TRTIME --------------------------------- TrigT = time (in TDC units) of the first BTI internal clock (first front) after event general trigger (for BTI trigger Syncronization) ------------------------ DTBX ------------------------------------ Nhits = total number of hits in the event in the TDC hlay = number of layer (1-4) htube = number of cell htime = drift time (in TDC units) hflag = 0 = first front 1 = second front NB: htube=20 and htube=26 are not present (they are scintT and trigT) --------------------------- BTI ----------------------------------- Nbti = total number of triggers from the BTI bqual = strobe of trigger data (for TRACO input) 1 = left TRACO 2 = central TRACO 4 = right TRACO bnum = number of BTI (1-6) bcod = trigger quality. 1 = High trigger (HTRG) 0 = Low trigger (LTRG) bslot1 = number of slot (in 12.5 ns unit) when the k-parameter (bk) has been output by BTI bslot2 = number of slot (in 12.5 ns unit) when the x-parameter (bx) has been output by BTI (if ok it should be shifted by 1 slot with respect to bslot1) bk = k-parameter ("angle") bx = x-parameter ("position") ---------------------------- SCTIME --------------------------------- scintT = time of one scintillator of the beam trigger (only the first hit) --------------------------- BCH ------------------------------------- Nbch = total number of hits in the Beam Chambers chamber = number of the TDC channel chtime = time of the hit (in BC's TDC units) NB. chamber = 120 is an internal event counter. It was not reset at the beginning of the run. It goes from 0 to 1023 then restarts from 0 and so on. chamber = 121 is equal to the number of channels with data for the current event. It has not been written in the ntupla but used to verify the internal consistency of BC data. (see also html://warco.pd.infn.it/cms/testbeamQ4/BC.ps) ---------------------------- FLAGS ---------------------------------- tdcflag = 2 = (BAD) original event but with wrong sequence (not correctable) 1 = (OK) event identified with bug and corrected for the bug 0 = (OK) original event identified as ok. btiflag = 0 = OK 1 = sequence error in bslot1-bslot2 (it never occurs) ----------------------------------------------------------------------