00001 #if !defined(CSCTFTBRAWFORMAT_CSCTFTBSPBLOCK_H) 00002 #define CSCTFTBRAWFORMAT_CSCTFTBSPBLOCK_H 00003 // -*- C++ -*- 00004 // 00005 // Package: CSCTFTBRawFormat 00006 // Module: CSCTFTBSPBlock 00007 // 00008 // Description: Header file for SP Data Block (Tracks and DT Stubs) 00009 // 00010 // Implementation: 00011 // <Notes on implementation> 00012 // 00013 // Author: Lindsey Gray 00014 // Created: 13.1.2005 00015 // 00016 // $Id: CSCTFTBSPBlock.h,v 1.1 2007/04/26 23:39:19 kkotov Exp $ 00017 // 00018 // Revision History 00019 // $Log: CSCTFTBSPBlock.h,v $ 00020 // Revision 1.1 2007/04/26 23:39:19 kkotov 00021 // 00022 // Moved old TB data format to a separate folder, attempted to unpack status digi 00023 // 00024 // Revision 1.3 2006/06/22 14:51:39 lgray 00025 // Found error. 00026 // 00027 // Revision 1.2 2006/06/22 14:46:05 lgray 00028 // Forced commit of all code 00029 // 00030 // Revision 1.1 2006/06/22 00:34:18 lgray 00031 // Moved all data format classes here. Removed old Packages from nightly 00032 // 00033 // Revision 1.1 2006/02/22 23:15:49 lgray 00034 // First commit of test beam data format from UF 00035 // 00036 // Revision 1.3 2005/05/10 21:57:21 lgray 00037 // Bugfixes, stability issues fixed 00038 // 00039 // Revision 1.2 2005/03/03 18:14:48 lgray 00040 // Added ability to pack data back into raw form. Added test program for this as well. 00041 // 00042 // Revision 1.1 2005/02/14 20:59:46 lgray 00043 // First Commit from UF 00044 // 00045 // Revision 1.6 2004/05/18 15:00:25 tfcvs 00046 // DEA: close to new SP data format 00047 // 00048 // Revision 1.5 2004/05/18 11:37:46 tfcvs 00049 // DEA: touch base 00050 // 00051 // Revision 1.4 2004/05/18 09:45:34 tfcvs 00052 // DEA: touch base 00053 // 00054 // Revision 1.3 2004/05/18 08:00:10 tfcvs 00055 // DEA: touch base 00056 // 00057 // Revision 1.2 2003/08/27 22:07:51 tfcvs 00058 // Added pretty-print - Rick 00059 // 00060 // Revision 1.1 2003/05/25 10:13:02 tfcvs 00061 // first working version -DEA 00062 // 00063 // Revision 1.7 2003/05/20 22:13:06 tfcvs 00064 // HS - Added Darin's changes 00065 // 00066 // Revision 1.6 2003/05/19 23:23:12 tfcvs 00067 // HS - Commit after some changes 00068 // 00069 // Revision 1.4 2003/05/19 15:47:18 tfcvs 00070 // HS - Some cleanup 00071 // 00072 // Revision 1.3 2003/05/19 00:25:56 tfcvs 00073 // DEA: committed, but may not compile 00074 // 00075 // Revision 1.2 2003/05/15 23:58:40 tfcvs 00076 // HS - Some cosmetics 00077 // 00078 // 00079 // 00080 00081 // System include files 00082 #include <vector> 00083 #include <iostream> 00084 00085 // Package include files 00086 //class BitVector; 00087 #include "EventFilter/CSCTFRawToDigi/src/CSCTFTBSPHeader.h" 00088 #include "EventFilter/CSCTFRawToDigi/src/CSCTFTBSPData.h" 00089 #include "EventFilter/CSCTFRawToDigi/src/CSCTFTBDTData.h" 00090 00091 // External package include files 00092 00093 // STL classes 00094 00095 // Forward declarations 00096 class CSCTFTBEventHeader; 00097 00098 class CSCTFTBSPBlock 00099 { 00100 00101 // Friend classses and functions 00102 00103 // Public part 00104 public: 00105 // Constants, enums and typedefs 00106 00107 // Constructors and destructor 00108 CSCTFTBSPBlock(); 00109 00110 CSCTFTBSPBlock(unsigned short *buf, int bx, 00111 const CSCTFTBEventHeader& hdr); 00112 00113 CSCTFTBSPBlock(const CSCTFTBSPBlock&); 00114 ~CSCTFTBSPBlock(); 00115 00116 // Member functions 00117 00118 // Const member functions 00119 unsigned size() const {return size_;} 00121 std::vector<CSCTFTBSPData> spData() const {return spdata_;} 00122 CSCTFTBSPData spData(unsigned link) const 00123 {return spdata_[link = (link > 0 && link<= spdata_.size()) ? link-1 : 0];} 00124 00126 std::vector<CSCTFTBDTData> dtData() const {return dtdata_;} 00127 CSCTFTBDTData dtData(unsigned link) const 00128 {return dtdata_[link = (link > 0 && link<= dtdata_.size()) ? link-1 : 0];} 00129 00131 CSCTFTBSPHeader spHeader() const {return spheaderdata_;} 00132 00134 int BX() const {return myBX_;}; 00135 00137 //BitVector pack(); 00138 00140 friend std::ostream & operator<<(std::ostream & stream, const CSCTFTBSPBlock &); 00141 // Protected part 00142 protected: 00143 00144 // Protected member functions 00145 int unpackData(unsigned short * buf, 00146 const CSCTFTBEventHeader& the_hdr); 00147 00148 // Protected const member functions 00149 00151 std::vector<CSCTFTBSPData> spdata_; 00152 00154 std::vector<CSCTFTBDTData> dtdata_; 00155 00157 CSCTFTBSPHeader spheaderdata_; 00158 00159 int myBX_; 00160 unsigned size_; 00161 // Private part 00162 private: 00163 00164 // Constructors and destructor 00165 00166 // Assignment operator(s) 00167 00168 // Private member functions 00169 00170 // Private const member functions 00171 00172 // Data members 00173 00174 // Static data members 00175 00176 // Inline function definitions 00177 00178 }; 00179 00180 #endif