Ana səhifə

This file: /us11/safe/rich/phynix/rich doc $Id: rich doc,v 8 1995/11/17 09: 22: 30 ulm Exp $ Version history 91-11-07 ges 1 production version 91-12-11 ulm 2


Yüklə 36.49 Kb.
tarix14.06.2016
ölçüsü36.49 Kb.
The RICH package in Phynix - technical documentation ==================================================== Ulrich Mueller, 92-04-27 (last updated 94-08-04) >>> this file: /us11/safe/rich/phynix/rich.doc $Id: rich.doc,v 3.8 1995/11/17 09:22:30 ulm Exp $ ***** Version history ***** 91-11-07 ges 1 production version 91-12-11 ulm 2.0 new likelihood method (using radii of hits instead of search bands), new N0 calibration, changed output format 91-12-28 ulm 2.1 minor bug fixes -> Phynix v7, v7.1, v7.2 92-02-12 ulm 2.2 ring centre fitting, output backgr. dens. for calibration, changed some histos 92-03-19 ulm 2.3 sped up cluster finding, bug fix in ffclbr 92-04-14 ulm 2.4 use only track type 0 -> Phynix v8, v8.1 92-05-01 ulm 2.5 allow reading of calibsum.dat, but calibration switched off. output machno write likmet instead of version into ivsric -> Phynix v7.4, v8.2 92-05-20 ulm 2.6 introduced switch for number of hypotheses, added track types 1 and -1, bug fix in inimir -> Phynix v9.1, v9.2 92-08-08 ulm 2.7 removed usage of ptrack in rcpeff implemented rich bank (for skeleton v10) new fitting method for calibration -> Phynix v10, v10.1 92-09-21 ulm 2.8 graphics improved and adapted for DEC-GKS ffread card for track types use fseek for reading of calibration file included routine for K*(892) again 92-10-13 ulm 2.9 routine for phynix DST included (for skeleton v11), bug fix in ffclbr 92-11-09 ulm 2.10 bug fix (run number for calibration) 92-12-03 ulm 2.11 correction for chamber edge field array RICHHIT now partly integer test calibsum.dat for write access 93-01-29 ulm 2.12 minor mods in (n-1) calculation allow compilation for old skeleton versions -> Phynix v10.2, v10.3, v11.0, v11.1, v11.2 93-02-26 ulm 2.13 new decoding for 1993 data routines for chamber and mirror alignment 93-06-09 ulm 2.14 bug fix in raw data decoding separate calibsum files for each year all printouts to LUNOUT instead of unit 6 new FFR cards for track association 93-08-23 ulm 2.15 bug fixes in chamber alignment bug fix and improvements in calibration routines routine RCRDST optionally reads RICH bank RICH package can be called only for DST writing several new histograms 93-08-30 ulm 2.16 bug fix in CALIBENR 93-09-06 ulm 3.1 meaning of T0 changed for new track correction TDIF correction now for tracks, not for hits routine RCHISH dropped correct for diffusion of charged particle hits new array for module number passed by track new FFREAD card T0PHOT in rcrdc*.ffr new cards TDIF and TRKDIF in rcal*.ffr stereographic projection for impacts on mirrors graphics display for mirrors -> Phynix v12.1 93-09-30 ulm 3.2 compatibility fixes for old skeleton versions improved background reduction (regions around track impacts and singing wires) new definition for mirror alignment constants dip angle correction for charged track impacts cut on relative angle between tracks and chambers suppress some messages in RCDE93 -> Phynix v12.2 93-10-05 ulm 3.3 minor bug fixes in histogram booking -> Phynix v12.3, v12.4, v12.5, v12.6 93-12-03 ulm 3.4 checks for NaN and Infinity in RCHYPR search two directories for calibration files handle simulated data -> Phynix v12.7, v12.8, v12.9, v13.0, v13.1 94-04-15 ulm 3.5 normalize likelihoods when reading DST new FFR card CFRMIN for minimum fraction of ring read calibsum file by default 94-08-04 ulm 3.6 correct for slow pions in N0 calibration prepare for run 1994 94-11-10 ulm 3.7 Heavy ion hypotheses introduced. Added a link to the track banks with a reference to the RICH bank. 95-11-15 ulm 3.8 Read calib data only after first event of a run. "Lux" display routines. The likelihood method used is written into the event header. The major.minor version is output in the phynix logfile. ***** Compilation flags ***** Several features can be defined by preprocessor statements (you must compile with `f77 -cpp'). -DRCBANK include code for RICH bank -DRCPDST include code for Phynix DST -DRCALIG include alignment routines (NEW in version 2.13) -DRCGRAF include graphics subroutines -DRCFITC include ring centre fitting routines If RCBANK was on during compilation, it will be marked with the letter `B' in the phynix logfile after the RICH version number, like in the following line: RICH information processing is ON. Version 3.01 B If RCGRAF was on, it will be marked in the same way with the letter `G'. RCPDST will be marked with the letter `D'. RCALIG will be marked with the letter `A'. RCFITC will be marked with the letter `F'. ***** How to access the source files ***** Starting from version 2.6, the source is stored under the Revision Control System (RCS). You may access the source files by the two following commands: ln -s /us11/safe/rich/phynix/RCS co -r3.1 RCS/* This copies every source file of the specified revision (in the above example: 3.1) into the working directory. A copy of the newest source files is also kept in directory /us11/safe/rich/phynix/rich. Old versions (1 - 2.6) are stored as Patchy card image file (in file rich.car), also under RCS. ***** Libraries to link ***** Link with: - [/us11/safe/rich/phynix/rich-nograf.o] see below - /us2/prod/phynix/v12/skeleton.{a,b} - /us11/safe/rich/phynix/rich.{a,b} a link to the newest version - /us2/prod/phynix/v12/auxil.{a,b} - /us2/prod/phynix/v12/dummy.{a,b} - /us11/safe/rich/phynix/librmon.a (for decoding of RMON info) - [/us11/safe/rich/phynix/libfumili.{a,b}] (if compiled with RCFITC) - $ONLINEA - $CERNLIBNA or $NEWCERNLIBNA (no graphics) - $CERNLIBA or $CERNLIBDA or $NEWCERNLIBA (graphics, see below) Graphics: If the rich package was compiled with option RCGRAF, link with one of - /us11/safe/rich/phynix/rich-nograf.o if you do not need graphics - $CERNLIBA GKS GTS-Gral - $CERNLIBDA DEC-GKS - $NEWCERNLIBA HIGZ-X11 ***** Files used at run time ***** /us12/calib/rich/rcal*.ffr run independent alignment constants /us12/calib/rich/rcrdc*.ffr run dependent constants /us12/calib/rich/calibsum*.dat like rcrdc, for calibration output /us12/calib/rich/rmon/rmon.par information for RMON decoding ***** Cards in main phynix FFREAD file ***** IRCHIS (30) histogram selection 1=2 Event length etc 2=2 Wire map timing distr etc 3=1 Hit position calculation 4=2 Track extrapolation and association 5=2 Alignment and calibration checking 6=2 Ring predictions 7=2 Cluster finding 8=3 N minus one and mirror alignment checking 9=3 Probability calculations 10=2 RCPEFF proton efficiency (from Lamdba -> p pi-) 13=2 RCPEFF pbar efficiency (from Lambda bar -> pbar pi+) 11=2 phi(1020) -> K+ K- 12=2 Lambda(1520) -> p K- 14=1 K*(892) -> K pi 20=1 Simulation (NEW in 3.4) 21= Chamber alignment (NEW in 2.13) 22= Mirror alignment (NEW in 2.13) ICALIB (3) calibration 1=0 2=0 calibration switched off 1=1 calibration switched on (reading and writing) 1=2 like 1=1, but force new T0 output. This setting may only be used by the RICH group (NEW in 3.1) 1=0 2=1 calibration off, but calibsum.dat is read (default) 3= minimum number of trigger 1 events to output calibration (default 2000) ISELEV (30) single event selection (for debugging) RCCUTL (3) cuts on likelihood ratios used for histograms (default 1.,2.,10.) RCDUMP dump some information of event (NEW in 2.13) bit 0: raw data before RICHDEC (array IBUF) bit 1: hits after RICHDEC (array RICHDAT) bit 2: hits after RICPOS (array RICHHIT) bit 3: tracks (several arrays) bit 4: rings (several arrays) bit 5: KTRACK back (ZPTREE) RCYEAR year (for calibration etc., NEW in 3.4) if not specified, it is determined from the run number Graphics control. This is only available if RICH package was compiled with option RCGRAF. IDRAWF (4) graphics control 1= 0-no pictures; 1-screen; 2-metafile only; 3-screen+metafile 2=1 draw event 3=1 draw rings with search bands etc 4=1 draw Y X projection KWTYP (2) HIGZ workstation type 1= workstation type 0 use default (recommended setting) 32120 X windows (GTS-Gral) 101 Tek 4014 (GTS-Gral) 211 X windows (DEC-GKS) 72 Tek 4014 (DEC-GKS) 1 X windows (HIGZ-X11, NEW in 2.14) 7878 Tek 4014 (HIGZ-X11) 2= metafile workstation type 0 default 4 GKS metafile (GTS-Gral) -112 HIGZ postscript driver (landscape) 5242941 Postscript (only DEC-GKS) 5242945 encapsulated Postscript (only DEC-GKS) Note: you may link with GTS-Gral, DEC-GKS, or HIGZ-X11 (NEW in 2.14). NPIC number of pictures to plot (default 1000) RCMETA filename for graphics output (NEW in 2.14) (default 'rich.meta') "Private" flags (only to be used by the RICH group). RCALIB (40) directories to be searched for calibration files (default '.' and '/us12/calib/rich') RCTRTY (20) list of track types used (default 0, 1, -1) LIKMET (2) select algorithm for likelihood calculation 1=1 ges 1=2 ulm (default) 1=3 ges and ulm (only if compiled with RCBANK option, write information into RICH bank) 1=4 same as 3, plus heavy ion hypotheses (NEW in 3.7) 2= flags to enable hypotheses (only for ges method) 1 dummy (should always be set) 2 electron 4 pion 8 kaon 16 proton e.g. 29: hypotheses dummy, pi, K, p (default) 31: hypotheses dummy, e, pi, K, p RCOMPR create small output for alignment program (NEW in 2.13) bit 0: compress raw data (only RICH data left) bit 1: drop tracks not used by the RICH bit 2: drop tracks not hitting centre of mirrors bit 3: drop events without raw data or with no tracks left ***** FFREAD cards in rcal*.ffr ***** This file contains RICH alignment and other constants which are independent of the run number. Chamber alignment YALIN (10) y position of wire #0 [cm] ZALIN (10) z position of HV electrode [cm] CCDC (3) x,y position of chamber cylinder axis [cm] RDC radius of chamber cylinder [cm] BEAMH (4) beam hole (distance from wire 0 in chamber 3, length, zhigh in chambers 3 and 8) [cm] Corrections for photon time of flight and diffusion of charged hits TDIF correction for travelling time of light [time slices] (NEW in 3.1) TRKDIF (3) correction for diffusion of charged hits (NEW in 3.1) TRKXPS (3) dip angle correction for charged tracks (NEW in 3.2) Mirror alignment YOFFCC (125) offset of c.c. for all mirrors to the c.c. of the ZOFFCC (125) ... nominal mirror sphere [cm] (NEW in 3.2) CCMIY (125) centre of curvature for all mirrors in Omega coord. [cm] CCMIZ (125) ... for backwards compatibility only RMI (125) radius of curvature for all mirrors [cm] (NEW in 3.2) YZCMIR (2) centre of mirror #1 y,z [cm] Parameters for ring prediction and likelihood calculation CFRMIN minimum fraction of ring in active area (default 0.5; NEW in 3.5) SPR spatial resolution of chambers (default 0.4) [cm] SBW search band width (for LIKMET=1) (default 0.4) [cm] REGHW half width of interesting region around rings (for LIKMET=2, default 1.2) [cm] PRCERR (2) error of predicted ring centre y,z [cm] (only used if RCFITC) if both are zero, fitting is switched off Cluster finding parameters ICLMCT minimum multiplicity for a cluster ICLYCT maximum y distance for hits to be considered neighbours [wires] ICLZCT maximum z distance for hits to be considered neighbours [time slices] Background reduction (NEW in 3.2) IHITHR flag for high threshold hit rejection (default 1) ISINGW minimum number of hits for singing wire (default 0=off) TRKREG (2) size (y,z) of track region (default 0.,0.) [cm] Track association parameters (NEW in 2.14) ASSCUT max. hit distance from track impact (default 0.5) [cm] MHITAS minimum hit multiplicity for association (default 3) Azimuth angle between tracks and chambers (NEW in 3.2) AZICUT (2) cut on relative angle between tracks and chambers Correction for chamber edge field NCORR (2) 1= # of wires to apply correction (default 0) 2= wire for which fit was done EDGFIT (3) parameters from fit Momentum cut for simulated tracks (NEW in 3.4) SIMPCT cut on delta(p)/p^2 for sim. tracks (default 5.e-4) ***** FFREAD cards in rcrdc*.ffr and calibsum*.dat ***** These files contain run-dependent constants like drift velocities. rcrdc*.ffr is the regular calibration file, calibsum*.dat is use to accumulate the output while the calibration is running. NRUN (2) range of run numbers T0PHOT (10) T0 for wire modules, photon hits (NEW in 3.1) T0ABSM (10) T0 for wire modules (old definition for charged hits, only supported for compatibility with old versions) T0TDC (80) T0 for TDCs (optional) VDABSM (10) drift velocity for wire modules VDTDC (80) drift velocity for TDCs (optional) RINDEX refractive index (n-1)*1e6 PHOTRI (10) photons per pion ring for wire modules ***** FFREAD cards in rcsim*.ffr (NEW in 3.4) ***** PMAX maximum momentum in efficiency tables NPBINS number of momentum bins in tables RATIO (10) likelihood ratios IDEFPA default particle to simulate (1=e,2=pi,3=K,4=p) IRNSEQ (3) initialization for random generator (RANMAR) LRDTAB (80) list of tables to read (experts only) PEF* (*) identification efficiencies PMI* (*) misidentification probabilities Definition of FFR cards for efficiency tables. The cards are composed as follows: 1. PEF,PMI efficiency / misidentification probabilities 2. 1,2,3,4 id of simulated particle (e,pi,K,p) 3. 0,1,2,3,4 particle to be discriminated (BG,e,pi,K,p) 4. N,P negative / positive particles 5. 01,...,10 index of likelihood ratio (defined by card RATIO) ***** Histograms in the RICH package ***** histogram IDs filled flag 400001 ricpos 1 Event length etc. 400002 rcdeco 1 400003-400006 rcompr 1 400008-400009 ricrun 1 400011-400030 rcdeco 2 Wire map, timing distribution, etc. 400031-400040 ricpos 2 400041-400080 rcdeco 2 400101-400103 ricpos 3 Hit position calculation 400200-400230 rctrxt 4 Track extrapolation and association 400250-400253 rcasso 4 400301-400350 rcalhi 5 Alignment and calibration checking 400400-400411 rinpre 6 Ring predictions 400501-400560 finclu 7 Cluster finding 400600-400699 rcnm1 8 (n-1) calculation 400700-400778 rchypr 9 Likelihood calculations 400780-400799 rcnlklf 9 400801-400903 rcnm1 8 Mirror alignment checking 401000-401019 rcphi 11 phi(1020) -> K+ K- 401020-401044 rcl152 12 Lambda(1520) -> p K- 401060-401073 rckstar 14 K*(892) -> K pi 401100-401163 rcpeff 10 proton efficiency (from Lamdba -> p pi-) 401200-401263 rcpeff 13 pbar efficiency (from Lambda bar) 407000-407003 rcsimtrk 20 Simulation 407020-407054 rcsimeff 20 407100-407180 rcsimini 408001-408030 calibrun t0, vd, n-1 calibration (for each run) 408031-408050 calibenr 408100 legaus temporary histogram for fitting 410001-410164 rmonnm1 8 RMON 412001-418910 rcmial 22 Mirror alignment 419001-419580 rcchal 21 Chamber alignment ***** RICH information in the KTRACK bank ***** The likelihoods for the particle hypotheses e, pi, K, and p are normally written into words 46 - 50 of the tracks bank in KTRACK. Only tracks of types 0, 1, and -1 are used (this may be changed by FFREAD card RCTRTY). q(ltrack+..) Value Meaning ----------------------------------------------------------------- 47-50 -100. Particle is not in RICH acceptance 47-50 -50. Error in RICH package (should not happen) 47-50 -10. Unknown particle (simulated data only) ----------------------------------------------------------------- 46 .lt. 0. - (Number of hypotheses below threshold) 46 .ge. 0. Likelihood of background hypothesis 47 Likelihood of electron hypothesis 48 Likelihood of pion hypothesis 49 Likelihood of kaon hypothesis 50 Likelihood of proton hypothesis ----------------------------------------------------------------- ***** Access to RICH bank information ***** Writing of the RICH bank is switched on with the FFREAD card `LIKMET' set to 3 or 4 (and with the RCBANK flag during compile time). A user bank is now provided by Eugene. The RICH bank is linked to this bank (link number 4). The layout of banks is as follows: IUBANK | | +-----+---------+-----+------------------+ +--> | ... | link #4 | ... | USER bank (root) | +-----+---------+-----+------------------+ | | +-----+---+---+--------------------+------+ +--> | ... | | | RICH bank (branch) | data | +-----+---+---+--------------------+------+ | | | | +--------------------+------+ | +--> | RICH bank (leaf 1) | data | | +--------------------+------+ | | +--------------------+------+ +------> | RICH bank (leaf 2) | data | +--------------------+------+ The data in the leaf RICH banks is organized as follows: q(lrich+..) 1 same as q(ltrack+1) (track type) 2 same as q(ltrack+2) (track number) 3 # of associated hits at the track impact (NEW in 3.7) 4 expected signal for electron hypothesis (some measure for N0) 5 expected background in electron search band (some measure for event-correlated background) 6-10 Likelihoods (GES method) 11-15 Likelihoods (ULM method), same as q(ltrack+46..50) 16-19 Heavy ion hypotheses, only for LIKMET=4 (NEW in 3.7) 16 Likelihood of helium-3 hypothesis 17 Likelihood of alpha hypothesis 18 Likelihood of deuteron hypothesis 19 Likelihood of triton hypothesis RICH bank information can be accessed as in the following example: #include "blankcom.inc" #include "cubank.inc" integer krich,lrich ! local variables ... if (iubank.eq.0) goto 9999 ! USER bank does not exist nl=iq(iubank+iq(iubank)+1) ! number of links in USER bank if (nl.lt.4) goto 9999 ! no RICH link krich=iq(iubank-4) if (krich.eq.0) goto 9999 ! RICH bank does not exist nl=iq(krich+iq(krich)+1) ! number of links in RICH bank do 10 i=1,nl lrich=iq(krich-i) if (lrich.eq.0) goto 10 ... 10 continue 9999 continue Starting with version 3.7, link #1 of the track bank points to a bank whose ZBOOK bank number is equal to the number of the link in the RICH bank. ***** RICH bank information in the Phynix DST ***** Two user-callable subroutines are provided in the RICH package library to write and read additional RICH bank information in the DST. call rcwdst(ierr) writes the information from the RICH bank to the user part of the DST. It returns the following error codes in IERR: 0: OK 2: array in DST is already occupied 3: no space -1: no RICH information -2: too many links in RICH bank The routine rcwdst is called within the RICH package if - the RICH package was compiled with flags RCBANK and RCPDST, and - writing of the RICH bank is enabled (LIKMET.ge.3), and - the DST is switched on (ATRACK.ge.3). If you want to write a DST from data which already contain RICH bank information (without reprocessing by the RICH package), you should - call RCWDST from usrrun, or - call the RICH package with FFREAD card "ARICH -1" (NEW in 2.15). call rcrdst(rdst,nel) reads the information from the RICH bank or from the DST into a user-supplied array. On input, nel denotes the maximum available space in the array. On output, rcrdst returns rdst(15,*) RICH information (same format as in RICH bank) nel number of elements filled or error code: -1: pudstusr failed -2: bad data from DST -3: user's array too small If you set the FFREAD cards PHYPRI(14) and DEBUG, the information from the RICH bank will be printed in routine rcrdst. ***** Routines for simulated data (NEW in 3.4) ***** For simulated data, the properties of the RICH like its geometrical acceptance and the momentum dependent probabilities for identification and misidentification of different particles have to be taken into account. No special FFREAD cards are necessary to run on Monte-Carlo data. If the KSIMUL bank is present for an event, the simulation routines are called automatically and the routines for raw data decoding and calibration are skipped. In a first step, the reconstructed tracks in the KTRACK bank are matched with simulated tracks by using the link number in the track bank for the Omega part of the track. Several cuts are then applied: - Simulated and reconstructed track must have the same (non-zero) charge. - A cut on delta(p) / p^2 of reconstructed and simulated track is applied. The default is 5e-4 / GeV (card SIMPCT in file rcal*.ffr). - The mass of the simulated particle must agree with one of the particles e, pi, K, or p (within 50 MeV/c^2, so muons are accepted as pions). The Geant particle ID in KSIMUL is not needed. For tracks not fullfilling those requirements, all likelihoods are set to a value of -10. It is also possible to use a default particle for them instead. This is controlled with card IDEFPA in file rcsim*.ffr. The acceptance of the RICH is handled in the normal way, i.e. tracks outside the acceptance are marked by -100. in words 47-50 of KTRACK. Tracks inside the acceptance of the RICH are given likelihoods according to the efficiency tables taken from file rcsim*.ffr, and by using a random number for each track. This number is first compared with the efficiencies, then with the misidentification probabilities for combinations of the simulated particle and all other hypotheses. If there is no data for a given combination, the table for the particle of the opposite charge is searched. If this is absent too, a default efficiency of one is assumed, and a misidentification probability of zero. (This chapter is not yet complete. Ask ULM for further information). ***** Alignment and calibration routines ***** With version 2.13, routines for alignment of chambers and mirrors have been included. They were a stand-alone program before. Important: The alignment routines are included only if the RICH package is compiled with option RCALIG. RCOMPR: Create compressed output for alignment This routine should only be called to create a small output to align the RICH Mirrors. It deletes all types of tracks in the KTRACK Bank, which are NOT selected to use inside the RICH-Package and do not hit the mirrors in the center. If no tracks are left over, the event is dropped. The track banks themselves are shrunk to 29 words and all sub-level links are deleted. It strips the RAW Data (KRAW-Bank) to contain only the RICH raw data. Amount of rejection is selected by bits in RCOMPR, to be set in RICFF. RCOMPR: Bit 0: Compress Raw Data (only RICH Data left) Bit 1: drop tracks not used by the RICH Bit 2: drop tracks not hitting the centre of mirrors Bit 3: drop events without raw data or with no tracks left The Record Type is changed to 1020 (instead of 1001) To help the routine, please select only the left-over Banks to be read by Phynix. Use the following FFREAD cards: to read and write KHEAD, KRAW and KTRACK. ATRACK 0 Switch off filling of PTRACK commons ARICH 1 Switch on RICH package RCOMPR 15 see above RCTRTY 0 19*0 Use only track type zero KEYGET 7001 7003 7004 17*0 Read only KHEAD, KRAW, and KTRACK KEYSV1 7001 7003 7004 17*0 Write only KHEAD, KRAW, and KTRACK SAVE 1 Write only event records RCCHAL: Chamber alignment Fills Histos and Arrays for Chamber Alignment. Only called from RICRUN, if IRCHIS(21) > 0 To be called after decoding and track extrapolation Never switch on all histos, they are very large. Histogram Switches: IRCHIS(21) > 0: Simple alignment check histos = 2: predicted y-coordinate vs wire (per modul) = 3: predicted z-coordinate vs drift time (per modul) =100: predicted z-coordinate vs drift time (per TDC) WM 1 =200: predicted z-coordinate vs drift time (per TDC) WM 2 usw. =1000: predicted z-coordinate vs drift time (per TDC) WM 10 RCMIAL: Mirror alignment Called from RICRUN if IRCHIS(22) > 0 To be called after decoding and track extrapolation Histogram Switches: IRCHIS(22) > 0: Normal n-1 Histos > 1: left/right/top/bottom all wires > 2: left/right/top/bottom central wires > 5: mirror alignment (4000 histos booked!) > 6: Wiremap for mirror alignment (5000 histos booked!) Documentation for Lux (as of version 3.8): /* ---------------------------------------------------------------------- *\ A short introduction to LUX a tcl-based display program for the RICH \* ---------------------------------------------------------------------- */ Lux is made out of 3 different parts: Lux: The shell-script. To use LUX, call: Lux tridentoutputfilename Lux will create a named pipe and the ffread-file for Phynix, start phynix (which will write event-data in a special format to this pipe) and the tcl-script lux.tcl (which will read event-data from this pipe). Cleans up the current working directory after exit of lux.tcl. Phynix: called by Lux with ffread-card RICLUX set to 1. This causes Phynix to write event-data in a special format (see below) to a file (in this case it's a pipe) named by the second new ffread-card LUXPIP. The lux-part is called by the RICH-package in Phynix, making it necessary to switch on the RICH-part as well. Here's the ffread-file Lux sets up for phynix: NOLI READ 8 LIST ARICH 1 EVTOT 99999 DATYPE 2 DINPUT '$filename' SAVE 0 MERGE 0 TRIGG 1 2 3 5 6 5*0 PHYPRI 10=1 HISTBK 0 HROUT 0 0 ICALIB 0 1 RICLUX 1 LUXPIP '$pipename' See programming section below for further documentation of the Phynix-part. lux.tcl is the tcl-script which does the main work. Called by Lux with the filename to read data from as 1st argument, it displays the tcl-main window, reads event data, displays it and reacts to user's input. The display should be intuitive enough to make no further documentation necessary. Some functions may not be implemented yet, though. : zoom-in : zoom-out : move displayed region Some functions are also accessible via keyboard (mouse in canvas!): : next event q : quit = : zoom in + : zoom in - : zoom out : pop zoom : move right : move left : move up : move down : write postscript c : display/hide chambers m : display/hide mirrors l : display/hide low threshold hits h : display/hide high threshold hits r : display/hide rejected hits t : display/hide tracks i : display/hide track impact on chambers I : display/hide track impact on mirrors p : display/hide pion ring P : display/hide other hypotheses H : display/hide toggle ring window (not implemented so far) /*-----------------------*\ | program documentation | \*-----------------------*/ /*--------*\ | Phynix | \*--------*/ Since fortran cannot write to named pipes, the output-routine had to be written in C, namely rcluxc.c. Event-data-passing is done via standard RICH-package common-blocks mapped to C-structures and one additional commonblock/C-structure for phynix-data in rclux.inc. See Files rcdim.inc rcffcn.inc rcgeom.inc rchits.inc tchyp.inc rclux.inc rcnhyp.inc rcring.inc rctrak.inc reflec.inc for names and further #defines required for C/Fortran interaction. On the phynix-side, ricrun.f calls riclux.f, if the ffread-variable RICLUX is set to 1. riclux fills a special common-block (rclux, defined in rclux.inc), needed to pass general event data contained in a Phynix common-block. (All other common-blocks are local to the RICH-package and were therefore easyly accessible ;-) riclux then calls rcluxc.c with arguments (mode, pipename). If mode==0, this is the very first call, causing rcluxc.c to write non-changing general information like chamber, mirror and beamhole positions, followed by event-data. If mode==1, rcluxc.c will only write event-data (see below for format). At the very end, ricend.f calls rcluxc.c with mode==2. rcluxc.c will then write an 'END' to the pipe causing lux.tcl to finish. The data written to the pipe always consists of one keyword per line, followed by data. Keywords are: CHAMBER followed by y1 z1 y2 z2 for all 10 chambers and the beamhole MIRROR followed by y/z positions for the 6 edges per mirror EVENT followed by runnumber eventnumber burstnumber eventinburst date time HITLOW followed by y1 z1 y2 z2 of bounding rectangle for hitcircle HITHIGH as HITLOW for high-threshold hits HITREJ as HITLOW for low-thres hits rejected by the cluster algorithm RING followed by trackno ypos zpos momentum radii(e pi K p) TRACK followed by momentum and yz-intersection with chambers and mirrors ENDEVENT telling lux.tcl that this event ends here END telling lux.tcl to exit /*---------*\ | lux.tcl | \*---------*/ I tried to use reasonable and consistent variable-names and put some comments to the code, too -> I hope it is not too hard to understand, once you got the names for all the widgets a.s.o. Some small remarks to help: Move to the very end of the script - the last 3 lines are the whole program (everything else is procs and declarations): set_color check whether we're using color or b/w and set global variables color_* set fp [...] set global variable filepointer to read data from .ec.next invoke has the same effect as calling proc 'read_event' (see the first line in the 'bindings'-section). read_event first deletes all old graphics (except chambers and mirrors), then calls read_line until this returns '1', cleans up the zoom-stack and finally calls display_event. read_line reads lines from fp and parses them (via eval_line -> fill data-arrays) until it reads ENDEVENT (-> return 1 to read_event) or END (-> call lux_exit). display_event calls the display-function for each component (i.e. chambers, mirrors, low thres hits, high hits, ...) if the corresponding 'show_something' variable is set to 1. The display-items are (capitalized the tag-name in the canvas - sorry this is not always consistent): cham CHAM mirr MIRR hitl HITL (low threshold hits) hith HITH (high threshold hits) hitr HITR (rejected hits) trk TRK (tracks) trkc IMPC (impact point of track in chamber-plane) trkm IMPM (intersection point with mirrors) ring PION (Pion hypothesis) hypo ELEC KAON PROT (other hypotheses) global variables (lot of them are arrays) ----------------------------------------- show_displayitem: (i.e. show_cham, show_mirr, ...) ==1 : display item ==0 : don't display item color_displayitem: (i.e. color_cham, etc. and some more!) color to display this item in (set differently for colour and b/w) file_line last line read from pipe evt_runno, evt_evtno, evt_burst, evt_evbur, evt_time, evt_date guess what? data_cham chamber positions (chamber no 11 == beamhole) data_nofhitl, data_hitl1, data_hitl2, data_hitl3, data_hitl4 number of low-threshold hits, y/z-positions of bounding rectangles (arrays!) data_nofhith, data_hith1, data_hith2, data_hith3, data_hith4 same for high threshold hits data_nofhitr, data_hitr1, data_hitr2, data_hitr3, data_hitr4 same for hits rejected by cluster algorithm data_nofring, data_ringno, data_ringx, data_ringy, data_ringmom data_rade, data_radpi, data_radk, data_radp number of rings, ring number, positions, momentum radii for hypotheses data_noftrk, data_trkmom, data_trkx, data_trky, data_trkmx, data_trkmy number of tracks, momentum, impact points on chambers and mirrors data_nofmir data_mirx0, data_mirx1, data_mirx2, data_mirx3, data_mirx4, data_mirx5 data_miry0, data_miry1, data_miry2, data_miry3, data_miry4, data_miry5 number of mirrors, edge-positions zoom_stck zoom_stckx zoom_stcky zoom_scale zoom_mode zomm-handling: stck = stack-pointer stckx, stcky, scale = zoom-rectangle and enlargement mode = flag, shall we reset to 'mirror' or 'chamber' scaling when reading next event the zoom-stackpointer is reset with each new event


Verilənlər bazası müəlliflik hüququ ilə müdafiə olunur ©kagiz.org 2016
rəhbərliyinə müraciət