CMS 3D CMS Logo

LTCDigi.cc
Go to the documentation of this file.
2 
3 LTCDigi::LTCDigi(const unsigned char *data) {
4  // six 64 bit words
5  cms_uint64_t const *ld = reinterpret_cast<cms_uint64_t const *>(data);
6 
7  trigType_ = (ld[0] >> 56) & 0xFULL; // 4 bits
8 
9  eventID_ = (ld[0] >> 32) & 0x00FFFFFFULL; // 24 bits
10  runNumber_ = (ld[2] >> 32) & 0xFFFFFFFFULL; // 32 bits
11  eventNumber_ = (ld[2]) & 0xFFFFFFFFULL; // 32 bits
12 
13  sourceID_ = (ld[0] >> 8) & 0x00000FFFULL; // 12 bits
14  // this should always be 815?
15  //assert(sourceID_ == 815);
16 
17  bunchNumber_ = (ld[0] >> 20) & 0xFFFULL; // 12 bits
18  orbitNumber_ = (ld[1] >> 32) & 0xFFFFFFFFULL; // 32 bits
19 
20  versionNumber_ = (ld[1] >> 24) & 0xFFULL; // 8 bits
21 
22  daqPartition_ = (ld[1]) & 0xFULL; // 4 bits
23 
24  trigInputStat_ = (ld[3]) & 0xFFFFFFFFULL; // 32 bits
25 
26  trigInhibitNumber_ = (ld[3] >> 32) & 0xFFFFFFFFULL; // 32 bits
27 
28  bstGpsTime_ = ld[4]; // 64 bits
29 }
30 //static
32  // six 64 bit words
33  cms_uint64_t const *ld = reinterpret_cast<cms_uint64_t const *>(data);
34  cms_uint32_t eventNumber = (ld[2]) & 0xFFFFFFFFULL; // 32 bits
35  return eventNumber;
36 }
37 //static
39  // six 64 bit words
40  cms_uint64_t const *ld = reinterpret_cast<cms_uint64_t const *>(data);
41  cms_uint32_t runNumber = (ld[2] >> 32) & 0xFFFFFFFFULL; // 32 bits
42  return runNumber;
43 }
44 
45 std::ostream &operator<<(std::ostream &stream, const LTCDigi &myDigi) {
46  stream << "----------------------------------------" << std::endl;
47  stream << "Dumping LTC digi. " << std::endl;
48  stream << "Source ID: " << myDigi.sourceID() << std::endl;
49  stream << "Run, event: " << myDigi.runNumber() << ", " << myDigi.eventNumber() << std::endl;
50  stream << "N_Inhibit:" << myDigi.triggerInhibitNumber() << std::endl;
51  stream << LTCDigi::utcTime(myDigi.bstGpsTime()) << std::endl;
52  stream << LTCDigi::locTime(myDigi.bstGpsTime()) << std::endl;
54  stream << "Partition: " << myDigi.daqPartition() << std::endl;
55  stream << "Bunch #: " << myDigi.bunchNumber() << std::endl;
56  stream << "Orbit #: " << myDigi.orbitNumber() << std::endl;
57 
58  // Trigger information
59  stream << "Trigger Bits(0-5):";
60  for (int i = 0; i < 6; ++i) {
61  if (myDigi.HasTriggered(i))
62  stream << "1";
63  else
64  stream << "0";
65  stream << " ";
66  }
67  stream << std::endl;
68 
69  //
70  stream << "Ram trigger: " << myDigi.ramTrigger() << std::endl;
71  stream << "VME trigger: " << myDigi.vmeTrigger() << std::endl;
72 
73  stream << "++++++++++++++++++++++++++++++++++++++++" << std::endl;
74 
75  stream << "Raw Data" << std::endl;
76  stream << "Trigger Input status: 0x" << std::hex << myDigi.triggerInputStatus() << std::endl;
77  stream << "GPS time: 0x" << std::hex << myDigi.bstGpsTime() << std::endl;
78 
79  stream << "----------------------------------------" << std::endl;
80  stream << std::dec << std::endl;
81 
82  return stream;
83 }
84 
86 {
87  // note that gmtime isn't reentrant and we don't own the data
88  time_t tsmall = t / 1000000;
89  tm *utct = gmtime(&tsmall);
90  std::string tstr("UTC: ");
91  tstr += asctime(utct);
92  tstr.replace(tstr.find('\n'), tstr.size(), "");
93  return tstr;
94 }
95 
97 {
98  time_t tsmall = t / 1000000;
99  std::string a("LOC: ");
100  a += std::string(ctime(&tsmall));
101  a.replace(a.find('\n'), a.size(), "");
102  return a;
103 }
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
LTCDigi::LTCDigi
LTCDigi()
Definition: LTCDigi.h:18
LTCDigi::HasTriggered
bool HasTriggered(int i) const
Definition: LTCDigi.h:60
cms::cuda::stream
uint32_t const T *__restrict__ const uint32_t *__restrict__ int32_t int Histo::index_type cudaStream_t stream
Definition: HistoContainer.h:51
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
LTCDigi::trigType_
unsigned int trigType_
Definition: LTCDigi.h:68
LTCDigi::utcTime
static std::string utcTime(cms_uint64_t t)
Definition: LTCDigi.cc:85
LTCDigi::sourceID_
unsigned int sourceID_
Definition: LTCDigi.h:73
operator<<
std::ostream & operator<<(std::ostream &stream, const LTCDigi &myDigi)
Definition: LTCDigi.cc:45
LTCDigi.h
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
LTCDigi::bstGpsTime
cms_uint64_t bstGpsTime() const
Definition: LTCDigi.h:46
LTCDigi
Definition: LTCDigi.h:15
LTCDigi::bunchNumber
unsigned int bunchNumber() const
Definition: LTCDigi.h:35
a
double a
Definition: hdecay.h:119
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
AlCaHLTBitMon_QueryRunRegistry.string
string string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
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
TauDecayModes.dec
dec
Definition: TauDecayModes.py:142
LTCDigi::eventNumber_
cms_uint32_t eventNumber_
Definition: LTCDigi.h:82