CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_6_1_2_SLHC2_patch1/src/EventFilter/CSCTFRawToDigi/src/CSCTFEvent.h

Go to the documentation of this file.
00001 #ifndef CSCTFEvent_h
00002 #define CSCTFEvent_h
00003 
00004 #include "EventFilter/CSCTFRawToDigi/src/CSCSPEvent.h"
00005 #include <vector>
00006 
00007 class CSCTFEvent {
00008 private:
00009         CSCSPEvent sp[12];
00010         int nRecords;
00011 
00012 public:
00013         // Before we do unpacking, we need to do basic TF format checks (TF Binary Examiner)
00014         enum {MISSING_HEADER=0x2, MISSING_TRAILER=0x4, OUT_OF_BUFFER=0x8, WORD_COUNT=0x10, CONFIGURATION=0x20, NONSENSE=0x40};
00015 
00016         std::vector<CSCSPEvent> SPs(void) const throw() {
00017                 std::vector<CSCSPEvent> result;
00018                 result.reserve(nRecords);
00019                 for(int spNum=0; spNum<nRecords; spNum++) result.push_back(sp[spNum]);
00020                 return result;
00021         }
00022 
00023         // Faster analog of the previous function:
00024     std::vector<const CSCSPEvent*> SPs_fast(void) const throw() {
00025         std::vector<const CSCSPEvent*> retval;
00026         retval.clear();
00027         retval.reserve(nRecords);
00028         for(int spNum=0; spNum<nRecords; spNum++) retval.push_back(sp+spNum);
00029         return retval;
00030     }
00031 
00032         unsigned int unpack(const unsigned short *buf, unsigned int length) throw() ;
00033 
00034         CSCTFEvent(void){}
00035 };
00036 
00037 #endif