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)

Id:
LTCDigi.h,v 1.5 2011/08/25 20:18:06 wmtan Exp

Definition at line 17 of file LTCDigi.h.

Constructor & Destructor Documentation

LTCDigi::LTCDigi ( )
inline

Definition at line 21 of file LTCDigi.h.

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

Definition at line 5 of file LTCDigi.cc.

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

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

Member Function Documentation

cms_uint64_t LTCDigi::bstGpsTime ( ) const
inline

Definition at line 49 of file LTCDigi.h.

References bstGpsTime_.

Referenced by operator<<().

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

Definition at line 38 of file LTCDigi.h.

References bunchNumber_.

Referenced by operator<<().

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

Definition at line 51 of file LTCDigi.h.

References triggerInputStatus().

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

Definition at line 64 of file LTCDigi.h.

References triggerInputStatus().

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

Definition at line 44 of file LTCDigi.h.

References daqPartition_.

Referenced by operator<<().

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

Definition at line 35 of file LTCDigi.h.

References eventID_.

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

Definition at line 34 of file LTCDigi.h.

References eventNumber_.

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

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

Definition at line 60 of file LTCDigi.h.

References triggerInputStatus().

Referenced by HasTriggered().

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

Definition at line 36 of file LTCDigi.cc.

References eventNumber().

37 {
38  // six 64 bit words
40  cms_uint32_t eventNumber = (ld[2]) &0xFFFFFFFFULL; // 32 bits
41  return eventNumber;
42 }
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:34
cms_uint32_t LTCDigi::GetRunNumberFromBuffer ( const unsigned char *  databuffer)
static

Definition at line 44 of file LTCDigi.cc.

References runNumber().

45 {
46  // six 64 bit words
48  cms_uint32_t runNumber = (ld[2]>>32)&0xFFFFFFFFULL; // 32 bits
49  return runNumber;
50 }
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:36
bool LTCDigi::HasTriggered ( int  i) const
inline

Definition at line 71 of file LTCDigi.h.

References externTriggerMask().

Referenced by operator<<().

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

Definition at line 110 of file LTCDigi.cc.

References a.

Referenced by operator<<().

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

Definition at line 39 of file LTCDigi.h.

References orbitNumber_.

Referenced by operator<<().

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

Definition at line 56 of file LTCDigi.h.

References triggerInputStatus().

Referenced by operator<<().

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

Definition at line 36 of file LTCDigi.h.

References runNumber_.

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

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

Definition at line 42 of file LTCDigi.h.

References sourceID_.

Referenced by operator<<().

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

Definition at line 47 of file LTCDigi.h.

References trigInhibitNumber_.

Referenced by operator<<().

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

Definition at line 46 of file LTCDigi.h.

References trigInputStat_.

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

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

Definition at line 99 of file LTCDigi.cc.

Referenced by operator<<().

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

Definition at line 41 of file LTCDigi.h.

References versionNumber_.

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

Definition at line 52 of file LTCDigi.h.

References triggerInputStatus().

Referenced by operator<<().

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

Member Data Documentation

cms_uint64_t LTCDigi::bstGpsTime_
private

Definition at line 98 of file LTCDigi.h.

Referenced by bstGpsTime(), and LTCDigi().

unsigned int LTCDigi::bunchNumber_
private

Definition at line 87 of file LTCDigi.h.

Referenced by bunchNumber(), and LTCDigi().

int LTCDigi::daqPartition_
private

Definition at line 92 of file LTCDigi.h.

Referenced by daqPartition(), and LTCDigi().

unsigned int LTCDigi::eventID_
private

Definition at line 82 of file LTCDigi.h.

Referenced by eventID(), and LTCDigi().

cms_uint32_t LTCDigi::eventNumber_
private

Definition at line 94 of file LTCDigi.h.

Referenced by eventNumber(), and LTCDigi().

cms_uint32_t LTCDigi::orbitNumber_
private

Definition at line 88 of file LTCDigi.h.

Referenced by LTCDigi(), and orbitNumber().

unsigned int LTCDigi::runNumber_
private

Definition at line 83 of file LTCDigi.h.

Referenced by LTCDigi(), and runNumber().

unsigned int LTCDigi::sourceID_
private

Definition at line 85 of file LTCDigi.h.

Referenced by LTCDigi(), and sourceID().

cms_uint32_t LTCDigi::trigInhibitNumber_
private

Definition at line 97 of file LTCDigi.h.

Referenced by LTCDigi(), and triggerInhibitNumber().

cms_uint32_t LTCDigi::trigInputStat_
private

Definition at line 96 of file LTCDigi.h.

Referenced by LTCDigi(), and triggerInputStatus().

unsigned int LTCDigi::trigType_
private

Definition at line 80 of file LTCDigi.h.

Referenced by LTCDigi().

int LTCDigi::versionNumber_
private

Definition at line 90 of file LTCDigi.h.

Referenced by LTCDigi(), and version().