CMS 3D CMS Logo

CSCTFTBEventHeader.cc

Go to the documentation of this file.
00001 // -*- C++ -*-
00002 //
00003 // Package:     CSCTFTBRawFormat
00004 // Module:      CSCTFTBEventHeader
00005 // 
00006 // Description: SP VME Header class
00007 //  Unpacks and stores CSCTFTBSPVMEHeader data in member variables of CSCTFTBSPVMEHeader.h;
00008 //  rewritten to use bit fields.
00009 //
00010 // Implementation:
00011 //     <Notes on implementation>
00012 //
00013 // Author:      Darin Acosta / Holger Stoeck / Lindsey Gray
00014 // Created:     13.1.2005
00015 //
00016 // $Id: CSCTFTBEventHeader.cc,v 1.1 2007/04/26 23:39:19 kkotov Exp $
00017 //
00018 // Revision History
00019 // $Log: CSCTFTBEventHeader.cc,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:16:42  lgray
00031 // First commit of test beam data format from UF
00032 //
00033 // Revision 1.2  2005/05/13 08:29:59  lgray
00034 // Another bug fix.
00035 //
00036 // Revision 1.1  2005/02/14 21:01:32  lgray
00037 // First Commit from UF
00038 //
00039 // Revision 1.15  2004/05/28 00:24:58  tfcvs
00040 // DEA: a working version of code for 4 chambers!
00041 //
00042 // Revision 1.14  2004/05/18 21:53:42  tfcvs
00043 // DEA: some print out
00044 //
00045 // Revision 1.13  2004/05/18 21:05:06  tfcvs
00046 // DEA: close to working
00047 //
00048 // Revision 1.12  2004/05/18 08:00:35  tfcvs
00049 // DEA: touch base
00050 //
00051 // Revision 1.11  2004/05/17 15:19:49  tfcvs
00052 // DEA: expand header for TB 2004
00053 //
00054 // Revision 1.10  2004/05/16 07:43:49  tfcvs
00055 // DEA: TB2003 version working with new software
00056 //
00057 // Revision 1.9  2003/09/19 20:22:55  tfcvs
00058 // latest
00059 //
00060 // Revision 1.8  2003/08/27 22:09:14  tfcvs
00061 // Added pretty-print  -Rick
00062 //
00063 // Revision 1.7  2003/05/25 10:13:02  tfcvs
00064 // first working version -DEA
00065 //
00066 // Revision 1.6  2003/05/20 22:13:06  tfcvs
00067 // HS - Added Darin's changes
00068 //
00069 // Revision 1.5  2003/05/19 23:23:12  tfcvs
00070 // HS - Commit after some changes
00071 //
00072 // Revision 1.3  2003/05/19 15:47:18  tfcvs
00073 // HS - Some cleanup
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 <iostream>
00083 #include <stdio.h>
00084 
00085 // Package include files
00086 #include "EventFilter/CSCTFRawToDigi/src/CSCTFTBEventHeader.h"
00087 
00088 // External package include files
00089 // #include "DMBHeader.h"
00090 // #include "ALCTHeader.h"
00091 
00092 // STL classes
00093 
00094 // Constants, enums and typedefs
00095 
00096 // CVS-based strings (Id and Tag with which file was checked out)
00097 static const char* const kIdString  = "$Id: CSCTFTBEventHeader.cc,v 1.1 2007/04/26 23:39:19 kkotov Exp $";
00098 static const char* const kTagString = "$Name: V02-15-07 $";
00099 
00100 // Static data member definitions
00101 
00102 // Constructors and destructor
00103 
00104 CSCTFTBEventHeader::CSCTFTBEventHeader()
00105 {}
00106 
00107 CSCTFTBEventHeader::CSCTFTBEventHeader(const CSCTFTBEventHeader& parent)
00108 {
00109   memcpy(reinterpret_cast<unsigned*>(this),&parent,size()*sizeof(unsigned short));
00110 }
00111 
00112 CSCTFTBEventHeader::~CSCTFTBEventHeader()
00113 {}
00114 
00115 unsigned int CSCTFTBEventHeader::getNumActiveFront() const
00116 {
00117   unsigned int num = 0;
00118 
00119   for(int i=0;i<5;i++)
00120     {
00121       if(act_ffpga_&(1<<i)) num++;
00122     }
00123   return num;
00124 }
00125 
00126 bool CSCTFTBEventHeader::check() const
00127 {
00128   return (key1_ == 0xf && key2_ == 0xf && key3_ == 0xf && key4_ == 0xf);
00129 }
00130 
00131 std::ostream & operator<<(std::ostream & stream, const CSCTFTBEventHeader & header) {
00132   stream << std::dec <<"Event Header for L1A " << header.getLvl1num()<<" :\n"
00133          << " BX " << header.getBXnum() << std::endl
00134          << " " << header.numMPC() << " MPC(s)" 
00135          << " with " << header.numLinks() << " links per MPC.\n"
00136          << " There are " << header.numBX() << " BX in this event." << std::endl;
00137   if(header.getZeroSupp()) stream << " Zero Suppression is active.\n";
00138   if(header.getActiveDT()) stream << " DT is active.\n";
00139   if(header.getPtLutSpy()) 
00140     stream << " PT LUT data present on link " << header.getPtLutSpy()<<".\n";
00141   if(header.getActiveFront())
00142     {
00143       stream << " There are "<<header.getNumActiveFront()<<" active front FPGAs." <<std::endl;
00144     }
00145   stream<<std::hex;
00146   return stream;
00147 }

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