CMS 3D CMS Logo

LTCDigi.h
Go to the documentation of this file.
1 #ifndef DataFormats_LTCDigi_h
2 #define DataFormats_LTCDigi_h
3 
4 #include <vector>
5 #include <ostream>
6 #include <string>
7 
9 
15 class LTCDigi {
16 public:
17  // need a default constructor!
18  LTCDigi() {}
19  LTCDigi(const unsigned char *data);
20 
21  // STATIC functions
22  // These are to allow the event builder to grab the run number
23  // from a butter it knows points at LTC data.
24  static cms_uint32_t GetEventNumberFromBuffer(const unsigned char *databuffer);
25  static cms_uint32_t GetRunNumberFromBuffer(const unsigned char *databuffer);
28 
29  // right now these are just silly but maybe if we pack the internals
30  // then this won't seem as silly
31  unsigned int eventNumber() const { return eventNumber_; };
32  unsigned int eventID() const { return eventID_; };
33  unsigned int runNumber() const { return runNumber_; };
34 
35  unsigned int bunchNumber() const { return bunchNumber_; };
36  cms_uint32_t orbitNumber() const { return orbitNumber_; };
37 
38  int version() const { return versionNumber_; };
39  int sourceID() const { return sourceID_; };
40 
41  int daqPartition() const { return daqPartition_; };
42 
45 
46  cms_uint64_t bstGpsTime() const { return bstGpsTime_; };
47 
48  unsigned int bxMask() const { return ((triggerInputStatus() >> 28) & 0x1); };
49  unsigned int vmeTrigger() const { return ((triggerInputStatus() >> 27) & 0x1); };
50  unsigned int ramTrigger() const { return ((triggerInputStatus() >> 26) & 0x1); };
51  unsigned char externTriggerMask() const // six bits
52  {
53  return ((triggerInputStatus() >> 20) & 0x3FU);
54  };
55  unsigned char cyclicTriggerMask() const // six bits
56  {
57  return (triggerInputStatus() & 0x3FU);
58  };
59 
60  bool HasTriggered(int i) const {
61  if (i > 5)
62  return false; // throw exception?
63  return ((externTriggerMask() & (0x1U << i)) != 0);
64  }
65 
66 private:
67  // unpacked for now
68  unsigned int trigType_; // 4 bits
69 
70  unsigned int eventID_; // 24 bits
71  unsigned int runNumber_; // 32 bits
72 
73  unsigned int sourceID_; // 12 bits - 0xCBB constant for LTC
74 
75  unsigned int bunchNumber_; // 12 bits
77 
78  int versionNumber_; // 8 bits - Slink data version number
79 
80  int daqPartition_; // 4 bits
81 
83  // same as event number up to resets
86  cms_uint64_t bstGpsTime_; // 64 bits - is standard unix time in seconds
87 };
88 
89 std::ostream &operator<<(std::ostream &stream, const LTCDigi &myDigi);
90 
91 typedef std::vector<LTCDigi> LTCDigiCollection;
92 
93 #endif // DataFormats_LTCDigi_h
cms_uint32_t
unsigned int cms_uint32_t
Definition: typedefs.h:15
mps_fire.i
i
Definition: mps_fire.py:428
LTCDigi::orbitNumber_
cms_uint32_t orbitNumber_
Definition: LTCDigi.h:76
LTCDigi::ramTrigger
unsigned int ramTrigger() const
Definition: LTCDigi.h:50
LTCDigi::daqPartition_
int daqPartition_
Definition: LTCDigi.h:80
cms::cuda::stream
cudaStream_t stream
Definition: HistoContainer.h:57
LTCDigi::LTCDigi
LTCDigi()
Definition: LTCDigi.h:18
LTCDigi::HasTriggered
bool HasTriggered(int i) const
Definition: LTCDigi.h:60
LTCDigi::triggerInhibitNumber
cms_uint32_t triggerInhibitNumber() const
Definition: LTCDigi.h:44
LTCDigi::daqPartition
int daqPartition() const
Definition: LTCDigi.h:41
LTCDigi::vmeTrigger
unsigned int vmeTrigger() const
Definition: LTCDigi.h:49
watchdog.const
const
Definition: watchdog.py:83
LTCDigi::trigType_
unsigned int trigType_
Definition: LTCDigi.h:68
LTCDigi::utcTime
static std::string utcTime(cms_uint64_t t)
Definition: LTCDigi.cc:85
LTCDigi::cyclicTriggerMask
unsigned char cyclicTriggerMask() const
Definition: LTCDigi.h:55
LTCDigi::sourceID_
unsigned int sourceID_
Definition: LTCDigi.h:73
LTCDigi::bxMask
unsigned int bxMask() const
Definition: LTCDigi.h:48
testProducerWithPsetDescEmpty_cfi.x1
x1
Definition: testProducerWithPsetDescEmpty_cfi.py:33
LTCDigi::bunchNumber_
unsigned int bunchNumber_
Definition: LTCDigi.h:75
LTCDigi::versionNumber_
int versionNumber_
Definition: LTCDigi.h:78
LTCDigi::eventNumber
unsigned int eventNumber() const
Definition: LTCDigi.h:31
LTCDigi::trigInputStat_
cms_uint32_t trigInputStat_
Definition: LTCDigi.h:84
typedefs.h
LTCDigi::bstGpsTime
cms_uint64_t bstGpsTime() const
Definition: LTCDigi.h:46
LTCDigi
Definition: LTCDigi.h:15
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
LTCDigi::bunchNumber
unsigned int bunchNumber() const
Definition: LTCDigi.h:35
LTCDigiCollection
std::vector< LTCDigi > LTCDigiCollection
Definition: LTCDigi.h:91
LTCDigi::version
int version() const
Definition: LTCDigi.h:38
operator<<
std::ostream & operator<<(std::ostream &stream, const LTCDigi &myDigi)
Definition: LTCDigi.cc:45
LTCDigi::orbitNumber
cms_uint32_t orbitNumber() const
Definition: LTCDigi.h:36
LTCDigi::GetRunNumberFromBuffer
static cms_uint32_t GetRunNumberFromBuffer(const unsigned char *databuffer)
Definition: LTCDigi.cc:38
LTCDigi::bstGpsTime_
cms_uint64_t bstGpsTime_
Definition: LTCDigi.h:86
cms_uint64_t
unsigned long long cms_uint64_t
Definition: typedefs.h:17
LTCDigi::eventID
unsigned int eventID() const
Definition: LTCDigi.h:32
LTCDigi::externTriggerMask
unsigned char externTriggerMask() const
Definition: LTCDigi.h:51
LTCDigi::runNumber
unsigned int runNumber() const
Definition: LTCDigi.h:33
LTCDigi::runNumber_
unsigned int runNumber_
Definition: LTCDigi.h:71
LTCDigi::GetEventNumberFromBuffer
static cms_uint32_t GetEventNumberFromBuffer(const unsigned char *databuffer)
Definition: LTCDigi.cc:31
LTCDigi::eventID_
unsigned int eventID_
Definition: LTCDigi.h:70
data
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:79
LTCDigi::sourceID
int sourceID() const
Definition: LTCDigi.h:39
LTCDigi::triggerInputStatus
cms_uint32_t triggerInputStatus() const
Definition: LTCDigi.h:43
LTCDigi::trigInhibitNumber_
cms_uint32_t trigInhibitNumber_
Definition: LTCDigi.h:85
LTCDigi::locTime
static std::string locTime(cms_uint64_t t)
Definition: LTCDigi.cc:96
submitPVValidationJobs.t
string t
Definition: submitPVValidationJobs.py:644
LTCDigi::eventNumber_
cms_uint32_t eventNumber_
Definition: LTCDigi.h:82