#ifndef DSTBANKS_HEADER_H #define DSTBANKS_HEADER_H #include "banks.h" #include "4vectors.h" #include "h1util.h" #include "bos.h" #include #include extern bcstype<1000000>& bcs; class dtnvrow; class dtrarow; class dverrow; class dtnvrow { public: struct cen_hits { unsigned int nbpc_tn: 2; unsigned int ncjc1_tn: 5; unsigned int ncjc2_tn: 6; unsigned int nciz_tn: 3; unsigned int ncoz_tn: 3; unsigned int npla_tn: 6; unsigned int nrad_tn: 6; }; struct for_hits { unsigned int izvtx_tn: 1; unsigned int ms3_tn: 6; unsigned int msk_tn: 6; unsigned int ms2_tn: 6; unsigned int npla_tn: 6; unsigned int nrad_tn: 6; }; struct muelq_hits { unsigned int ndedx_tn: 8; unsigned int lamuq_tn: 2; unsigned int laelq_tn: 2; }; float curv_tn; float phi_tn; float thet_tn; union {float dca_tn; float x0_tn;}; union {float zdca_tn; float y0_tn;}; union {float rs_tn; float z0_tn;}; union {int nhit_tn; cen_hits nhitc_tn; for_hits nhitf_tn;}; float dcurv_tn; float dphi_tn; float dthet_tn; float ddca_tn; float dzdca_tn; float cor1_tn; float cor2_tn; float cor3_tn; float cor4_tn; float chi2_tn; float xend_tn; float yend_tn; float zend_tn; union {float dedx_tn; float phie_tn;}; union {float tzero_tn; float thte_tn;}; union {int muelq_tn; muelq_hits muelqbits_tn;}; TablePointer l_nxt_tn; inline int is_forward () { return nhit_tn & 0x7ff80000 != 0; } inline int is_central () { return (nhit_tn & 0x7ff80000 == 0) && (nhit_tn & 0x0007fffc != 0); } inline int is_bpc () { return (nhit_tn & 0x7ff80000 == 0) && (nhit_tn & 0x00000003 != 0); } inline float getrend () { return sqrt (xend_tn*xend_tn + yend_tn*yend_tn); } inline fourvector getfourvector (float m=fourvector::mpi) { const float c0 = 0.2998E-3; float Edummy = 0; float xyz [3]; /* if (is_forward()) { xyz [0] = 0.5*(x0_tn + xend_tn); xyz [1] = 0.5*(y0_tn + yend_tn); xyz [2] = 0.5*(z0_tn + zend_tn); } else if (is_central()) { float rmid = 0.5*(rs_tn + getrend()); xyz [0] = rmid*cos (phi_tn); xyz [1] = rmid*sin (phi_tn); xyz [2] = rmid/tan (thet_tn); } else { */ xyz [0] = 0; xyz [1] = 0; xyz [2] = 0; /* } */ float field [3]; gufld (xyz, field); float ptinv_tn = c0*field [2]*curv_tn; return fourvector (cos (phi_tn)/ptinv_tn, sin (phi_tn)/ptinv_tn, 1./(tan(thet_tn)*ptinv_tn), Edummy, m); } }; class dtrarow { public: float ptinv_tr; float phi_tr; float thet_tr; float q_tr; float dptin_tr; float dphi_tr; float dthet_tr; float corr_tr; float chi2v_tr; float czvth_tr; float qual_tr; int nhit_tr; TablePointer l_ver_tr; TablePointer l_tcn_tr; TablePointer l_tnf_tr; TablePointer l_nxn_tr; inline float getpx () {return cos (phi_tr)/ptinv_tr;} inline float getpy () {return sin (phi_tr)/ptinv_tr;} inline float getpt () {return 1/ptinv_tr;} inline float getpz () {return 1/(tan(thet_tr)*ptinv_tr);} inline float getp () {return 1/(sin(thet_tr)*ptinv_tr);} inline fourvector getfourvector (float m=fourvector::mpi) { float Edummy = 0; return fourvector (getpx(), getpy(), getpz(), Edummy, m); } inline int is_central () {return l_tcn_tr != 0;} inline int is_forward () {return l_tnf_tr != 0;} inline int is_combined () {return l_tcn_tr != 0 && l_tnf_tr != 0;} }; class dverrow { public: float x_ve; float y_ve; float z_ve; float dx_ve; float dy_ve; float dz_ve; float corr_ve; int ityp_ve; TablePointer l_tra_ve; }; #endif