CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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 16 of file LTCDigi.h.

Constructor & Destructor Documentation

LTCDigi::LTCDigi ( )
inline

Definition at line 20 of file LTCDigi.h.

20 {}
LTCDigi::LTCDigi ( const unsigned char *  data)

Definition at line 4 of file LTCDigi.cc.

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

5 {
6  // six 64 bit words
7  cms_uint64_t const *ld = reinterpret_cast<cms_uint64_t const*>(data);
8 
9  trigType_ = (ld[0]>>56)& 0xFULL; // 4 bits
10 
11  eventID_ = (ld[0]>>32)&0x00FFFFFFULL; // 24 bits
12  runNumber_ = (ld[2]>>32)&0xFFFFFFFFULL; // 32 bits
13  eventNumber_ = (ld[2]) &0xFFFFFFFFULL; // 32 bits
14 
15  sourceID_ = (ld[0]>> 8)&0x00000FFFULL; // 12 bits
16  // this should always be 815?
17  //assert(sourceID_ == 815);
18 
19  bunchNumber_ = (ld[0]>>20)& 0xFFFULL; // 12 bits
20  orbitNumber_ = (ld[1]>>32)&0xFFFFFFFFULL; // 32 bits
21 
22  versionNumber_ = (ld[1]>>24)&0xFFULL; // 8 bits
23 
24  daqPartition_ = (ld[1] )&0xFULL; // 4 bits
25 
26 
27  trigInputStat_ = (ld[3] )&0xFFFFFFFFULL; // 32 bits
28 
29  trigInhibitNumber_ = (ld[3]>>32)&0xFFFFFFFFULL; // 32 bits
30 
31  bstGpsTime_ = ld[4]; // 64 bits
32 
33 }
int daqPartition_
Definition: LTCDigi.h:91
unsigned int bunchNumber_
Definition: LTCDigi.h:86
cms_uint32_t eventNumber_
Definition: LTCDigi.h:93
unsigned int runNumber_
Definition: LTCDigi.h:82
unsigned int trigType_
Definition: LTCDigi.h:79
cms_uint64_t bstGpsTime_
Definition: LTCDigi.h:97
unsigned int sourceID_
Definition: LTCDigi.h:84
cms_uint32_t trigInputStat_
Definition: LTCDigi.h:95
unsigned int eventID_
Definition: LTCDigi.h:81
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:82
cms_uint32_t trigInhibitNumber_
Definition: LTCDigi.h:96
int versionNumber_
Definition: LTCDigi.h:89
unsigned long long cms_uint64_t
Definition: typedefs.h:17
cms_uint32_t orbitNumber_
Definition: LTCDigi.h:87

Member Function Documentation

cms_uint64_t LTCDigi::bstGpsTime ( ) const
inline

Definition at line 48 of file LTCDigi.h.

References bstGpsTime_.

Referenced by operator<<().

48 { return bstGpsTime_;};
cms_uint64_t bstGpsTime_
Definition: LTCDigi.h:97
unsigned int LTCDigi::bunchNumber ( ) const
inline

Definition at line 37 of file LTCDigi.h.

References bunchNumber_.

Referenced by operator<<().

37 { return bunchNumber_;};
unsigned int bunchNumber_
Definition: LTCDigi.h:86
unsigned int LTCDigi::bxMask ( ) const
inline

Definition at line 50 of file LTCDigi.h.

References triggerInputStatus().

50 { return ((triggerInputStatus()>>28)&0x1); } ;
cms_uint32_t triggerInputStatus() const
Definition: LTCDigi.h:45
unsigned char LTCDigi::cyclicTriggerMask ( ) const
inline

Definition at line 63 of file LTCDigi.h.

References triggerInputStatus().

64  {
65  return (triggerInputStatus()&0x3FU);
66  } ;
cms_uint32_t triggerInputStatus() const
Definition: LTCDigi.h:45
int LTCDigi::daqPartition ( ) const
inline

Definition at line 43 of file LTCDigi.h.

References daqPartition_.

Referenced by operator<<().

43 { return daqPartition_; };
int daqPartition_
Definition: LTCDigi.h:91
unsigned int LTCDigi::eventID ( ) const
inline

Definition at line 34 of file LTCDigi.h.

References eventID_.

34 { return eventID_; };
unsigned int eventID_
Definition: LTCDigi.h:81
unsigned int LTCDigi::eventNumber ( ) const
inline

Definition at line 33 of file LTCDigi.h.

References eventNumber_.

Referenced by GetEventNumberFromBuffer(), operator<<(), and Vispa.Plugins.EdmBrowser.EdmDataAccessor.EdmDataAccessor::setFilterBranches().

33 { return eventNumber_; };
cms_uint32_t eventNumber_
Definition: LTCDigi.h:93
unsigned char LTCDigi::externTriggerMask ( ) const
inline

Definition at line 59 of file LTCDigi.h.

References triggerInputStatus().

Referenced by HasTriggered().

60  {
61  return ((triggerInputStatus()>>20)&0x3FU);
62  } ;
cms_uint32_t triggerInputStatus() const
Definition: LTCDigi.h:45
cms_uint32_t LTCDigi::GetEventNumberFromBuffer ( const unsigned char *  databuffer)
static

Definition at line 35 of file LTCDigi.cc.

References edmStreamStallGrapher::const, data, and eventNumber().

36 {
37  // six 64 bit words
38  cms_uint64_t const *ld = reinterpret_cast<cms_uint64_t const*>(data);
39  cms_uint32_t eventNumber = (ld[2]) &0xFFFFFFFFULL; // 32 bits
40  return eventNumber;
41 }
unsigned int cms_uint32_t
Definition: typedefs.h:15
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:82
unsigned long long cms_uint64_t
Definition: typedefs.h:17
unsigned int eventNumber() const
Definition: LTCDigi.h:33
cms_uint32_t LTCDigi::GetRunNumberFromBuffer ( const unsigned char *  databuffer)
static

Definition at line 43 of file LTCDigi.cc.

References edmStreamStallGrapher::const, data, and runNumber().

44 {
45  // six 64 bit words
46  cms_uint64_t const *ld = reinterpret_cast<cms_uint64_t const*>(data);
47  cms_uint32_t runNumber = (ld[2]>>32)&0xFFFFFFFFULL; // 32 bits
48  return runNumber;
49 }
unsigned int cms_uint32_t
Definition: typedefs.h:15
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:82
unsigned long long cms_uint64_t
Definition: typedefs.h:17
unsigned int runNumber() const
Definition: LTCDigi.h:35
bool LTCDigi::HasTriggered ( int  i) const
inline

Definition at line 70 of file LTCDigi.h.

References externTriggerMask().

Referenced by operator<<().

70  {
71  if ( i > 5 ) return false; // throw exception?
72  return ((externTriggerMask()&(0x1U<<i))!=0);
73  }
int i
Definition: DBlmapReader.cc:9
unsigned char externTriggerMask() const
Definition: LTCDigi.h:59
std::string LTCDigi::locTime ( cms_uint64_t  t)
static

Definition at line 109 of file LTCDigi.cc.

References a, and AlCaHLTBitMon_QueryRunRegistry::string.

Referenced by operator<<().

110 {
111  time_t tsmall = t/1000000;
112  std::string a("LOC: ");
113  a+= std::string(ctime(&tsmall));
114  a.replace(a.find("\n"),a.size(), "");
115  return a;
116 }
double a
Definition: hdecay.h:121
cms_uint32_t LTCDigi::orbitNumber ( ) const
inline

Definition at line 38 of file LTCDigi.h.

References orbitNumber_.

Referenced by operator<<().

38 { return orbitNumber_;};
cms_uint32_t orbitNumber_
Definition: LTCDigi.h:87
unsigned int LTCDigi::ramTrigger ( ) const
inline

Definition at line 55 of file LTCDigi.h.

References triggerInputStatus().

Referenced by operator<<().

56  {
57  return ((triggerInputStatus()>>26)&0x1);
58  } ;
cms_uint32_t triggerInputStatus() const
Definition: LTCDigi.h:45
unsigned int LTCDigi::runNumber ( ) const
inline

Definition at line 35 of file LTCDigi.h.

References runNumber_.

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

35 { return runNumber_; };
unsigned int runNumber_
Definition: LTCDigi.h:82
int LTCDigi::sourceID ( ) const
inline

Definition at line 41 of file LTCDigi.h.

References sourceID_.

Referenced by operator<<().

41 { return sourceID_; };
unsigned int sourceID_
Definition: LTCDigi.h:84
cms_uint32_t LTCDigi::triggerInhibitNumber ( ) const
inline

Definition at line 46 of file LTCDigi.h.

References trigInhibitNumber_.

Referenced by operator<<().

46 { return trigInhibitNumber_; };
cms_uint32_t trigInhibitNumber_
Definition: LTCDigi.h:96
cms_uint32_t LTCDigi::triggerInputStatus ( ) const
inline

Definition at line 45 of file LTCDigi.h.

References trigInputStat_.

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

45 { return trigInputStat_; };
cms_uint32_t trigInputStat_
Definition: LTCDigi.h:95
std::string LTCDigi::utcTime ( cms_uint64_t  t)
static

Definition at line 98 of file LTCDigi.cc.

References AlCaHLTBitMon_QueryRunRegistry::string.

Referenced by operator<<().

99 {
100  // note that gmtime isn't reentrant and we don't own the data
101  time_t tsmall = t/1000000;
102  tm *utct = gmtime(&tsmall);
103  std::string tstr("UTC: ");
104  tstr += asctime(utct);
105  tstr.replace(tstr.find("\n"),tstr.size(), "");
106  return tstr;
107 }
int LTCDigi::version ( ) const
inline

Definition at line 40 of file LTCDigi.h.

References versionNumber_.

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

40 { return versionNumber_; } ;
int versionNumber_
Definition: LTCDigi.h:89
unsigned int LTCDigi::vmeTrigger ( ) const
inline

Definition at line 51 of file LTCDigi.h.

References triggerInputStatus().

Referenced by operator<<().

52  {
53  return ((triggerInputStatus()>>27)&0x1);
54  } ;
cms_uint32_t triggerInputStatus() const
Definition: LTCDigi.h:45

Member Data Documentation

cms_uint64_t LTCDigi::bstGpsTime_
private

Definition at line 97 of file LTCDigi.h.

Referenced by bstGpsTime(), and LTCDigi().

unsigned int LTCDigi::bunchNumber_
private

Definition at line 86 of file LTCDigi.h.

Referenced by bunchNumber(), and LTCDigi().

int LTCDigi::daqPartition_
private

Definition at line 91 of file LTCDigi.h.

Referenced by daqPartition(), and LTCDigi().

unsigned int LTCDigi::eventID_
private

Definition at line 81 of file LTCDigi.h.

Referenced by eventID(), and LTCDigi().

cms_uint32_t LTCDigi::eventNumber_
private

Definition at line 93 of file LTCDigi.h.

Referenced by eventNumber(), and LTCDigi().

cms_uint32_t LTCDigi::orbitNumber_
private

Definition at line 87 of file LTCDigi.h.

Referenced by LTCDigi(), and orbitNumber().

unsigned int LTCDigi::runNumber_
private

Definition at line 82 of file LTCDigi.h.

Referenced by LTCDigi(), and runNumber().

unsigned int LTCDigi::sourceID_
private

Definition at line 84 of file LTCDigi.h.

Referenced by LTCDigi(), and sourceID().

cms_uint32_t LTCDigi::trigInhibitNumber_
private

Definition at line 96 of file LTCDigi.h.

Referenced by LTCDigi(), and triggerInhibitNumber().

cms_uint32_t LTCDigi::trigInputStat_
private

Definition at line 95 of file LTCDigi.h.

Referenced by LTCDigi(), and triggerInputStatus().

unsigned int LTCDigi::trigType_
private

Definition at line 79 of file LTCDigi.h.

Referenced by LTCDigi().

int LTCDigi::versionNumber_
private

Definition at line 89 of file LTCDigi.h.

Referenced by LTCDigi(), and version().