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

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)
 
uint32_t orbitNumber () const
 
unsigned int ramTrigger () const
 
unsigned int runNumber () const
 
int sourceID () const
 
uint32_t triggerInhibitNumber () const
 
uint32_t triggerInputStatus () const
 
int version () const
 
unsigned int vmeTrigger () const
 

Static Public Member Functions

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

Private Attributes

uint64_t bstGpsTime_
 
unsigned int bunchNumber_
 
int daqPartition_
 
unsigned int eventID_
 
uint32_t eventNumber_
 
uint32_t orbitNumber_
 
unsigned int runNumber_
 
unsigned int sourceID_
 
uint32_t trigInhibitNumber_
 
uint32_t trigInputStat_
 
unsigned int trigType_
 
int versionNumber_
 

Detailed Description

Data from the Local Trigger Controller (LTC)

Id:
LTCDigi.h,v 1.3 2006/06/09 21:56:17 wittich 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
8  uint64_t *ld = (uint64_t*)data;
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
uint32_t eventNumber_
Definition: LTCDigi.h:94
unsigned int runNumber_
Definition: LTCDigi.h:83
unsigned int trigType_
Definition: LTCDigi.h:80
unsigned int sourceID_
Definition: LTCDigi.h:85
uint64_t bstGpsTime_
Definition: LTCDigi.h:98
uint32_t orbitNumber_
Definition: LTCDigi.h:88
uint32_t trigInhibitNumber_
Definition: LTCDigi.h:97
unsigned long long uint64_t
Definition: Time.h:15
unsigned int eventID_
Definition: LTCDigi.h:82
int versionNumber_
Definition: LTCDigi.h:90
uint32_t trigInputStat_
Definition: LTCDigi.h:96

Member Function Documentation

uint64_t LTCDigi::bstGpsTime ( ) const
inline

Definition at line 49 of file LTCDigi.h.

References bstGpsTime_.

Referenced by operator<<().

49 { return bstGpsTime_;};
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); } ;
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  } ;
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
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  } ;
uint32_t triggerInputStatus() const
Definition: LTCDigi.h:46
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
39  uint64_t *ld = (uint64_t*)data;
40  uint32_t eventNumber = (ld[2]) &0xFFFFFFFFULL; // 32 bits
41  return eventNumber;
42 }
unsigned long long uint64_t
Definition: Time.h:15
unsigned int eventNumber() const
Definition: LTCDigi.h:34
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
47  uint64_t *ld = (uint64_t*)data;
48  uint32_t runNumber = (ld[2]>>32)&0xFFFFFFFFULL; // 32 bits
49  return runNumber;
50 }
unsigned long long uint64_t
Definition: Time.h:15
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 ( 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
uint32_t LTCDigi::orbitNumber ( ) const
inline

Definition at line 39 of file LTCDigi.h.

References orbitNumber_.

Referenced by operator<<().

39 { return orbitNumber_;};
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  } ;
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
uint32_t LTCDigi::triggerInhibitNumber ( ) const
inline

Definition at line 47 of file LTCDigi.h.

References trigInhibitNumber_.

Referenced by operator<<().

47 { return trigInhibitNumber_; };
uint32_t trigInhibitNumber_
Definition: LTCDigi.h:97
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_; };
uint32_t trigInputStat_
Definition: LTCDigi.h:96
std::string LTCDigi::utcTime ( 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  } ;
uint32_t triggerInputStatus() const
Definition: LTCDigi.h:46

Member Data Documentation

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

uint32_t LTCDigi::eventNumber_
private

Definition at line 94 of file LTCDigi.h.

Referenced by eventNumber(), and LTCDigi().

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

uint32_t LTCDigi::trigInhibitNumber_
private

Definition at line 97 of file LTCDigi.h.

Referenced by LTCDigi(), and triggerInhibitNumber().

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