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.

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

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 }
int daqPartition_
Definition: LTCDigi.h:80
unsigned int bunchNumber_
Definition: LTCDigi.h:75
cms_uint32_t eventNumber_
Definition: LTCDigi.h:82
unsigned int runNumber_
Definition: LTCDigi.h:71
unsigned int trigType_
Definition: LTCDigi.h:68
cms_uint64_t bstGpsTime_
Definition: LTCDigi.h:86
unsigned int sourceID_
Definition: LTCDigi.h:73
cms_uint32_t trigInputStat_
Definition: LTCDigi.h:84
unsigned int eventID_
Definition: LTCDigi.h:70
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:80
cms_uint32_t trigInhibitNumber_
Definition: LTCDigi.h:85
int versionNumber_
Definition: LTCDigi.h:78
unsigned long long cms_uint64_t
Definition: typedefs.h:17
cms_uint32_t orbitNumber_
Definition: LTCDigi.h:76

Member Function Documentation

◆ bstGpsTime()

cms_uint64_t LTCDigi::bstGpsTime ( ) const
inline

Definition at line 46 of file LTCDigi.h.

References bstGpsTime_.

Referenced by operator<<().

46 { return bstGpsTime_; };
cms_uint64_t bstGpsTime_
Definition: LTCDigi.h:86

◆ bunchNumber()

unsigned int LTCDigi::bunchNumber ( ) const
inline

Definition at line 35 of file LTCDigi.h.

References bunchNumber_.

Referenced by operator<<().

35 { return bunchNumber_; };
unsigned int bunchNumber_
Definition: LTCDigi.h:75

◆ bxMask()

unsigned int LTCDigi::bxMask ( ) const
inline

Definition at line 48 of file LTCDigi.h.

References triggerInputStatus(), and testProducerWithPsetDescEmpty_cfi::x1.

48 { return ((triggerInputStatus() >> 28) & 0x1); };
cms_uint32_t triggerInputStatus() const
Definition: LTCDigi.h:43

◆ cyclicTriggerMask()

unsigned char LTCDigi::cyclicTriggerMask ( ) const
inline

Definition at line 55 of file LTCDigi.h.

References triggerInputStatus().

56  {
57  return (triggerInputStatus() & 0x3FU);
58  };
cms_uint32_t triggerInputStatus() const
Definition: LTCDigi.h:43

◆ daqPartition()

int LTCDigi::daqPartition ( ) const
inline

Definition at line 41 of file LTCDigi.h.

References daqPartition_.

Referenced by operator<<().

41 { return daqPartition_; };
int daqPartition_
Definition: LTCDigi.h:80

◆ eventID()

unsigned int LTCDigi::eventID ( ) const
inline

Definition at line 32 of file LTCDigi.h.

References eventID_.

32 { return eventID_; };
unsigned int eventID_
Definition: LTCDigi.h:70

◆ eventNumber()

unsigned int LTCDigi::eventNumber ( ) const
inline

Definition at line 31 of file LTCDigi.h.

References eventNumber_.

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

31 { return eventNumber_; };
cms_uint32_t eventNumber_
Definition: LTCDigi.h:82

◆ externTriggerMask()

unsigned char LTCDigi::externTriggerMask ( ) const
inline

Definition at line 51 of file LTCDigi.h.

References triggerInputStatus().

Referenced by HasTriggered().

52  {
53  return ((triggerInputStatus() >> 20) & 0x3FU);
54  };
cms_uint32_t triggerInputStatus() const
Definition: LTCDigi.h:43

◆ GetEventNumberFromBuffer()

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

Definition at line 31 of file LTCDigi.cc.

References data, and eventNumber().

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 }
unsigned int cms_uint32_t
Definition: typedefs.h:15
unsigned int eventNumber() const
Definition: LTCDigi.h:31
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:80
unsigned long long cms_uint64_t
Definition: typedefs.h:17

◆ GetRunNumberFromBuffer()

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

Definition at line 38 of file LTCDigi.cc.

References data, and runNumber().

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 }
unsigned int cms_uint32_t
Definition: typedefs.h:15
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:80
unsigned long long cms_uint64_t
Definition: typedefs.h:17
unsigned int runNumber() const
Definition: LTCDigi.h:33

◆ HasTriggered()

bool LTCDigi::HasTriggered ( int  i) const
inline

Definition at line 60 of file LTCDigi.h.

References externTriggerMask(), and mps_fire::i.

Referenced by operator<<().

60  {
61  if (i > 5)
62  return false; // throw exception?
63  return ((externTriggerMask() & (0x1U << i)) != 0);
64  }
unsigned char externTriggerMask() const
Definition: LTCDigi.h:51

◆ locTime()

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

Definition at line 96 of file LTCDigi.cc.

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

Referenced by operator<<().

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 }
double a
Definition: hdecay.h:121

◆ orbitNumber()

cms_uint32_t LTCDigi::orbitNumber ( ) const
inline

Definition at line 36 of file LTCDigi.h.

References orbitNumber_.

Referenced by operator<<().

36 { return orbitNumber_; };
cms_uint32_t orbitNumber_
Definition: LTCDigi.h:76

◆ ramTrigger()

unsigned int LTCDigi::ramTrigger ( ) const
inline

Definition at line 50 of file LTCDigi.h.

References triggerInputStatus(), and testProducerWithPsetDescEmpty_cfi::x1.

Referenced by operator<<().

50 { return ((triggerInputStatus() >> 26) & 0x1); };
cms_uint32_t triggerInputStatus() const
Definition: LTCDigi.h:43

◆ runNumber()

unsigned int LTCDigi::runNumber ( ) const
inline

Definition at line 33 of file LTCDigi.h.

References runNumber_.

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

33 { return runNumber_; };
unsigned int runNumber_
Definition: LTCDigi.h:71

◆ sourceID()

int LTCDigi::sourceID ( ) const
inline

Definition at line 39 of file LTCDigi.h.

References sourceID_.

Referenced by operator<<().

39 { return sourceID_; };
unsigned int sourceID_
Definition: LTCDigi.h:73

◆ triggerInhibitNumber()

cms_uint32_t LTCDigi::triggerInhibitNumber ( ) const
inline

Definition at line 44 of file LTCDigi.h.

References trigInhibitNumber_.

Referenced by operator<<().

44 { return trigInhibitNumber_; };
cms_uint32_t trigInhibitNumber_
Definition: LTCDigi.h:85

◆ triggerInputStatus()

cms_uint32_t LTCDigi::triggerInputStatus ( ) const
inline

Definition at line 43 of file LTCDigi.h.

References trigInputStat_.

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

43 { return trigInputStat_; };
cms_uint32_t trigInputStat_
Definition: LTCDigi.h:84

◆ utcTime()

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

Definition at line 85 of file LTCDigi.cc.

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

Referenced by operator<<().

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 }

◆ version()

int LTCDigi::version ( ) const
inline

Definition at line 38 of file LTCDigi.h.

References versionNumber_.

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

38 { return versionNumber_; };
int versionNumber_
Definition: LTCDigi.h:78

◆ vmeTrigger()

unsigned int LTCDigi::vmeTrigger ( ) const
inline

Definition at line 49 of file LTCDigi.h.

References triggerInputStatus(), and testProducerWithPsetDescEmpty_cfi::x1.

Referenced by operator<<().

49 { return ((triggerInputStatus() >> 27) & 0x1); };
cms_uint32_t triggerInputStatus() const
Definition: LTCDigi.h:43

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().