CMS 3D CMS Logo

CSCTFEvent.h
Go to the documentation of this file.
1 #ifndef CSCTFEvent_h
2 #define CSCTFEvent_h
3 
5 #include <vector>
6 
7 class CSCTFEvent {
8 private:
10  int nRecords;
11 
12 public:
13  // Before we do unpacking, we need to do basic TF format checks (TF Binary Examiner)
14  enum {
18  WORD_COUNT = 0x10,
19  CONFIGURATION = 0x20,
20  NONSENSE = 0x40
21  };
22 
23  std::vector<CSCSPEvent> SPs(void) const throw() {
24  std::vector<CSCSPEvent> result;
25  result.reserve(nRecords);
26  for (int spNum = 0; spNum < nRecords; spNum++)
27  result.push_back(sp[spNum]);
28  return result;
29  }
30 
31  // Faster analog of the previous function:
32  std::vector<const CSCSPEvent *> SPs_fast(void) const throw() {
33  std::vector<const CSCSPEvent *> retval;
34  retval.clear();
35  retval.reserve(nRecords);
36  for (int spNum = 0; spNum < nRecords; spNum++)
37  retval.push_back(sp + spNum);
38  return retval;
39  }
40 
41  unsigned int unpack(const unsigned short *buf, unsigned int length);
42 
43  CSCTFEvent(void) {}
44 };
45 
46 #endif
unsigned int unpack(const unsigned short *buf, unsigned int length)
Definition: CSCTFEvent.cc:6
std::vector< const CSCSPEvent * > SPs_fast(void) const
Definition: CSCTFEvent.h:32
CSCTFEvent(void)
Definition: CSCTFEvent.h:43
CSCSPEvent sp[12]
Definition: CSCTFEvent.h:9
std::vector< CSCSPEvent > SPs(void) const
Definition: CSCTFEvent.h:23
int nRecords
Definition: CSCTFEvent.h:10