This is a draft documentation for the staf modules and data structures for RICH subsystem of PHENIX detector. (I) convensions All the STAF tables and PAMs are named by the following convention. For PAM mCrkXXX For Staf table type dCrkXXX (Ia) Table name convention The following words are used for table names Geo for geometry Cal for calibration constants Par for parameters of PAM (named as dCrk(PAM_NAME)Par) Raw for raw data Hit for calibrated hit data Proj for track projection to RICH Pid for RICH pid result Exceptions: the following table deos not obey this rule for historical reason and they are output from Dave's dio program crkghit for GEANT/PISA hits of RICH ctra for GEANT/PISA hits of RICH fictitious tracker crkpar for GEANT/PISA parameters crkparu for GEANT/PISA user parameters Examples: dCrkGeo : RICH geometry dCrkCal : RICH calibration constants dCrkGhitRawPar : parameter for mCrkGhitRaw (Ib) PAM name convention A PAM is named as mCrk[Verb][table_name1][table_name_2]... If the PAM is a convertor (convert a table or tables to another table), there is no [Verb] (i.e., it is implied) Examples: mCrkSetGeo : set dCrkGeo mCrkParGeo : convert dCrkPar to dCrkGeo mCrkGhitRaw : convert crkghit to dCrkRaw (Ic) PAM argument order convention The arguments of a PAM is placed in the follwing order Par, Geo, Cal, event inputs, event in/out, event out (II) STAF tables and the data flow. Tables of event data: From PISA: crkghit: GEANT hits in RICH ctra(ctr1,ctr2): GEANT hits in fictitious tracker ctr1 and ctr2 Data in crkStaf: 5 tables dCrkRaw: raw digitized data dCrkHit: calibrated hit dCrkTrk: fictitious perfect track dCrkProj: track projection into RICH dCrkPid: RICH PID results crkghit ctr1 ctr2 | | | | | | =========== =========== ----------------- mCrkGhitRaw mCrkCtraTrk | real tracking | =========== =========== ----------------- | | | dCrkRaw dCrkTrk (real track DS ) | | | =========== =========== ============= mCrkRawHit mCrkTrkProj mCrk(xxx)Proj =========== =========== ============= | | | dCrkHit dCrkProj<------------ \ / \ / \ / ============ mCrkProjPid ============ | dCrkPid Tables of constants From PISA crkpar crkparu Tables in crkStaf 3 tables dCrkGeo : geometry constants (one entry) dCrkUcal: un-calibratin constants (5120 entries. One for each PMT) dCrkCal : calibration constants (5120 entries. One for each PMT) dCrkGeo is set either by (i) mCrkSetGeo (set to the default values) (ii) mCrkParGeo (crkpar is converted to dCrkGeo) (iii) set by "putvalue" command (* (iv) set from Database, when it is available *) dCrkUcal is set by (i) mCrkSetUcal (* (ii) set from Database, when it is available *) dCrkCal is set by (i) mCrkSetCal (* (ii) set from Database, when it is available *) Tables of parameters (some of PAMs has Par argument) 4 tables dCrkGhitRawPar dCrkRawHitPar dCrkProjPidPar dCrkHbkPar PAMs process RICH data mCrkGhitRaw convert crkghit (GEANT hit) to dCrkRaw (raw data) mCrkRawHit convert dCrkRaw (raw data) to dCrkHit (calibrated data) process fictitious track mCrkCtraTrk perfect, fictitious tracking mCrkTrkProj project dCrkTrk onto RICH RICH PID mCrkProjPid RICH PID calculation on track projections Set up constants mCrkSetCal set dCrkCal (calibration constants) table mCrkSetUcal set dCrkUcal (uncalibration constants) table mCrkSetGeo set dCrkGeo (geometry constants) table mCrkParGeo convert crkpar to dCrkGeo Hbook mCrkHbk book hbook histograms mCrkHFN fill Ntuples (III) IDLs of STAF tables (IIIa)Event Data 5 tables dCrkRaw dCrkHit dCrkTrk dCrkProj dCrkPid /**************************************************************************** * File: dCrkRaw.idl * Author: Y. Akiba, KEK * Purpose: DS for raw digitized output of RICH * Originally for DSPACK. converted to STAF. * Date: 7/28/97 * 9/15/97 renamed to dCrkRaw *****************************************************************************/ struct dCrkRaw { short pmt; short adc; short tdc; }; /*****************************************************************************/ /* File: dCrkHit.idl */ /* Author: Y. Akiba, KEK */ /* Purpose: IDL for dCrkHit (calibrated hits of PHENIX RICH) */ /* Date: 7/28/97 */ /* 9/15/97 renamed to dCrkHit */ /*****************************************************************************/ struct dCrkHit { short pmt; /* PMT id. 0 through 5119 */ float npe; /* normalized pulse height in terms of photo-electron */ float time; /* calibrated time of the hit (nsec) */ }; /****************************************************************************** * File: dCrkTrk.idl * Author: Y. Akiba, KEK * Purpose: IDL for dCrkTrk * "reconstructed tracks" by fictious tracker CTR1 and CTR2 * Date: 7/28/97 * 9/15/97 renamed as dCrkTrk.idl ***************************************************************************/ struct dCrkTrk { short ctr1; /* index of hit in CTR1 */ short ctr2; /* index of hit in CTR2 */ short itra; /* track number */ short pid; /* pid code */ float u[3]; /* direction at CTR1 (unit vector) */ float x1[3]; /* position at CTR1 */ float pv[3]; /* momentum vector at origin */ float vx[3]; /* origin vertex */ }; /*****************************************************************************/ /* File: dCrkProj.idl */ /* Author: Y. Akiba, KEK */ /* Purpose: IDL for dCrkProj (track projection into RICH) */ /* originally for DSPACK. converted to STAF. */ /* Date: 7/28/97 */ /* 9/15/97 renamed to dCrkProj */ /*****************************************************************************/ struct dCrkProj { short id; short track_id; float x[3]; /* starting point of projection */ float u[3]; /* direction vector */ }; /*****************************************************************************/ /* File: dCrkPid.idl */ /* Author: Y. Akiba, KEK */ /* Purpose: IDL for dCrkPid (Pid calculation result of RICH) */ /* originally for DSPACK. converted to STAF. */ /* Date: 7/28/97 */ /* 9/15/97 renamed to dCrkPid */ /*****************************************************************************/ struct dCrkPid { short id; short proj_id; short faccept; /* Flag: 1--> in acceptance. 0--> out of acceptance */ short npmt; /* # of PMTs associated to the track */ float npe; /* sum of pulse height of PMTs */ float timing; /* (corrected) average timing of PMT hits. (nsec) */ float chi2; /* chi-squares/npmt of PMT hits */ float rdisp; /* center displacement of PMT hits */ float Lpath; /* path length from x of ray to xproj */ float xproj[3]; /* projected position in RICH PMT array */ float chi2b; /* narrow chisqr */ float dt; }; (IIIb) constants 3 tables dCrkGeo dCrkUcal dCrkCal /****************************************************************************/ /* File: dCrkGeo.idl */ /* Author: Y. Akiba, KEK */ /* Purpose: IDL for dCrkGeo data structure */ /* Used by: many crk modules */ /* originally written for DSPACK, translated to STAF */ /* Date: 7/28/97 */ /* 9/15/97 renamed to dCrkGeo */ /****************************************************************************/ struct dCrkGeo { /* global geometry */ /* Note: phi_cntr is the angle of center of two arms.*/ /* center of arm0 is phi_cntr - phi_open */ /* center of arm1 is phi_cntr + phi_open */ float phi_cntr; /* phi angle of the center of the two arms */ float phi_open; /* phi opening half angle of the two arms */ float dphi_carm; /* phi sapn of CARM outer envelope */ float dphi_cshe; /* phi span of CSHE outer envelope */ float pmt_phi_min; /* min phi angle covered by PMT array */ float pmt_phi_max; /* max phi angle covered by PMT array */ float pmt_dphi; /* phi angle per PMT row */ /* pmt geometry */ float r_pmt_ent; /* radius of PMT entrance */ float dx_pmt[32]; /* sideward displacement of PMT's from SM */ float r_pmt[32]; /* radial position of PMT's */ float z_pmt[32]; /* z position of PMT's */ float theta_pmt[32]; /* theta angle of PMT's */ /* mirror geometry */ float mir_rin; /* inner radius of the mirror */ float mir_thck; /* thickness of the mirror */ float mir_theta1; /* theta angle of the low |z| edge of the mirror */ float mir_theta2; /* theta angle of the high |z| edge of the mirror */ float mir_thetacut; /* theta angle of mirror cover (effective area) */ float mir_phi1; /* starting phi angle */ float mir_phi2; /* ending phi angle */ float mir_dz; /* displacement of mirror center along z axis */ /* window geometry */ float wi1_rin; /* inner radius of the entrance window */ float wi1_thck; /* thickness of the entrance window */ float wi1_zend; /* z position of the entrance window edge */ float wi2_rin; /* radius of the exit window */ float wi2_thck; /* thichness of the exit window */ float wi2_zend; /* z position of the exit window edge */ }; /*****************************************************************************/ /* File: dCrkUcal.idl */ /* Author: Y. Akiba, KEK */ /* Purpose: IDL for dCrkUcal (un-calibration constants, or reverse calib- */ /* ration constants of each PMT of RICH. They describe the gain */ /* variation, time offset, etc of each tube. They also serve as */ /* dead channel mask) */ /* Used by: mCrkGhitRaw */ /* Date: 9/20/97 */ /* */ /*****************************************************************************/ struct dCrkUcal { short pmt; /* PMT channel ID */ float gain; /* ADC ch per 1 p.e. 0 if the channel is dead */ float ped; /* pedestal of ADC */ float clock; /* # of TDC bins per nsec */ float t0; /* timing 0 */ float slew; /* slewing parameter. */ float N0p; /* photo-cathode N0 value */ float P_noise; /* noise hit probability */ float mean_noise; /* noise pulse height */ float sigma_pe; /* one photo-electron resolution */ float sigma_t; /* time resolution for one photon */ }; /*****************************************************************************/ /* File: dCrkCal.idl */ /* Author: Y. Akiba, KEK */ /* Purpose: IDL for dCrkCal (calibration constants of each PMT of RICH) */ /* Used by: mCrkRawHit */ /* originally for DSPACK. Translated to STAF */ /* Date: 7/28/97 */ /* 9/15/97 renamed to dCrkRawHit */ /*****************************************************************************/ struct dCrkCal { short pmt; /* PMT channel ID */ float adc_gain; /* ADC ch per 1 p.e */ float adc_ped; /* pedestal of ADC */ float tdc_clock; /* # of TDC bins per nsec */ float tdc_t0; /* timing 0 */ float slew; /* slewing parameter. */ }; (IIIc) Parameters 4 tables dCrkGhitRawPar dCrkRawHitPar dCrkProjPidPar dCrkHbkPar /****************************************************************************/ /* File: dCrkGhitRawPar.idl */ /* Author: Y. Akiba, KEK */ /* Purpose: IDL for dCrkGhitPawPar (control parameters for mCrkGhitRaw) */ /* Used by: mCrkGhitRaw */ /* originally written for DSPACK, translated to STAF */ /* Date: 7/28/97 */ /* 9/15/97 renamed to dCrkGhitRawPar */ /* 9/25/97 response parameters of individial PMT is moved to */ /* dCrkUcal. Only common parameters are left here */ /****************************************************************************/ struct dCrkGhitRawPar { short ghitraw; /* switch to turn ON(1) or OFF(0) ghitraw output */ short max_adc; /* max value of ADC */ short max_tdc; /* max value of TDC */ short min_tdc; /* min value of TDC */ float N0_pisa; /* N0 value used in PISA simulation */ float sinTmax; /* Winstone cone acceptance */ }; /****************************************************************************/ /* File: dCrkRawHitPar.idl */ /* Author: Y. Akiba, KEK */ /* Purpose: IDL for dCrkPawHitPar (control parameters for mCrkRawHit) */ /* Used by: mCrkRawHit */ /* Date: 7/28/97 */ /* 9/15/97 renamed to dCrkRawHitPar */ /****************************************************************************/ struct dCrkRawHitPar { float min_pe; /* minimum pulse height of hit (avoid div by 0) */ }; /****************************************************************************/ /* File: dCrkProjPidPar.idl */ /* Author: Y. Akiba, KEK */ /* Purpose: IDL for dCrkProjPidPar (control parameters for mCrkProjPid) */ /* Used by: mCrkProjPid */ /* Date: 7/28/97 */ /* 9/15/97 renamed to dCrkProjPidPar */ /****************************************************************************/ struct dCrkProjPidPar { short in_accept; /* Flag whether in_accept condition is required or not */ short min_npmt; /* Minimum NPMT required to make Pid output */ }; /****************************************************************************/ /* File: dCrkHbkPar.idl */ /* Author: Y. Akiba, KEK */ /* Purpose: control parameters for mCrkHbk */ /* sw = 1--> book histograms 2--> call hrput */ /* Used by: mCrkHbk */ /* Date: 9/15/97 */ /****************************************************************************/ struct dCrkHbkPar { long sw; }; /********************************************************************* *File: dCrkRel2s.idl * Author: Y. Akiba, KEK * Purpose: IDL for dCrkRel2s, a short relation table for two tables * Date: 7/28/97 * 9/15/97 renamed as dCrkRel2s.idl **********************************************************************/ struct dCrkRel2s { short id1; /* key for table 1 */ short id2; /* key for table 2 */ }; (IV) PAM IDLs process RICH data mCrkGhitRaw mCrkRawHit process fictitious track mCrkCtraTrk mCrkTrkProj RICH PID mCrkProjPid Set up constants mCrkSetCal mCrkSetUcal mCrkSetGeo mCrkParGeo Hbook mCrkHbk mCrkHFN (IV-a) Process RICH data mCrkGhitRaw mCrkRawHit /************************************************************************** * File: mCrkGhitRaw.idl * Purpose: IDL for PAM mCrkGhitRaw * convert GEANT/PISA hits in crkghit into digitized raw data in * dCrkRaw * Author: Y. Akiba (KEK) **************************************************************************/ #include "PAM.idl" #include "dCrkGhitRawPar.idl" #include "dCrkGeo.idl" #include "dCrkUcal.idl" #include "crkghit.idl" #include "dCrkRaw.idl" #include "dCrkRel2s.idl" interface mCrkGhitRaw: amiModule { STAFCV_T call( in dCrkGhitRawPar par , in dCrkGeo geo , in dCrkUcal ucal , in crkghit ghit , out dCrkRaw raw , out dCrkRel2s ghitraw); }; /************************************************************************** * File: mCrkRawHit.idl * Purpose: IDL for PAM mCrkRawHit * convert raw data (dCrkRaw) to calibrated data (dCrkHit) by the * calibration constants (dCrkCal). * Author: Y. Akiba (KEK) **************************************************************************/ #include "PAM.idl" #include "dCrkRawHitPar.idl" #include "dCrkCal.idl" #include "dCrkRaw.idl" #include "dCrkHit.idl" interface mCrkRawHit: amiModule { STAFCV_T call( in dCrkRawHitPar par , in dCrkCal cal , in dCrkRaw raw , out dCrkHit hit); }; (IV-b) Process fictitious tracker mCrkCtraTrk mCrkTrkProj /************************************************************************** * File: mCrkCtraTrk.idl * Purpose: IDL for PAM mCrkCtraTrk * Fictitious perfect tracking module that connect hits in ctr1 and ctr2 * and store the result in ctrk * Author: Y. Akiba (KEK) **************************************************************************/ #include "PAM.idl" #include "ctra.idl" #include "dCrkTrk.idl" interface mCrkCtraTrk: amiModule { STAFCV_T call( in ctra ctr1 , in ctra ctr2 , out dCrkTrk ctrk); }; /************************************************************************** * File: mCrkTrkProj.idl * Purpose: IDL for PAM mCrkTrkProj * Interface between dCrkTrk and RICH PID. Tracks in dCrkTrk is projected * onto RICH detector. The projection is stored in dCrkProj. * Author: Y. Akiba (KEK) **************************************************************************/ #include "PAM.idl" #include "dCrkTrk.idl" #include "dCrkProj.idl" interface mCrkTrkProj: amiModule { STAFCV_T call( in dCrkTrk trk , out dCrkProj proj); }; (IV-c) RICH PID mCrkProjPid /************************************************************************** * File: mCrkProjPid.idl * Purpose: IDL for PAM mCrkProjPid * does electron PID for track projection onto RICH (dCrkProj), and * store the result in dCrkPid. For each track projection, the number * of PMT hits, # of photo-electrons, chisquares, timing, etc are * calculated. * Author: Y. Akiba (KEK) **************************************************************************/ #include "PAM.idl" #include "dCrkProjPidPar.idl" #include "dCrkGeo.idl" #include "dCrkHit.idl" #include "dCrkProj.idl" #include "dCrkPid.idl" interface mCrkProjPid: amiModule { STAFCV_T call( in dCrkProjPidPar par , in dCrkGeo geo , in dCrkHit hit , in dCrkProj proj , out dCrkPid pid); }; (IV-d) Set up constants mCrkSetCal mCrkSetUcal mCrkSetGeo mCrkParGeo /************************************************************************** * File: mCrkSetCal.idl * Purpose: IDL for PAM mCrkSetCal * set values in dCrkCal (calibration constants of RICH) as follows. * (1) if cal is empty (rowcount == 0) then cal is expaned to 5120 * entries, and the default values are stored in all entries of cal. * (2) if cal is not empty, but its size (rowcount) is less than 5120, * the table is expanded to 5120 entries, and the values in cal[0] * is copied to all entries of the table. * (3) if cal has 5120 entries, it does nothing. * Author: Y. Akiba (KEK) **************************************************************************/ #include "PAM.idl" #include "dCrkCal.idl" interface mCrkSetCal: amiModule { STAFCV_T call( inout dCrkCal cal ); }; /************************************************************************** * File: mCrkSetUcal.idl * Purpose: IDL for PAM mCrkSetUcal * set values in dCrkUcal (un-calibration constants of RICH) as follows. * (1) if ucal is empty (rowcount == 0) then ucal is expaned to 5120 * entries, and the default values are stored in all entries of ucal. * (2) if ucal is not empty, but its size (rowcount) is less than 5120, * the table is expanded to 5120 entries, and the values in ucal[0] * is copied to all entries of the table. * (3) if ucal has (more than) 5120 entries, it does nothing. * Author: Y. Akiba (KEK) * Date: 9/25/97 **************************************************************************/ #include "PAM.idl" #include "dCrkUcal.idl" interface mCrkSetUcal: amiModule { STAFCV_T call( inout dCrkUcal ucal ); }; /************************************************************************** * File: mCrkSetGeo.idl * Purpose: IDL for PAM mCrkSetGeo * set default values in dCrkGeo (geometry constants of RICH). * Author: Y. Akiba (KEK) **************************************************************************/ #include "PAM.idl" #include "dCrkGeo.idl" interface mCrkSetGeo: amiModule { STAFCV_T call( out dCrkGeo geo ); }; /************************************************************************** * File: mCrkParGeo.idl * Purpose: IDL for PAM mCrkParGeo * convert RICH geometry parameter bank in PISA (crkpar) to geometry * data (dCrkGeo) * Author: Y. Akiba (KEK) **************************************************************************/ #include "PAM.idl" #include "crkpar.idl" #include "dCrkGeo.idl" interface mCrkParGeo: amiModule { STAFCV_T call( in crkpar para , out dCrkGeo geo ); }; (IV-e) HBOOK related mCrkHbk mCrkHFN /************************************************************************** * File: mCrkHbk.idl * Purpose: IDL for PAM mCrkHbk * Book HBOOK histograms used in RICH modules. (Temporarily until * TNT or other general HBOOK interface is available.) * if par->sw == 1 book histograms * if par->sw == 2 call hrput(0) * Author: Y. Akiba (KEK) **************************************************************************/ #include "PAM.idl" #include "dCrkHbkPar.idl" interface mCrkHbk: amiModule { STAFCV_T call( in dCrkHbkPar par ); }; /************************************************************************** * File: mCrkHFN.idl * Purpose: IDL for PAM mCrkHFN * Fill contents of dCrkProj and dCrkPid in a Ntuple. (Temporarily * until TNT or other general HBOOK interface is available.) * Author: Y. Akiba (KEK) **************************************************************************/ #include "PAM.idl" #include "dCrkProj.idl" #include "dCrkPid.idl" interface mCrkHFN: amiModule { STAFCV_T call( in dCrkProj proj , in dCrkPid pid ); };