Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:10:29

0001 #ifndef CSCTFEvent_h
0002 #define CSCTFEvent_h
0003 
0004 #include "EventFilter/CSCTFRawToDigi/src/CSCSPEvent.h"
0005 #include <vector>
0006 
0007 class CSCTFEvent {
0008 private:
0009   CSCSPEvent sp[12];
0010   int nRecords;
0011 
0012 public:
0013   // Before we do unpacking, we need to do basic TF format checks (TF Binary Examiner)
0014   enum {
0015     MISSING_HEADER = 0x2,
0016     MISSING_TRAILER = 0x4,
0017     OUT_OF_BUFFER = 0x8,
0018     WORD_COUNT = 0x10,
0019     CONFIGURATION = 0x20,
0020     NONSENSE = 0x40
0021   };
0022 
0023   std::vector<CSCSPEvent> SPs(void) const throw() {
0024     std::vector<CSCSPEvent> result;
0025     result.reserve(nRecords);
0026     for (int spNum = 0; spNum < nRecords; spNum++)
0027       result.push_back(sp[spNum]);
0028     return result;
0029   }
0030 
0031   // Faster analog of the previous function:
0032   std::vector<const CSCSPEvent *> SPs_fast(void) const throw() {
0033     std::vector<const CSCSPEvent *> retval;
0034     retval.clear();
0035     retval.reserve(nRecords);
0036     for (int spNum = 0; spNum < nRecords; spNum++)
0037       retval.push_back(sp + spNum);
0038     return retval;
0039   }
0040 
0041   unsigned int unpack(const unsigned short *buf, unsigned int length);
0042 
0043   CSCTFEvent(void) {}
0044 };
0045 
0046 #endif