CMS 3D CMS Logo

List of all members | Public Member Functions | Static Public Member Functions | Private Attributes
LTCDigi Class Reference

#include <LTCDigi.h>

Public Member Functions

cms_uint64_t bstGpsTime () const
 
unsigned int bunchNumber () const
 
unsigned int bxMask () const
 
unsigned char cyclicTriggerMask () const
 
int daqPartition () const
 
unsigned int eventID () const
 
unsigned int eventNumber () const
 
unsigned char externTriggerMask () const
 
bool HasTriggered (int i) const
 
 LTCDigi ()
 
 LTCDigi (const unsigned char *data)
 
cms_uint32_t orbitNumber () const
 
unsigned int ramTrigger () const
 
unsigned int runNumber () const
 
int sourceID () const
 
cms_uint32_t triggerInhibitNumber () const
 
cms_uint32_t triggerInputStatus () const
 
int version () const
 
unsigned int vmeTrigger () const
 

Static Public Member Functions

static cms_uint32_t GetEventNumberFromBuffer (const unsigned char *databuffer)
 
static cms_uint32_t GetRunNumberFromBuffer (const unsigned char *databuffer)
 
static std::string locTime (cms_uint64_t t)
 
static std::string utcTime (cms_uint64_t t)
 

Private Attributes

cms_uint64_t bstGpsTime_
 
unsigned int bunchNumber_
 
int daqPartition_
 
unsigned int eventID_
 
cms_uint32_t eventNumber_
 
cms_uint32_t orbitNumber_
 
unsigned int runNumber_
 
unsigned int sourceID_
 
cms_uint32_t trigInhibitNumber_
 
cms_uint32_t trigInputStat_
 
unsigned int trigType_
 
int versionNumber_
 

Detailed Description

Data from the Local Trigger Controller (LTC)

Definition at line 15 of file LTCDigi.h.

Constructor & Destructor Documentation

◆ LTCDigi() [1/2]

LTCDigi::LTCDigi ( )
inline

Definition at line 18 of file LTCDigi.h.

18 {}

◆ LTCDigi() [2/2]

LTCDigi::LTCDigi ( const unsigned char *  data)

Definition at line 3 of file LTCDigi.cc.

3  {
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 }

References bstGpsTime_, bunchNumber_, daqPartition_, data, eventID_, eventNumber_, orbitNumber_, runNumber_, sourceID_, trigInhibitNumber_, trigInputStat_, trigType_, and versionNumber_.

Member Function Documentation

◆ bstGpsTime()

cms_uint64_t LTCDigi::bstGpsTime ( ) const
inline

Definition at line 46 of file LTCDigi.h.

46 { return bstGpsTime_; };

References bstGpsTime_.

Referenced by operator<<().

◆ bunchNumber()

unsigned int LTCDigi::bunchNumber ( ) const
inline

Definition at line 35 of file LTCDigi.h.

35 { return bunchNumber_; };

References bunchNumber_.

Referenced by operator<<().

◆ bxMask()

unsigned int LTCDigi::bxMask ( ) const
inline

Definition at line 48 of file LTCDigi.h.

48 { return ((triggerInputStatus() >> 28) & 0x1); };

References triggerInputStatus(), and testProducerWithPsetDescEmpty_cfi::x1.

◆ cyclicTriggerMask()

unsigned char LTCDigi::cyclicTriggerMask ( ) const
inline

Definition at line 55 of file LTCDigi.h.

56  {
57  return (triggerInputStatus() & 0x3FU);
58  };

References triggerInputStatus().

◆ daqPartition()

int LTCDigi::daqPartition ( ) const
inline

Definition at line 41 of file LTCDigi.h.

41 { return daqPartition_; };

References daqPartition_.

Referenced by operator<<().

◆ eventID()

unsigned int LTCDigi::eventID ( ) const
inline

Definition at line 32 of file LTCDigi.h.

32 { return eventID_; };

References eventID_.

◆ eventNumber()

unsigned int LTCDigi::eventNumber ( ) const
inline

Definition at line 31 of file LTCDigi.h.

31 { return eventNumber_; };

References eventNumber_.

Referenced by GetEventNumberFromBuffer(), and operator<<().

◆ externTriggerMask()

unsigned char LTCDigi::externTriggerMask ( ) const
inline

Definition at line 51 of file LTCDigi.h.

52  {
53  return ((triggerInputStatus() >> 20) & 0x3FU);
54  };

References triggerInputStatus().

Referenced by HasTriggered().

◆ GetEventNumberFromBuffer()

cms_uint32_t LTCDigi::GetEventNumberFromBuffer ( const unsigned char *  databuffer)
static

Definition at line 31 of file LTCDigi.cc.

31  {
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 }

References data, and eventNumber().

◆ GetRunNumberFromBuffer()

cms_uint32_t LTCDigi::GetRunNumberFromBuffer ( const unsigned char *  databuffer)
static

Definition at line 38 of file LTCDigi.cc.

38  {
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 }

References data, and runNumber().

◆ HasTriggered()

bool LTCDigi::HasTriggered ( int  i) const
inline

Definition at line 60 of file LTCDigi.h.

60  {
61  if (i > 5)
62  return false; // throw exception?
63  return ((externTriggerMask() & (0x1U << i)) != 0);
64  }

References externTriggerMask(), and mps_fire::i.

Referenced by operator<<().

◆ locTime()

std::string LTCDigi::locTime ( cms_uint64_t  t)
static

Definition at line 96 of file LTCDigi.cc.

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 }

References a, AlCaHLTBitMon_QueryRunRegistry::string, and submitPVValidationJobs::t.

Referenced by operator<<().

◆ orbitNumber()

cms_uint32_t LTCDigi::orbitNumber ( ) const
inline

Definition at line 36 of file LTCDigi.h.

36 { return orbitNumber_; };

References orbitNumber_.

Referenced by operator<<().

◆ ramTrigger()

unsigned int LTCDigi::ramTrigger ( ) const
inline

Definition at line 50 of file LTCDigi.h.

50 { return ((triggerInputStatus() >> 26) & 0x1); };

References triggerInputStatus(), and testProducerWithPsetDescEmpty_cfi::x1.

Referenced by operator<<().

◆ runNumber()

unsigned int LTCDigi::runNumber ( ) const
inline

Definition at line 33 of file LTCDigi.h.

33 { return runNumber_; };

References runNumber_.

Referenced by GetRunNumberFromBuffer(), and operator<<().

◆ sourceID()

int LTCDigi::sourceID ( ) const
inline

Definition at line 39 of file LTCDigi.h.

39 { return sourceID_; };

References sourceID_.

Referenced by operator<<().

◆ triggerInhibitNumber()

cms_uint32_t LTCDigi::triggerInhibitNumber ( ) const
inline

Definition at line 44 of file LTCDigi.h.

44 { return trigInhibitNumber_; };

References trigInhibitNumber_.

Referenced by operator<<().

◆ triggerInputStatus()

cms_uint32_t LTCDigi::triggerInputStatus ( ) const
inline

Definition at line 43 of file LTCDigi.h.

43 { return trigInputStat_; };

References trigInputStat_.

Referenced by bxMask(), cyclicTriggerMask(), externTriggerMask(), operator<<(), ramTrigger(), and vmeTrigger().

◆ utcTime()

std::string LTCDigi::utcTime ( cms_uint64_t  t)
static

Definition at line 85 of file LTCDigi.cc.

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 }

References AlCaHLTBitMon_QueryRunRegistry::string, and submitPVValidationJobs::t.

Referenced by operator<<().

◆ version()

int LTCDigi::version ( ) const
inline

Definition at line 38 of file LTCDigi.h.

38 { return versionNumber_; };

References versionNumber_.

Referenced by validation.Sample::datasetpattern(), and validation.Sample::filename().

◆ vmeTrigger()

unsigned int LTCDigi::vmeTrigger ( ) const
inline

Definition at line 49 of file LTCDigi.h.

49 { return ((triggerInputStatus() >> 27) & 0x1); };

References triggerInputStatus(), and testProducerWithPsetDescEmpty_cfi::x1.

Referenced by operator<<().

Member Data Documentation

◆ bstGpsTime_

cms_uint64_t LTCDigi::bstGpsTime_
private

Definition at line 86 of file LTCDigi.h.

Referenced by bstGpsTime(), and LTCDigi().

◆ bunchNumber_

unsigned int LTCDigi::bunchNumber_
private

Definition at line 75 of file LTCDigi.h.

Referenced by bunchNumber(), and LTCDigi().

◆ daqPartition_

int LTCDigi::daqPartition_
private

Definition at line 80 of file LTCDigi.h.

Referenced by daqPartition(), and LTCDigi().

◆ eventID_

unsigned int LTCDigi::eventID_
private

Definition at line 70 of file LTCDigi.h.

Referenced by eventID(), and LTCDigi().

◆ eventNumber_

cms_uint32_t LTCDigi::eventNumber_
private

Definition at line 82 of file LTCDigi.h.

Referenced by eventNumber(), and LTCDigi().

◆ orbitNumber_

cms_uint32_t LTCDigi::orbitNumber_
private

Definition at line 76 of file LTCDigi.h.

Referenced by LTCDigi(), and orbitNumber().

◆ runNumber_

unsigned int LTCDigi::runNumber_
private

Definition at line 71 of file LTCDigi.h.

Referenced by LTCDigi(), and runNumber().

◆ sourceID_

unsigned int LTCDigi::sourceID_
private

Definition at line 73 of file LTCDigi.h.

Referenced by LTCDigi(), and sourceID().

◆ trigInhibitNumber_

cms_uint32_t LTCDigi::trigInhibitNumber_
private

Definition at line 85 of file LTCDigi.h.

Referenced by LTCDigi(), and triggerInhibitNumber().

◆ trigInputStat_

cms_uint32_t LTCDigi::trigInputStat_
private

Definition at line 84 of file LTCDigi.h.

Referenced by LTCDigi(), and triggerInputStatus().

◆ trigType_

unsigned int LTCDigi::trigType_
private

Definition at line 68 of file LTCDigi.h.

Referenced by LTCDigi().

◆ versionNumber_

int LTCDigi::versionNumber_
private

Definition at line 78 of file LTCDigi.h.

Referenced by LTCDigi(), and version().

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::daqPartition_
int daqPartition_
Definition: LTCDigi.h:80
LTCDigi::trigType_
unsigned int trigType_
Definition: LTCDigi.h:68
LTCDigi::sourceID_
unsigned int sourceID_
Definition: LTCDigi.h:73
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
a
double a
Definition: hdecay.h:119
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::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::eventID_
unsigned int eventID_
Definition: LTCDigi.h:70
data
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:79
LTCDigi::triggerInputStatus
cms_uint32_t triggerInputStatus() const
Definition: LTCDigi.h:43
LTCDigi::trigInhibitNumber_
cms_uint32_t trigInhibitNumber_
Definition: LTCDigi.h:85
submitPVValidationJobs.t
string t
Definition: submitPVValidationJobs.py:644
LTCDigi::eventNumber_
cms_uint32_t eventNumber_
Definition: LTCDigi.h:82