CMS 3D CMS Logo

CSCTFTBEventHeader.h

Go to the documentation of this file.
00001 #ifndef CSCTFTBRAWFORMAT_CSCTFTBEVENTHEADER_H
00002 #define CSCTFTBRAWFORMAT_CSCTFTBEVENTHEADER_H
00003 // -*- C++ -*-
00004 //
00005 // Package:     CSCTFTBRawFormat
00006 // Module:      CSCTFTBEventHeader
00007 // 
00008 // Description: Header file for SP VME Header class,
00009 //              rewritten to use bitfields
00010 // Implementation:
00011 //     <Notes on implementation>
00012 //
00013 // Author:      Darin Acosta / Holger Stoeck / Lindsey Gray
00014 // Created:     13.1.2004
00015 //
00016 // $Id: CSCTFTBEventHeader.h,v 1.1 2007/04/26 23:39:19 kkotov Exp $
00017 //
00018 // Revision History
00019 // $Log: CSCTFTBEventHeader.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.2  2006/06/22 14:46:05  lgray
00025 // Forced commit of all code
00026 //
00027 // Revision 1.1  2006/06/22 00:34:18  lgray
00028 // Moved all data format classes here. Removed old Packages from nightly
00029 //
00030 // Revision 1.1  2006/02/22 23:15:49  lgray
00031 // First commit of test beam data format from UF
00032 //
00033 // Revision 1.1  2005/02/14 20:59:46  lgray
00034 // First Commit from UF
00035 //
00036 // Revision 1.10  2004/05/17 15:20:32  tfcvs
00037 // DEA: expand header for TB 2004
00038 //
00039 // Revision 1.9  2003/08/27 22:08:07  tfcvs
00040 // Added pretty-print - Rick
00041 //
00042 // Revision 1.8  2003/05/25 10:13:02  tfcvs
00043 // first working version -DEA
00044 //
00045 // Revision 1.7  2003/05/20 22:13:06  tfcvs
00046 // HS - Added Darin's changes
00047 //
00048 // Revision 1.6  2003/05/19 23:23:12  tfcvs
00049 // HS - Commit after some changes
00050 //
00051 // Revision 1.4  2003/05/19 15:47:18  tfcvs
00052 // HS - Some cleanup
00053 //
00054 // Revision 1.3  2003/05/19 00:25:56  tfcvs
00055 // DEA: committed, but may not compile
00056 //
00057 // Revision 1.2  2003/05/15 23:58:40  tfcvs
00058 // HS - Some cosmetics
00059 //
00060 //
00061 //
00062 
00063 // System include files
00064 #include <iostream>
00065 // Package include files
00066 
00067 // External package include files
00068 
00069 // STL classes
00070 
00071 // Forward declarations
00072 
00073 class CSCTFTBEventHeader 
00074 {
00075 
00076 // Friend classses and functions
00077 
00078 // Public part
00079  public:
00080         // Constants, enums and typedefs
00081 
00082         // Constructors and destructor
00083         CSCTFTBEventHeader();
00084         CSCTFTBEventHeader(const CSCTFTBEventHeader&);
00085 
00086         ~CSCTFTBEventHeader();
00087 
00088         // Member functions
00089 
00090         // Const member functions
00092         int getLvl1num() const {return ((l1a_lsb_)|(l1a_msb_<<12));}
00093         
00095         int getBXnum() const {return bunch_cntr_;}
00096         
00098         unsigned int getZeroSupp() const {return zero_supp_;}
00099         
00101         unsigned int getActiveDT() const {return act_DT_;}
00102         
00104         unsigned int getActiveME1a() const {return getActiveFrontFPGA1();}
00105         unsigned int getActiveME1b() const {return getActiveFrontFPGA2();}
00106         unsigned int getActiveFrontFPGA1() const {return (act_ffpga_&1);}
00107         unsigned int getActiveFrontFPGA2() const {return ((act_ffpga_&2)>>1);}
00108         
00110         unsigned int getActiveME2() const {return getActiveFrontFPGA3();}
00111         unsigned int getActiveFrontFPGA3() const {return ((act_ffpga_&4)>>2);}
00112 
00114         unsigned int getActiveME3() const {return getActiveFrontFPGA4();}
00115         unsigned int getActiveFrontFPGA4() const {return ((act_ffpga_&8)>>3);}
00116 
00118         unsigned int getActiveME4() const {return getActiveFrontFPGA4();}
00119         unsigned int getActiveFrontFPGA5() const {return ((act_ffpga_&10)>>4);}
00120 
00122         unsigned int getActiveFront() const {return act_ffpga_;}
00123 
00125         unsigned int getNumActiveFront() const;
00126 
00128         unsigned int getPtLutSpy() const { return pt_lut_spy_;}
00129 
00131         int numLinks() const {return nLinks_;}
00132         
00134         int numMPC() const {return nMPC_;}
00135 
00137         int numBX() const {return num_bx_;}
00138         
00140         bool check() const;
00141         
00142         // Static member functions
00143         static unsigned size() {return size_;}
00144                 
00146         friend std::ostream & operator<<(std::ostream & stream, const CSCTFTBEventHeader &);
00147         
00149         friend class CSCTFTBEventData;
00150  private:
00151         //frame 1
00152         unsigned num_bx_     :3;
00153         unsigned zero_supp_  :1;
00154         unsigned act_ffpga_  :5;
00155         unsigned act_DT_     :1;
00156         unsigned pt_lut_spy_ :2;
00157         unsigned key1_       :4; // always 0xf
00158         //frame 2               
00159         unsigned bunch_cntr_ :12;
00160         unsigned key2_       :4; // always 0xf
00161         //frame 3
00162         unsigned l1a_lsb_    :12;
00163         unsigned key3_       :4; // always 0xf
00164         //frame 4
00165         unsigned l1a_msb_    :12;
00166         unsigned key4_       :4; // always 0xf
00167 
00168         static const unsigned size_ = 4;
00169         static const unsigned nLinks_ = 3;
00170         static const unsigned nMPC_ = 5;
00171 };
00172 
00173 #endif

Generated on Tue Jun 9 17:34:27 2009 for CMSSW by  doxygen 1.5.4