#ifndef TSIM_L1CPS #define TSIM_L1CPS /////////////////////////////////////////////////////////////////////////////// // File: tsim_l1cps.hpp // // Purpose: Header File for CPS objects Finder // Input : CPS Cluster Chunk info // Output : CPS Object (Type=electron/EM, Addr=address) // // Created: 07-JUNE-99 A. Lucotte // History: /////////////////////////////////////////////////////////////////////////////// #include "edm/Event.hpp" #include "edm/TKey.hpp" #include "unpack_evt/SysID.hpp" #include "unpack_evt/Channel.hpp" #include #include #include #include"CPS_L1Object.hpp" //========================================================= // CPS L1 Cluster Class //========================================================= typedef unsigned int MYBYTE; class tsim_l1cps{ public: tsim_l1cps(); ~tsim_l1cps(); int Get_L1ObjectCount(); void CPS_L1ObjectForm(); void Read_L1Object( int L1Object ); void read_L1_CPS(Event &, D0MCH::SysID) ; std::vector create_CPSL1Chunk(Event &, D0MCH::SysID); CPS_L1Object & operator[]( int i ); // Return _cps_l1object[i] private: int _l1ObjectCount; // Count L1 Objects CPS_L1Object _cps_l1object[ 512 ]; // List of L1 Objects vector _cpsl1chunk[]; // CPS L1 Chunk Output }; // Bit Packing Function (from Mrinmoy) // inline MYBYTE mask(MYBYTE j){ MYBYTE maskbits=1; for (MYBYTE i=1; i>31) & mask(1)); fend = ((pword>>27) & mask(4)); addr = ((pword>>19) & mask(8)); type = ((pword>>18) & mask(1)); widt = ((pword>>15) & mask(3)); tlow = ((pword>>14) & mask(1)); thig = ((pword>>13) & mask(1)); }; #endif